pub struct ImportDecl {
pub matching_source: Fragment,
pub imported_item: Path,
pub imported_as: Option<Identifier>,
}Available on crate feature
ast-models only.Expand description
A use item::from::elsewhere [as name]; declaration in a wright source file.
Fields§
§matching_source: FragmentThe full matching source of the declaration, whitespace and all.
imported_item: PathThe item being imported.
imported_as: Option<Identifier>The name it’s imported as (usually None).
Implementations§
Source§impl ImportDecl
impl ImportDecl
Sourcepub fn parse(parser: &mut Parser) -> Result<Self, ParserError>
Available on crate feature parser only.
pub fn parse(parser: &mut Parser) -> Result<Self, ParserError>
parser only.Parse an import declaration.
This will advance the parser if use is seen – if a valid formed import does not follow,
the parser may be left in the middle of a malformed declaration.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ImportDecl
impl RefUnwindSafe for ImportDecl
impl Send for ImportDecl
impl Sync for ImportDecl
impl Unpin for ImportDecl
impl UnwindSafe for ImportDecl
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
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>
Converts
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>
Converts
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