pub trait FromValue {
    fn from_value(v: Value) -> Res<Self>
    where
        Self: Sized
; fn get(v: Value) -> Option<Self>
    where
        Self: Sized
, { ... } }

Required Methods§

source

fn from_value(v: Value) -> Res<Self>where
    Self: Sized,

attempt to cast v to the type of self using any reasonable means

Provided Methods§

source

fn get(v: Value) -> Option<Self>where
    Self: Sized,

extract the type of self from v if the type of v is equivelent to the type of self, otherwise return None.

Implementations on Foreign Types§

source§

impl FromValue for u8

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl FromValue for i8

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl FromValue for u16

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl FromValue for i16

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl FromValue for u32

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl FromValue for i32

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl FromValue for u64

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl FromValue for usize

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl FromValue for i64

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl FromValue for f32

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl FromValue for f64

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl FromValue for Decimal

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl FromValue for Bytes

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl FromValue for Chars

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl FromValue for Path

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl FromValue for String

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl FromValue for DateTime<Utc>

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl FromValue for Duration

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl FromValue for bool

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl FromValue for Arc<[Value]>

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl<T: FromValue> FromValue for Vec<T>

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl<T: FromValue, U: FromValue> FromValue for (T, U)

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl<T: FromValue, U: FromValue, V: FromValue> FromValue for (T, U, V)

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl<K: FromValue + Eq + Hash, V: FromValue, S: BuildHasher + Default> FromValue for HashMap<K, V, S>

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl<K: FromValue + Ord, V: FromValue> FromValue for BTreeMap<K, V>

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl<K: FromValue + Eq + Hash, S: BuildHasher + Default> FromValue for HashSet<K, S>

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl<K: FromValue + Ord> FromValue for BTreeSet<K>

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl<K: FromValue + Eq + Hash, V: FromValue, S: BuildHasher + Default> FromValue for IndexMap<K, V, S>

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl<K: FromValue + Eq + Hash, S: BuildHasher + Default> FromValue for IndexSet<K, S>

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

source§

impl<T: FromValue> FromValue for Option<T>

source§

fn from_value(v: Value) -> Res<Self>

source§

fn get(v: Value) -> Option<Self>

Implementors§