pub struct MemoryStore { /* private fields */ }Expand description
Files in memory. Clones share the same files, so a writer and a reader can hold one store.
Implementations§
Source§impl MemoryStore
impl MemoryStore
Sourcepub fn total_bytes(&self) -> usize
pub fn total_bytes(&self) -> usize
Bytes stored, over every file.
Sourcepub fn bytes_under(&self, prefix: &str) -> usize
pub fn bytes_under(&self, prefix: &str) -> usize
Bytes stored under prefix.
Trait Implementations§
Source§impl Clone for MemoryStore
impl Clone for MemoryStore
Source§fn clone(&self) -> MemoryStore
fn clone(&self) -> MemoryStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MemoryStore
impl Debug for MemoryStore
Source§impl Default for MemoryStore
impl Default for MemoryStore
Source§fn default() -> MemoryStore
fn default() -> MemoryStore
Returns the “default value” for a type. Read more
Source§impl TileStore for MemoryStore
impl TileStore for MemoryStore
Source§fn get(&self, path: &str) -> Result<Option<Vec<u8>>>
fn get(&self, path: &str) -> Result<Option<Vec<u8>>>
The bytes at
path, or nothing when there is no such file.Source§fn put(&self, path: &str, bytes: &[u8]) -> Result<()>
fn put(&self, path: &str, bytes: &[u8]) -> Result<()>
Writes
bytes at path, whole or not at all, replacing what is there.Source§fn create_new(&self, path: &str, bytes: &[u8]) -> Result<bool>
fn create_new(&self, path: &str, bytes: &[u8]) -> Result<bool>
Writes
bytes at path only when nothing is there; false when
something is.Source§fn delete(&self, path: &str) -> Result<bool>
fn delete(&self, path: &str) -> Result<bool>
Removes
path; false when there was nothing to remove.Source§fn rename(&self, from: &str, to: &str) -> Result<()>
fn rename(&self, from: &str, to: &str) -> Result<()>
Moves
from to to, replacing what is at to.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