Skip to main content

PrivateIndexFacts

Struct PrivateIndexFacts 

Source
pub struct PrivateIndexFacts<F: RepositoryFacts> { /* private fields */ }
Expand description

What: Rule facts from the wrapped real repository and candidate reads from a private index. Why: The private index changes from one replay to the next, so the facts keep it as a replaceable value.

In TS you’d write (pseudocode):

type CommitFacts = { rules: RepositoryFacts; privateIndex: { indexPath: string; objectDirectory: string } };

Implementations§

Source§

impl<F: RepositoryFacts> PrivateIndexFacts<F>

Source

pub fn new(inner: F, index: &Path, object_directory: &Path) -> Self

What: Wrap rule facts with the private index and the object store the candidates are read from. Why: The candidate prediction copies the named index, so reading never changes the transaction’s index.

In TS you’d write (pseudocode):

createPrivateIndexFacts({ indexPath, objectDirectory });
Source

pub fn use_index(&mut self, index: &Path, object_directory: &Path)

What: Read the candidates from another private index from now on. Why: A replay validates its own merged tree in replay-<n>/commit.index.

In TS you’d write (pseudocode):

facts = createPrivateIndexFacts({ indexPath: replayIndexPath, objectDirectory });

Trait Implementations§

Source§

impl<F: RepositoryFacts> RepositoryFacts for PrivateIndexFacts<F>

Source§

fn location(&mut self) -> Result<RepositoryLocation, String>

Repository identity, worktree top level and the path below it; asked once.
Source§

fn index_vs_head(&mut self) -> Result<IndexVsHead, String>

Whether the index differs from HEAD.
Source§

fn sequencer_state(&mut self) -> Result<SequencerState, String>

Whether a merge, cherry-pick or revert awaits its concluding commit.
Source§

fn remote_guess_creates_branch( &mut self, target: &OsStr, ) -> Result<bool, String>

Whether git switch <target> or git checkout <target> would create a local branch from the one remote branch of that name.
Source§

fn candidates( &mut self, request: &CandidateRequest, ) -> Result<PreparedCandidates, CandidateError>

The candidates a content policy reads for this request, prepared on a private index; a failure carries the candidate layer’s cause.
Source§

fn asked_location(&self) -> Option<Result<RepositoryLocation, String>>

The location when it was already asked for, without asking.
Source§

fn transaction_context(&self) -> GitContext

Real Git, the child environment and the invocation’s global options, for transaction and recovery work.

Auto Trait Implementations§

§

impl<F> Freeze for PrivateIndexFacts<F>
where F: Freeze,

§

impl<F> RefUnwindSafe for PrivateIndexFacts<F>
where F: RefUnwindSafe,

§

impl<F> Send for PrivateIndexFacts<F>
where F: Send,

§

impl<F> Sync for PrivateIndexFacts<F>
where F: Sync,

§

impl<F> Unpin for PrivateIndexFacts<F>
where F: Unpin,

§

impl<F> UnsafeUnpin for PrivateIndexFacts<F>
where F: UnsafeUnpin,

§

impl<F> UnwindSafe for PrivateIndexFacts<F>
where F: UnwindSafe,

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