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,
§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.