Trait ContextReportExt

Source
pub trait ContextReportExt: PluginContext {
    // Provided methods
    fn generate_filename(&mut self, short_name: &str) -> PathBuf { ... }
    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 { ... }
}

Provided Methods§

Source

fn generate_filename(&mut self, short_name: &str) -> PathBuf

Source

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.

Source

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.

Source

fn add_periodic_report<T: Tabulator + Clone + 'static>( &mut self, short_name: &str, period: f64, tabulator: T, ) -> Result<(), IxaError>

Adds a periodic report at the end of period period which summarizes the number of people in each combination of properties in tabulator.

§Errors

If the file already exists and overwrite is set to false, raises an error and info message. If the file cannot be created, returns IxaError

Source

fn get_writer(&self, type_id: TypeId) -> RefMut<'_, Writer<File>>

Source

fn send_report<T: Report>(&self, report: T)

Write a new row to the appropriate report file

Source

fn report_options(&mut self) -> &mut ConfigReportOptions

Returns a ConfigReportOptions object which has setter methods for report configuration

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.

Implementors§