Skip to main content

Delta

Struct Delta 

Source
pub struct Delta {
    pub address: Address,
    pub kind: DeltaKind,
    pub fidelity: Fidelity,
    pub before: Option<String>,
    pub after: Option<String>,
    pub lines: Vec<Line>,
    pub package: Option<PackageId>,
    pub summary: Option<String>,
}
Expand description

One addressed difference inside a Diff, carried at its own rung.

before and after hold content ids, not content: the identity of the bytes on each side, absent when the side does not exist. lines carries the text-rung comparison and is empty at the binary rung. package names the format package whose projection or differ produced the delta — outputs carry the package version (ADR-0003) — and is None at rungs no package produced: the binary floor and plain-text raises. summary is a rich delta’s difference in the format’s own terms — the affected text and the property change — and None below the rich rung.

Fields§

§address: Address

Where the delta lands, in the format’s own terms.

§kind: DeltaKind

What kind of change the delta records.

§fidelity: Fidelity

The rung the delta is carried at.

§before: Option<String>

The content id of the before side; None when the side does not exist.

§after: Option<String>

The content id of the after side; None when the side does not exist.

§lines: Vec<Line>

The text-rung line comparison; empty at the binary rung.

§package: Option<PackageId>

The package whose projection or differ produced the delta; None at rungs no package produced.

§summary: Option<String>

A rich delta’s difference in the format’s own terms; None below the rich rung.

Implementations§

Source§

impl Delta

Source

pub fn at_text_rung(self, lines: Vec<Line>, package: Option<PackageId>) -> Self

This delta raised to the text rung, carrying its line comparison and the package that projected the compared text (None for plain text).

Source

pub fn rich( address: Address, summary: impl Into<String>, package: PackageId, ) -> Self

A rich-rung delta a format package produced: addressed in the format’s own terms, its difference described by summary.

Trait Implementations§

Source§

impl Clone for Delta

Source§

fn clone(&self) -> Delta

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Delta

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for Delta

Source§

impl PartialEq for Delta

Source§

fn eq(&self, other: &Delta) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Delta

Auto Trait Implementations§

§

impl Freeze for Delta

§

impl RefUnwindSafe for Delta

§

impl Send for Delta

§

impl Sync for Delta

§

impl Unpin for Delta

§

impl UnsafeUnpin for Delta

§

impl UnwindSafe for Delta

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.