This is unreleased documentation for Yew Next version.
For up-to-date documentation, see the latest version on docs.rs.
Settings
Help

AttrValue

Type Alias AttrValue 

Source
pub type AttrValue = IString;
Expand description

Attribute value

Aliased Type§

pub enum AttrValue {
    Static(&'static str),
    Rc(Rc<str>),
}

Variants§

§

Static(&'static str)

A static string slice.

§

Rc(Rc<str>)

A reference counted string slice.

Implementations

§

impl IString

pub fn as_str(&self) -> &str

Extracts a string slice containing the entire IString.

§Examples

Basic usage:

let s = IString::from("foo");

assert_eq!("foo", s.as_str());

pub fn as_cow(&self) -> Cow<'_, str>

Obtain the contents of [IString] as a Cow.

§Examples
use std::borrow::Cow;
let s = IString::from("foo");

let cow: Cow<'_, str> = s.as_cow();

Trait Implementations§

Source§

impl IntoPropValue<ChildrenRenderer<VNode>> for AttrValue

Source§

fn into_prop_value(self) -> ChildrenRenderer<VNode>

Convert self to a value of a Properties struct.
Source§

impl IntoPropValue<VNode> for &AttrValue

Source§

fn into_prop_value(self) -> VNode

Convert self to a value of a Properties struct.
Source§

impl IntoPropValue<VNode> for AttrValue

Source§

fn into_prop_value(self) -> VNode

Convert self to a value of a Properties struct.
§

impl AsRef<str> for IString

§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
§

impl Borrow<str> for IString

§

fn borrow(&self) -> &str

Immutably borrows from an owned value. Read more
§

impl Clone for IString

§

fn clone(&self) -> IString

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
§

impl Debug for IString

§

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

Formats the value using the given formatter. Read more
§

impl Default for IString

§

fn default() -> IString

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

impl Deref for IString

§

type Target = str

The resulting type after dereferencing.
§

fn deref(&self) -> &<IString as Deref>::Target

Dereferences the value.
§

impl<'de> Deserialize<'de> for IString

§

fn deserialize<D>( deserializer: D, ) -> Result<IString, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
§

impl Display for IString

§

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

Formats the value using the given formatter. Read more
§

impl From<&IString> for IString

§

fn from(s: &IString) -> IString

Converts to this type from the input type.
§

impl From<&'static str> for IString

§

fn from(s: &'static str) -> IString

Converts to this type from the input type.
§

impl From<Arguments<'_>> for IString

§

fn from(args: Arguments<'_>) -> IString

Converts to this type from the input type.
§

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

§

fn from(cow: Cow<'static, str>) -> IString

Converts to this type from the input type.
§

impl From<Rc<str>> for IString

§

fn from(s: Rc<str>) -> IString

Converts to this type from the input type.
§

impl From<String> for IString

§

fn from(s: String) -> IString

Converts to this type from the input type.
§

impl FromStr for IString

§

type Err = Infallible

The associated error which can be returned from parsing.
§

fn from_str(value: &str) -> Result<IString, <IString as FromStr>::Err>

Parses a string s to return a value of this type. Read more
§

impl Hash for IString

§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
§

impl ImplicitClone for IString

§

fn implicit_clone(&self) -> Self

This function is not magic; it is literally defined as Read more
§

impl Ord for IString

§

fn cmp(&self, other: &IString) -> 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,

Restrict a value to a certain interval. Read more
§

impl PartialEq<&String> for IString

§

fn eq(&self, other: &&String) -> 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.
§

impl PartialEq<&str> for IString

§

fn eq(&self, other: &&str) -> 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.
§

impl PartialEq<String> for IString

§

fn eq(&self, other: &String) -> 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.
§

impl PartialEq<str> for IString

§

fn eq(&self, other: &str) -> 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.
§

impl PartialEq for IString

§

fn eq(&self, other: &IString) -> 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.
§

impl PartialOrd<&String> for IString

§

fn partial_cmp(&self, other: &&String) -> 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

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

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

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

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

impl PartialOrd<&str> for IString

§

fn partial_cmp(&self, other: &&str) -> 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

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

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

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

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

impl PartialOrd<String> for IString

§

fn partial_cmp(&self, other: &String) -> 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

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

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

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

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

impl PartialOrd<str> for IString

§

fn partial_cmp(&self, other: &str) -> 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

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

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

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

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

impl PartialOrd for IString

§

fn partial_cmp(&self, other: &IString) -> 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

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

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

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

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

impl Serialize for IString

§

fn serialize<S>( &self, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl Eq for IString