Struct yew::prelude::Classes[][src]

pub struct Classes { /* fields omitted */ }
Expand description

A set of classes.

The preferred way of creating this is using the classes! macro.

Implementations

impl Classes[src]

pub fn new() -> Self[src]

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

pub fn with_capacity(n: usize) -> Self[src]

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

pub fn push<T: Into<Self>>(&mut self, class: T)[src]

Adds a class to a set.

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

pub unsafe fn unchecked_push<T: Into<Cow<'static, str>>>(&mut self, class: T)[src]

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. Using push() is preferred.

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

Check the set contains a class.

pub fn is_empty(&self) -> bool[src]

Check the set is empty.

Trait Implementations

impl Clone for Classes[src]

fn clone(&self) -> Classes[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Classes[src]

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

Formats the value using the given formatter. Read more

impl Default for Classes[src]

fn default() -> Classes[src]

Returns the “default value” for a type. Read more

impl<T: Into<Classes>> Extend<T> for Classes[src]

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

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

fn extend_one(&mut self, item: A)[src]

🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

fn extend_reserve(&mut self, additional: usize)[src]

🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

impl<T: Into<Classes> + Clone> From<&'_ [T]> for Classes[src]

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

Performs the conversion.

impl<T: Into<Classes> + Clone> From<&'_ Option<T>> for Classes[src]

fn from(t: &Option<T>) -> Self[src]

Performs the conversion.

impl From<&'_ String> for Classes[src]

fn from(t: &String) -> Self[src]

Performs the conversion.

impl From<&'static str> for Classes[src]

fn from(t: &'static str) -> Self[src]

Performs the conversion.

impl From<Cow<'static, str>> for Classes[src]

fn from(t: Cow<'static, str>) -> Self[src]

Performs the conversion.

impl<T: Into<Classes>> From<Option<T>> for Classes[src]

fn from(t: Option<T>) -> Self[src]

Performs the conversion.

impl From<String> for Classes[src]

fn from(t: String) -> Self[src]

Performs the conversion.

impl<T: Into<Classes>> From<Vec<T, Global>> for Classes[src]

fn from(t: Vec<T>) -> Self[src]

Performs the conversion.

impl<T: Into<Classes>> FromIterator<T> for Classes[src]

fn from_iter<IT: IntoIterator<Item = T>>(iter: IT) -> Self[src]

Creates a value from an iterator. Read more

impl IntoIterator for Classes[src]

type Item = Cow<'static, str>

The type of the elements being iterated over.

type IntoIter = IntoIter<Cow<'static, str>>

Which kind of iterator are we turning this into?

fn into_iter(self) -> Self::IntoIter[src]

Creates an iterator from a value. Read more

impl IntoOptPropValue<Cow<'static, str>> for Classes[src]

fn into_opt_prop_value(self) -> Option<AttrValue>[src]

Convert self to an optional value of a Properties struct.

impl IntoPropValue<Cow<'static, str>> for Classes[src]

fn into_prop_value(self) -> AttrValue[src]

Convert self to a value of a Properties struct.

impl PartialEq<Classes> for Classes[src]

fn eq(&self, other: &Self) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl ToString for Classes[src]

fn to_string(&self) -> String[src]

Converts the given value to a String. Read more

Auto Trait Implementations

impl RefUnwindSafe for Classes

impl Send for Classes

impl Sync for Classes

impl Unpin for Classes

impl UnwindSafe for Classes

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T> Any for T where
    T: Any
[src]

impl<T> CloneAny for T where
    T: Any + Clone
[src]