Skip to main content

GroupKind

Enum GroupKind 

Source
#[non_exhaustive]
pub enum GroupKind { Arm(Arm), Gripper(Gripper), Generic(Generic), }
Expand description

Sum type of every group variant the robot can hold.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Arm(Arm)

Articulated arm.

§

Gripper(Gripper)

Single-motor gripper.

§

Generic(Generic)

Generic catch-all group.

Implementations§

Source§

impl GroupKind

Source

pub fn as_arm(&self) -> Option<&Arm>

Downcast to Arm.

Source

pub fn as_arm_mut(&mut self) -> Option<&mut Arm>

Downcast to Arm mutably.

Source

pub fn as_gripper(&self) -> Option<&Gripper>

Downcast to Gripper.

Source

pub fn as_gripper_mut(&mut self) -> Option<&mut Gripper>

Downcast to Gripper mutably.

Source

pub fn as_generic(&self) -> Option<&Generic>

Downcast to Generic.

Source

pub fn as_generic_mut(&mut self) -> Option<&mut Generic>

Downcast to Generic mutably.

Source

pub fn inner(&self) -> &MotorGroup

Borrow the underlying MotorGroup regardless of variant.

Source

pub fn inner_mut(&mut self) -> &mut MotorGroup

Borrow mutably regardless of variant.

Source

pub fn name(&self) -> &str

Group name (delegated to the inner MotorGroup).

Source

pub fn bus_name(&self) -> &str

Bus name (delegated).

Source

pub fn enable_all(&mut self) -> Result<(), Error>

Enable all motors in this group (delegated).

Source

pub fn disable_all(&mut self) -> Result<(), Error>

Disable all motors in this group (delegated).

Source

pub fn refresh_all(&mut self) -> Result<(), Error>

Send a state-refresh query to every motor in this group (delegated).

Source

pub fn set_mode(&mut self, mode: CommandKind) -> Result<(), Error>

Set the persistent control mode on every motor in this group (delegated).

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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