pub struct Worklist<'s, F: FileProvider> { /* private fields */ }Expand description
The order to work a project in, growing as it goes. See the module documentation.
Implementations§
Source§impl<'s, F: FileProvider> Worklist<'s, F>
impl<'s, F: FileProvider> Worklist<'s, F>
Sourcepub fn new(
store: &'s mut SummaryStore<F>,
open: impl IntoIterator<Item = PathBuf>,
project: impl IntoIterator<Item = PathBuf>,
) -> Self
pub fn new( store: &'s mut SummaryStore<F>, open: impl IntoIterator<Item = PathBuf>, project: impl IntoIterator<Item = PathBuf>, ) -> Self
A work list over the files the user is looking at and the rest of the project.
Neither list has to be sorted, complete, or free of duplicates. A path in both is worked once, in the open half — which is the answer to “I have the file open and it is in the project”: it is the file the user is looking at, and that is the reason it goes first.
Sourcepub fn step(&mut self) -> Option<Step>
pub fn step(&mut self) -> Option<Step>
Index the next file in the order, and say what happened.
None when the list is finished. A file that cannot be read is a step like any other: it is reported as
StepOutcome::Missing and the list moves on, because one deleted file in a project is not a reason to
stop indexing the rest of it.
A file already worked by this list is never worked twice, however many paths reach it — a header included by twenty files, or a cycle, both cost one step each.
Sourcepub fn pending(&self) -> usize
pub fn pending(&self) -> usize
How many files are queued and not yet worked.
It grows as the list runs, which is not a bug to hide from a progress bar: the number of files a project needs is a fact about the project that nobody knows until its includes have been read. A caller showing progress shows this number, or a count of steps taken, and not a fraction of a total it cannot have.
Auto Trait Implementations§
impl<'s, F> !RefUnwindSafe for Worklist<'s, F>
impl<'s, F> !UnwindSafe for Worklist<'s, F>
impl<'s, F> Forget for Worklist<'s, F>
impl<'s, F> Freeze for Worklist<'s, F>where
&'s mut SummaryStore<F>: Freeze,
impl<'s, F> Send for Worklist<'s, F>where
&'s mut SummaryStore<F>: Send,
impl<'s, F> Sync for Worklist<'s, F>where
&'s mut SummaryStore<F>: Sync,
impl<'s, F> Unpin for Worklist<'s, F>where
&'s mut SummaryStore<F>: Unpin,
impl<'s, F> UnsafeUnpin for Worklist<'s, F>where
&'s mut SummaryStore<F>: UnsafeUnpin,
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> 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