Struct ink_lang_ir::Storage[][src]

pub struct Storage { /* fields omitted */ }

An ink! storage struct definition.

Noticed by ink! through the #[ink(storage)] annotation.

Note

An ink! smart contract must have exactly one storage definition. The storage definition must be found in the root of the ink! module.

Example

#[ink(storage)]
pub struct MyStorage {
    my_value: bool,
     counter: u32,
}

Implementations

impl Storage[src]

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

Returns the non-ink! attributes of the ink! storage struct.

pub fn ident(&self) -> &Ident[src]

Returns the identifier of the storage struct.

pub fn fields(&self) -> Iter<'_, Field>[src]

Returns an iter yielding all fields of the storage struct.

Trait Implementations

impl Debug for Storage[src]

impl Eq for Storage[src]

impl From<Storage> for InkItem[src]

impl PartialEq<Storage> for Storage[src]

impl StructuralEq for Storage[src]

impl StructuralPartialEq for Storage[src]

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

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl RefUnwindSafe for Storage

impl !Send for Storage

impl !Sync for Storage

impl Unpin for Storage

impl UnwindSafe for Storage

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.