Skip to main content

SourceBindingCache

Struct SourceBindingCache 

Source
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: u64

Allowance after subtracting coexisting publication owners.

§root: &'a Path

Exact 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: SourceRecoveryWork

Additional actual parser work, separate from reused fresh sidecars.

§retained_bytes: u64

Bounded owned source graphs/evidence retained during projection.

Implementations§

Source§

impl SourceBindingCache<'_>

Source

fn reserve_cohort_bytes(&mut self, bytes: u64) -> Result<(), CliError>

Reserve a derived cache or temporary construction before inserting it.

Source

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.

Source

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>

Source

fn new( root: &'a Path, nodes: &'a [Node], direct_paths: Option<&BTreeSet<String>>, ) -> Self

Index captured metadata once without reading any source file.

Source

fn set_retained_limit(&mut self, limit: u64) -> Result<(), CliError>

Update a phase allowance without discarding already retained cache owners.

Source

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§

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.

§

impl<'a, T> FromIn<'a, T> for T

§

fn from_in(t: T, _: &'a Allocator) -> T

Converts to this type from the input type within the given allocator.
§

impl<T> Instrument for T

§

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

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

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
§

impl<'a, T, U> IntoIn<'a, U> for T
where U: FromIn<'a, T>,

§

fn into_in(self, allocator: &'a Allocator) -> U

Converts this type into the (usually inferred) input type within the given allocator.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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