pub struct ColorWrites { /* private fields */ }
Expand description
A bitmask to enable or disable writes to individual color channels.
Implementations§
Source§impl ColorWrites
impl ColorWrites
Sourcepub const EMPTY: ColorWrites
pub const EMPTY: ColorWrites
An empty set of flags.
Sourcepub const R: ColorWrites
pub const R: ColorWrites
Enable writes to the Red channel.
Sourcepub const G: ColorWrites
pub const G: ColorWrites
Enable writes to the Green channel.
Sourcepub const B: ColorWrites
pub const B: ColorWrites
Enable writes to the Blue channel.
Sourcepub const A: ColorWrites
pub const A: ColorWrites
Enable writes to the Alpha channel.
Sourcepub const ALL: ColorWrites
pub const ALL: ColorWrites
Enable writes to all channels.
Sourcepub const fn from_bits_truncate(bits: u8) -> ColorWrites
pub const fn from_bits_truncate(bits: u8) -> ColorWrites
Creates a new bitflag set from the given raw bits. Bits not corresponding to any defined flag are kept.
Sourcepub const fn contains(&self, other: ColorWrites) -> bool
pub const fn contains(&self, other: ColorWrites) -> bool
Returns true
if all flags in other
are contained within self
.
Sourcepub const fn intersects(&self, other: ColorWrites) -> bool
pub const fn intersects(&self, other: ColorWrites) -> bool
Returns true
if any flag in other
is contained within self
.
Sourcepub fn insert(&mut self, other: ColorWrites)
pub fn insert(&mut self, other: ColorWrites)
Inserts the flags in other
into self
.
Sourcepub fn remove(&mut self, other: ColorWrites)
pub fn remove(&mut self, other: ColorWrites)
Removes the flags in other
from self
.
Sourcepub fn toggle(&mut self, other: ColorWrites)
pub fn toggle(&mut self, other: ColorWrites)
Toggles the flags in other
in self
.
Sourcepub const fn with(self, other: ColorWrites) -> ColorWrites
pub const fn with(self, other: ColorWrites) -> ColorWrites
Returns a new Self
with other
flags inserted.
Sourcepub const fn without(self, other: ColorWrites) -> ColorWrites
pub const fn without(self, other: ColorWrites) -> ColorWrites
Returns a new Self
with other
flags removed.
Trait Implementations§
Source§impl BitAnd for ColorWrites
impl BitAnd for ColorWrites
Source§type Output = ColorWrites
type Output = ColorWrites
The resulting type after applying the
&
operator.Source§fn bitand(self, other: ColorWrites) -> ColorWrites
fn bitand(self, other: ColorWrites) -> ColorWrites
Performs the
&
operation. Read moreSource§impl BitAndAssign for ColorWrites
impl BitAndAssign for ColorWrites
Source§fn bitand_assign(&mut self, other: ColorWrites)
fn bitand_assign(&mut self, other: ColorWrites)
Performs the
&=
operation. Read moreSource§impl BitOr for ColorWrites
impl BitOr for ColorWrites
Source§type Output = ColorWrites
type Output = ColorWrites
The resulting type after applying the
|
operator.Source§fn bitor(self, other: ColorWrites) -> ColorWrites
fn bitor(self, other: ColorWrites) -> ColorWrites
Performs the
|
operation. Read moreSource§impl BitOrAssign for ColorWrites
impl BitOrAssign for ColorWrites
Source§fn bitor_assign(&mut self, other: ColorWrites)
fn bitor_assign(&mut self, other: ColorWrites)
Performs the
|=
operation. Read moreSource§impl BitXor for ColorWrites
impl BitXor for ColorWrites
Source§type Output = ColorWrites
type Output = ColorWrites
The resulting type after applying the
^
operator.Source§fn bitxor(self, other: ColorWrites) -> ColorWrites
fn bitxor(self, other: ColorWrites) -> ColorWrites
Performs the
^
operation. Read moreSource§impl BitXorAssign for ColorWrites
impl BitXorAssign for ColorWrites
Source§fn bitxor_assign(&mut self, other: ColorWrites)
fn bitxor_assign(&mut self, other: ColorWrites)
Performs the
^=
operation. Read moreSource§impl Clone for ColorWrites
impl Clone for ColorWrites
Source§fn clone(&self) -> ColorWrites
fn clone(&self) -> ColorWrites
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 ColorWrites
impl Debug for ColorWrites
Source§impl Default for ColorWrites
impl Default for ColorWrites
Source§fn default() -> ColorWrites
fn default() -> ColorWrites
Returns the “default value” for a type. Read more
Source§impl Hash for ColorWrites
impl Hash for ColorWrites
Source§impl Not for ColorWrites
impl Not for ColorWrites
Source§type Output = ColorWrites
type Output = ColorWrites
The resulting type after applying the
!
operator.Source§fn not(self) -> ColorWrites
fn not(self) -> ColorWrites
Performs the unary
!
operation. Read moreSource§impl PartialEq for ColorWrites
impl PartialEq for ColorWrites
impl Copy for ColorWrites
impl Eq for ColorWrites
impl StructuralPartialEq for ColorWrites
Auto Trait Implementations§
impl Freeze for ColorWrites
impl RefUnwindSafe for ColorWrites
impl Send for ColorWrites
impl Sync for ColorWrites
impl Unpin for ColorWrites
impl UnwindSafe for ColorWrites
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.