pub struct CuConfig {
pub monitors: Vec<MonitorConfig>,
pub logging: Option<LoggingConfig>,
pub runtime: Option<RuntimeConfig>,
pub resources: Vec<ResourceBundleConfig>,
pub bridges: Vec<BridgeConfig>,
pub graphs: ConfigGraphs,
/* private fields */
}Expand description
CuConfig is the programmatic representation of the configuration graph. It is a directed graph where nodes are tasks and edges are connections between tasks.
The core of CuConfig is its graphs field which can be either a simple graph
or a collection of mission-specific graphs. The graph structure is based on petgraph.
Fields§
§monitors: Vec<MonitorConfig>Monitoring configuration list.
logging: Option<LoggingConfig>Optional logging configuration
runtime: Option<RuntimeConfig>Optional runtime configuration
resources: Vec<ResourceBundleConfig>Declarative resource bundle definitions
bridges: Vec<BridgeConfig>Declarative bridge definitions that are yet to be expanded into the graph
graphs: ConfigGraphsGraph structure - either a single graph or multiple mission-specific graphs
Implementations§
Source§impl CuConfig
The implementation has a lot of convenience methods to manipulate
the configuration to give some flexibility into programmatically creating the configuration.
impl CuConfig
The implementation has a lot of convenience methods to manipulate the configuration to give some flexibility into programmatically creating the configuration.
pub fn new_simple_type() -> Self
pub fn new_mission_type() -> Self
pub fn serialize_ron(&self) -> CuResult<String>
pub fn deserialize_ron(ron: &str) -> CuResult<Self>
Sourcepub fn render(
&self,
output: &mut dyn Write,
mission_id: Option<&str>,
) -> CuResult<()>
pub fn render( &self, output: &mut dyn Write, mission_id: Option<&str>, ) -> CuResult<()>
Render the configuration graph in the dot format.
pub fn get_all_instances_configs( &self, mission_id: Option<&str>, ) -> Vec<Option<&ComponentConfig>>
pub fn get_graph(&self, mission_id: Option<&str>) -> CuResult<&CuGraph>
pub fn get_graph_mut( &mut self, mission_id: Option<&str>, ) -> CuResult<&mut CuGraph>
pub fn get_monitor_config(&self) -> Option<&MonitorConfig>
pub fn get_monitor_configs(&self) -> &[MonitorConfig]
pub fn get_runtime_config(&self) -> Option<&RuntimeConfig>
pub fn find_task_node( &self, mission_id: Option<&str>, task_id: &str, ) -> Option<&Node>
pub fn find_logging_codec_spec( &self, codec_id: &str, ) -> Option<&LoggingCodecSpec>
Sourcepub fn validate_constants(&self) -> CuResult<()>
pub fn validate_constants(&self) -> CuResult<()>
Validate compile-time constant names, shapes, scalar ranges, and unit compatibility.
Sourcepub fn validate_logging_config(&self) -> CuResult<()>
pub fn validate_logging_config(&self) -> CuResult<()>
Validate the logging configuration to ensure section pre-allocation sizes do not exceed slab sizes. This method is wrapper around LoggingConfig::validate
Sourcepub fn validate_runtime_config(&self) -> CuResult<()>
pub fn validate_runtime_config(&self) -> CuResult<()>
Validate the runtime configuration.
Sourcepub fn validate_anytime_configs(&self) -> CuResult<()>
pub fn validate_anytime_configs(&self) -> CuResult<()>
Validates every anytime: policy in the resolved graphs.
Runs at configuration-resolution time, the first point where both the
resolved graphs and runtime.rate_target_hz are known:
- node-local bounds and ranges (see
AnytimeConfig); anytime:is only supported on regular tasks — refinement needs both an input and an output;- an anytime task has exactly one input connection (the runner anchors
the job on the input’s Tov) and at most one output message type
(
base()and everyrefine()write the same output slot); - a foreground anytime task needs
max_refines: the execution plan is static (the node compiles to a base step plusmax_refinesrefine steps, seecuruntime::expand_anytime_steps), so the refine count must be known at compile time; - fit the period: a foreground anytime task in a rate-limited config
must set a time bound (
time_budget_msormax_age_ms), and the worst-case window —minof the ones set — must be smaller than the loop period. Background nodes and configs without a rate target skip this check.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CuConfig
impl<'de> Deserialize<'de> for CuConfig
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
This is a custom serialization to make this implementation independent of petgraph.
Auto Trait Implementations§
impl Freeze for CuConfig
impl RefUnwindSafe for CuConfig
impl Send for CuConfig
impl Sync for CuConfig
impl Unpin for CuConfig
impl UnsafeUnpin for CuConfig
impl UnwindSafe for CuConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> GetTypeRegistration for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more