pub enum InkItem {
Storage(Storage),
Event(Event),
ImplBlock(ItemImpl),
}
Expand description
An ink! specific item.
Variants§
Storage(Storage)
The ink! storage struct definition.
Event(Event)
An ink! event definition.
ImplBlock(ItemImpl)
An ink! implementation block.
Implementations§
source§impl InkItem
impl InkItem
sourcepub fn filter_map_storage_item(&self) -> Option<&Storage>
pub fn filter_map_storage_item(&self) -> Option<&Storage>
Returns Some
if self
is the ink! storage struct definition.
Otherwise, returns None
.
sourcepub fn is_storage_item(&self) -> bool
pub fn is_storage_item(&self) -> bool
Returns true
if the ink! specific item is the storage struct definition.
sourcepub fn filter_map_event_item(&self) -> Option<&Event>
pub fn filter_map_event_item(&self) -> Option<&Event>
Returns Some
if self
is an ink! event struct definition.
Otherwise, returns None
.
sourcepub fn is_event_item(&self) -> bool
pub fn is_event_item(&self) -> bool
Returns true
if the ink! specific item is an event struct definition.
sourcepub fn filter_map_impl_block(&self) -> Option<&ItemImpl>
pub fn filter_map_impl_block(&self) -> Option<&ItemImpl>
Returns Some
if self
is an ink! implementation block.
Otherwise, returns None
.
sourcepub fn is_impl_block(&self) -> bool
pub fn is_impl_block(&self) -> bool
Returns true
if the ink! specific item is an implementation block.
Trait Implementations§
source§impl PartialEq<InkItem> for InkItem
impl PartialEq<InkItem> for InkItem
source§impl ToTokens for InkItem
impl ToTokens for InkItem
source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
We mainly implement this trait for this ink! type to have a derived
Spanned
implementation for it.
source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
impl Eq for InkItem
impl StructuralEq for InkItem
impl StructuralPartialEq for InkItem
Auto Trait Implementations§
impl RefUnwindSafe for InkItem
impl !Send for InkItem
impl !Sync for InkItem
impl Unpin for InkItem
impl UnwindSafe for InkItem
Blanket Implementations§
source§impl<T> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere
T: Spanned + ?Sized,
source§fn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span
covering the complete contents of this syntax tree
node, or Span::call_site()
if this node is empty.