[−][src]Struct rune::ast::ItemConst
A const declaration.
Examples
use rune::{testing, ast}; testing::roundtrip::<ast::ItemConst>("const value = #{}");
Fields
id: Option<Id>
Opaque identifier for the constant.
attributes: Vec<Attribute>
The inner attributes that are applied to the const declaration.
visibility: Visibility
The visibility of the const.
const_token: Const
The const
keyword.
name: Ident
The name of the constant.
eq: Eq
The equals token.
expr: Expr
The optional body of the module declaration.
Implementations
impl ItemConst
[src]
pub fn parse_with_meta(
parser: &mut Parser<'_>,
attributes: Vec<Attribute>,
visibility: Visibility,
const_token: Const
) -> Result<Self, ParseError>
[src]
parser: &mut Parser<'_>,
attributes: Vec<Attribute>,
visibility: Visibility,
const_token: Const
) -> Result<Self, ParseError>
Parse #ident and attach the given meta
impl ItemConst
[src]
pub fn descriptive_span(&self) -> Span
[src]
Get the descriptive span of this item, e.g. const ITEM
instead of the
span for the whole expression.
Trait Implementations
impl Clone for ItemConst
[src]
impl Debug for ItemConst
[src]
impl Eq for ItemConst
[src]
impl Parse for ItemConst
[src]
pub fn parse(p: &mut Parser<'_>) -> Result<Self, ParseError>
[src]
impl PartialEq<ItemConst> for ItemConst
[src]
impl Spanned for ItemConst
[src]
impl StructuralEq for ItemConst
[src]
impl StructuralPartialEq for ItemConst
[src]
impl ToTokens for ItemConst
[src]
pub fn to_tokens(&self, context: &MacroContext, stream: &mut TokenStream)
[src]
Auto Trait Implementations
impl RefUnwindSafe for ItemConst
[src]
impl Send for ItemConst
[src]
impl Sync for ItemConst
[src]
impl Unpin for ItemConst
[src]
impl UnwindSafe for ItemConst
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,