pub struct Classes { /* private fields */ }
Expand description
A set of classes, cheap to clone.
The preferred way of creating this is using the classes!
macro.
Implementations§
source§impl Classes
impl Classes
sourcepub fn with_capacity(n: usize) -> Self
pub fn with_capacity(n: usize) -> Self
Creates an empty set of classes with capacity for n elements. (Does not allocate if n is zero.)
sourcepub fn push<T: Into<Self>>(&mut self, class: T)
pub fn push<T: Into<Self>>(&mut self, class: T)
Adds a class to a set.
If the provided class has already been added, this method will ignore it.
sourcepub unsafe fn unchecked_push<T: Into<AttrValue>>(&mut self, class: T)
pub unsafe fn unchecked_push<T: Into<AttrValue>>(&mut self, class: T)
Adds a class to a set.
If the provided class has already been added, this method will ignore it.
This method won’t check if there are multiple classes in the input string.
§Safety
This function will not split the string into multiple classes. Please do not use it unless
you are absolutely certain that the string does not contain any whitespace and it is not
empty. Using push()
is preferred.
Trait Implementations§
source§impl<T: Into<Classes>> Extend<T> for Classes
impl<T: Into<Classes>> Extend<T> for Classes
source§fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
source§impl<T: Into<Classes>> FromIterator<T> for Classes
impl<T: Into<Classes>> FromIterator<T> for Classes
source§fn from_iter<IT: IntoIterator<Item = T>>(iter: IT) -> Self
fn from_iter<IT: IntoIterator<Item = T>>(iter: IT) -> Self
Creates a value from an iterator. Read more
source§impl ImplicitClone for Classes
impl ImplicitClone for Classes
§fn implicit_clone(&self) -> Self
fn implicit_clone(&self) -> Self
This function is not magic; it is literally defined as Read more
source§impl IntoIterator for &Classes
impl IntoIterator for &Classes
source§impl IntoIterator for Classes
impl IntoIterator for Classes
source§impl IntoPropValue<Classes> for &'static str
impl IntoPropValue<Classes> for &'static str
source§fn into_prop_value(self) -> Classes
fn into_prop_value(self) -> Classes
Convert
self
to a value of a Properties
struct.source§impl IntoPropValue<IString> for Classes
impl IntoPropValue<IString> for Classes
source§fn into_prop_value(self) -> AttrValue
fn into_prop_value(self) -> AttrValue
Convert
self
to a value of a Properties
struct.source§impl IntoPropValue<Option<IString>> for Classes
impl IntoPropValue<Option<IString>> for Classes
source§fn into_prop_value(self) -> Option<AttrValue>
fn into_prop_value(self) -> Option<AttrValue>
Convert
self
to a value of a Properties
struct.impl Eq for Classes
Auto Trait Implementations§
impl Freeze for Classes
impl RefUnwindSafe for Classes
impl !Send for Classes
impl !Sync for Classes
impl Unpin for Classes
impl UnwindSafe for Classes
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§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>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
source§fn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self
to a value of a Properties
struct.source§impl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
source§fn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self
to a value of a Properties
struct.