Skip to main content

EntityFields

Trait EntityFields 

Source
pub trait EntityFields {
    // Required methods
    fn field(&self, name: &str) -> Option<&Value>;
    fn whole(&self) -> Cow<'_, Value>;
}
Expand description

Field access shared by plain values and SharedEntity copies.

Required Methods§

Source

fn field(&self, name: &str) -> Option<&Value>

The top-level field name, if the entity is an object that has it.

Source

fn whole(&self) -> Cow<'_, Value>

The whole entity. Borrowed whenever it can be.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl EntityFields for Value

Source§

fn field(&self, name: &str) -> Option<&Value>

Source§

fn whole(&self) -> Cow<'_, Value>

Implementors§