pub enum BlobTarget {
Artifact {
id: String,
},
Tree {
root: ContentHash,
},
Store {
algo: String,
hash: ContentHash,
},
}Expand description
What a blob command addresses: RFC 07 §2’s three shapes, each validated.
There is deliberately no String constructor for the content-addressed
tiers — a tree or store address is a ContentHash or it does not
exist. RFC 07 §2.3 revoked the caller-chosen tree name (tree/nightly) in
v1.7, and the generated builders have refused to spell one ever since; this
type refuses for the same reason, at the point where an operator’s typing
enters the system.
Variants§
Artifact
Tier-1: a named artifact, whose endpoints live under it (RFC 07 §2.2).
Tree
Tier-2: a directory index, keyed by its own root (RFC 07 §2.3).
Fields
root: ContentHashStore
Tier-2: one content-addressed chunk (RFC 07 §2.4).
Implementations§
Source§impl BlobTarget
impl BlobTarget
Sourcepub fn parse(spec: &str) -> Result<BlobTarget>
pub fn parse(spec: &str) -> Result<BlobTarget>
Parse the one spelling both frontends accept:
<id> | artifact/<id> | tree/<hex> | store/<algo>/<hex>A bare id is Tier-1, because that is the tier an operator has an id for: Tier-2 addresses are hashes, and nobody types one from memory.
An id that is not a valid RFC 03 §2 plain chunk is refused with the citation rather than lowercased. A canonical ULID is uppercase Crockford base32 and a key chunk has no uppercase spelling (RFC 07 §2.2 as amended in v1.11) — but silently rewriting the caller’s id would mean probing for something they did not ask for and reporting holders of it, which is worse than refusing.
pub fn tier(&self) -> BlobTier
Sourcepub fn probe_prefix(&self) -> BlobProbePrefix
pub fn probe_prefix(&self) -> BlobProbePrefix
The *-origin probe prefix (RFC 07 §2.5) — the only wildcard form that
exists for this plane, and not a Key.
Sourcepub fn key_at(&self, origin: &Origin) -> Result<Key>
pub fn key_at(&self, origin: &Origin) -> Result<Key>
This target’s concrete key under one origin — the only fetchable form.
For Tier-1 that is the artifact’s base key, which the endpoint tails of RFC 07 §2.2 hang off; for Tier-2 the key is the object.
Trait Implementations§
Source§impl Clone for BlobTarget
impl Clone for BlobTarget
Source§fn clone(&self) -> BlobTarget
fn clone(&self) -> BlobTarget
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BlobTarget
impl Debug for BlobTarget
impl Eq for BlobTarget
Source§impl PartialEq for BlobTarget
impl PartialEq for BlobTarget
impl StructuralPartialEq for BlobTarget
Auto Trait Implementations§
impl Freeze for BlobTarget
impl RefUnwindSafe for BlobTarget
impl Send for BlobTarget
impl Sync for BlobTarget
impl Unpin for BlobTarget
impl UnsafeUnpin for BlobTarget
impl UnwindSafe for BlobTarget
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§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