Skip to main content

Record

Trait Record 

Source
pub trait Record: Sized {
    // Required methods
    fn field(&self, path: &[String]) -> Option<Value>;
    fn collection(&self, path: &[String]) -> Option<Vec<&Self>>;
}
Expand description

A row expressions can read: a JSON object, a grid row, an entity.

Required Methods§

Source

fn field(&self, path: &[String]) -> Option<Value>

The value at a field path; None when there is no such field.

Source

fn collection(&self, path: &[String]) -> Option<Vec<&Self>>

The rows of a nested collection; None when there is no such collection.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Record for HashMap<String, Value>

Source§

fn field(&self, path: &[String]) -> Option<Value>

Source§

fn collection(&self, _path: &[String]) -> Option<Vec<&Self>>

Source§

impl Record for Value

Available on crate feature json only.
Source§

fn field(&self, path: &[String]) -> Option<Value>

Source§

fn collection(&self, path: &[String]) -> Option<Vec<&Self>>

Implementors§