pub unsafe trait Component {
type Input: Bag;
type Output: Bag;
// Required methods
fn get_t_last(&self) -> f64;
fn set_t_last(&mut self, t_last: f64);
fn get_t_next(&self) -> f64;
fn set_t_next(&mut self, t_next: f64);
fn get_input(&self) -> &Self::Input;
fn get_input_mut(&mut self) -> &mut Self::Input;
fn get_output(&self) -> &Self::Output;
fn get_output_mut(&mut self) -> &mut Self::Output;
// Provided methods
fn clear_input(&mut self) { ... }
fn clear_output(&mut self) { ... }
}
Expand description
Interface for DEVS components. All DEVS components must implement this trait.
§Safety
This trait must be implemented via macros. Do not implement it manually.
Required Associated Types§
Required Methods§
Sourcefn get_t_last(&self) -> f64
fn get_t_last(&self) -> f64
Returns the last time the component was updated.
Sourcefn set_t_last(&mut self, t_last: f64)
fn set_t_last(&mut self, t_last: f64)
Sets the last time the component was updated.
Sourcefn get_t_next(&self) -> f64
fn get_t_next(&self) -> f64
Returns the next time the component will be updated.
Sourcefn set_t_next(&mut self, t_next: f64)
fn set_t_next(&mut self, t_next: f64)
Sets the next time the component will be updated.
Sourcefn get_input_mut(&mut self) -> &mut Self::Input
fn get_input_mut(&mut self) -> &mut Self::Input
Returns a mutable reference to the model’s input event bag.
Sourcefn get_output(&self) -> &Self::Output
fn get_output(&self) -> &Self::Output
Returns a reference to the model’s output event bag.
Sourcefn get_output_mut(&mut self) -> &mut Self::Output
fn get_output_mut(&mut self) -> &mut Self::Output
Returns a mutable reference to the model’s output event bag.
Provided Methods§
Sourcefn clear_input(&mut self)
fn clear_input(&mut self)
Clears the input bag, removing all values.
Sourcefn clear_output(&mut self)
fn clear_output(&mut self)
Clears the output bag, removing all values.