pub struct ParseResult {
pub dependencies: Vec<ParsedDependency>,
pub workspace_root: Option<PathBuf>,
pub uri: Uri,
pub resolved_registries: Vec<(RegistryIndex, Option<AuthToken>)>,
pub blocked_registries: Vec<(Range, HostClass, String)>,
}Expand description
Result of parsing a Cargo.toml file.
Contains all extracted dependencies with their positions, plus optional workspace root information for resolving inherited dependencies.
Fields§
§dependencies: Vec<ParsedDependency>All dependencies found in the file
workspace_root: Option<PathBuf>Workspace root path if this is a workspace member
uri: UriDocument URI
resolved_registries: Vec<(RegistryIndex, Option<AuthToken>)>Every alternate-registry index this parse resolved (spec FR-002), paired with the credential (if any) to attach to requests against it.
crate::ecosystem::CargoEcosystem::parse_manifest registers each of these into the
shared CargoRegistry router immediately after parsing, so a later
Registry::get_versions_from call for the matching
DependencySource::AlternateRegistry source can find its (possibly authenticated)
client. Empty when Self::dependencies contains no CustomRegistry source and
no [source.crates-io] replace-with chain resolves to a sparse mirror — 1a’s
zero-extra-work lazy trigger (spec NFR-004) no longer holds unconditionally once 1b’s
[source] support is in play, since a mirror can rewrite every plain dependency (spec
NFR-005’s corrected premise).
blocked_registries: Vec<(Range, HostClass, String)>Dependency lines whose registry/registry-index resolution was blocked by the
current registries.workspace_registries policy (spec #443, plan-1b §1.7) —
(name_range, blocked host class, raw declared value) triples. Surfaced by
deps_core::lsp_helpers::generate_diagnostics_from_cache via
Self::blocked_registries’s trait override as an informational diagnostic, so the
block never degrades silently.
Trait Implementations§
Source§impl Clone for ParseResult
impl Clone for ParseResult
Source§fn clone(&self) -> ParseResult
fn clone(&self) -> ParseResult
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 ParseResult
impl Debug for ParseResult
Source§impl ParseResult for ParseResult
impl ParseResult for ParseResult
Source§fn dependencies(&self) -> Vec<&dyn Dependency>
fn dependencies(&self) -> Vec<&dyn Dependency>
Source§fn workspace_root(&self) -> Option<&Path>
fn workspace_root(&self) -> Option<&Path>
Source§fn blocked_registries(&self) -> Vec<(Range, HostClass, String)>
fn blocked_registries(&self) -> Vec<(Range, HostClass, String)>
.local/specs/023-cargo-custom-registries/plan-1b.md §1.7,
#443) — (name_range, blocked host class, raw declared value) triples, where the raw
value is the exact registry/registry-index alias or URL the dependency declared
(so two different blocked aliases render as two distinguishable messages, not one
byte-identical warning). Used by
crate::lsp_helpers::generate_diagnostics_from_cache to surface an
[tower_lsp_server::ls_types::DiagnosticSeverity::INFORMATION] diagnostic on the
blocked dependency’s line so the block never degrades silently. Read moreAuto Trait Implementations§
impl Freeze for ParseResult
impl RefUnwindSafe for ParseResult
impl Send for ParseResult
impl Sync for ParseResult
impl Unpin for ParseResult
impl UnsafeUnpin for ParseResult
impl UnwindSafe for ParseResult
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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