logo
pub enum Value {
Show 18 variants Bool(bool), Str(&'static str), String(String), Vec(Vec<Value, Global>), U8(u8), U16(u16), U32(u32), U64(u64), Usize(usize), U128(u128), I8(i8), I16(i16), I32(i32), I64(i64), I128(i128), Isize(isize), F32(f32), F64(f64),
}
Expand description

Wraps different primitive variants used as values in html This is needed since html attributes can have different value types such as checked(bool), name(String), tab_index(i32)

Variants

Bool(bool)

bool value

Str(&'static str)

&’static str value

String(String)

String value

Vec(Vec<Value, Global>)

a vec of values

U8(u8)

u8 value

U16(u16)

u16 value

U32(u32)

u32 value

U64(u64)

u64 value

Usize(usize)

usize value

U128(u128)

u128 value

I8(i8)

i8 value

I16(i16)

i16 value

I32(i32)

i32 value

I64(i64)

i64 value

I128(i128)

i128 value

Isize(isize)

isize value

F32(f32)

f32 value

F64(f64)

f64 value

Implementations

returns an &str reference if this value is Str or String variant Note: This doesn’t convert other variant into str representation Use the to_string() for that.

returns the bool value if this a Bool variant

converts to f64 if the variants are numerical representation

converts to i32 if the variants are numerical representation

If this is Value::Vec variant, append the new value otherwise, turn this value into Value::Vec(Vec) variant and append the new value.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

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

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

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

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.