pub struct MmapPagerSource { /* private fields */ }Expand description
Memory-mapped PagerSource — faster random access than seek+read.
Requires the mmap feature. The mmap is created read-only and is safe to
share across threads. OS-level demand paging may still cause page faults
on access, but the read_bytes_at implementation is zero-copy after the
initial map.
Implementations§
Trait Implementations§
Source§impl PagerSource for MmapPagerSource
Available on crate feature mmap only.
impl PagerSource for MmapPagerSource
Available on crate feature
mmap only.Source§fn read_bytes_at(&self, offset: u64, out: &mut [u8]) -> Result<(), RuntimeError>
fn read_bytes_at(&self, offset: u64, out: &mut [u8]) -> Result<(), RuntimeError>
Source§fn total_size_bytes(&self) -> u64
fn total_size_bytes(&self) -> u64
Total size of the backing store in bytes.
Auto Trait Implementations§
impl Freeze for MmapPagerSource
impl RefUnwindSafe for MmapPagerSource
impl Send for MmapPagerSource
impl Sync for MmapPagerSource
impl Unpin for MmapPagerSource
impl UnsafeUnpin for MmapPagerSource
impl UnwindSafe for MmapPagerSource
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