pub struct Schema {
pub nodes: BTreeMap<String, SchemaNode>,
pub hash: &'static str,
pub timestamp: u64,
}Expand description
Schema
Fields§
§nodes: BTreeMap<String, SchemaNode>§hash: &'static str§timestamp: u64Implementations§
Source§impl Schema
impl Schema
pub fn new() -> Self
pub fn insert_node(&mut self, node: SchemaNode)
pub fn get_node<'a>(&'a self, path: &str) -> Option<&'a SchemaNode>
pub fn try_get_node<'a>(&'a self, path: &str) -> Result<&'a SchemaNode, Error>
pub fn cast_node<'a, T: 'static>(&'a self, path: &str) -> Result<&'a T, Error>
pub fn check_node_as<T: 'static>(&self, path: &str) -> Result<(), Error>
pub fn get_nodes<T: 'static>(&self) -> impl Iterator<Item = (&str, &T)>
pub fn get_node_values<T: 'static>(&self) -> impl Iterator<Item = &T> + '_
pub fn filter_nodes<'a, T: 'static>( &'a self, predicate: impl Fn(&T) -> bool + 'a, ) -> impl Iterator<Item = (&'a str, &'a T)> + 'a
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Schema
impl RefUnwindSafe for Schema
impl Send for Schema
impl Sync for Schema
impl Unpin for Schema
impl UnwindSafe for Schema
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more