pub trait Node<ID: PartialEq>: Send {
// Required methods
fn get_id(&self) -> ID;
fn get_update_delay_us(&self) -> u128;
// Provided methods
fn start(&mut self) { ... }
fn update(&mut self) { ... }
fn shutdown(&mut self) { ... }
}Expand description
A Node represents a singular process that performs some singular purpose
Nodes should also all be given unique IDs so that they can be identified as trait objects.
Required Methods§
Sourcefn get_update_delay_us(&self) -> u128
fn get_update_delay_us(&self) -> u128
Return the node’s update rate (in us)
Provided Methods§
Sourcefn start(&mut self)
fn start(&mut self)
Complete the necessary setup functionalities for a Node.
Note: this method is called on Start for the executor or (if the executor was not formally started) before the executor begins updating nodes.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".