Skip to main content

Fixity

Enum Fixity 

Source
pub enum Fixity {
    Off,
    On,
}
Expand description

Whether a workspace records content checksums.

Not a coverage scale, though it was one — off | attachments | all, where all additionally checksummed a combined document’s body. What a checksum covers is now read off the document’s shape instead, and the shape answers better than a setting could, so all that is left to configure is whether checksums are written at all. covers is the rule and why.

Variants§

§

Off

No content checksums are recorded.

§

On

Every node whose content is a file of its own records one.

Implementations§

Source§

impl Fixity

Source

pub fn covers(self, doc: &Document) -> bool

Whether a content_hash is written for doc: fixity is on, and the hash would cover a file other than the one recording it — an attachment’s payload, or a separated document’s prose body.

That second half is the whole rule, and it is a claim about what a checksum is worth, not about how much work to do. A hash covering a sibling file is one artifact vouching for another, whole-file: sha256sum body.md reproduces it by hand, which is the tool-agnostic verifiability this module’s choice of SHA-256 exists to buy. A hash of a combined document’s own body buys none of it. It covers Document::body, a parsed substring — and not reliably a contiguous one, since a metadata block need not sit at a file’s edge and the body is then the prose from both sides of it, concatenated. There is no file to hand sha256sum, and no rule to state to an outside verifier short of reimplementing prov’s parser. A guarantee that silently changed strength with the carrier is what retired the tier.

A manifest node is not covered here, and is not thereby exempt: its checksum pins the manifest document it declares, so it is recorded and refreshed by the manifest verbs — the only ones that know what rebuilding it costs. See manifest.

Source

pub fn is_on(self) -> bool

Whether checksums are recorded at all — the axis on its own, for a caller with no parsed document to ask about: a sidecar being minted, whose shape is not in question because the verb is what is giving it one.

Source

pub fn from_config_str(value: &str) -> Option<Self>

Parse the configuration spelling; unknown values return None.

attachments is still read. It was this axis’s default spelling while coverage was tiered, so it is written into every prov.yaml predating this, and it names a subset of what on now covers — nothing an author asked for is lost by taking it at its word. all is deliberately not read, though it was the other live spelling: what it asked for was body checksums, which is precisely the thing that went away, and a workspace that asked for them is owed the news rather than something quietly narrower. It lands as an invalid value on a recognized axis — the default is kept and check reports it, listing the spellings that remain.

Source

pub fn as_config_str(self) -> &'static str

Return the configuration spelling.

Trait Implementations§

Source§

impl Clone for Fixity

Source§

fn clone(&self) -> Fixity

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 Copy for Fixity

Source§

impl Debug for Fixity

Source§

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

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

impl Default for Fixity

Source§

fn default() -> Fixity

Returns the “default value” for a type. Read more
Source§

impl Eq for Fixity

Source§

impl PartialEq for Fixity

Source§

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

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Same for T

Source§

type Output = T

Should always be Self
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.