Struct rustdb::atomfile::AtomicFile
source · pub struct AtomicFile {
pub stg: Box<dyn Storage>,
pub upd: Box<dyn Storage>,
/* private fields */
}
Expand description
AtomicFile makes sure that database updates are all-or-nothing. Keeps a map of outstanding writes which have not yet been written to the underlying file.
Fields§
§stg: Box<dyn Storage>
The main underlying storage.
upd: Box<dyn Storage>
Temporary storage for updates during commit.
Implementations§
source§impl AtomicFile
impl AtomicFile
sourcepub fn new(stg: Box<dyn Storage>, upd: Box<dyn Storage>) -> Box<Self>
pub fn new(stg: Box<dyn Storage>, upd: Box<dyn Storage>) -> Box<Self>
Construct a new AtomicFle. stg is the main underlying storage, upd is temporary storage for updates during commit.
sourcepub fn commit_phase(&self, size: u64, phase: u8)
pub fn commit_phase(&self, size: u64, phase: u8)
Perform the specified phase ( 1 or 2 ) of a two-phase commit.
Trait Implementations§
Auto Trait Implementations§
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