TransducerMask

Enum TransducerMask 

Source
pub enum TransducerMask {
    AllEnabled,
    Masked(Vec<DeviceTransducerMask>),
}
Available on crate feature gain only.
Expand description

A filter that represents which transducers are enabled.

Variants§

§

AllEnabled

All transducers are enabled.

§

Masked(Vec<DeviceTransducerMask>)

A filtered mask where each value represents the enabled transducers for the corresponding device.

Implementations§

Source§

impl TransducerMask

Source

pub fn new<T>(v: T) -> Self

Creates a TransducerMask.

Source

pub fn from_fn( geo: &Geometry, f: impl Fn(&Device) -> DeviceTransducerMask, ) -> Self

Creates a TransducerMask from a function that maps each Device to a DeviceTransducerMask.

Source

pub const fn is_all_enabled(&self) -> bool

Returns true if all transducers are enabled.

Source

pub fn has_enabled(&self, dev: &Device) -> bool

Returns true if the Device has enabled transducers.

Source

pub fn is_enabled(&self, tr: &Transducer) -> bool

Returns true if the Transducer is enabled.

Source

pub fn num_enabled_devices(&self, geometry: &Geometry) -> usize

Returns the number of enabled devices.

Source

pub fn num_enabled_transducers(&self, dev: &Device) -> usize

Returns the number of enabled transducers for the given Device.

Trait Implementations§

Source§

impl Debug for TransducerMask

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&DeviceMask> for TransducerMask

Source§

fn from(filter: &DeviceMask) -> Self

Converts to this type from the input type.

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

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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.