pub struct DioAlign {
pub offset: usize,
pub memory: usize,
}Available on crate feature
async only.Fields§
§offset: usizeAlignment required for the file offset and the transfer length.
memory: usizeAlignment required for the buffer address.
Invariant: no less than MIN_MEM_ALIGN.
Implementations§
Source§impl DioAlign
impl DioAlign
Sourcepub fn span(&self, offset: u64, len: usize) -> (u64, u64, usize)
pub fn span(&self, offset: u64, len: usize) -> (u64, u64, usize)
Round offset down and end up to the offset alignment.
Returns (lo, hi, pad) where pad is how far into the aligned span the
caller’s data begins. Note hi is deliberately not clamped to the
file size: the length must stay aligned, so a read at EOF is expected to
come up short and the caller must handle the tail.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DioAlign
impl RefUnwindSafe for DioAlign
impl Send for DioAlign
impl Sync for DioAlign
impl Unpin for DioAlign
impl UnsafeUnpin for DioAlign
impl UnwindSafe for DioAlign
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> ⓘ
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> ⓘ
Converts
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> ⓘ
Converts
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