Skip to main content

Navigate

Trait Navigate 

Source
pub trait Navigate: Sized {
    // Required methods
    fn child(&self, key: &str) -> Option<&Self>;
    fn items(&self) -> Option<&[Self]>;
    fn text(&self) -> Option<&str>;
}
Expand description

A metadata tree a FieldPath can be walked over. Both value trees prov reads — its own Value and fig’s — are one.

Required Methods§

Source

fn child(&self, key: &str) -> Option<&Self>

The value under key, if this is a mapping holding it.

Source

fn items(&self) -> Option<&[Self]>

The items, if this is a list.

Source

fn text(&self) -> Option<&str>

The text, if this is a string.

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 Navigate for Value

Source§

fn child(&self, key: &str) -> Option<&Self>

Source§

fn items(&self) -> Option<&[Self]>

Source§

fn text(&self) -> Option<&str>

Implementors§

Source§

impl Navigate for prov_graph::meta::Value