#[non_exhaustive]pub struct ModuleResolutionCandidate {
pub request_index: usize,
pub directive_item: Option<HirId>,
pub request_kind: ModuleRequestKind,
pub target: String,
pub relative_path: String,
pub roots: Vec<ModuleResolutionCandidateRoot>,
pub status: ModuleResolutionCandidateStatus,
pub resolved_path: Option<String>,
pub range: SourceLocation,
pub package_context: Option<String>,
pub provenance: CompileProvenance,
pub confidence: CompileConfidence,
}Expand description
Derived module-resolution candidate fact keyed to a HIR module request.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.request_index: usizeZero-based request index in CompileEnvironment::module_requests.
directive_item: Option<HirId>Directive HIR item that produced this request.
request_kind: ModuleRequestKindSource shape that requested the module.
target: StringStatic module target.
relative_path: StringRelative module path, for example Foo/Bar.pm.
roots: Vec<ModuleResolutionCandidateRoot>Ordered candidate roots considered for this request.
status: ModuleResolutionCandidateStatusResolution status for this candidate packet.
resolved_path: Option<String>Candidate path selected by the resolver, when a matching file exists.
range: SourceLocationSource range for the request.
package_context: Option<String>Package context active at the request.
provenance: CompileProvenanceHow this fact was produced.
confidence: CompileConfidenceConfidence in this fact.
Implementations§
Source§impl ModuleResolutionCandidate
impl ModuleResolutionCandidate
Sourcepub fn cache_key(&self, resolver_epoch: u64) -> ModuleResolutionCacheKey
pub fn cache_key(&self, resolver_epoch: u64) -> ModuleResolutionCacheKey
Build the cache key for this module-resolution candidate.
The key intentionally records request identity, root provenance/order, candidate paths, source anchor, and resolver epoch, but not the current resolution outcome. Candidate existence is tracked separately as an invalidation input so file appearance/removal can invalidate a cached result without changing the request identity.
Sourcepub fn cache_invalidation(
&self,
resolver_epoch: u64,
path_exists: impl FnMut(&str) -> bool,
) -> ModuleResolutionCacheInvalidation
pub fn cache_invalidation( &self, resolver_epoch: u64, path_exists: impl FnMut(&str) -> bool, ) -> ModuleResolutionCacheInvalidation
Build cache invalidation inputs for this candidate.
The caller supplies the path-existence predicate; parser-core still does not read ambient process state or inspect the filesystem directly.
Trait Implementations§
Source§impl Clone for ModuleResolutionCandidate
impl Clone for ModuleResolutionCandidate
Source§fn clone(&self) -> ModuleResolutionCandidate
fn clone(&self) -> ModuleResolutionCandidate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ModuleResolutionCandidate
impl Debug for ModuleResolutionCandidate
Source§impl PartialEq for ModuleResolutionCandidate
impl PartialEq for ModuleResolutionCandidate
Source§fn eq(&self, other: &ModuleResolutionCandidate) -> bool
fn eq(&self, other: &ModuleResolutionCandidate) -> bool
self and other values to be equal, and is used by ==.