Struct wgsl_parser::decl::import::ImportPathDecl
source · pub struct ImportPathDecl {
pub keyword: Token,
pub path: ImportPath,
}Expand description
Represents a #define_import_path statement like the ones supported by
naga_oil:
#define_import_path my::shader::module
Fields§
§keyword: Token§path: ImportPathImplementations§
source§impl ImportPathDecl
impl ImportPathDecl
sourcepub fn qualified_path(&self) -> Arc<[Token]>
pub fn qualified_path(&self) -> Arc<[Token]>
Returns the fully-qualified path defined by this declaration as an array of tokens.
I.e., for the following import path declaration:
#define_import_path foo::bar::baz
This function will return the tokens [foo, bar, baz].
sourcepub fn qualified_name(&self) -> Token
pub fn qualified_name(&self) -> Token
Returns an ad-hoc Token::Path that represents a combination of the
tokens that make up the path defined by this declaration.
I.e., for the following import path declaration:
#define_import_path foo::bar::baz
This function will return a Token::Path("foo::bar::baz", (1:21..1:34)).
The token returned by this function is created by this function by
“joining” the tokens actually contained in the ImportPath into a
single token. This is in contrast to qualified_path,
which returns the actual sequence of tokens contained in the ImportPath.
Trait Implementations§
source§impl Clone for ImportPathDecl
impl Clone for ImportPathDecl
source§fn clone(&self) -> ImportPathDecl
fn clone(&self) -> ImportPathDecl
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for ImportPathDecl
impl Debug for ImportPathDecl
source§impl DebugLisp for ImportPathDecl
impl DebugLisp for ImportPathDecl
source§impl Parse for ImportPathDecl
impl Parse for ImportPathDecl
Auto Trait Implementations§
impl Freeze for ImportPathDecl
impl RefUnwindSafe for ImportPathDecl
impl Send for ImportPathDecl
impl Sync for ImportPathDecl
impl Unpin for ImportPathDecl
impl UnwindSafe for ImportPathDecl
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> 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