pub trait ContextReportExt {
// Required methods
fn add_report_by_type_id(
&mut self,
type_id: TypeId,
short_name: &str,
) -> Result<(), IxaError>;
fn add_report<T: Report + 'static>(
&mut self,
short_name: &str,
) -> Result<(), IxaError>;
fn add_periodic_report<T: Tabulator + Clone + 'static>(
&mut self,
short_name: &str,
period: f64,
tabulator: T,
) -> Result<(), IxaError>;
fn get_writer(&self, type_id: TypeId) -> RefMut<'_, Writer<File>>;
fn send_report<T: Report>(&self, report: T);
fn report_options(&mut self) -> &mut ConfigReportOptions;
}
Required Methods§
Sourcefn add_report_by_type_id(
&mut self,
type_id: TypeId,
short_name: &str,
) -> Result<(), IxaError>
fn add_report_by_type_id( &mut self, type_id: TypeId, short_name: &str, ) -> Result<(), IxaError>
Add a report file keyed by a TypeId
.
The short_name
is used for file naming to distinguish what data each
output file points to.
§Errors
If the file already exists and overwrite
is set to false, raises an error and info message.
If the file cannot be created, raises an error.
Sourcefn add_report<T: Report + 'static>(
&mut self,
short_name: &str,
) -> Result<(), IxaError>
fn add_report<T: Report + 'static>( &mut self, short_name: &str, ) -> Result<(), IxaError>
Call add_report
with each report type, passing the name of the report type.
The short_name
is used for file naming to distinguish what data each
output file points to.
§Errors
If the file already exists and overwrite
is set to false, raises an error and info message.
If the file cannot be created, raises an error.
Sourcefn add_periodic_report<T: Tabulator + Clone + 'static>(
&mut self,
short_name: &str,
period: f64,
tabulator: T,
) -> Result<(), IxaError>
fn add_periodic_report<T: Tabulator + Clone + 'static>( &mut self, short_name: &str, period: f64, tabulator: T, ) -> Result<(), IxaError>
fn get_writer(&self, type_id: TypeId) -> RefMut<'_, Writer<File>>
fn send_report<T: Report>(&self, report: T)
fn report_options(&mut self) -> &mut ConfigReportOptions
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.