pub struct Schema { /* private fields */ }Expand description
Schema
Implementations§
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
Sourcepub const fn nodes(&self) -> &BTreeMap<String, SchemaNode>
pub const fn nodes(&self) -> &BTreeMap<String, SchemaNode>
Borrow all schema nodes indexed by path.
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 UnsafeUnpin 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