pub trait Context<M: UserModel> {
// Required methods
fn logging_on(&self, category: M::LoggingCategory) -> bool;
fn set_logging(&mut self, category: M::LoggingCategory, enabled: bool);
fn log(
&self,
status: Fmi3Status,
category: M::LoggingCategory,
args: Arguments<'_>,
);
fn resource_path(&self) -> &PathBuf;
fn initialize(&mut self, start_time: f64, stop_time: Option<f64>);
fn time(&self) -> f64;
fn set_time(&mut self, time: f64);
fn stop_time(&self) -> Option<f64>;
fn as_any_mut(&mut self) -> &mut dyn Any;
// Provided method
fn early_return_allowed(&self) -> bool { ... }
}Expand description
Context trait for FMU instances
Required Methods§
Sourcefn logging_on(&self, category: M::LoggingCategory) -> bool
fn logging_on(&self, category: M::LoggingCategory) -> bool
Check if logging is enabled for the specified category.
Sourcefn set_logging(&mut self, category: M::LoggingCategory, enabled: bool)
fn set_logging(&mut self, category: M::LoggingCategory, enabled: bool)
Enable or disable logging for the specified category.
Sourcefn log(
&self,
status: Fmi3Status,
category: M::LoggingCategory,
args: Arguments<'_>,
)
fn log( &self, status: Fmi3Status, category: M::LoggingCategory, args: Arguments<'_>, )
Log a message if the specified logging category is enabled.
Sourcefn resource_path(&self) -> &PathBuf
fn resource_path(&self) -> &PathBuf
Get the path to the resources directory.
fn initialize(&mut self, start_time: f64, stop_time: Option<f64>)
fn as_any_mut(&mut self) -> &mut dyn Any
Provided Methods§
Sourcefn early_return_allowed(&self) -> bool
fn early_return_allowed(&self) -> bool
Whether early return is allowed for this instance (relevant for CS).