pub struct Attributes(/* private fields */);
Expand description
a bitset for all possible attributes
Implementations§
Source§impl Attributes
impl Attributes
Sourcepub const fn none() -> Attributes
pub const fn none() -> Attributes
Returns the empty bitset.
Sourcepub const fn with(self, attribute: Attribute) -> Attributes
pub const fn with(self, attribute: Attribute) -> Attributes
Returns a copy of the bitset with the given attribute set. If it’s already set, this returns the bitset unmodified.
Sourcepub const fn without(self, attribute: Attribute) -> Attributes
pub const fn without(self, attribute: Attribute) -> Attributes
Returns a copy of the bitset with the given attribute unset. If it’s not set, this returns the bitset unmodified.
Sourcepub fn set(&mut self, attribute: Attribute)
pub fn set(&mut self, attribute: Attribute)
Sets the attribute. If it’s already set, this does nothing.
Sourcepub fn unset(&mut self, attribute: Attribute)
pub fn unset(&mut self, attribute: Attribute)
Unsets the attribute. If it’s not set, this changes nothing.
Sourcepub fn toggle(&mut self, attribute: Attribute)
pub fn toggle(&mut self, attribute: Attribute)
Sets the attribute if it’s unset, unset it if it is set.
Sourcepub fn extend(&mut self, attributes: Attributes)
pub fn extend(&mut self, attributes: Attributes)
Sets all the passed attributes. Removes none.
Trait Implementations§
Source§impl BitAnd<Attribute> for Attributes
impl BitAnd<Attribute> for Attributes
Source§type Output = Attributes
type Output = Attributes
The resulting type after applying the
&
operator.Source§impl BitAnd for Attributes
impl BitAnd for Attributes
Source§type Output = Attributes
type Output = Attributes
The resulting type after applying the
&
operator.Source§fn bitand(self, rhs: Attributes) -> Attributes
fn bitand(self, rhs: Attributes) -> Attributes
Performs the
&
operation. Read moreSource§impl BitOr<Attribute> for Attributes
impl BitOr<Attribute> for Attributes
Source§type Output = Attributes
type Output = Attributes
The resulting type after applying the
|
operator.Source§impl BitOr for Attributes
impl BitOr for Attributes
Source§type Output = Attributes
type Output = Attributes
The resulting type after applying the
|
operator.Source§fn bitor(self, rhs: Attributes) -> Attributes
fn bitor(self, rhs: Attributes) -> Attributes
Performs the
|
operation. Read moreSource§impl BitXor<Attribute> for Attributes
impl BitXor<Attribute> for Attributes
Source§type Output = Attributes
type Output = Attributes
The resulting type after applying the
^
operator.Source§impl BitXor for Attributes
impl BitXor for Attributes
Source§type Output = Attributes
type Output = Attributes
The resulting type after applying the
^
operator.Source§fn bitxor(self, rhs: Attributes) -> Attributes
fn bitxor(self, rhs: Attributes) -> Attributes
Performs the
^
operation. Read moreSource§impl Clone for Attributes
impl Clone for Attributes
Source§fn clone(&self) -> Attributes
fn clone(&self) -> Attributes
Returns a copy 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 Attributes
impl Debug for Attributes
Source§impl Default for Attributes
impl Default for Attributes
Source§fn default() -> Attributes
fn default() -> Attributes
Returns the “default value” for a type. Read more
Source§impl From<&[Attribute]> for Attributes
impl From<&[Attribute]> for Attributes
Source§fn from(arr: &[Attribute]) -> Attributes
fn from(arr: &[Attribute]) -> Attributes
Converts to this type from the input type.
Source§impl From<Attribute> for Attributes
impl From<Attribute> for Attributes
Source§fn from(attribute: Attribute) -> Attributes
fn from(attribute: Attribute) -> Attributes
Converts to this type from the input type.
Source§impl PartialEq for Attributes
impl PartialEq for Attributes
impl Copy for Attributes
impl Eq for Attributes
impl StructuralPartialEq for Attributes
Auto Trait Implementations§
impl Freeze for Attributes
impl RefUnwindSafe for Attributes
impl Send for Attributes
impl Sync for Attributes
impl Unpin for Attributes
impl UnwindSafe for Attributes
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