struct SourceBindingCache<'a> {
retained_limit: u64,
root: &'a Path,
nodes: Arc<BTreeMap<&'a str, &'a Node>>,
direct_paths: Option<BTreeSet<&'a str>>,
captured: BTreeMap<String, Arc<CapturedSourceGraph>>,
cargo_cohorts: BTreeMap<String, Arc<CargoRootCohortIndex>>,
work: SourceRecoveryWork,
retained_bytes: u64,
}Expand description
Per-operation captured source cache, limited to requested projection/context paths.
Fields§
§retained_limit: u64Allowance after subtracting coexisting publication owners.
root: &'a PathExact selected checkout.
nodes: Arc<BTreeMap<&'a str, &'a Node>>Captured file inventory, used to reject changed or unindexed source.
direct_paths: Option<BTreeSet<&'a str>>Direct paths for incremental work; absence means a full candidate set.
captured: BTreeMap<String, Arc<CapturedSourceGraph>>One immutable parse per required unchanged path.
cargo_cohorts: BTreeMap<String, Arc<CargoRootCohortIndex>>Derived Cargo cohorts retain no second manifest graph or parser facts.
work: SourceRecoveryWorkAdditional actual parser work, separate from reused fresh sidecars.
retained_bytes: u64Bounded owned source graphs/evidence retained during projection.
Implementations§
Source§impl SourceBindingCache<'_>
impl SourceBindingCache<'_>
Sourcefn reserve_cohort_bytes(&mut self, bytes: u64) -> Result<(), CliError>
fn reserve_cohort_bytes(&mut self, bytes: u64) -> Result<(), CliError>
Reserve a derived cache or temporary construction before inserting it.
Sourcefn cohort(
&mut self,
project: ProjectInstanceId,
package: &PackageOwner,
directory: &str,
kind: CohortKind,
) -> Result<Option<Arc<CargoRootCohort>>, CliError>
fn cohort( &mut self, project: ProjectInstanceId, package: &PackageOwner, directory: &str, kind: CohortKind, ) -> Result<Option<Arc<CargoRootCohort>>, CliError>
Admit one shared key; an invalid identity retains exact file causes instead.
Sourcepub(super) fn cargo_root_cohorts(
&mut self,
project: ProjectInstanceId,
package: &PackageOwner,
targets: &SourceCargoTargets,
packages: &PackageIndex,
control: &IndexWorkControl,
) -> Result<Arc<CargoRootCohortIndex>, CliError>
pub(super) fn cargo_root_cohorts( &mut self, project: ProjectInstanceId, package: &PackageOwner, targets: &SourceCargoTargets, packages: &PackageIndex, control: &IndexWorkControl, ) -> Result<Arc<CargoRootCohortIndex>, CliError>
Cache only derived roots, sharing the already captured manifest’s parse.
Source§impl<'a> SourceBindingCache<'a>
impl<'a> SourceBindingCache<'a>
Sourcefn new(
root: &'a Path,
nodes: &'a [Node],
direct_paths: Option<&BTreeSet<String>>,
) -> Self
fn new( root: &'a Path, nodes: &'a [Node], direct_paths: Option<&BTreeSet<String>>, ) -> Self
Index captured metadata once without reading any source file.
Sourcefn set_retained_limit(&mut self, limit: u64) -> Result<(), CliError>
fn set_retained_limit(&mut self, limit: u64) -> Result<(), CliError>
Update a phase allowance without discarding already retained cache owners.
Sourcefn capture(
&mut self,
path: &str,
control: &IndexWorkControl,
) -> Result<Arc<CapturedSourceGraph>, CliError>
fn capture( &mut self, path: &str, control: &IndexWorkControl, ) -> Result<Arc<CapturedSourceGraph>, CliError>
Recover only an explicitly requested source, preserving its original parser order.
Auto Trait Implementations§
impl<'a> Freeze for SourceBindingCache<'a>
impl<'a> RefUnwindSafe for SourceBindingCache<'a>
impl<'a> Send for SourceBindingCache<'a>
impl<'a> Sync for SourceBindingCache<'a>
impl<'a> Unpin for SourceBindingCache<'a>
impl<'a> UnsafeUnpin for SourceBindingCache<'a>
impl<'a> UnwindSafe for SourceBindingCache<'a>
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
§impl<'a, T> FromIn<'a, T> for T
impl<'a, T> FromIn<'a, T> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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