Value

Trait Value 

Source
pub trait Value<'map, 'elem: 'map>: Sized {
    // Required methods
    fn get_from_map(map: &'map Map<'elem>, key: &str) -> Result<Self>;
    fn get_iter_from_map(
        map: &'map Map<'elem>,
        key: &str,
    ) -> Result<ValueIter<'map, 'elem, Self>>;
    fn store_in_map(
        map: &'map mut Map<'elem>,
        key: &str,
        x: &Self,
    ) -> Result<()>;
    fn append_to_map(
        map: &'map mut Map<'elem>,
        key: &str,
        x: &Self,
    ) -> Result<()>;
}
Expand description

A trait for values which can be stored in a map.

Required Methods§

Source

fn get_from_map(map: &'map Map<'elem>, key: &str) -> Result<Self>

Retrieves the value from the map.

Source

fn get_iter_from_map( map: &'map Map<'elem>, key: &str, ) -> Result<ValueIter<'map, 'elem, Self>>

Retrieves an iterator over the values from the map.

Source

fn store_in_map(map: &'map mut Map<'elem>, key: &str, x: &Self) -> Result<()>

Sets the property value in the map.

Source

fn append_to_map(map: &'map mut Map<'elem>, key: &str, x: &Self) -> Result<()>

Appends the value to the map.

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<'map, 'elem: 'map> Value<'map, 'elem> for &'map [u8]

Source§

fn get_from_map(map: &'map Map<'_>, key: &str) -> Result<Self>

Source§

fn get_iter_from_map( map: &'map Map<'elem>, key: &str, ) -> Result<ValueIter<'map, 'elem, Self>>

Source§

fn store_in_map(map: &'map mut Map<'_>, key: &str, x: &Self) -> Result<()>

Source§

fn append_to_map(map: &'map mut Map<'_>, key: &str, x: &Self) -> Result<()>

Source§

impl<'map, 'elem: 'map> Value<'map, 'elem> for f64

Source§

fn get_from_map(map: &Map<'_>, key: &str) -> Result<Self>

Source§

fn get_iter_from_map( map: &'map Map<'elem>, key: &str, ) -> Result<ValueIter<'map, 'elem, Self>>

Source§

fn store_in_map(map: &mut Map<'_>, key: &str, x: &Self) -> Result<()>

Source§

fn append_to_map(map: &mut Map<'_>, key: &str, x: &Self) -> Result<()>

Source§

impl<'map, 'elem: 'map> Value<'map, 'elem> for i64

Source§

fn get_from_map(map: &Map<'_>, key: &str) -> Result<Self>

Source§

fn get_iter_from_map( map: &'map Map<'elem>, key: &str, ) -> Result<ValueIter<'map, 'elem, Self>>

Source§

fn store_in_map(map: &mut Map<'_>, key: &str, x: &Self) -> Result<()>

Source§

fn append_to_map(map: &mut Map<'_>, key: &str, x: &Self) -> Result<()>

Implementors§

Source§

impl<'map, 'elem: 'map> Value<'map, 'elem> for FrameRef<'elem>

Source§

impl<'map, 'elem: 'map> Value<'map, 'elem> for Function<'elem>

Source§

impl<'map, 'elem: 'map> Value<'map, 'elem> for Node<'elem>