Struct rustdb::dividedstg::DividedStg
source · pub struct DividedStg {
pub bs: BlockStg,
pub blk_cap: u64,
/* private fields */
}
Expand description
Divides Storage into sub-files of arbitrary size using BlockStg.
Fields§
§bs: BlockStg
Underlying block storage.
blk_cap: u64
Block capacity.
Implementations§
source§impl DividedStg
impl DividedStg
sourcepub fn new(stg: Box<dyn Storage>, blk_cap: u64) -> Self
pub fn new(stg: Box<dyn Storage>, blk_cap: u64) -> Self
Construct DividedStg from specified Storage and block capacity.
sourcepub fn truncate(&mut self, f: &mut FD, size: u64)
pub fn truncate(&mut self, f: &mut FD, size: u64)
Free blocks not required for file of specified size.
sourcepub fn write(&mut self, f: &mut FD, offset: u64, data: &[u8])
pub fn write(&mut self, f: &mut FD, offset: u64, data: &[u8])
Write data to specified file at specified offset.
sourcepub fn write_data(&mut self, f: &mut FD, offset: u64, data: Data, n: usize)
pub fn write_data(&mut self, f: &mut FD, offset: u64, data: Data, n: usize)
Write Data to specified file at specified offset.
sourcepub fn read(&self, f: &FD, offset: u64, data: &mut [u8])
pub fn read(&self, f: &FD, offset: u64, data: &mut [u8])
Read data from file at specified offset.
sourcepub fn wait_complete(&self)
pub fn wait_complete(&self)
Wait for save to complete.
Auto Trait Implementations§
impl Freeze for DividedStg
impl !RefUnwindSafe for DividedStg
impl Send for DividedStg
impl Sync for DividedStg
impl Unpin for DividedStg
impl !UnwindSafe for DividedStg
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