pub struct MemoryStore { /* private fields */ }Expand description
Implementations§
Source§impl MemoryStore
impl MemoryStore
Sourcepub fn new(algo: HashAlgo) -> Self
pub fn new(algo: HashAlgo) -> Self
Create an empty store using algo for WritableObjectStore::write.
Trait Implementations§
Source§impl Debug for MemoryStore
impl Debug for MemoryStore
Source§impl ObjectStore for MemoryStore
impl ObjectStore for MemoryStore
Source§fn read(&self, oid: &ObjectId) -> Result<Option<Object>>
fn read(&self, oid: &ObjectId) -> Result<Option<Object>>
Load the full object, if present. Read more
Source§fn read_info(&self, oid: &ObjectId) -> Result<Option<ObjectInfo>>
fn read_info(&self, oid: &ObjectId) -> Result<Option<ObjectInfo>>
Object kind and size without loading the full payload. Read more
Source§fn contains(&self, oid: &ObjectId) -> Result<bool>
fn contains(&self, oid: &ObjectId) -> Result<bool>
Whether
oid is stored in this backend (without reading the payload). Read moreSource§fn contains_many(&self, oids: &[ObjectId]) -> Result<Vec<bool>>
fn contains_many(&self, oids: &[ObjectId]) -> Result<Vec<bool>>
For each id in
oids, whether it is stored in this backend; the result has
one entry per input id, in input order. Read moreSource§fn open_stream(&self, oid: &ObjectId) -> Result<Option<ObjectStream<'_>>>
fn open_stream(&self, oid: &ObjectId) -> Result<Option<ObjectStream<'_>>>
Open a stream over the object’s uncompressed payload. Read more
Source§fn for_each_object(
&self,
f: &mut dyn FnMut(&ObjectId) -> ControlFlow<()>,
) -> Result<()>
fn for_each_object( &self, f: &mut dyn FnMut(&ObjectId) -> ControlFlow<()>, ) -> Result<()>
Source§fn lookup_prefix(
&self,
prefix: &str,
limit: usize,
out: &mut Vec<ObjectId>,
) -> Result<()>
fn lookup_prefix( &self, prefix: &str, limit: usize, out: &mut Vec<ObjectId>, ) -> Result<()>
Source§impl WritableObjectStore for MemoryStore
impl WritableObjectStore for MemoryStore
Source§fn write(
&self,
kind: ObjectKind,
data: &[u8],
_options: WriteOptions,
) -> Result<ObjectId>
fn write( &self, kind: ObjectKind, data: &[u8], _options: WriteOptions, ) -> Result<ObjectId>
Store canonical object bytes and return the object id. Read more
Source§fn write_stream(
&self,
kind: ObjectKind,
size: u64,
reader: &mut dyn Read,
options: WriteOptions,
) -> Result<ObjectId>
fn write_stream( &self, kind: ObjectKind, size: u64, reader: &mut dyn Read, options: WriteOptions, ) -> Result<ObjectId>
Store an object from a byte stream of known uncompressed size. Read more
Auto Trait Implementations§
impl !Freeze for MemoryStore
impl RefUnwindSafe for MemoryStore
impl Send for MemoryStore
impl Sync for MemoryStore
impl Unpin for MemoryStore
impl UnsafeUnpin for MemoryStore
impl UnwindSafe for MemoryStore
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