pub enum BlobReplacement {
Replaceable,
WriteOnce,
}Expand description
A blob’s replacement story: whether the row carrying it may ever be repointed at
a different blob. Orthogonal to Provenance and CacheFill; a blob declares all
three.
It exists because a cloud object must never be rewritten with different bytes. The pull verifies an object against its row’s content hash and a position advances only over a fully-realized changeset, so a key whose content can change leaves a device that pulls an older changeset unable to satisfy it — wedged there for good, not merely missing a blob. Two declarations reach that guarantee by different routes, and coven enforces whichever one the blob declares:
Replaceable— the row may be repointed, so the key must move with the blob: a readablecloud_pathhas to name its blob ([crate::blob::decl::cloud_path_names_blob]), and a replacement then writes a new object beside the one it replaces instead of over it.WriteOnce— the row is never repointed, so the object at its key is written once and there is nothing to protect it from. Its path is free to be a stable, fully readable name. coven refuses the repointing.
Replaceable is the default: its guarantee is the airtight one (the key itself
carries the blob id, so no path can ever be reused), while WriteOnce is a weaker
contract a consumer opts into knowingly — see its docs.
Variants§
Replaceable
The row may be repointed at a new blob id — replacing a cover, swapping an
attachment. Requires a readable cloud_path that names its blob, so that the
replacement’s fresh blob id yields a fresh key.
WriteOnce
The row is never repointed: the blob it names when it is inserted is the blob it names for life. Repointing one is refused.
This buys a stable, fully readable cloud path — Live at Leeds/01 Sonata.flac
rather than 01 Sonata-0ef7a1c9.flac — for content that is written once and never
rewritten: an imported file, whose bytes are what they are.
What coven enforces, and what it does not. coven refuses to repoint the row,
which is the reuse it can see. It cannot see a consumer deleting a row and
inserting a different blob at the same cloud_path — the deleted row is gone, and
coven keeps no history of the paths it has used. Declaring WriteOnce is therefore
also a promise that the path is never reused by a different blob. Derive it from
data that never repeats and it holds by construction: a path carrying a freshly
minted id for the thing being imported can never be handed out twice.
Trait Implementations§
Source§impl Clone for BlobReplacement
impl Clone for BlobReplacement
Source§fn clone(&self) -> BlobReplacement
fn clone(&self) -> BlobReplacement
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BlobReplacement
impl Debug for BlobReplacement
Source§impl PartialEq for BlobReplacement
impl PartialEq for BlobReplacement
impl Copy for BlobReplacement
impl Eq for BlobReplacement
impl StructuralPartialEq for BlobReplacement
Auto Trait Implementations§
impl Freeze for BlobReplacement
impl RefUnwindSafe for BlobReplacement
impl Send for BlobReplacement
impl Sync for BlobReplacement
impl Unpin for BlobReplacement
impl UnsafeUnpin for BlobReplacement
impl UnwindSafe for BlobReplacement
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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