Enum ink_lang_ir::Item[][src]

pub enum Item {
    Ink(InkItem),
    Rust(Item),
}

An item in the root of the ink! module (ir::ItemMod).

This is either an ink! specific item or a normal Rust item.

Variants

Ink(InkItem)

The item is an ink! specific item.

Rust(Item)

The item is a normal Rust item.

Implementations

impl Item[src]

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

Returns true if self is an ink! specific item.

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

Returns true if self is an normal Rust item.

pub fn map_ink_item(&self) -> Option<&InkItem>[src]

Returns Some if self is an ink! specific item.

Otherwise, returns None.

pub fn map_rust_item(&self) -> Option<&Item>[src]

Returns Some if self is an ink! specific item.

Otherwise, returns None.

Trait Implementations

impl Debug for Item[src]

impl Eq for Item[src]

impl PartialEq<Item> for Item[src]

impl StructuralEq for Item[src]

impl StructuralPartialEq for Item[src]

impl ToTokens for Item[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<Item> for Item[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Item

impl !Send for Item

impl !Sync for Item

impl Unpin for Item

impl UnwindSafe for Item

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.