pub struct ReadPlan {
items: Vec<PlannedRead>,
low_file: Option<File>,
}Expand description
Reads required between pool acquisition and residency completion. Built by the service thread, then moved or borrowed by reader threads.
Fields§
§items: Vec<PlannedRead>§low_file: Option<File>Implementations§
Source§impl ReadPlan
impl ReadPlan
pub(super) fn read_requests(&self) -> impl Iterator<Item = (usize, usize)> + '_
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
Sourcepub fn run_tracked(
&self,
cached: &File,
nocache: &File,
need_len: usize,
) -> Vec<Landed>
pub fn run_tracked( &self, cached: &File, nocache: &File, need_len: usize, ) -> Vec<Landed>
Run the reads: copies go to their slots past the cache
(nocache), cache reads pull pages in through cached.
Run every read on its own detached thread; returns one flag per
entry of the need list the plan was built for (need_len), set
once that record is in memory (records that needed no read start
set). The caller keeps the flags of reads it stops waiting for and
checks them before the slot can be reused.
pub fn run(&self, cached: &File, nocache: &File)
fn file<'a>( &'a self, read: &PlannedRead, cached: &'a File, nocache: &'a File, ) -> &'a File
pub(super) fn observe( &mut self, tracker: &ReadTracker, layer: usize, source: ReadSource, )
pub(super) fn tickets(&self, need: &[usize]) -> Vec<(usize, ReadTicket)>
Auto Trait Implementations§
impl Freeze for ReadPlan
impl RefUnwindSafe for ReadPlan
impl Send for ReadPlan
impl Sync for ReadPlan
impl Unpin for ReadPlan
impl UnsafeUnpin for ReadPlan
impl UnwindSafe for ReadPlan
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§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>
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