struct DeviceChain {
    _nodes: Vec<DeviceNode>,
    _name: String,
    locked: bool,
}
Expand description

Represents a device chain, which is a collection of DeviceNode objects. Part of the “Facade” pattern example.

Fields§

§_nodes: Vec<DeviceNode>

The list of DeviceNodes on this device chain.

§_name: String

The Name of this device chain.

§locked: bool

Whether this device chain is locked for access.

Implementations§

source§

impl DeviceChain

source

pub fn new(name: &str) -> DeviceChain

Constructor.

Parameters
  • name

    Name of this device chain

Returns

Returns a new DeviceChain instance.

source

pub fn add_node(&mut self, node: DeviceNode)

Helper method to add a DeviceNode to the device chain. DeviceNode objects that are of DEVICECONTROLLER are always inserted as the first device in the device chain, with the assumption there is only one DEVICECONTROLLER in a given device chain (this is not actually enforced, though).

Parameters
  • node

    A DeviceNode object to add to the device chain.

source

pub fn reset_visibility(&mut self)

Resets the device chain so that all devices that are not CLdevices are no longer visible in the device chain.

source

pub fn select_nodes(&mut self, node_select_mask: u32)

Make visible one or more devices in the device chain.

Parameters
  • node_select_mask

    A bit mask specifying which device or devices to make visible, where bit 0 is the first device, bit 1 is the second, etc. Bit 0 is ignored as the first device is always visible.

source

pub fn deselect_nodes(&mut self, node_select_mask: u32)

Make invisible one or more devices in the device chain.

Parameters
  • node_select_mask

A bit mask specifying which device or devices to hide, where bit 0 is the first device, bit 1 is the second, etc. Bit 0 is ignored as the first device is always visible.

source

pub fn get_id_codes_for_visible_nodes(&self) -> Vec<u32>

Retrieve a list of idcodes for all devices that are visible in the device chain.

Returns

Returns an array of unsigned 32-bit integers corresponding to the idcodes of each visible device. The first idcode corresponds to the first visible device.

source

fn _show_hide_nodes(&mut self, node_select_mask: u32, make_visible: bool)

Helper method to show or hide devices on the device chain.

Parameters
  • node_select_mask

    A bit mask where the position of each bit corresponds to a device in the device chain, with bit 0 being the first device, bit 1 being the second device, and so on.

  • make_visible

    true if the device is to be made visible on the device chain; otherwise false, the device cannot be seen on the device chain.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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 Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

source§

fn vzip(self) -> V