pub struct BlobRef {
pub namespace: String,
pub id: String,
pub scope: BlobScope,
pub cloud_path: Option<String>,
pub provenance: Provenance,
pub fill: CacheFill,
}Expand description
A blob a row references: its cloud identity, encryption scope, and the two
declared properties (provenance +
fill). coven derives it from the row’s declared columns
(crate::sync::session::BlobDecl) via [decl::BlobDecls]. Where its bytes
live depends on its locality and provenance: a user-provided Local blob is the
user’s file at its path; a host-provided Local blob is in coven’s local store
(storage/local/<namespace>/<id>); a Remote blob’s device-local copy is a cache
copy (storage/pinned/<namespace>/<id> / storage/cache/<namespace>/<id>, built
from the validated namespace + id — see [cache]).
Fields§
§namespace: StringCloud namespace, e.g. "images". Becomes {namespace}/{ab}/{cd}/{id}
under the hashed scheme, or {namespace}/{cloud_path} under the plain one.
id: StringBlob id (typically the id of the blob-bearing row).
scope: BlobScopeEncryption scope for this blob.
cloud_path: Option<String>The consumer’s readable cloud-relative path for this blob, e.g.
"Artist - Album/cover.jpg". Used as the object key under namespace when
the home’s [crate::sync::cloud_storage::BlobPathScheme] is Plain;
ignored when Hashed. None is only valid for a Hashed home — a Plain
home with no cloud_path is a surfaced error, never a silent fallback.
provenance: ProvenanceThe blob’s Local story: where its bytes live while Local, and whether
make_local needs a destination path. See Provenance.
fill: CacheFillThe blob’s Remote story: whether a pulling device fetches it into the
cache right away (CacheFill::CacheEager) or on first read
(CacheFill::CacheLazy). See CacheFill.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BlobRef
impl<'de> Deserialize<'de> for BlobRef
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<BlobRef, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<BlobRef, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for BlobRef
impl Serialize for BlobRef
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for BlobRef
impl StructuralPartialEq for BlobRef
Auto Trait Implementations§
impl Freeze for BlobRef
impl RefUnwindSafe for BlobRef
impl Send for BlobRef
impl Sync for BlobRef
impl Unpin for BlobRef
impl UnsafeUnpin for BlobRef
impl UnwindSafe for BlobRef
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