[−][src]Trait yang2::data::Data
Methods common to data trees, data node references and data diffs.
Provided methods
pub fn find(&self, xpath: &str) -> Result<Set<'_, DataNodeRef<'_>>, Error>
[src]
Search in the given data for instances of nodes matching the provided XPath.
The expected format of the expression is JSON, meaning the first node in
every path must have its module name as prefix or be the special *
value for all the nodes.
If a list instance is being selected with all its key values specified
(but not necessarily ordered) in the form
list[key1='val1'][key2='val2'][key3='val3']
or a leaf-list instance in
the form leaf-list[.='val']
, these instances are found using hashes
with constant (O(1)) complexity (unless they are defined in
top-level). Other predicates can still follow the aforementioned ones.
pub fn find_single(&self, xpath: &str) -> Result<DataNodeRef<'_>, Error>
[src]
Search in the given data for a single node matching the provided XPath.
The expected format of the expression is JSON, meaning the first node in
every path must have its module name as prefix or be the special *
value for all the nodes.
pub fn print_file<F: AsRawFd>(
&self,
fd: F,
format: DataFormat,
options: DataPrinterFlags
) -> Result<(), Error>
[src]
&self,
fd: F,
format: DataFormat,
options: DataPrinterFlags
) -> Result<(), Error>
Print data tree in the specified format.
pub fn print_string(
&self,
format: DataFormat,
options: DataPrinterFlags
) -> Result<String, Error>
[src]
&self,
format: DataFormat,
options: DataPrinterFlags
) -> Result<String, Error>
Print data tree in the specified format.