pub struct Node {
id: String,
type_: Option<String>,
config: Option<ComponentConfig>,
resources: Option<HashMap<String, String>>,
missions: Option<Vec<String>>,
background: Option<bool>,
run_in_sim: Option<bool>,
logging: Option<NodeLogging>,
flavor: Flavor,
}Expand description
A node in the configuration graph. A node represents a Task in the system Graph.
Fields§
§id: StringUnique node identifier.
type_: Option<String>Task rust struct underlying type, e.g. “mymodule::Sensor”, etc.
config: Option<ComponentConfig>Config passed to the task.
resources: Option<HashMap<String, String>>Resources requested by the task.
missions: Option<Vec<String>>Missions for which this task is run.
background: Option<bool>Run this task in the background:
ie. Will be set to run on a background thread and until it is finished CuTask::process will return None.
run_in_sim: Option<bool>Option to include/exclude stubbing for simulation. By default, sources and sinks are replaces (stubbed) by the runtime to avoid trying to compile hardware specific code for sensing or actuation. In some cases, for example a sink or source used as a middleware bridge, you might want to run the real code even in simulation. This option allows to control this behavior. Note: Normal tasks will be run in sim and this parameter ignored.
logging: Option<NodeLogging>Config passed to the task.
flavor: FlavorNode role in the runtime graph (normal task or bridge endpoint).
Implementations§
Source§impl Node
impl Node
pub fn new(id: &str, ptype: &str) -> Self
pub fn new_with_flavor(id: &str, ptype: &str, flavor: Flavor) -> Self
pub fn get_id(&self) -> String
pub fn get_type(&self) -> &str
pub fn set_type(self, name: Option<String>) -> Self
pub fn set_resources<I>(&mut self, resources: Option<I>)
pub fn is_background(&self) -> bool
pub fn get_instance_config(&self) -> Option<&ComponentConfig>
pub fn get_resources(&self) -> Option<&HashMap<String, String>>
Sourcepub fn is_run_in_sim(&self) -> bool
pub fn is_run_in_sim(&self) -> bool
By default, assume a source or a sink is not run in sim. Normal tasks will be run in sim and this parameter ignored.
pub fn is_logging_enabled(&self) -> bool
pub fn get_param<T: From<Value>>(&self, key: &str) -> Option<T>
pub fn set_param<T: Into<Value>>(&mut self, key: &str, value: T)
Sourcepub fn get_flavor(&self) -> Flavor
pub fn get_flavor(&self) -> Flavor
Returns whether this node is treated as a normal task or as a bridge.
Sourcepub fn set_flavor(&mut self, flavor: Flavor)
pub fn set_flavor(&mut self, flavor: Flavor)
Overrides the node flavor; primarily used when injecting bridge nodes.