#[non_exhaustive]pub struct ItemStatic {
pub attributes: Vec<Attribute>,
pub visibility: Visibility,
pub static_token: Static,
pub name: Ident,
pub init: Option<ItemStaticInit>,
/* private fields */
}Expand description
A static declaration.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.attributes: Vec<Attribute>The inner attributes that are applied to the static declaration.
visibility: VisibilityThe visibility of the static.
static_token: StaticThe static keyword.
name: IdentThe name of the static.
init: Option<ItemStaticInit>The initializer, if the static has one.
A static without an initializer has to be assigned before it can be read, either by a script or by the caller through the storage the virtual machine has been configured with.
Implementations§
Source§impl ItemStatic
impl ItemStatic
Sourcepub fn parse_with_meta(
parser: &mut Parser<'_>,
attributes: Vec<Attribute>,
visibility: Visibility,
static_token: Static,
) -> Result<Self, Error>
pub fn parse_with_meta( parser: &mut Parser<'_>, attributes: Vec<Attribute>, visibility: Visibility, static_token: Static, ) -> Result<Self, Error>
Parse #ident and attach the given meta
Trait Implementations§
Source§impl Debug for ItemStatic
impl Debug for ItemStatic
impl Eq for ItemStatic
Source§impl OptionSpanned for ItemStatic
impl OptionSpanned for ItemStatic
Source§fn option_span(&self) -> Option<Span>
fn option_span(&self) -> Option<Span>
Get the optional span of the type.
Source§impl Parse for ItemStatic
impl Parse for ItemStatic
Source§impl PartialEq for ItemStatic
impl PartialEq for ItemStatic
impl StructuralPartialEq for ItemStatic
Source§impl ToTokens for ItemStatic
impl ToTokens for ItemStatic
Source§fn to_tokens(
&self,
context: &mut MacroContext<'_, '_, '_>,
stream: &mut TokenStream,
) -> Result<()>
fn to_tokens( &self, context: &mut MacroContext<'_, '_, '_>, stream: &mut TokenStream, ) -> Result<()>
Turn the current item into tokens.
Auto Trait Implementations§
impl Freeze for ItemStatic
impl RefUnwindSafe for ItemStatic
impl Send for ItemStatic
impl Sync for ItemStatic
impl Unpin for ItemStatic
impl UnsafeUnpin for ItemStatic
impl UnwindSafe for ItemStatic
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.