pub struct Mode {
bits: u32,
}
Expand description
Map to wl_output.mode
values
Fields
bits: u32
Implementations
sourceimpl Mode
impl Mode
pub const NONE: Mode = Mode{bits: 0,}
pub const CURRENT: Mode = Mode{bits: 1,}
pub const PREFERRED: Mode = Mode{bits: 2,}
sourcepub fn from_bits(bits: u32) -> Option<Mode>
pub fn from_bits(bits: u32) -> Option<Mode>
Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.
sourcepub const fn from_bits_truncate(bits: u32) -> Mode
pub const fn from_bits_truncate(bits: u32) -> Mode
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
sourcepub const unsafe fn from_bits_unchecked(bits: u32) -> Mode
pub const unsafe fn from_bits_unchecked(bits: u32) -> Mode
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
sourcepub const fn intersects(&self, other: Mode) -> bool
pub const fn intersects(&self, other: Mode) -> bool
Returns true
if there are flags common to both self
and other
.
Trait Implementations
sourceimpl BitAndAssign<Mode> for Mode
impl BitAndAssign<Mode> for Mode
sourcefn bitand_assign(&mut self, other: Mode)
fn bitand_assign(&mut self, other: Mode)
Disables all flags disabled in the set.
sourceimpl BitOrAssign<Mode> for Mode
impl BitOrAssign<Mode> for Mode
sourcefn bitor_assign(&mut self, other: Mode)
fn bitor_assign(&mut self, other: Mode)
Adds the set of flags.
sourceimpl BitXorAssign<Mode> for Mode
impl BitXorAssign<Mode> for Mode
sourcefn bitxor_assign(&mut self, other: Mode)
fn bitxor_assign(&mut self, other: Mode)
Toggles the set of flags.
sourceimpl Extend<Mode> for Mode
impl Extend<Mode> for Mode
sourcefn extend<T: IntoIterator<Item = Mode>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Mode>>(&mut self, iterator: T)
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
sourceimpl FromIterator<Mode> for Mode
impl FromIterator<Mode> for Mode
sourceimpl Ord for Mode
impl Ord for Mode
sourceimpl PartialOrd<Mode> for Mode
impl PartialOrd<Mode> for Mode
sourcefn partial_cmp(&self, other: &Mode) -> Option<Ordering>
fn partial_cmp(&self, other: &Mode) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl SubAssign<Mode> for Mode
impl SubAssign<Mode> for Mode
sourcefn sub_assign(&mut self, other: Mode)
fn sub_assign(&mut self, other: Mode)
Disables all flags enabled in the set.
impl Copy for Mode
impl Eq for Mode
impl StructuralEq for Mode
impl StructuralPartialEq for Mode
Auto Trait Implementations
impl RefUnwindSafe for Mode
impl Send for Mode
impl Sync for Mode
impl Unpin for Mode
impl UnwindSafe for Mode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.