PathAccess

Trait PathAccess 

Source
pub trait PathAccess {
    type Value;

    // Required methods
    fn get_path<'a>(&'a self, path: &str) -> Option<&'a Self::Value>;
    fn set_path(&mut self, path: &str, value: Self::Value) -> bool;

    // Provided method
    fn has_path(&self, path: &str) -> bool { ... }
}
Expand description

Trait for types that support path-based access

Required Associated Types§

Source

type Value

Associated value type accessed by path

Required Methods§

Source

fn get_path<'a>(&'a self, path: &str) -> Option<&'a Self::Value>

Get a reference to the value at path

Source

fn set_path(&mut self, path: &str, value: Self::Value) -> bool

Set the value at path, returning true if set

Provided Methods§

Source

fn has_path(&self, path: &str) -> bool

True if a value exists at path

Implementors§