Struct rustdb::atomfile::AtomicFile
source · pub struct AtomicFile { /* private fields */ }
Expand description
Based on BasicAtomicFile which makes sure that database updates are all-or-nothing. Provides read buffering for small reads, and a thread to perform commit asyncronously.
Implementations§
Trait Implementations§
source§impl Storage for AtomicFile
impl Storage for AtomicFile
source§fn commit(&mut self, size: u64)
fn commit(&mut self, size: u64)
Finish write transaction, size is new size of underlying storage.
source§fn size(&self) -> u64
fn size(&self) -> u64
Get the size of the underlying storage.
Note : this is valid initially and after a commit but is not defined after write is called.
source§fn write_data(&mut self, start: u64, data: Data, off: usize, len: usize)
fn write_data(&mut self, start: u64, data: Data, off: usize, len: usize)
Write Data slice to storage.
source§fn wait_complete(&self)
fn wait_complete(&self)
Wait until current writes are complete.
fn clone(&self) -> Box<dyn Storage>
Auto Trait Implementations§
impl Freeze for AtomicFile
impl RefUnwindSafe for AtomicFile
impl Send for AtomicFile
impl Sync for AtomicFile
impl Unpin for AtomicFile
impl UnwindSafe for AtomicFile
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