[][src]Struct ink_lang_ir::ItemImpl

pub struct ItemImpl { /* fields omitted */ }

An ink! implementation block.

Note

  • This can be either an inherent implementation block that implements some constructors, messages or internal functions for the storage struct; OR it can be a trait implementation for the storage struct.
  • We try to support all fields that are supported by the underlying syn implementation for syn::ItemImpl even though they are not really required to represent ink!. This is done for consistency with syn.

Implementations

impl ItemImpl[src]

pub fn attrs(&self) -> &[Attribute][src]

Returns all non-ink! specific attributes of the implementation block.

pub fn self_type(&self) -> &Type[src]

Returns the Self type of the implementation block.

pub fn trait_path(&self) -> Option<&Path>[src]

Returns the trait type path if this is a trait implementation block.

Returns None if this is an inherent implementation block.

pub fn trait_ident(&self) -> Option<&Ident>[src]

Returns the trait identifier if this is a trait implementation block.

Returns None if this is an inherent implementation block.

pub fn namespace(&self) -> Option<&Namespace>[src]

Returns the namespace of the implementation block if any has been provided.

pub fn iter_messages(&self) -> IterMessages<'_>

Notable traits for IterMessages<'a>

impl<'a> Iterator for IterMessages<'a> type Item = CallableWithSelector<'a, Message>;
[src]

Returns an iterator yielding the ink! messages of the implementation block.

pub fn iter_constructors(&self) -> IterConstructors<'_>

Notable traits for IterConstructors<'a>

impl<'a> Iterator for IterConstructors<'a> type Item = CallableWithSelector<'a, Constructor>;
[src]

Returns an iterator yielding the ink! messages of the implementation block.

pub fn items(&self) -> &[ImplItem][src]

Returns a slice over the shared references of the items of the impl.

Trait Implementations

impl Debug for ItemImpl[src]

impl Eq for ItemImpl[src]

impl From<ItemImpl> for InkItem[src]

impl PartialEq<ItemImpl> for ItemImpl[src]

impl StructuralEq for ItemImpl[src]

impl StructuralPartialEq for ItemImpl[src]

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

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for ItemImpl

impl !Send for ItemImpl

impl !Sync for ItemImpl

impl Unpin for ItemImpl

impl UnwindSafe for ItemImpl

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.