pub struct LocalStore { /* private fields */ }Implementations§
Source§impl LocalStore
impl LocalStore
pub fn open(root: impl AsRef<Path>) -> Result<Self>
pub fn load_manifest(&self) -> Result<Option<Manifest>>
Sourcepub fn commit_manifest(&self, manifest: &Manifest) -> Result<()>
pub fn commit_manifest(&self, manifest: &Manifest) -> Result<()>
The commit: write sideways, rename over. Atomic on POSIX and on Windows (MoveFileEx with replace). The object-store version of this is a conditional PUT on the manifest’s ETag.
Sourcepub fn write_segment(&self, name: &str, bytes: &[u8]) -> Result<()>
pub fn write_segment(&self, name: &str, bytes: &[u8]) -> Result<()>
Segments are uploaded before the manifest that names them: a crash between the two leaves an orphan file for the sweep, never a dangling reference.
pub fn read_segment(&self, name: &str) -> Result<Vec<u8>>
Auto Trait Implementations§
impl Freeze for LocalStore
impl RefUnwindSafe for LocalStore
impl Send for LocalStore
impl Sync for LocalStore
impl Unpin for LocalStore
impl UnsafeUnpin for LocalStore
impl UnwindSafe for LocalStore
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