pub struct ModulePath {
pub segments: NonEmpty<Ident>,
pub span: Span,
}Expand description
A dot-separated module path: nasa.rocket.dynamics.
Always absolute from a package root. The first segment is the package name
(real or virtual); subsequent segments walk the package’s module tree
(directories under source_dir, files inside the package, and inline dag
declarations). There are no file-path strings, no .. parent navigation,
and no / separators in the source language — only ..
Fields§
§segments: NonEmpty<Ident>§span: SpanImplementations§
Source§impl ModulePath
impl ModulePath
pub const fn span(&self) -> Span
Sourcepub const fn is_empty(&self) -> bool
pub const fn is_empty(&self) -> bool
Returns false; provided for API compatibility with sequence-like code.
Sourcepub fn display_path(&self) -> String
pub fn display_path(&self) -> String
Human-readable path string for diagnostics: "nasa.rocket.dynamics".
Sourcepub fn split_last(&self) -> (&[Ident], &Ident)
pub fn split_last(&self) -> (&[Ident], &Ident)
Split the path into qualifier segments and the leaf segment.
The qualifier slice is empty for one-segment paths.
Sourcepub fn qualifier_segments(&self) -> &[Ident]
pub fn qualifier_segments(&self) -> &[Ident]
Returns the qualifier segments before the leaf. Empty for bare paths.
Sourcepub fn qualifier_and_leaf(&self) -> Option<(&[Ident], &Ident)>
pub fn qualifier_and_leaf(&self) -> Option<(&[Ident], &Ident)>
Returns qualifier segments and leaf only when this path is qualified.
Trait Implementations§
Source§impl Clone for ModulePath
impl Clone for ModulePath
Source§fn clone(&self) -> ModulePath
fn clone(&self) -> ModulePath
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 ModulePath
impl Debug for ModulePath
Source§impl FormatEquivalent for ModulePath
impl FormatEquivalent for ModulePath
Source§fn format_equivalent(&self, other: &Self) -> bool
fn format_equivalent(&self, other: &Self) -> bool
true if self and other are equivalent up to formatting.