[−][src]Trait json_utils::query::Query
Associated Types
Loading content...Required methods
fn lookup<'p, P>(&'v self, path: P) -> Option<Self::ItemRef> where
P: Path<'p>,
P: Path<'p>,
Lookup for an element under the specified path. Returns an optional reference to the sought element.
fn take<'p, P>(self, path: P) -> (Option<Self>, Option<Self::Item>) where
P: Path<'p>,
P: Path<'p>,
Takes the element under the specified path out of the queried node. Returns a tuple of two items:
- optinal remainder of the queried node;
- optinal taken away element.
fn insert<'p, P>(
&mut self,
path: P,
insertee: Self::Item
) -> Result<(), Self::Item> where
P: Path<'p>,
&mut self,
path: P,
insertee: Self::Item
) -> Result<(), Self::Item> where
P: Path<'p>,
Inserts an element into the queried node under the specified path. Returns Ok(()) if inserted or Err(rejected_element) if could not perform insertion (e.g. path leads to a child of a non-object sub-node).
Implementors
impl<'v> Query<'v> for JsValue
[src]
type Item = Self
type ItemRef = &'v Self::Item
fn lookup<'p, P>(&'v self, path: P) -> Option<Self::ItemRef> where
P: Path<'p>,
[src]
P: Path<'p>,
fn take<'p, P>(self, path: P) -> (Option<Self>, Option<Self::Item>) where
P: Path<'p>,
[src]
P: Path<'p>,
fn insert<'p, P>(
&mut self,
path: P,
insertee: Self::Item
) -> Result<(), Self::Item> where
P: Path<'p>,
[src]
&mut self,
path: P,
insertee: Self::Item
) -> Result<(), Self::Item> where
P: Path<'p>,
impl<'v> Query<'v> for SchemaNode
[src]
type Item = QueryNode<SchemaNode>
type ItemRef = QueryNode<&'v SchemaNode>
fn lookup<'p, P>(&'v self, path: P) -> Option<Self::ItemRef> where
P: Path<'p>,
[src]
P: Path<'p>,
fn take<'p, P>(self, path: P) -> (Option<Self>, Option<Self::Item>) where
P: Path<'p>,
[src]
P: Path<'p>,
fn insert<'p, P>(
&mut self,
path: P,
insertee: Self::Item
) -> Result<(), Self::Item> where
P: Path<'p>,
[src]
&mut self,
path: P,
insertee: Self::Item
) -> Result<(), Self::Item> where
P: Path<'p>,