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
impl Fixity
Sourcepub fn covers(self, doc: &Document) -> bool
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.
Sourcepub fn is_on(self) -> bool
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.
Sourcepub fn from_config_str(value: &str) -> Option<Self>
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.
Sourcepub fn as_config_str(self) -> &'static str
pub fn as_config_str(self) -> &'static str
Return the configuration spelling.
Trait Implementations§
impl Copy for Fixity
impl Eq for Fixity
impl StructuralPartialEq for Fixity
Auto Trait Implementations§
impl Freeze for Fixity
impl RefUnwindSafe for Fixity
impl Send for Fixity
impl Sync for Fixity
impl Unpin for Fixity
impl UnsafeUnpin for Fixity
impl UnwindSafe for Fixity
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.