Struct rune::ast::ItemUse [−][src]
pub struct ItemUse { pub attributes: Vec<Attribute>, pub visibility: Visibility, pub use_token: Use, pub path: ItemUsePath, }
Expand description
A use item.
Examples
use rune::{testing, ast}; testing::roundtrip::<ast::ItemUse>("use foo"); testing::roundtrip::<ast::ItemUse>("use foo::bar"); testing::roundtrip::<ast::ItemUse>("use foo::bar::baz"); testing::roundtrip::<ast::ItemUse>("#[macro_use] use foo::bar::baz"); testing::roundtrip::<ast::ItemUse>("#[macro_use] pub(crate) use foo::bar::baz");
Fields
attributes: Vec<Attribute>
The attributes on use item
visibility: Visibility
The visibility of the use
item
use_token: Use
The use token.
path: ItemUsePath
Item path.
Implementations
pub fn parse_with_meta(
parser: &mut Parser<'_>,
attributes: Vec<Attribute>,
visibility: Visibility
) -> Result<Self, ParseError>
pub fn parse_with_meta(
parser: &mut Parser<'_>,
attributes: Vec<Attribute>,
visibility: Visibility
) -> Result<Self, ParseError>
Parse #ident and attach the given meta
Trait Implementations
Parse the current item from the parser.
Turn the current item into tokens.
Auto Trait Implementations
impl RefUnwindSafe for ItemUse
impl UnwindSafe for ItemUse
Blanket Implementations
Mutably borrows from an owned value. Read more