pub struct ColorWrite { /* private fields */ }
Expand description
Color write mask. Disabled color channels will not be written to.
Implementations§
Source§impl ColorWrite
impl ColorWrite
Sourcepub const RED: ColorWrite
pub const RED: ColorWrite
Enable red channel writes
Sourcepub const GREEN: ColorWrite
pub const GREEN: ColorWrite
Enable green channel writes
Sourcepub const BLUE: ColorWrite
pub const BLUE: ColorWrite
Enable blue channel writes
Sourcepub const ALPHA: ColorWrite
pub const ALPHA: ColorWrite
Enable alpha channel writes
Sourcepub const COLOR: ColorWrite
pub const COLOR: ColorWrite
Enable red, green, and blue channel writes
Sourcepub const ALL: ColorWrite
pub const ALL: ColorWrite
Enable writes to all channels.
Sourcepub const fn empty() -> ColorWrite
pub const fn empty() -> ColorWrite
Returns an empty set of flags
Sourcepub const fn all() -> ColorWrite
pub const fn all() -> ColorWrite
Returns the set containing all flags.
Sourcepub fn from_bits(bits: u32) -> Option<ColorWrite>
pub fn from_bits(bits: u32) -> Option<ColorWrite>
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) -> ColorWrite
pub const fn from_bits_truncate(bits: u32) -> ColorWrite
Convert from underlying bit representation, dropping any bits that do not correspond to flags.
Sourcepub const unsafe fn from_bits_unchecked(bits: u32) -> ColorWrite
pub const unsafe fn from_bits_unchecked(bits: u32) -> ColorWrite
Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).
Sourcepub const fn intersects(&self, other: ColorWrite) -> bool
pub const fn intersects(&self, other: ColorWrite) -> bool
Returns true
if there are flags common to both self
and other
.
Sourcepub const fn contains(&self, other: ColorWrite) -> bool
pub const fn contains(&self, other: ColorWrite) -> bool
Returns true
all of the flags in other
are contained within self
.
Sourcepub fn insert(&mut self, other: ColorWrite)
pub fn insert(&mut self, other: ColorWrite)
Inserts the specified flags in-place.
Sourcepub fn remove(&mut self, other: ColorWrite)
pub fn remove(&mut self, other: ColorWrite)
Removes the specified flags in-place.
Sourcepub fn toggle(&mut self, other: ColorWrite)
pub fn toggle(&mut self, other: ColorWrite)
Toggles the specified flags in-place.
Sourcepub fn set(&mut self, other: ColorWrite, value: bool)
pub fn set(&mut self, other: ColorWrite, value: bool)
Inserts or removes the specified flags depending on the passed value.
Trait Implementations§
Source§impl Binary for ColorWrite
impl Binary for ColorWrite
Source§impl BitAnd for ColorWrite
impl BitAnd for ColorWrite
Source§fn bitand(self, other: ColorWrite) -> ColorWrite
fn bitand(self, other: ColorWrite) -> ColorWrite
Returns the intersection between the two sets of flags.
Source§type Output = ColorWrite
type Output = ColorWrite
&
operator.Source§impl BitAndAssign for ColorWrite
impl BitAndAssign for ColorWrite
Source§fn bitand_assign(&mut self, other: ColorWrite)
fn bitand_assign(&mut self, other: ColorWrite)
Disables all flags disabled in the set.
Source§impl BitOr for ColorWrite
impl BitOr for ColorWrite
Source§fn bitor(self, other: ColorWrite) -> ColorWrite
fn bitor(self, other: ColorWrite) -> ColorWrite
Returns the union of the two sets of flags.
Source§type Output = ColorWrite
type Output = ColorWrite
|
operator.Source§impl BitOrAssign for ColorWrite
impl BitOrAssign for ColorWrite
Source§fn bitor_assign(&mut self, other: ColorWrite)
fn bitor_assign(&mut self, other: ColorWrite)
Adds the set of flags.
Source§impl BitXor for ColorWrite
impl BitXor for ColorWrite
Source§fn bitxor(self, other: ColorWrite) -> ColorWrite
fn bitxor(self, other: ColorWrite) -> ColorWrite
Returns the left flags, but with all the right flags toggled.
Source§type Output = ColorWrite
type Output = ColorWrite
^
operator.Source§impl BitXorAssign for ColorWrite
impl BitXorAssign for ColorWrite
Source§fn bitxor_assign(&mut self, other: ColorWrite)
fn bitxor_assign(&mut self, other: ColorWrite)
Toggles the set of flags.
Source§impl Clone for ColorWrite
impl Clone for ColorWrite
Source§fn clone(&self) -> ColorWrite
fn clone(&self) -> ColorWrite
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ColorWrite
impl Debug for ColorWrite
Source§impl Default for ColorWrite
impl Default for ColorWrite
Source§fn default() -> ColorWrite
fn default() -> ColorWrite
Source§impl<'de> Deserialize<'de> for ColorWrite
impl<'de> Deserialize<'de> for ColorWrite
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ColorWrite, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ColorWrite, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Extend<ColorWrite> for ColorWrite
impl Extend<ColorWrite> for ColorWrite
Source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = ColorWrite>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = ColorWrite>,
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 FromIterator<ColorWrite> for ColorWrite
impl FromIterator<ColorWrite> for ColorWrite
Source§fn from_iter<T>(iterator: T) -> ColorWritewhere
T: IntoIterator<Item = ColorWrite>,
fn from_iter<T>(iterator: T) -> ColorWritewhere
T: IntoIterator<Item = ColorWrite>,
Source§impl Hash for ColorWrite
impl Hash for ColorWrite
Source§impl LowerHex for ColorWrite
impl LowerHex for ColorWrite
Source§impl Not for ColorWrite
impl Not for ColorWrite
Source§fn not(self) -> ColorWrite
fn not(self) -> ColorWrite
Returns the complement of this set of flags.
Source§type Output = ColorWrite
type Output = ColorWrite
!
operator.Source§impl Octal for ColorWrite
impl Octal for ColorWrite
Source§impl Ord for ColorWrite
impl Ord for ColorWrite
Source§fn cmp(&self, other: &ColorWrite) -> Ordering
fn cmp(&self, other: &ColorWrite) -> 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 ColorWrite
impl PartialEq for ColorWrite
Source§impl PartialOrd for ColorWrite
impl PartialOrd for ColorWrite
Source§impl Serialize for ColorWrite
impl Serialize for ColorWrite
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Source§impl Sub for ColorWrite
impl Sub for ColorWrite
Source§fn sub(self, other: ColorWrite) -> ColorWrite
fn sub(self, other: ColorWrite) -> ColorWrite
Returns the set difference of the two sets of flags.
Source§type Output = ColorWrite
type Output = ColorWrite
-
operator.Source§impl SubAssign for ColorWrite
impl SubAssign for ColorWrite
Source§fn sub_assign(&mut self, other: ColorWrite)
fn sub_assign(&mut self, other: ColorWrite)
Disables all flags enabled in the set.