Skip to main content

DirectFixPasses

Struct DirectFixPasses 

Source
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.

In TS you’d write (pseudocode):

class DirectFixPasses { constructor(request, checks) {} }
Source

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.

In TS you’d write (pseudocode):

class DirectFixPasses implements FixPasses {}
Source§

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

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

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more