pub struct EnabledDacTypes { /* private fields */ }Expand description
Set of enabled DAC types for discovery.
Implementations§
Source§impl EnabledDacTypes
impl EnabledDacTypes
Sourcepub fn is_enabled(&self, dac_type: DacType) -> bool
pub fn is_enabled(&self, dac_type: DacType) -> bool
Returns true if the given DAC type is enabled.
Sourcepub fn enable(&mut self, dac_type: DacType) -> &mut Self
pub fn enable(&mut self, dac_type: DacType) -> &mut Self
Enables a DAC type for discovery.
Returns &mut Self to allow method chaining.
§Examples
use laser_dac::{EnabledDacTypes, DacType};
let mut enabled = EnabledDacTypes::none();
enabled.enable(DacType::Helios).enable(DacType::EtherDream);
assert!(enabled.is_enabled(DacType::Helios));
assert!(enabled.is_enabled(DacType::EtherDream));Sourcepub fn disable(&mut self, dac_type: DacType) -> &mut Self
pub fn disable(&mut self, dac_type: DacType) -> &mut Self
Disables a DAC type for discovery.
Returns &mut Self to allow method chaining.
§Examples
use laser_dac::{EnabledDacTypes, DacType};
let mut enabled = EnabledDacTypes::all();
enabled.disable(DacType::Helios).disable(DacType::EtherDream);
assert!(!enabled.is_enabled(DacType::Helios));
assert!(!enabled.is_enabled(DacType::EtherDream));Trait Implementations§
Source§impl Clone for EnabledDacTypes
impl Clone for EnabledDacTypes
Source§fn clone(&self) -> EnabledDacTypes
fn clone(&self) -> EnabledDacTypes
Returns a duplicate of the value. Read more
1.0.0 · 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 EnabledDacTypes
impl Debug for EnabledDacTypes
Source§impl Default for EnabledDacTypes
impl Default for EnabledDacTypes
Source§impl Extend<DacType> for EnabledDacTypes
impl Extend<DacType> for EnabledDacTypes
Source§fn extend<I: IntoIterator<Item = DacType>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = DacType>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl FromIterator<DacType> for EnabledDacTypes
impl FromIterator<DacType> for EnabledDacTypes
Source§impl PartialEq for EnabledDacTypes
impl PartialEq for EnabledDacTypes
impl Eq for EnabledDacTypes
impl StructuralPartialEq for EnabledDacTypes
Auto Trait Implementations§
impl Freeze for EnabledDacTypes
impl RefUnwindSafe for EnabledDacTypes
impl Send for EnabledDacTypes
impl Sync for EnabledDacTypes
impl Unpin for EnabledDacTypes
impl UnwindSafe for EnabledDacTypes
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