pub struct TargetsConfig {
pub dev: Option<TargetEntry>,
pub simulation: Option<TargetEntry>,
pub robot: Option<TargetEntry>,
pub remote: Option<TargetEntry>,
pub rl: Option<TargetEntry>,
}Expand description
Target execution configuration: where nodes run (locally, in simulation, on the robot, or
remotely), and, for robot/remote/rl, which Rust target triple(s) builds compile for.
Fields§
§dev: Option<TargetEntry>Nodes that run locally on the developer’s machine, in-process, via mecha10 dev
simulation: Option<TargetEntry>Nodes that run in a simulated environment
robot: Option<TargetEntry>Nodes that run on the robot as local processes, typically hardware drivers and low-latency control nodes
remote: Option<TargetEntry>Nodes that run remotely in Docker containers, typically AI/ML nodes with platform-specific dependencies
rl: Option<TargetEntry>Nodes that run as a trained RL policy in production (excludes the simulator) -
see mecha10 run rl/mecha10 build rl.
Implementations§
Source§impl TargetsConfig
impl TargetsConfig
Sourcepub fn nodes_for(&self, target: &str) -> &[NodeRef]
pub fn nodes_for(&self, target: &str) -> &[NodeRef]
Nodes configured for the given target key
("dev"/"simulation"/"robot"/"remote"/"rl"), or an empty slice when that target
isn’t configured at all.
Sourcepub fn present_entries(&self) -> Vec<(&'static str, &[NodeRef])>
pub fn present_entries(&self) -> Vec<(&'static str, &[NodeRef])>
The (name, nodes) pairs for every target key that’s actually configured (i.e. present
in the source mecha10.json, even with an empty nodes list) - "dev"/"simulation"/
"robot"/"remote"/"rl" that were omitted entirely are excluded.
Sourcepub fn validate_no_duplicate_node_instances(&self) -> Result<(), Error>
pub fn validate_no_duplicate_node_instances(&self) -> Result<(), Error>
Reject a target whose nodes list has two entries with the same (name, instance_id)
pair - e.g. two bare "@mecha10/camera" entries, or two
{"name": "@mecha10/camera", "instance_id": "real"} entries naming the same instance.
Two entries that share a name but name different instance_ids (the whole point of
LAB-4131) are fine.
§Errors
Returns an error naming the target and the duplicated (name, instance_id) pair.
Trait Implementations§
Source§impl Clone for TargetsConfig
impl Clone for TargetsConfig
Source§fn clone(&self) -> TargetsConfig
fn clone(&self) -> TargetsConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TargetsConfig
impl Debug for TargetsConfig
Source§impl Default for TargetsConfig
impl Default for TargetsConfig
Source§fn default() -> TargetsConfig
fn default() -> TargetsConfig
Source§impl<'de> Deserialize<'de> for TargetsConfig
impl<'de> Deserialize<'de> for TargetsConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TargetsConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TargetsConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for TargetsConfig
impl JsonSchema for TargetsConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Serialize for TargetsConfig
impl Serialize for TargetsConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for TargetsConfig
impl RefUnwindSafe for TargetsConfig
impl Send for TargetsConfig
impl Sync for TargetsConfig
impl Unpin for TargetsConfig
impl UnsafeUnpin for TargetsConfig
impl UnwindSafe for TargetsConfig
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>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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