pub struct Store {
pub indexes: HashMap<String, Index>,
pub empties: Vec<Index>,
pub blob_file: File,
pub empty_file: File,
pub db_file: File,
}Fields§
§indexes: HashMap<String, Index>§empties: Vec<Index>§blob_file: File§empty_file: File§db_file: FileImplementations§
Source§impl Store
impl Store
Sourcepub fn new(directory: PathBuf) -> Result<Self>
pub fn new(directory: PathBuf) -> Result<Self>
creates a new Mammon::Store in the given directory. cannot be used to open an existing store.
Sourcepub fn open(directory: PathBuf) -> Result<Self>
pub fn open(directory: PathBuf) -> Result<Self>
opens an existing Mammon::Store in a given directory. cannot be used to create a new store.
Sourcepub fn store(&mut self, key: impl ToString, val: Vec<u8>) -> Result<()>
pub fn store(&mut self, key: impl ToString, val: Vec<u8>) -> Result<()>
store a blob in the store, returning Ok(()) on success
Auto Trait Implementations§
impl Freeze for Store
impl RefUnwindSafe for Store
impl Send for Store
impl Sync for Store
impl Unpin for Store
impl UnwindSafe for Store
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