[][src]Enum sauron_core::html::attributes::Value

pub enum Value {
    Bool(bool),
    Str(&'static str),
    String(String),
    Vec(Vec<Value>),
    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),
    Bytes(Vec<u8>),
}

TODO: merge this with AttributeValue Value is an abstraction of the values used in the actual backend. Html and gtk-rs have different set of compatible values therefore a need for a storage of these intermediate value is needed

Variants

Bool(bool)

bool value

Str(&'static str)

&'static str value

String(String)

String value

Vec(Vec<Value>)

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

Bytes(Vec<u8>)

bytes value

Implementations

impl Value[src]

pub fn as_str(&self) -> Option<&str>[src]

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.

pub fn as_bool(&self) -> Option<bool>[src]

returns the bool value if this a Bool variant

pub fn as_bytes(&self) -> Option<&[u8]>[src]

returns the reference to the bytes if this is a Bytes variant

pub fn as_f64(&self) -> Option<f64>[src]

converts to f64 if the variants are numerical representation

pub fn append(&mut self, new_value: Value)[src]

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

impl Clone for Value[src]

impl Debug for Value[src]

impl Display for Value[src]

impl From<&'_ [u8]> for Value[src]

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

impl From<&'_ Vec<u8, Global>> for Value[src]

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

impl<T> From<[T; 1]> for Value where
    T: Into<Value> + Clone
[src]

impl<T> From<[T; 10]> for Value where
    T: Into<Value> + Clone
[src]

impl<T> From<[T; 11]> for Value where
    T: Into<Value> + Clone
[src]

impl<T> From<[T; 12]> for Value where
    T: Into<Value> + Clone
[src]

impl<T> From<[T; 2]> for Value where
    T: Into<Value> + Clone
[src]

impl<T> From<[T; 3]> for Value where
    T: Into<Value> + Clone
[src]

impl<T> From<[T; 4]> for Value where
    T: Into<Value> + Clone
[src]

impl<T> From<[T; 5]> for Value where
    T: Into<Value> + Clone
[src]

impl<T> From<[T; 6]> for Value where
    T: Into<Value> + Clone
[src]

impl<T> From<[T; 7]> for Value where
    T: Into<Value> + Clone
[src]

impl<T> From<[T; 8]> for Value where
    T: Into<Value> + Clone
[src]

impl<T> From<[T; 9]> for Value where
    T: Into<Value> + Clone
[src]

impl<T, U, V, X, Z> From<(T, U, V, X, Z)> for Value where
    T: Into<Value>,
    U: Into<Value>,
    V: Into<Value>,
    X: Into<Value>,
    Z: Into<Value>, 
[src]

impl<T, U, V, X> From<(T, U, V, X)> for Value where
    T: Into<Value>,
    U: Into<Value>,
    V: Into<Value>,
    X: Into<Value>, 
[src]

impl<T, U, V> From<(T, U, V)> for Value where
    T: Into<Value>,
    U: Into<Value>,
    V: Into<Value>, 
[src]

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

impl From<String> for Value[src]

impl From<Vec<u8, Global>> for Value[src]

impl From<bool> for Value[src]

impl From<f32> for Value[src]

impl From<f64> for Value[src]

impl From<i128> for Value[src]

impl From<i16> for Value[src]

impl From<i32> for Value[src]

impl From<i64> for Value[src]

impl From<i8> for Value[src]

impl From<isize> for Value[src]

impl From<u128> for Value[src]

impl From<u16> for Value[src]

impl From<u32> for Value[src]

impl From<u64> for Value[src]

impl From<u8> for Value[src]

impl From<usize> for Value[src]

impl PartialEq<Value> for Value[src]

impl StructuralPartialEq for Value[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.

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.