Value

Trait Value 

Source
pub trait Value: PartialEq<Self> {
    type Key;
    type Item;

    // Required method
    fn items<'a>(
        &'a self,
    ) -> Option<Box<dyn Iterator<Item = (Self::Key, &'a Self::Item)> + 'a>>;
}
Expand description

Represents a scalar value or an associative array.

Required Associated Types§

Source

type Key

The Key type used to find Values in a mapping.

Source

type Item

The Value type itself.

Required Methods§

Source

fn items<'a>( &'a self, ) -> Option<Box<dyn Iterator<Item = (Self::Key, &'a Self::Item)> + 'a>>

Returns None if this is a scalar value, and an iterator yielding (Key, Value) pairs otherwise. It is entirely possible for it to yield no values though.

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.

Implementors§