Struct rustdb::atomfile::AtomicFile [−][src]
pub struct AtomicFile {
pub map: Mutex<BTreeMap<u64, DataSlice>>,
pub stg: Box<dyn Storage>,
pub upd: Box<dyn Storage>,
}
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
map: Mutex<BTreeMap<u64, DataSlice>>
Map of existing outstanding writes. Note the key is the file address of the last byte written.
stg: Box<dyn Storage>
The main underlying storage.
upd: Box<dyn Storage>
Temporary storage for updates during commit.
Implementations
Trait Implementations
Finish write transaction, size is new size of underlying storage. If prepare is set true, the updates are saved but not applied (for atomic storage). Read more
Get the size of the underlying storage. Note : this is valid initially and after a commit but is not defined after write is called. Read more
Write Data slice to storage.