pub struct Change<T> {
pub before: T,
pub after: T,
}Expand description
A value that differs between the two scans.
Every field-level difference takes this shape. A field that is always present
carries the values directly, as Change<PortState>; a field that may be absent
carries Options, as Change<Option<String>>, where before: None reads as
gained and after: None as lost.
The changes a comparison builds never hold two equal values:
between returns None when nothing moved.
use zond_engine::diff::Change;
assert_eq!(Change::between(80, 80), None);
let moved = Change::between(Some("1.18.0"), Some("1.24.0")).unwrap();
assert!(moved.is_replacement());
assert_eq!(moved.before, Some("1.18.0"));Fields§
§before: TWhat the baseline scan found.
after: TWhat the current scan found.
Implementations§
Source§impl<T> Change<T>
impl<T> Change<T>
Sourcepub fn between(before: T, after: T) -> Option<Self>where
T: PartialEq,
pub fn between(before: T, after: T) -> Option<Self>where
T: PartialEq,
The change from before to after, or None if they are equal.
Sourcepub fn new(before: T, after: T) -> Self
pub fn new(before: T, after: T) -> Self
A change between two values a caller has already established differ.
For fields whose equality is not the derived one. An operating system identified at 80% and then at 92% confidence is the same finding, so the host comparison decides equality itself and builds the change here.
Trait Implementations§
impl<T: Eq> Eq for Change<T>
impl<T: PartialEq> StructuralPartialEq for Change<T>
Auto Trait Implementations§
impl<T> Freeze for Change<T>where
T: Freeze,
impl<T> RefUnwindSafe for Change<T>where
T: RefUnwindSafe,
impl<T> Send for Change<T>where
T: Send,
impl<T> Sync for Change<T>where
T: Sync,
impl<T> Unpin for Change<T>where
T: Unpin,
impl<T> UnsafeUnpin for Change<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Change<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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