Skip to main content

RuntimeValueDecode

Trait RuntimeValueDecode 

Source
pub trait RuntimeValueDecode {
    // Required method
    fn from_value(value: &Value) -> Option<Self>
       where Self: Sized;
}
Expand description

Runtime-only reconstruction of a typed value from the canonical Value union.

This contract must not be used as a persisted-row or primary-key codec.

Required Methods§

Source

fn from_value(value: &Value) -> Option<Self>
where Self: Sized,

Reconstruct a typed value when the runtime representation matches.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl RuntimeValueDecode for ()

Source§

fn from_value(value: &Value) -> Option<Self>

Source§

impl RuntimeValueDecode for Principal

Source§

fn from_value(value: &Value) -> Option<Self>

Source§

impl RuntimeValueDecode for String

Source§

fn from_value(value: &Value) -> Option<Self>

Source§

impl RuntimeValueDecode for bool

Source§

fn from_value(value: &Value) -> Option<Self>

Source§

impl RuntimeValueDecode for i8

Source§

fn from_value(value: &Value) -> Option<Self>

Source§

impl RuntimeValueDecode for i16

Source§

fn from_value(value: &Value) -> Option<Self>

Source§

impl RuntimeValueDecode for i32

Source§

fn from_value(value: &Value) -> Option<Self>

Source§

impl RuntimeValueDecode for i64

Source§

fn from_value(value: &Value) -> Option<Self>

Source§

impl RuntimeValueDecode for i128

Source§

fn from_value(value: &Value) -> Option<Self>

Source§

impl RuntimeValueDecode for u8

Source§

fn from_value(value: &Value) -> Option<Self>

Source§

impl RuntimeValueDecode for u16

Source§

fn from_value(value: &Value) -> Option<Self>

Source§

impl RuntimeValueDecode for u32

Source§

fn from_value(value: &Value) -> Option<Self>

Source§

impl RuntimeValueDecode for u64

Source§

fn from_value(value: &Value) -> Option<Self>

Source§

impl RuntimeValueDecode for u128

Source§

fn from_value(value: &Value) -> Option<Self>

Source§

impl<K, V> RuntimeValueDecode for BTreeMap<K, V>

Source§

fn from_value(value: &Value) -> Option<Self>

Source§

impl<T: RuntimeValueDecode> RuntimeValueDecode for Box<T>

Source§

fn from_value(value: &Value) -> Option<Self>

Source§

impl<T: RuntimeValueDecode> RuntimeValueDecode for Option<T>

Source§

fn from_value(value: &Value) -> Option<Self>

Source§

impl<T: RuntimeValueDecode> RuntimeValueDecode for Vec<T>

Source§

fn from_value(value: &Value) -> Option<Self>

Source§

impl<T> RuntimeValueDecode for BTreeSet<T>

Source§

fn from_value(value: &Value) -> Option<Self>

Implementors§