pub struct MemoryBlobStore<H: HashProtocol> { /* private fields */ }Implementations§
Source§impl<H: HashProtocol> MemoryBlobStore<H>
impl<H: HashProtocol> MemoryBlobStore<H>
Sourcepub fn new() -> MemoryBlobStore<H>
pub fn new() -> MemoryBlobStore<H>
Creates a new MemoryBlobStore with no blobs.
The store keeps all data in memory and is primarily intended for tests or other transient repositories such as workspaces.
Sourcepub fn insert<S>(&mut self, blob: Blob<S>) -> Value<Handle<H, S>>where
S: BlobSchema,
pub fn insert<S>(&mut self, blob: Blob<S>) -> Value<Handle<H, S>>where
S: BlobSchema,
Inserts blob into the store and returns the newly computed handle.
The handle is derived from hashing the blob’s bytes using the hash protocol associated with this store.
Trait Implementations§
Source§impl<H: HashProtocol> BlobStore<H> for MemoryBlobStore<H>
impl<H: HashProtocol> BlobStore<H> for MemoryBlobStore<H>
Source§type ReaderError = Infallible
type ReaderError = Infallible
Error type for creating a reader.
Source§impl<H: HashProtocol> BlobStoreKeep<H> for MemoryBlobStore<H>
impl<H: HashProtocol> BlobStoreKeep<H> for MemoryBlobStore<H>
Source§impl<H> BlobStorePut<H> for MemoryBlobStore<H>where
H: HashProtocol,
impl<H> BlobStorePut<H> for MemoryBlobStore<H>where
H: HashProtocol,
Source§impl<H> Debug for MemoryBlobStore<H>where
H: HashProtocol,
impl<H> Debug for MemoryBlobStore<H>where
H: HashProtocol,
Source§impl<H: HashProtocol> Default for MemoryBlobStore<H>
impl<H: HashProtocol> Default for MemoryBlobStore<H>
Source§impl<H> FromIterator<(Value<Handle<H, UnknownBlob>>, Blob<UnknownBlob>)> for MemoryBlobStore<H>where
H: HashProtocol,
impl<H> FromIterator<(Value<Handle<H, UnknownBlob>>, Blob<UnknownBlob>)> for MemoryBlobStore<H>where
H: HashProtocol,
Source§fn from_iter<I: IntoIterator<Item = (Value<Handle<H, UnknownBlob>>, Blob<UnknownBlob>)>>(
iter: I,
) -> Self
fn from_iter<I: IntoIterator<Item = (Value<Handle<H, UnknownBlob>>, Blob<UnknownBlob>)>>( iter: I, ) -> Self
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl<H> !Freeze for MemoryBlobStore<H>
impl<H> !RefUnwindSafe for MemoryBlobStore<H>
impl<H> Send for MemoryBlobStore<H>
impl<H> !Sync for MemoryBlobStore<H>
impl<H> Unpin for MemoryBlobStore<H>
impl<H> UnsafeUnpin for MemoryBlobStore<H>
impl<H> !UnwindSafe for MemoryBlobStore<H>
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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