pub struct MemoryBlobStore { /* private fields */ }Expand description
Re-export of the in-memory blob store. In-memory blob storage keyed by content-hash handle.
Internally a PATCH mapping the 32-byte raw handle to a
Blob<UnknownBlob>. Writes go through &mut self (the
type system enforces single-writer); reader hands out
owned snapshots that are independent of the original
store. PATCH’s structural sharing makes those snapshots
O(1) clones — the writer keeps mutating the canonical
PATCH, readers each hold a pinned Arc-clone.
Implementations§
Source§impl MemoryBlobStore
impl MemoryBlobStore
Sourcepub fn new() -> MemoryBlobStore
pub fn new() -> MemoryBlobStore
Creates a new MemoryBlobStore with no blobs.
Sourcepub fn insert<S>(&mut self, blob: Blob<S>) -> Inline<Handle<S>>
pub fn insert<S>(&mut self, blob: Blob<S>) -> Inline<Handle<S>>
Inserts blob into the store and returns its handle.
O(1) over the handle computation — the handle was hashed once
at Blob::new and cached in the blob; this method reuses it.
Idempotent at the PATCH level: re-inserting the same handle is
a no-op, which matches the content-addressed semantics
(same handle ⇒ same bytes).
Sourcepub fn union(&mut self, other: Self)
pub fn union(&mut self, other: Self)
Structurally merge other into this store, consuming other.
Handle bytes match by content-addressing — duplicate keys
collapse via PATCH’s union semantics (idempotent). Faster
than per-blob BlobStorePut::put: PATCH’s union is a
structural merge — cost is bounded by the size of the
non-overlapping subtrees, not the total blob count.
Trait Implementations§
Source§impl BlobStore for MemoryBlobStore
impl BlobStore for MemoryBlobStore
Source§type ReaderError = Infallible
type ReaderError = Infallible
Source§impl BlobStoreKeep for MemoryBlobStore
impl BlobStoreKeep for MemoryBlobStore
Source§impl BlobStorePut for MemoryBlobStore
impl BlobStorePut for MemoryBlobStore
Source§impl Clone for MemoryBlobStore
impl Clone for MemoryBlobStore
Source§impl Debug for MemoryBlobStore
impl Debug for MemoryBlobStore
Source§impl Default for MemoryBlobStore
impl Default for MemoryBlobStore
impl Eq for MemoryBlobStore
Source§impl FromIterator<(Inline<Handle<UnknownBlob>>, Blob<UnknownBlob>)> for MemoryBlobStore
impl FromIterator<(Inline<Handle<UnknownBlob>>, Blob<UnknownBlob>)> for MemoryBlobStore
Source§fn from_iter<I: IntoIterator<Item = (Inline<Handle<UnknownBlob>>, Blob<UnknownBlob>)>>(
iter: I,
) -> Self
fn from_iter<I: IntoIterator<Item = (Inline<Handle<UnknownBlob>>, Blob<UnknownBlob>)>>( iter: I, ) -> Self
Source§impl PartialEq for MemoryBlobStore
impl PartialEq for MemoryBlobStore
Auto Trait Implementations§
impl !RefUnwindSafe for MemoryBlobStore
impl !UnwindSafe for MemoryBlobStore
impl Freeze for MemoryBlobStore
impl Send for MemoryBlobStore
impl Sync for MemoryBlobStore
impl Unpin for MemoryBlobStore
impl UnsafeUnpin for MemoryBlobStore
Blanket Implementations§
impl<T> ArchiveOwner for T
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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