Struct rustdb::atomfile::BasicAtomicFile
source · pub struct BasicAtomicFile {
pub stg: Box<dyn Storage>,
pub upd: Box<dyn Storage>,
/* private fields */
}Expand description
Non-buffered alternative to AtomicFile.
Fields§
§stg: Box<dyn Storage>The main underlying storage.
upd: Box<dyn Storage>Temporary storage for updates during commit.
Implementations§
Trait Implementations§
source§impl Storage for BasicAtomicFile
impl Storage for BasicAtomicFile
source§fn commit(&mut self, size: u64)
fn commit(&mut self, size: u64)
Finish write transaction, size is new size of underlying storage, time is the database time (#commits since server started).
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.
fn clone(&self) -> Box<dyn Storage>
Auto Trait Implementations§
impl !RefUnwindSafe for BasicAtomicFile
impl Send for BasicAtomicFile
impl Sync for BasicAtomicFile
impl Unpin for BasicAtomicFile
impl !UnwindSafe for BasicAtomicFile
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