pub struct Component {
pub id: String,
pub name: String,
pub description: String,
pub component_type: ComponentType,
pub version: String,
pub category: String,
pub tags: Vec<String>,
pub cargo_dependencies: Vec<CargoDependency>,
pub files: Vec<FileTemplate>,
pub mecha10_config: Mecha10Config,
}Expand description
A component that can be added to a project
Fields§
§id: String§name: String§description: String§component_type: ComponentType§version: String§category: String§cargo_dependencies: Vec<CargoDependency>Cargo dependencies to add
files: Vec<FileTemplate>Files to generate
mecha10_config: Mecha10ConfigConfiguration to add to mecha10.json
Implementations§
Source§impl Component
impl Component
Sourcepub fn relevant_lifecycle_modes(&self) -> Vec<&'static str>
pub fn relevant_lifecycle_modes(&self) -> Vec<&'static str>
Infer which lifecycle.modes entries this component is relevant to, so newly
added/selected nodes (via mecha10 init or mecha10 add) can be appended to the
matching mode’s nodes list and actually get spawned by
CliLifecycleManager::nodes_for_current_mode.
- AI/perception components (tagged with any of [
AI_PERCEPTION_TAGS]) are relevant to bothsimulation(they consume the simulator’s synthetic camera feed) andhardware(they consume the real camera feed). - Other components backed by real hardware - drivers, or package nodes whose
run_targetis"robot"- arehardware-only (e.g. motor/imu nodes have nothing to do in simulation). - Anything else (examples, dev-only tooling, infra/plumbing nodes) has no inferred lifecycle-mode membership; those stay under manual/template control, matching prior behavior.
Sourcepub fn relevant_target(&self) -> Option<&'static str>
pub fn relevant_target(&self) -> Option<&'static str>
Infer which targets entry (see
mecha10_cli_core::types::project::targets::TargetsConfig) this component should be
dispatched to, so mecha10 add/mecha10 init can keep targets.robot/targets.remote
in sync with the node’s own run_target, the same way Self::relevant_lifecycle_modes
keeps lifecycle.modes.*.nodes in sync.
Falls back to None for anything without a driver/custom_node run_target of
exactly "robot" or "remote" (e.g. run_target: "dev", or components with neither
config block) - those aren’t meaningfully “targeted” and stay under manual control.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Component
impl<'de> Deserialize<'de> for Component
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>,
Auto Trait Implementations§
impl Freeze for Component
impl RefUnwindSafe for Component
impl Send for Component
impl Sync for Component
impl Unpin for Component
impl UnsafeUnpin for Component
impl UnwindSafe for Component
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