Struct yang2::data::DataDiff

source ·
pub struct DataDiff { /* private fields */ }
Expand description

YANG data tree diff.

Implementations§

source§

impl DataDiff

source

pub fn parse_string( context: &Arc<Context>, data: &str, format: DataFormat, parser_options: DataParserFlags, validation_options: DataValidationFlags ) -> Result<DataDiff, Error>

Parse (and validate) input data as a YANG data diff.

source

pub fn iter(&self) -> impl Iterator<Item = (DataDiffOp, DataNodeRef<'_>)>

Returns an iterator over the data changes.

source

pub fn reverse(&self) -> Result<DataDiff, Error>

Reverse a diff and make the opposite changes. Meaning change create to delete, delete to create, or move from place A to B to move from B to A and so on.

Trait Implementations§

source§

impl Data for DataDiff

source§

fn find_xpath(&self, xpath: &str) -> Result<Set<'_, DataNodeRef<'_>>, Error>

Search in the given data for instances of nodes matching the provided XPath. Read more
source§

fn find_path(&self, path: &str) -> Result<DataNodeRef<'_>, Error>

Search in the given data for a single node matching the provided XPath. Read more
source§

fn print_file<F: AsRawFd>( &self, fd: F, format: DataFormat, options: DataPrinterFlags ) -> Result<(), Error>

Print data tree in the specified format.
source§

fn print_string( &self, format: DataFormat, options: DataPrinterFlags ) -> Result<Option<String>, Error>

Print data tree in the specified format.
source§

impl Debug for DataDiff

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.