Struct rune::ast::Path [−][src]
pub struct Path { pub id: Option<Id>, pub global: Option<ColonColon>, pub first: PathSegment, pub rest: Vec<(ColonColon, PathSegment)>, pub trailing: Option<ColonColon>, }
Expand description
A path, where each element is separated by a ::
.
Examples
use rune::{testing, ast}; testing::roundtrip::<ast::Path>("foo::bar"); testing::roundtrip::<ast::Path>("Self::bar"); testing::roundtrip::<ast::Path>("self::bar"); testing::roundtrip::<ast::Path>("crate::bar"); testing::roundtrip::<ast::Path>("super::bar"); testing::roundtrip::<ast::Path>("HashMap::<Foo, Bar>"); testing::roundtrip::<ast::Path>("super::HashMap::<Foo, Bar>");
Fields
id: Option<Id>
Opaque id associated with path.
global: Option<ColonColon>
The optional leading colon ::
indicating global scope.
first: PathSegment
The first component in the path.
rest: Vec<(ColonColon, PathSegment)>
The rest of the components in the path.
trailing: Option<ColonColon>
Trailing scope.
Implementations
Borrow as an identifier used for field access calls.
This is only allowed if there are no other path components
and the path segment is not Crate
or Super
.
Borrow as an identifier used for field access calls.
This is only allowed if there are no other path components
and the path segment is not Crate
or Super
.
Iterate over all components in path.
Trait Implementations
Parse the current item from the parser.
Resolve implementation for path which “stringifies” it.
fn resolve_owned(
&self,
storage: &Storage,
source: &Source
) -> Result<Self::Owned, ResolveError>
fn resolve_owned(
&self,
storage: &Storage,
source: &Source
) -> Result<Self::Owned, ResolveError>
Resolve into an owned value.
Turn the current item into tokens.
Auto Trait Implementations
impl RefUnwindSafe for Path
impl UnwindSafe for Path
Blanket Implementations
Mutably borrows from an owned value. Read more