Struct DataDiff

Source
pub struct DataDiff<'a> { /* private fields */ }
Expand description

YANG data tree diff.

Implementations§

Source§

impl<'a> DataDiff<'a>

Source

pub fn parse_string( context: &'a Context, data: impl AsRef<[u8]>, format: DataFormat, parser_options: DataParserFlags, validation_options: DataValidationFlags, ) -> Result<DataDiff<'a>, 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<'a>, 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<'a> Data<'a> for DataDiff<'a>

Source§

fn find_xpath(&self, xpath: &str) -> Result<Set<'_, DataNodeRef<'_, 'a>>, 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<'_, 'a>, 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 to a String. Read more
Source§

fn print_bytes( &self, format: DataFormat, options: DataPrinterFlags, ) -> Result<Option<Vec<u8>>, Error>

Print data tree in the specified format to a bytes vector.
Source§

impl<'a> Debug for DataDiff<'a>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for DataDiff<'a>

§

impl<'a> RefUnwindSafe for DataDiff<'a>

§

impl<'a> Send for DataDiff<'a>

§

impl<'a> Sync for DataDiff<'a>

§

impl<'a> Unpin for DataDiff<'a>

§

impl<'a> UnwindSafe for DataDiff<'a>

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>,

Source§

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>,

Source§

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.