pub struct ComponentInstance { /* private fields */ }Expand description
One mounted component instance in the canonical robot.
The instance is keyed by its own id in Robot::components, so it carries
no copy of that id: the map is the identity.
Implementations§
Source§impl ComponentInstance
impl ComponentInstance
pub const fn component_type(&self) -> &ComponentTypeId
Sourcepub const fn mount_link(&self) -> &LinkId
pub const fn mount_link(&self) -> &LinkId
The robot link this instance is rigidly mounted on.
Sourcepub const fn driver(&self) -> Option<&Value>
pub const fn driver(&self) -> Option<&Value>
The hardware connection block, present exactly when a component driver runs for this instance. It is that driver’s own configuration, and the driver’s participant id is this instance’s id.
Sourcepub const fn direction_signs(&self) -> &BTreeMap<CapabilityId, i8>
pub const fn direction_signs(&self) -> &BTreeMap<CapabilityId, i8>
The authored direction sign for each capability this instance overrides. An absent capability turns forward.
Sourcepub const fn roles(&self) -> &BTreeMap<CapabilityId, BTreeSet<CapabilityRole>>
pub const fn roles(&self) -> &BTreeMap<CapabilityId, BTreeSet<CapabilityRole>>
Authored role assignments, ordered by capability and role.
Sourcepub fn has_role(&self, capability: &CapabilityId, role: CapabilityRole) -> bool
pub fn has_role(&self, capability: &CapabilityId, role: CapabilityRole) -> bool
Whether this instance assigns role to the named capability.
Trait Implementations§
Source§impl Clone for ComponentInstance
impl Clone for ComponentInstance
Source§fn clone(&self) -> ComponentInstance
fn clone(&self) -> ComponentInstance
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ComponentInstance
impl Debug for ComponentInstance
Source§impl DescribeWire for ComponentInstance
impl DescribeWire for ComponentInstance
Source§fn wire_schema() -> WireSchema
fn wire_schema() -> WireSchema
The shape a value of this type puts on the wire.
Source§impl<'de> Deserialize<'de> for ComponentInstance
impl<'de> Deserialize<'de> for ComponentInstance
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ComponentInstance
impl RefUnwindSafe for ComponentInstance
impl Send for ComponentInstance
impl Sync for ComponentInstance
impl Unpin for ComponentInstance
impl UnsafeUnpin for ComponentInstance
impl UnwindSafe for ComponentInstance
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
Mutably borrows from an owned value. Read more