#[repr(usize)]pub enum BufferSize {
S8 = 8,
S16 = 16,
S32 = 32,
S64 = 64,
S128 = 128,
S256 = 256,
S512 = 512,
S1024 = 1_024,
S2048 = 2_048,
S4096 = 4_096,
S8192 = 8_192,
S16384 = 16_384,
}Expand description
Size of a single IO buffer.
All variants are powers of two, which enables efficient alignment, masking, indexing, and allocator-friendly memory layouts throughout the storage engine.
The value of each variant is the buffer size in bytes.
NOTE: The BufferSize::S16384 is an upper limit for available buffer sizes, as it is large enough to never
create any sort of inconvience for the user, and small enough to never create overflow issues in arithmatic
operation across storage engine/s.
§Example
let buf_size = frozen_core::utils::BufferSize::S128.bytes();
assert!(frozen_core::utils::is_power_of_2(buf_size));Variants§
S8 = 8
8 bytes
S16 = 16
16 bytes
S32 = 32
32 bytes
S64 = 64
64 bytes
S128 = 128
128 bytes
S256 = 256
256 bytes
S512 = 512
512 bytes
S1024 = 1_024
1 KiB (1024 bytes)
S2048 = 2_048
2 KiB (2048 bytes)
S4096 = 4_096
4 KiB (4096 bytes)
S8192 = 8_192
8 KiB (8192 bytes)
S16384 = 16_384
16 KiB (16384 bytes)
Implementations§
Trait Implementations§
Source§impl Clone for BufferSize
impl Clone for BufferSize
Source§fn clone(&self) -> BufferSize
fn clone(&self) -> BufferSize
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BufferSize
Source§impl Debug for BufferSize
impl Debug for BufferSize
impl Eq for BufferSize
Source§impl Ord for BufferSize
impl Ord for BufferSize
Source§fn cmp(&self, other: &BufferSize) -> Ordering
fn cmp(&self, other: &BufferSize) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for BufferSize
impl PartialEq for BufferSize
Source§fn eq(&self, other: &BufferSize) -> bool
fn eq(&self, other: &BufferSize) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for BufferSize
impl PartialOrd for BufferSize
impl StructuralPartialEq for BufferSize
Auto Trait Implementations§
impl Freeze for BufferSize
impl RefUnwindSafe for BufferSize
impl Send for BufferSize
impl Sync for BufferSize
impl Unpin for BufferSize
impl UnsafeUnpin for BufferSize
impl UnwindSafe for BufferSize
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