pub struct PackagePath<'a> {
pub span: SourceSpan,
pub string: &'a str,
pub name: &'a str,
pub segments: &'a str,
pub version: Option<Version>,
}
Expand description
AST representation of a path to an item such as a world in a package (e.g. foo:bar/qux
).
Fields§
§span: SourceSpan
The span of the package path.
string: &'a str
The entire path string.
name: &'a str
The name of the package.
segments: &'a str
The path segments.
version: Option<Version>
The optional version of the package.
Implementations§
Source§impl<'a> PackagePath<'a>
impl<'a> PackagePath<'a>
Sourcepub fn package_name_span(&self) -> SourceSpan
pub fn package_name_span(&self) -> SourceSpan
Gets the span of only the package name.
Sourcepub fn segment_spans<'b>(
&'b self,
) -> impl Iterator<Item = (&'a str, SourceSpan)> + 'b
pub fn segment_spans<'b>( &'b self, ) -> impl Iterator<Item = (&'a str, SourceSpan)> + 'b
Iterates over the segments of the package path.
Trait Implementations§
Source§impl<'a> Clone for PackagePath<'a>
impl<'a> Clone for PackagePath<'a>
Source§fn clone(&self) -> PackagePath<'a>
fn clone(&self) -> PackagePath<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for PackagePath<'a>
impl<'a> Debug for PackagePath<'a>
Auto Trait Implementations§
impl<'a> Freeze for PackagePath<'a>
impl<'a> RefUnwindSafe for PackagePath<'a>
impl<'a> Send for PackagePath<'a>
impl<'a> Sync for PackagePath<'a>
impl<'a> Unpin for PackagePath<'a>
impl<'a> UnwindSafe for PackagePath<'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
Mutably borrows from an owned value. Read more