Skip to main content

CuConfig

Struct CuConfig 

Source
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: ConfigGraphs

Graph 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.

Source

pub fn new_simple_type() -> Self

Source

pub fn new_mission_type() -> Self

Source

pub fn serialize_ron(&self) -> CuResult<String>

Source

pub fn deserialize_ron(ron: &str) -> CuResult<Self>

Source

pub fn render( &self, output: &mut dyn Write, mission_id: Option<&str>, ) -> CuResult<()>

Render the configuration graph in the dot format.

Source

pub fn get_all_instances_configs( &self, mission_id: Option<&str>, ) -> Vec<Option<&ComponentConfig>>

Source

pub fn get_graph(&self, mission_id: Option<&str>) -> CuResult<&CuGraph>

Source

pub fn get_graph_mut( &mut self, mission_id: Option<&str>, ) -> CuResult<&mut CuGraph>

Source

pub fn get_monitor_config(&self) -> Option<&MonitorConfig>

Source

pub fn get_monitor_configs(&self) -> &[MonitorConfig]

Source

pub fn get_runtime_config(&self) -> Option<&RuntimeConfig>

Source

pub fn find_task_node( &self, mission_id: Option<&str>, task_id: &str, ) -> Option<&Node>

Source

pub fn find_logging_codec_spec( &self, codec_id: &str, ) -> Option<&LoggingCodecSpec>

Source

pub fn validate_constants(&self) -> CuResult<()>

Validate compile-time constant names, shapes, scalar ranges, and unit compatibility.

Source

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

Source

pub fn validate_runtime_config(&self) -> CuResult<()>

Validate the runtime configuration.

Source

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:

  1. node-local bounds and ranges (see AnytimeConfig);
  2. anytime: is only supported on regular tasks — refinement needs both an input and an output;
  3. 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 every refine() write the same output slot);
  4. a foreground anytime task needs max_refines: the execution plan is static (the node compiles to a base step plus max_refines refine steps, see curuntime::expand_anytime_steps), so the refine count must be known at compile time;
  5. fit the period: a foreground anytime task in a rate-limited config must set a time bound (time_budget_ms or max_age_ms), and the worst-case window — min of 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 Clone for CuConfig

Source§

fn clone(&self) -> CuConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CuConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CuConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for CuConfig

Source§

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.

Source§

impl Serialize for CuConfig

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

This is a custom serialization to make this implementation independent of petgraph.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> GetTypeRegistration for T

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PayloadDefaultHandlePolicyApply for T
where T: ?Sized,

Source§

impl<T> PayloadDefaultLoggingPolicy for T
where T: ?Sized,

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Reflect for T
where T: 'static,

Source§

impl<T> ReflectTypePath for T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.