pub enum BytePageSize {
Size4 = 0,
Size8 = 1,
Size16 = 2,
Size24 = 3,
Size32 = 4,
Size48 = 5,
Size64 = 6,
Unset = 7,
}Expand description
Capacity category used when allocating BytePage storage.
Variants§
Size4 = 0
A 4 KiB page.
Size8 = 1
An 8 KiB page.
Size16 = 2
A 16 KiB page.
Size24 = 3
A 24 KiB page.
Size32 = 4
A 32 KiB page.
Size48 = 5
A 48 KiB page.
Size64 = 6
A 64 KiB page.
Unset = 7
No fixed page category.
Buffers of this category are sized on demand and never returned to
the page cache. It cannot be used as the page size of
BytePages.
Implementations§
Source§impl BytePageSize
impl BytePageSize
Sourcepub const fn capacity(self) -> usize
pub const fn capacity(self) -> usize
Returns the page capacity in bytes.
A page is allocated together with its header, the capacity is the category size minus the header, so the allocation is exactly the category size and fits the allocator’s size classes.
Sourcepub const fn half_capacity(self) -> usize
pub const fn half_capacity(self) -> usize
Returns the recommended write-buffer threshold for this page size.
This is half of the category size, but at most 16 KiB.
Trait Implementations§
Source§impl Clone for BytePageSize
impl Clone for BytePageSize
impl Copy for BytePageSize
Source§impl Debug for BytePageSize
impl Debug for BytePageSize
Source§impl Default for BytePageSize
impl Default for BytePageSize
impl Eq for BytePageSize
Source§impl PartialEq for BytePageSize
impl PartialEq for BytePageSize
impl StructuralPartialEq for BytePageSize
Auto Trait Implementations§
impl Freeze for BytePageSize
impl RefUnwindSafe for BytePageSize
impl Send for BytePageSize
impl Sync for BytePageSize
impl Unpin for BytePageSize
impl UnsafeUnpin for BytePageSize
impl UnwindSafe for BytePageSize
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