Skip to main content

Context

Trait Context 

Source
pub trait Context: Sized {
    // Provided methods
    fn merge<T: Into<InnerData>>(&self, doc: T) -> Result<()> { ... }
    fn merge_path<T>(&self, path: &[&InnerData], doc: T) -> Result<()>
       where InnerData: From<T> { ... }
    fn set<T: Into<ContextMapValue>>(&self, doc: T) -> Result<()> { ... }
    fn create_scope(&self) -> ScopedContext<'_> { ... }
    fn set_path<T: Into<ContextMapValue>>(
        &self,
        path: &[&InnerData],
        doc: T,
    ) -> Result<()> { ... }
    fn get(&self) -> Data { ... }
    fn get_path(&self, path: &[&InnerData]) -> Data { ... }
}
Expand description

The primary context trait

Provided Methods§

Source

fn merge<T: Into<InnerData>>(&self, doc: T) -> Result<()>

Merge the data into the root context

Source

fn merge_path<T>(&self, path: &[&InnerData], doc: T) -> Result<()>
where InnerData: From<T>,

Merge the data into the context at the specified path

Source

fn set<T: Into<ContextMapValue>>(&self, doc: T) -> Result<()>

Set the root context value

Source

fn create_scope(&self) -> ScopedContext<'_>

Enter a new scope

Source

fn set_path<T: Into<ContextMapValue>>( &self, path: &[&InnerData], doc: T, ) -> Result<()>

Set the value at the specified path

Source

fn get(&self) -> Data

Get the root context value

Source

fn get_path(&self, path: &[&InnerData]) -> Data

Get the value at the path

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§