Enum ink_lang_ir::ImplItem[][src]

pub enum ImplItem {
    Constructor(Constructor),
    Message(Message),
    Other(ImplItem),
}

An item within an ink! implementation block.

Can be either

Note

Based on syn::ImplItem with special variants for ink! impl items.

Variants

Constructor(Constructor)

A #[ink(constructor)] marked inherent function.

Message(Message)

A #[ink(message)] marked method.

Other(ImplItem)

Any other implementation block item.

Implementations

impl ImplItem[src]

pub fn is_message(&self) -> bool[src]

Returns true if the impl block item is an ink! message.

pub fn filter_map_message(&self) -> Option<&Message>[src]

Returns Some if self is an ink! message.

Otherwise, returns None.

pub fn is_constructor(&self) -> bool[src]

Returns true if the impl block item is an ink! message.

pub fn filter_map_constructor(&self) -> Option<&Constructor>[src]

Returns Some if self is an ink! constructor.

Otherwise, returns None.

pub fn is_other_item(&self) -> bool[src]

Returns true if the impl block item is a non ink! specific item.

pub fn filter_map_other_item(&self) -> Option<&ImplItem>[src]

Returns Some if self is a not an ink! specific item.

Otherwise, returns None.

Trait Implementations

impl Debug for ImplItem[src]

impl Eq for ImplItem[src]

impl PartialEq<ImplItem> for ImplItem[src]

impl StructuralEq for ImplItem[src]

impl StructuralPartialEq for ImplItem[src]

impl ToTokens for ImplItem[src]

fn to_tokens(&self, tokens: &mut TokenStream)[src]

We mainly implement this trait for this ink! type to have a derived Spanned implementation for it.

impl TryFrom<ImplItem> for ImplItem[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for ImplItem

impl !Send for ImplItem

impl !Sync for ImplItem

impl Unpin for ImplItem

impl UnwindSafe for ImplItem

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.