#[repr(C, align(4096))]pub struct AlignedPageSize(/* private fields */);
Expand description
A wrapper data structure with 4096 bytes alignment, which is the most common alignment for direct I/O operations.
Implementations§
Source§impl AlignedPageSize
impl AlignedPageSize
Sourcepub const SIZE: usize = 4_096usize
pub const SIZE: usize = 4_096usize
4096 is as a relatively safe size due to sector size on SSDs commonly being 512 or 4096 bytes
Sourcepub fn slice_to_repr(value: &[Self]) -> &[[u8; 4096]]
pub fn slice_to_repr(value: &[Self]) -> &[[u8; 4096]]
Convenient conversion from slice to underlying representation for efficiency purposes
Sourcepub fn try_slice_from_repr(value: &[[u8; 4096]]) -> Option<&[Self]>
pub fn try_slice_from_repr(value: &[[u8; 4096]]) -> Option<&[Self]>
Convenient conversion from a slice of underlying representation for efficiency purposes.
Returns None
if not correctly aligned.
Sourcepub fn slice_mut_to_repr(slice: &mut [Self]) -> &mut [[u8; 4096]]
pub fn slice_mut_to_repr(slice: &mut [Self]) -> &mut [[u8; 4096]]
Convenient conversion from mutable slice to underlying representation for efficiency purposes
Sourcepub fn try_slice_mut_from_repr(value: &mut [[u8; 4096]]) -> Option<&mut [Self]>
pub fn try_slice_mut_from_repr(value: &mut [[u8; 4096]]) -> Option<&mut [Self]>
Convenient conversion from a slice of underlying representation for efficiency purposes.
Returns None
if not correctly aligned.
Trait Implementations§
Source§impl Clone for AlignedPageSize
impl Clone for AlignedPageSize
Source§fn clone(&self) -> AlignedPageSize
fn clone(&self) -> AlignedPageSize
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AlignedPageSize
impl Debug for AlignedPageSize
Source§impl Default for AlignedPageSize
impl Default for AlignedPageSize
impl Copy for AlignedPageSize
Auto Trait Implementations§
impl Freeze for AlignedPageSize
impl RefUnwindSafe for AlignedPageSize
impl Send for AlignedPageSize
impl Sync for AlignedPageSize
impl Unpin for AlignedPageSize
impl UnwindSafe for AlignedPageSize
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