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>
impl<F: RepositoryFacts> PrivateIndexFacts<F>
Sourcepub fn new(inner: F, index: &Path, object_directory: &Path) -> Self
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 });Sourcepub fn use_index(&mut self, index: &Path, object_directory: &Path)
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>
impl<F: RepositoryFacts> RepositoryFacts for PrivateIndexFacts<F>
Source§fn location(&mut self) -> Result<RepositoryLocation, String>
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>
fn index_vs_head(&mut self) -> Result<IndexVsHead, String>
Whether the index differs from
HEAD.Source§fn sequencer_state(&mut self) -> Result<SequencerState, String>
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>
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>
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>>
fn asked_location(&self) -> Option<Result<RepositoryLocation, String>>
The location when it was already asked for,
without asking.
Source§fn transaction_context(&self) -> GitContext
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> 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
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> ⓘ
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