pub struct DirectIoBackend { /* private fields */ }Expand description
Direct I/O block backend using O_DIRECT.
Implementations§
Source§impl DirectIoBackend
impl DirectIoBackend
Sourcepub fn new(path: &Path, read_only: bool) -> Result<DirectIoBackend, Error>
pub fn new(path: &Path, read_only: bool) -> Result<DirectIoBackend, Error>
Creates a new direct I/O backend.
§Errors
Returns an error if the file cannot be opened with O_DIRECT.
Sourcepub fn pread(&self, offset: u64, buf: &mut [u8]) -> Result<usize, Error>
pub fn pread(&self, offset: u64, buf: &mut [u8]) -> Result<usize, Error>
Reads data at the given offset using pread.
Trait Implementations§
Source§impl Drop for DirectIoBackend
impl Drop for DirectIoBackend
Auto Trait Implementations§
impl Freeze for DirectIoBackend
impl RefUnwindSafe for DirectIoBackend
impl Send for DirectIoBackend
impl Sync for DirectIoBackend
impl Unpin for DirectIoBackend
impl UnsafeUnpin for DirectIoBackend
impl UnwindSafe for DirectIoBackend
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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