Struct Attributes
pub struct Attributes(/* private fields */);Available on crate feature
term only.Expand description
a bitset for all possible attributes
Implementations§
§impl Attributes
impl Attributes
pub const fn none() -> Attributes
pub const fn none() -> Attributes
Returns the empty bitset.
pub 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.
pub 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.
pub fn set(&mut self, attribute: Attribute)
pub fn set(&mut self, attribute: Attribute)
Sets the attribute. If it’s already set, this does nothing.
pub fn unset(&mut self, attribute: Attribute)
pub fn unset(&mut self, attribute: Attribute)
Unsets the attribute. If it’s not set, this changes nothing.
pub 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.
pub fn extend(&mut self, attributes: Attributes)
pub fn extend(&mut self, attributes: Attributes)
Sets all the passed attributes. Removes none.
Trait Implementations§
§impl BitAnd for Attributes
impl BitAnd for Attributes
§type Output = Attributes
type Output = Attributes
The resulting type after applying the
& operator.§fn bitand(self, rhs: Attributes) -> Attributes
fn bitand(self, rhs: Attributes) -> Attributes
Performs the
& operation. Read more§impl BitAnd<Attribute> for Attributes
impl BitAnd<Attribute> for Attributes
§type Output = Attributes
type Output = Attributes
The resulting type after applying the
& operator.§fn bitand(self, rhs: Attribute) -> Attributes
fn bitand(self, rhs: Attribute) -> Attributes
Performs the
& operation. Read more§impl BitOr for Attributes
impl BitOr for Attributes
§type Output = Attributes
type Output = Attributes
The resulting type after applying the
| operator.§fn bitor(self, rhs: Attributes) -> Attributes
fn bitor(self, rhs: Attributes) -> Attributes
Performs the
| operation. Read more§impl BitOr<Attribute> for Attributes
impl BitOr<Attribute> for Attributes
§type Output = Attributes
type Output = Attributes
The resulting type after applying the
| operator.§fn bitor(self, rhs: Attribute) -> Attributes
fn bitor(self, rhs: Attribute) -> Attributes
Performs the
| operation. Read more§impl BitXor for Attributes
impl BitXor for Attributes
§type Output = Attributes
type Output = Attributes
The resulting type after applying the
^ operator.§fn bitxor(self, rhs: Attributes) -> Attributes
fn bitxor(self, rhs: Attributes) -> Attributes
Performs the
^ operation. Read more§impl BitXor<Attribute> for Attributes
impl BitXor<Attribute> for Attributes
§type Output = Attributes
type Output = Attributes
The resulting type after applying the
^ operator.§fn bitxor(self, rhs: Attribute) -> Attributes
fn bitxor(self, rhs: Attribute) -> Attributes
Performs the
^ operation. Read more§impl Clone for Attributes
impl Clone for Attributes
§fn clone(&self) -> Attributes
fn clone(&self) -> Attributes
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Attributes
§impl Debug for Attributes
impl Debug for Attributes
§impl Default for Attributes
impl Default for Attributes
§fn default() -> Attributes
fn default() -> Attributes
Returns the “default value” for a type. Read more
impl Eq for Attributes
§impl From<&[Attribute]> for Attributes
impl From<&[Attribute]> for Attributes
§fn from(arr: &[Attribute]) -> Attributes
fn from(arr: &[Attribute]) -> Attributes
Converts to this type from the input type.
§impl From<Attribute> for Attributes
impl From<Attribute> for Attributes
§fn from(attribute: Attribute) -> Attributes
fn from(attribute: Attribute) -> Attributes
Converts to this type from the input type.
§impl PartialEq for Attributes
impl PartialEq 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 UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more