MapCollection

Trait MapCollection 

Source
pub trait MapCollection:
    Debug
    + Clone
    + Default
    + Send
    + Sync
    + 'static {
    // Required methods
    fn len(&self) -> usize;
    fn iter_values(&self) -> impl Iterator<Item = Value>;
    fn select(v: Value) -> Option<Self>;
    fn project(self) -> Value;
    fn etyp(ft: &FnType) -> Result<Type>;
}

Required Methods§

Source

fn len(&self) -> usize

return the length of the collection

Source

fn iter_values(&self) -> impl Iterator<Item = Value>

iterate the collection elements as values

Source

fn select(v: Value) -> Option<Self>

given a value, return Some if the value is the collection type we are mapping.

Source

fn project(self) -> Value

given a collection wrap it in a value

Source

fn etyp(ft: &FnType) -> Result<Type>

return the element type given the function type

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 MapCollection for Map<Value, Value, 32>

Source§

fn iter_values(&self) -> impl Iterator<Item = Value>

Source§

fn len(&self) -> usize

Source§

fn select(v: Value) -> Option<Self>

Source§

fn project(self) -> Value

Source§

fn etyp(ft: &FnType) -> Result<Type>

Source§

impl MapCollection for ValArray

Source§

fn iter_values(&self) -> impl Iterator<Item = Value>

Source§

fn len(&self) -> usize

Source§

fn select(v: Value) -> Option<Self>

Source§

fn project(self) -> Value

Source§

fn etyp(ft: &FnType) -> Result<Type>

Implementors§