Trait treediff::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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Value for Value

§

type Key = Key

§

type Item = Value

source§

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

Implementors§