pub struct Class(pub Vec<String>);
Expand description

Class struct is just a wrapper of Vec<String>

several From<> provided for easier construction most of the time, you’ll use class! proc_macro to create instance.

Some Add<> helper also provided, so you can define common part, and append extra values if needed.

Tuple Fields§

§0: Vec<String>

Implementations§

source§

impl Class

source

pub const NONE: Class = _

source

pub fn to_class(&self) -> String

source

pub fn validate(&mut self)

source

pub fn validated(&mut self) -> Self

source

pub fn append(&mut self, v: &str)

Trait Implementations§

source§

impl Add<&Class> for Class

§

type Output = Class

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Class) -> Self::Output

Performs the + operation. Read more
source§

impl Add<&Option<&Class>> for Class

§

type Output = Class

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Option<&Class>) -> Self::Output

Performs the + operation. Read more
source§

impl Add<&str> for Class

§

type Output = Class

The resulting type after applying the + operator.
source§

fn add(self, rhs: &str) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Option<&Class>> for Class

§

type Output = Class

The resulting type after applying the + operator.
source§

fn add(self, rhs: Option<&Class>) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Option<&str>> for Class

§

type Output = Class

The resulting type after applying the + operator.
source§

fn add(self, rhs: Option<&str>) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Option<Class>> for Class

§

type Output = Class

The resulting type after applying the + operator.
source§

fn add(self, rhs: Option<Class>) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Option<String>> for Class

§

type Output = Class

The resulting type after applying the + operator.
source§

fn add(self, rhs: Option<String>) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Option<Vec<&str>>> for Class

§

type Output = Class

The resulting type after applying the + operator.
source§

fn add(self, rhs: Option<Vec<&str>>) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Option<Vec<String>>> for Class

§

type Output = Class

The resulting type after applying the + operator.
source§

fn add(self, rhs: Option<Vec<String>>) -> Self::Output

Performs the + operation. Read more
source§

impl Add<String> for Class

§

type Output = Class

The resulting type after applying the + operator.
source§

fn add(self, rhs: String) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Vec<&str>> for Class

§

type Output = Class

The resulting type after applying the + operator.
source§

fn add(self, rhs: Vec<&str>) -> Self::Output

Performs the + operation. Read more
source§

impl Add<Vec<String>> for Class

§

type Output = Class

The resulting type after applying the + operator.
source§

fn add(self, rhs: Vec<String>) -> Self::Output

Performs the + operation. Read more
source§

impl Add for Class

§

type Output = Class

The resulting type after applying the + operator.
source§

fn add(self, rhs: Class) -> Self::Output

Performs the + operation. Read more
source§

impl Clone for Class

source§

fn clone(&self) -> Class

Returns a copy 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 Class

source§

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

Formats the value using the given formatter. Read more
source§

impl Display for Class

source§

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

Formats the value using the given formatter. Read more
source§

impl From<&[&str]> for Class

source§

fn from(v: &[&str]) -> Self

Converts to this type from the input type.
source§

impl From<&[String]> for Class

source§

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

Converts to this type from the input type.
source§

impl From<Vec<&str>> for Class

source§

fn from(v: Vec<&str>) -> Self

Converts to this type from the input type.
source§

impl From<Vec<String>> for Class

source§

fn from(v: Vec<String>) -> Self

Converts to this type from the input type.
source§

impl IntoAttributeValue for &Class

source§

fn into_value(self) -> AttributeValue

Convert into an attribute value
source§

impl IntoAttributeValue for Class

source§

fn into_value(self) -> AttributeValue

Convert into an attribute value
source§

impl Ord for Class

source§

fn cmp(&self, other: &Class) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Class

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Class

source§

fn partial_cmp(&self, other: &Class) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Eq for Class

source§

impl StructuralPartialEq for Class

Auto Trait Implementations§

§

impl Freeze for Class

§

impl RefUnwindSafe for Class

§

impl Send for Class

§

impl Sync for Class

§

impl Unpin for Class

§

impl UnwindSafe for Class

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> 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, O> SuperFrom<T> for O
where O: From<T>,

source§

fn super_from(input: T) -> O

Convert from a type to another type.
source§

impl<T, O, M> SuperInto<O, M> for T
where O: SuperFrom<T, M>,

source§

fn super_into(self) -> O

Convert from a type to another type.
source§

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

source§

fn to<T>(self) -> T
where Self: Into<T>,

Converts to T by calling Into<T>::into.
source§

fn try_to<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Tries to convert to T by calling TryInto<T>::try_into.
source§

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

§

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> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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

§

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<Cfg> TryIntoConfig for Cfg

source§

fn into_config(self) -> Option<Cfg>

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<T> DependencyElement for T
where T: 'static + PartialEq + Clone,