pub struct ExtentAllocator { /* private fields */ }Expand description
Extent allocator for SST heap
Uses a simple bump allocator strategy:
- Allocations always extend the file
- Free space tracking is deferred to compaction
Implementations§
Source§impl ExtentAllocator
impl ExtentAllocator
Sourcepub fn allocate(&self, size: u64) -> Result<Extent>
pub fn allocate(&self, size: u64) -> Result<Extent>
Allocate a new extent with the given size (in bytes)
Sourcepub fn allocated_size(&self) -> u64
pub fn allocated_size(&self) -> u64
Get total allocated size (in bytes)
Sourcepub fn num_extents(&self) -> usize
pub fn num_extents(&self) -> usize
Get number of allocated extents
Sourcepub fn list_extents(&self) -> Vec<Extent>
pub fn list_extents(&self) -> Vec<Extent>
List all allocated extents
Auto Trait Implementations§
impl !Freeze for ExtentAllocator
impl !RefUnwindSafe for ExtentAllocator
impl Send for ExtentAllocator
impl Sync for ExtentAllocator
impl Unpin for ExtentAllocator
impl UnwindSafe for ExtentAllocator
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