Struct Classes

Source
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

Source

pub fn new() -> Classes

Creates an empty set of classes. (Does not allocate.)

Source

pub fn with_capacity(n: usize) -> Classes

Creates an empty set of classes with capacity for n elements. (Does not allocate if n is zero.)

Source

pub fn push<T>(&mut self, class: T)
where T: Into<Classes>,

Adds a class to a set.

If the provided class has already been added, this method will ignore it.

Source

pub unsafe fn unchecked_push<T>(&mut self, class: T)
where T: Into<IString>,

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.

Source

pub fn contains<T>(&self, class: T) -> bool
where T: AsRef<str>,

Check the set contains a class.

Source

pub fn is_empty(&self) -> bool

Check the set is empty.

Trait Implementationsยง

Sourceยง

impl Clone for Classes

Sourceยง

fn clone(&self) -> Classes

Returns a duplicate of the value. Read more
1.0.0 ยท Sourceยง

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Sourceยง

impl Debug for Classes

Sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Sourceยง

impl Default for Classes

Sourceยง

fn default() -> Classes

Returns the โ€œdefault valueโ€ for a type. Read more
Sourceยง

impl<T> Extend<T> for Classes
where T: Into<Classes>,

Sourceยง

fn extend<I>(&mut self, iter: I)
where I: IntoIterator<Item = T>,

Extends a collection with the contents of an iterator. Read more
Sourceยง

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)

๐Ÿ”ฌ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> From<&[T]> for Classes
where T: Into<Classes> + Clone,

Sourceยง

fn from(t: &[T]) -> Classes

Converts to this type from the input type.
Sourceยง

impl From<&IString> for Classes

Sourceยง

fn from(t: &IString) -> Classes

Converts to this type from the input type.
Sourceยง

impl<T> From<&Option<T>> for Classes
where T: Into<Classes> + Clone,

Sourceยง

fn from(t: &Option<T>) -> Classes

Converts to this type from the input type.
Sourceยง

impl From<&String> for Classes

Sourceยง

fn from(t: &String) -> Classes

Converts to this type from the input type.
Sourceยง

impl From<&'static str> for Classes

Sourceยง

fn from(t: &'static str) -> Classes

Converts to this type from the input type.
Sourceยง

impl<T, const SIZE: usize> From<[T; SIZE]> for Classes
where T: Into<Classes>,

Sourceยง

fn from(t: [T; SIZE]) -> Classes

Converts to this type from the input type.
Sourceยง

impl From<Cow<'static, str>> for Classes

Sourceยง

fn from(t: Cow<'static, str>) -> Classes

Converts to this type from the input type.
Sourceยง

impl From<IString> for Classes

Sourceยง

fn from(t: IString) -> Classes

Converts to this type from the input type.
Sourceยง

impl<T> From<Option<T>> for Classes
where T: Into<Classes>,

Sourceยง

fn from(t: Option<T>) -> Classes

Converts to this type from the input type.
Sourceยง

impl From<String> for Classes

Sourceยง

fn from(t: String) -> Classes

Converts to this type from the input type.
Sourceยง

impl From<Style> for Classes

Sourceยง

fn from(style: Style) -> Classes

Converts to this type from the input type.
Sourceยง

impl From<StyleSource> for Classes

Sourceยง

fn from(style_src: StyleSource) -> Classes

Converts to this type from the input type.
Sourceยง

impl<T> From<Vec<T>> for Classes
where T: Into<Classes>,

Sourceยง

fn from(t: Vec<T>) -> Classes

Converts to this type from the input type.
Sourceยง

impl<T> FromIterator<T> for Classes
where T: Into<Classes>,

Sourceยง

fn from_iter<IT>(iter: IT) -> Classes
where IT: IntoIterator<Item = T>,

Creates a value from an iterator. Read more
Sourceยง

impl ImplicitClone for Classes

Sourceยง

fn implicit_clone(&self) -> Self

This function is not magic; it is literally defined as Read more
Sourceยง

impl IntoIterator for &Classes

Sourceยง

type IntoIter = IntoIter<IString>

Which kind of iterator are we turning this into?
Sourceยง

type Item = IString

The type of the elements being iterated over.
Sourceยง

fn into_iter(self) -> <&Classes as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Sourceยง

impl IntoIterator for Classes

Sourceยง

type IntoIter = IntoIter<IString>

Which kind of iterator are we turning this into?
Sourceยง

type Item = IString

The type of the elements being iterated over.
Sourceยง

fn into_iter(self) -> <Classes as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Sourceยง

impl IntoPropValue<Classes> for &'static str

Sourceยง

fn into_prop_value(self) -> Classes

Convert self to a value of a Properties struct.
Sourceยง

impl IntoPropValue<Classes> for Style

Sourceยง

fn into_prop_value(self) -> Classes

Convert self to a value of a Properties struct.
Sourceยง

impl IntoPropValue<Classes> for StyleSource

Sourceยง

fn into_prop_value(self) -> Classes

Convert self to a value of a Properties struct.
Sourceยง

impl IntoPropValue<IString> for Classes

Sourceยง

fn into_prop_value(self) -> IString

Convert self to a value of a Properties struct.
Sourceยง

impl IntoPropValue<Option<IString>> for Classes

Sourceยง

fn into_prop_value(self) -> Option<IString>

Convert self to a value of a Properties struct.
Sourceยง

impl PartialEq for Classes

Sourceยง

fn eq(&self, other: &Classes) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 ยท Sourceยง

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Sourceยง

impl ToString for Classes

Sourceยง

fn to_string(&self) -> String

Converts the given value to a String. Read more
Sourceยง

impl Eq for Classes

Auto Trait Implementationsยง

Blanket Implementationsยง

Sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

Sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

Sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Sourceยง

impl<T> CloneToUninit for T
where T: Clone,

Sourceยง

unsafe fn clone_to_uninit(&self, dest: *mut u8)

๐Ÿ”ฌThis is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Sourceยง

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Sourceยง

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Sourceยง

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Sourceยง

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T> Instrument for T

Sourceยง

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Sourceยง

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Sourceยง

impl<T> IntoPropValue<Option<T>> for T

Sourceยง

fn into_prop_value(self) -> Option<T>

Convert self to a value of a Properties struct.
Sourceยง

impl<T> IntoPropValue<T> for T

Sourceยง

fn into_prop_value(self) -> T

Convert self to a value of a Properties struct.
Sourceยง

impl<T> ToOwned for T
where T: Clone,

Sourceยง

type Owned = T

The resulting type after obtaining ownership.
Sourceยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Sourceยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Sourceยง

impl<T> WithSubscriber for T

Sourceยง

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Sourceยง

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Sourceยง

impl<Token, Builder, How> AllPropsFor<Builder, How> for Token
where Builder: Buildable<Token>, <Builder as Buildable<Token>>::WrappedToken: HasAllProps<<Builder as Buildable<Token>>::Output, How>,

Sourceยง

impl<T> HasAllProps<(), T> for T