pub struct DirectFixPasses<'a, F: RepositoryFacts> { /* private fields */ }Expand description
What:
The passes of one direct fix,
as the bounded loop sees them.
'a names how
long the borrowed request and checks last.
Why:
The loop owns the control flow;
this owns running a pass,
applying its
corrections and remembering each changed state.
In TS you’d write (pseudocode):
class DirectFixPasses implements FixPasses { last?: PassResult; states: Map<string, InstallChange>[] }Implementations§
Source§impl<'a, F: RepositoryFacts> DirectFixPasses<'a, F>
What:
impl<F: RepositoryFacts> DirectFixPasses<'_, F> { ... } attaches the constructor
and the hand-back of what the loop left.
Why:
The states start with the uncorrected one,
which the cycle check compares against.
impl<'a, F: RepositoryFacts> DirectFixPasses<'a, F>
What:
impl<F: RepositoryFacts> DirectFixPasses<'_, F> { ... } attaches the constructor
and the hand-back of what the loop left.
Why:
The states start with the uncorrected one,
which the cycle check compares against.
In TS you’d write (pseudocode):
class DirectFixPasses { constructor(request, checks) {} }Sourcepub fn new(request: &'a StageRequest, checks: &'a mut ShippedChecks<F>) -> Self
pub fn new(request: &'a StageRequest, checks: &'a mut ShippedChecks<F>) -> Self
What:
Passes over checks with no pass run yet and the uncorrected state stored.
Why:
State number n is the state after n changes,
as the loop numbers them.
In TS you’d write (pseudocode):
constructor(request: StageRequest, checks: ShippedChecks)Trait Implementations§
Source§impl<F: RepositoryFacts> FixPasses for DirectFixPasses<'_, F>
What:
impl FixPasses for DirectFixPasses<'_, F> gives the loop its three operations.
Why:
The loop is tested without Git;
these are the real passes.
impl<F: RepositoryFacts> FixPasses for DirectFixPasses<'_, F>
What:
impl FixPasses for DirectFixPasses<'_, F> gives the loop its three operations.
Why:
The loop is tested without Git;
these are the real passes.
In TS you’d write (pseudocode):
class DirectFixPasses implements FixPasses {}Source§fn run_pass(&mut self, _candidate_version: usize) -> ConvergencePass
fn run_pass(&mut self, _candidate_version: usize) -> ConvergencePass
What: Run one whole policy pass on the current content and remember it. Why: Proposals left from an earlier pass were applied already; a pass starts with none, so it is read only from what this pass proposes.
In TS you’d write (pseudocode):
async runPass(version: number): Promise<'stable' | 'proposed' | 'failed'>;Source§fn apply(&mut self, _snapshot: usize) -> bool
fn apply(&mut self, _snapshot: usize) -> bool
What: Apply the last pass’s proposals and store the resulting state. Why: Applying in memory cannot fail, so the fix is never blocked here.
In TS you’d write (pseudocode):
async apply(snapshot: number): Promise<boolean>;Source§fn snapshots_equal(&mut self, left: usize, right: usize) -> bool
fn snapshots_equal(&mut self, left: usize, right: usize) -> bool
What: Whether two stored states hold the same bytes in every file. Why: Equal corrected maps mean equal content, because a file whose bytes return to its original is no longer in the map.
In TS you’d write (pseudocode):
async snapshotsEqual(left: number, right: number): Promise<boolean>;Auto Trait Implementations§
impl<'a, F> !RefUnwindSafe for DirectFixPasses<'a, F>
impl<'a, F> !Send for DirectFixPasses<'a, F>
impl<'a, F> !Sync for DirectFixPasses<'a, F>
impl<'a, F> !UnwindSafe for DirectFixPasses<'a, F>
impl<'a, F> Freeze for DirectFixPasses<'a, F>where
&'a mut ShippedChecks<F>: Freeze,
impl<'a, F> Unpin for DirectFixPasses<'a, F>where
&'a mut ShippedChecks<F>: Unpin,
impl<'a, F> UnsafeUnpin for DirectFixPasses<'a, F>where
&'a mut ShippedChecks<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> 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> ⓘ
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