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
sourceimpl AtomicFile
impl AtomicFile
sourcepub fn new(stg: Box<dyn Storage>, upd: Box<dyn Storage>) -> Self
pub fn new(stg: Box<dyn Storage>, upd: Box<dyn Storage>) -> 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
sourceimpl Storage for AtomicFile
impl Storage for AtomicFile
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more