Skip to main content

ViewDivergence

Struct ViewDivergence 

Source
pub struct ViewDivergence { /* private fields */ }
Expand description

The read-only comparison of live state to a saved plan (data-model §5).

differences is ordered by the field walk in [fields], so two runs over the same inputs report the same list in the same order. in_sync is a convenience summary: it is true exactly when there are no differences and no diagnostics.

Implementations§

Source§

impl ViewDivergence

Source

pub fn between(saved: &ViewPlan, live: &ViewPlan) -> Self

Compare two plans directly, with no marker identity.

Source

pub fn for_marker( marker: &ActiveViewMarker, saved: &ViewPlan, live: &ViewPlan, ) -> Self

Compare live state to a saved plan, keeping the marker’s identity.

Source

pub fn missing_marker(live: &ViewPlan) -> Self

No active view is selected: an explicit diagnostic, never a silent match.

Source

pub fn deleted(view_id: &ViewId, live: &ViewPlan) -> Self

The marker’s view is no longer in the registry (it was deleted).

Source

pub fn unreadable( view_id: &ViewId, live: &ViewPlan, diagnostics: Vec<ViewDiagnostic>, ) -> Self

The saved definition’s plan could not be interpreted, so no comparison was possible. The refusal’s own diagnostics are carried through verbatim.

Source

pub fn view_id(&self) -> Option<&ViewId>

The saved view the comparison is about, when a marker identified one.

Source

pub fn saved_plan(&self) -> Option<&ViewPlan>

The saved definition’s normalized plan, when it could be read.

Source

pub fn live_plan(&self) -> &ViewPlan

The live normalized plan that was compared.

Source

pub fn differences(&self) -> &[ViewDifference]

The divergent fields, in a fixed field order.

Source

pub fn diagnostics(&self) -> &[ViewDiagnostic]

Problems that prevented or qualified the comparison.

Source

pub fn in_sync(&self) -> bool

Whether the live plan matches the saved plan, with no diagnostics.

False for a missing marker or a deleted view: “nothing to compare” is not “in sync”.

Trait Implementations§

Source§

impl Clone for ViewDivergence

Source§

fn clone(&self) -> Self

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 ViewDivergence

Source§

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

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

impl PartialEq for ViewDivergence

Source§

fn eq(&self, other: &Self) -> 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 ViewDivergence

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.