pub struct DeviceType { /* private fields */ }Implementations§
Source§impl DeviceType
impl DeviceType
pub const DEFAULT: DeviceType
pub const CPU: DeviceType
pub const GPU: DeviceType
pub const ACCELERATOR: DeviceType
pub const CUSTOM: DeviceType
pub const ALL: DeviceType
Sourcepub const fn empty() -> DeviceType
pub const fn empty() -> DeviceType
Returns an empty set of flags
Sourcepub const fn all() -> DeviceType
pub const fn all() -> DeviceType
Returns the set containing all flags.
Sourcepub fn from_bits(bits: u64) -> Option<DeviceType>
pub fn from_bits(bits: u64) -> Option<DeviceType>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
Sourcepub const fn from_bits_truncate(bits: u64) -> DeviceType
pub const fn from_bits_truncate(bits: u64) -> DeviceType
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
Sourcepub const unsafe fn from_bits_unchecked(bits: u64) -> DeviceType
pub const unsafe fn from_bits_unchecked(bits: u64) -> DeviceType
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
Sourcepub const fn intersects(&self, other: DeviceType) -> bool
pub const fn intersects(&self, other: DeviceType) -> bool
Returns true if there are flags common to both self and other.
Sourcepub const fn contains(&self, other: DeviceType) -> bool
pub const fn contains(&self, other: DeviceType) -> bool
Returns true all of the flags in other are contained within self.
Sourcepub fn insert(&mut self, other: DeviceType)
pub fn insert(&mut self, other: DeviceType)
Inserts the specified flags in-place.
Sourcepub fn remove(&mut self, other: DeviceType)
pub fn remove(&mut self, other: DeviceType)
Removes the specified flags in-place.
Sourcepub fn toggle(&mut self, other: DeviceType)
pub fn toggle(&mut self, other: DeviceType)
Toggles the specified flags in-place.
Sourcepub fn set(&mut self, other: DeviceType, value: bool)
pub fn set(&mut self, other: DeviceType, value: bool)
Inserts or removes the specified flags depending on the passed value.
Trait Implementations§
Source§impl Binary for DeviceType
impl Binary for DeviceType
Source§impl BitAnd for DeviceType
impl BitAnd for DeviceType
Source§fn bitand(self, other: DeviceType) -> DeviceType
fn bitand(self, other: DeviceType) -> DeviceType
Returns the intersection between the two sets of flags.
Source§type Output = DeviceType
type Output = DeviceType
& operator.Source§impl BitAndAssign for DeviceType
impl BitAndAssign for DeviceType
Source§fn bitand_assign(&mut self, other: DeviceType)
fn bitand_assign(&mut self, other: DeviceType)
Disables all flags disabled in the set.
Source§impl BitOr for DeviceType
impl BitOr for DeviceType
Source§fn bitor(self, other: DeviceType) -> DeviceType
fn bitor(self, other: DeviceType) -> DeviceType
Returns the union of the two sets of flags.
Source§type Output = DeviceType
type Output = DeviceType
| operator.Source§impl BitOrAssign for DeviceType
impl BitOrAssign for DeviceType
Source§fn bitor_assign(&mut self, other: DeviceType)
fn bitor_assign(&mut self, other: DeviceType)
Adds the set of flags.
Source§impl BitXor for DeviceType
impl BitXor for DeviceType
Source§fn bitxor(self, other: DeviceType) -> DeviceType
fn bitxor(self, other: DeviceType) -> DeviceType
Returns the left flags, but with all the right flags toggled.
Source§type Output = DeviceType
type Output = DeviceType
^ operator.Source§impl BitXorAssign for DeviceType
impl BitXorAssign for DeviceType
Source§fn bitxor_assign(&mut self, other: DeviceType)
fn bitxor_assign(&mut self, other: DeviceType)
Toggles the set of flags.
Source§impl Clone for DeviceType
impl Clone for DeviceType
Source§fn clone(&self) -> DeviceType
fn clone(&self) -> DeviceType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DeviceType
impl Debug for DeviceType
Source§impl Extend<DeviceType> for DeviceType
impl Extend<DeviceType> for DeviceType
Source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = DeviceType>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = DeviceType>,
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl From<DeviceType> for u64
impl From<DeviceType> for u64
Source§fn from(d: DeviceType) -> u64
fn from(d: DeviceType) -> u64
Source§impl FromIterator<DeviceType> for DeviceType
impl FromIterator<DeviceType> for DeviceType
Source§fn from_iter<T>(iterator: T) -> DeviceTypewhere
T: IntoIterator<Item = DeviceType>,
fn from_iter<T>(iterator: T) -> DeviceTypewhere
T: IntoIterator<Item = DeviceType>,
Source§impl Hash for DeviceType
impl Hash for DeviceType
Source§impl LowerHex for DeviceType
impl LowerHex for DeviceType
Source§impl Not for DeviceType
impl Not for DeviceType
Source§fn not(self) -> DeviceType
fn not(self) -> DeviceType
Returns the complement of this set of flags.
Source§type Output = DeviceType
type Output = DeviceType
! operator.Source§impl Octal for DeviceType
impl Octal for DeviceType
Source§impl Ord for DeviceType
impl Ord for DeviceType
Source§fn cmp(&self, other: &DeviceType) -> Ordering
fn cmp(&self, other: &DeviceType) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for DeviceType
impl PartialEq for DeviceType
Source§impl PartialOrd for DeviceType
impl PartialOrd for DeviceType
Source§impl Sub for DeviceType
impl Sub for DeviceType
Source§fn sub(self, other: DeviceType) -> DeviceType
fn sub(self, other: DeviceType) -> DeviceType
Returns the set difference of the two sets of flags.
Source§type Output = DeviceType
type Output = DeviceType
- operator.Source§impl SubAssign for DeviceType
impl SubAssign for DeviceType
Source§fn sub_assign(&mut self, other: DeviceType)
fn sub_assign(&mut self, other: DeviceType)
Disables all flags enabled in the set.