pub enum ContentState {
Unrecorded,
Unverifiable,
Intact,
Drifted,
}Expand description
What a document’s recorded content checksum says about its bytes right now.
The three answers are not a scale, they are three different situations, and
a caller deciding whether to stamp a timestamp has to tell them apart:
Drifted is evidence an edit happened,
Intact is evidence one did not, and the other two are the
absence of evidence rather than either verdict — which is why they are not
folded into one of the first two.
Variants§
Unrecorded
The document records no content_hash — fixity is off, the document is
a shape prov does not checksum (a combined document, whose hash could
only cover its own parsed body), or it predates fixity. Nothing has
drifted from nothing; a caller that wants to stamp anyway is making a
claim of its own, not restating one.
Unverifiable
A recorded digest spelled in an algorithm this build cannot compute (a newer prov wrote it). Left alone rather than compared or overwritten.
Intact
The recorded digest still describes the bytes.
Drifted
The bytes no longer hash to what the document records. Whether that is
an intended out-of-band edit or corruption is not this answer — see
Finding::FixityMismatch, which
surfaces the same fact as a question.
Trait Implementations§
Source§impl Clone for ContentState
impl Clone for ContentState
Source§fn clone(&self) -> ContentState
fn clone(&self) -> ContentState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ContentState
Source§impl Debug for ContentState
impl Debug for ContentState
impl Eq for ContentState
Source§impl PartialEq for ContentState
impl PartialEq for ContentState
impl StructuralPartialEq for ContentState
Auto Trait Implementations§
impl Freeze for ContentState
impl RefUnwindSafe for ContentState
impl Send for ContentState
impl Sync for ContentState
impl Unpin for ContentState
impl UnsafeUnpin for ContentState
impl UnwindSafe for ContentState
Blanket Implementations§
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§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.