#[repr(C, align(4096))]pub struct AlignedPage(/* 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 AlignedPage
impl AlignedPage
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 as_uninit_slice_mut(value: &mut [Self]) -> &mut [MaybeUninit<Self>]
pub fn as_uninit_slice_mut(value: &mut [Self]) -> &mut [MaybeUninit<Self>]
Convert an exclusive slice to an uninitialized version
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 uninit_slice_to_repr(
value: &[MaybeUninit<Self>],
) -> &[MaybeUninit<[u8; 4096]>]
pub fn uninit_slice_to_repr( value: &[MaybeUninit<Self>], ) -> &[MaybeUninit<[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 try_uninit_slice_from_repr(
value: &[MaybeUninit<[u8; 4096]>],
) -> Option<&[MaybeUninit<Self>]>
pub fn try_uninit_slice_from_repr( value: &[MaybeUninit<[u8; 4096]>], ) -> Option<&[MaybeUninit<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 uninit_slice_mut_to_repr(
slice: &mut [MaybeUninit<Self>],
) -> &mut [MaybeUninit<[u8; 4096]>]
pub fn uninit_slice_mut_to_repr( slice: &mut [MaybeUninit<Self>], ) -> &mut [MaybeUninit<[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.
Sourcepub fn try_uninit_slice_mut_from_repr(
value: &mut [MaybeUninit<[u8; 4096]>],
) -> Option<&mut [MaybeUninit<Self>]>
pub fn try_uninit_slice_mut_from_repr( value: &mut [MaybeUninit<[u8; 4096]>], ) -> Option<&mut [MaybeUninit<Self>]>
Convenient conversion from a slice of underlying representation for efficiency purposes.
Returns None
if not correctly aligned.
Trait Implementations§
Source§impl Clone for AlignedPage
impl Clone for AlignedPage
Source§fn clone(&self) -> AlignedPage
fn clone(&self) -> AlignedPage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for AlignedPage
impl Debug for AlignedPage
Source§impl Default for AlignedPage
impl Default for AlignedPage
impl Copy for AlignedPage
Auto Trait Implementations§
impl Freeze for AlignedPage
impl RefUnwindSafe for AlignedPage
impl Send for AlignedPage
impl Sync for AlignedPage
impl Unpin for AlignedPage
impl UnwindSafe for AlignedPage
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more