ValueLike

Trait ValueLike 

Source
pub trait ValueLike: Sized {
    // Required methods
    fn into_value(self) -> Value;
    fn try_from_value(value: Value) -> Result<Self, Value>;
}
Expand description

Represents some data that can be converted to and from a Value

Required Methods§

Source

fn into_value(self) -> Value

Consumes this data, converting it into an abstract Value

Source

fn try_from_value(value: Value) -> Result<Self, Value>

Attempts to convert an abstract Value into this data, returning the owned value back if unable to convert

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ValueLike for String

Source§

impl ValueLike for OsString

Source§

impl ValueLike for PathBuf

Source§

impl<T: ValueLike + Ord> ValueLike for BinaryHeap<T>

Source§

impl<T: ValueLike + Ord> ValueLike for BTreeSet<T>

Source§

impl<T: ValueLike + Hash + Eq> ValueLike for HashSet<T>

Source§

impl<T: ValueLike> ValueLike for Option<T>

Source§

impl<T: ValueLike> ValueLike for BTreeMap<String, T>

Source§

impl<T: ValueLike> ValueLike for LinkedList<T>

Source§

impl<T: ValueLike> ValueLike for VecDeque<T>

Source§

impl<T: ValueLike> ValueLike for Vec<T>

Source§

impl<T: ValueLike> ValueLike for HashMap<String, T>

Implementors§