[][src]Struct ink_storage::Memory

pub struct Memory<T> { /* fields omitted */ }

An instance that is solely stored within the contract's memory.

This will never be stored to or loaded from contract storage.

Note

Use instances of this type in order to have some shared state between contract messages and functions. Its usage is comparable to the Solidity's memory instances. Pulling an instance of this type from the contract storage will always yield a default constructed value.

Implementations

impl<T> Memory<T>[src]

pub fn new(inner: T) -> Self[src]

Creates a new memory instance.

pub fn get(memory: &Self) -> &T[src]

Returns a shared reference to the inner T.

pub fn get_mut(memory: &mut Self) -> &mut T[src]

Returns an exclusive reference to the inner T.

Trait Implementations

impl<T> AsMut<T> for Memory<T> where
    T: SpreadLayout
[src]

impl<T> AsRef<T> for Memory<T> where
    T: SpreadLayout
[src]

impl<T> Borrow<T> for Memory<T> where
    T: SpreadLayout
[src]

impl<T> BorrowMut<T> for Memory<T> where
    T: SpreadLayout
[src]

impl<T: Clone> Clone for Memory<T>[src]

impl<T: Copy> Copy for Memory<T>[src]

impl<T: Debug> Debug for Memory<T>[src]

impl<T> Default for Memory<T> where
    T: Default
[src]

impl<T> Deref for Memory<T>[src]

type Target = T

The resulting type after dereferencing.

impl<T> DerefMut for Memory<T>[src]

impl<T> Display for Memory<T> where
    T: Display
[src]

impl<T: Eq> Eq for Memory<T>[src]

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

impl<T: Hash> Hash for Memory<T>[src]

impl<T: Ord> Ord for Memory<T>[src]

impl<T: PartialEq> PartialEq<Memory<T>> for Memory<T>[src]

impl<T: PartialOrd> PartialOrd<Memory<T>> for Memory<T>[src]

impl<T> SpreadLayout for Memory<T> where
    T: Default
[src]

impl<T> StorageLayout for Memory<T>[src]

impl<T> StructuralEq for Memory<T>[src]

impl<T> StructuralPartialEq for Memory<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Memory<T> where
    T: RefUnwindSafe

impl<T> Send for Memory<T> where
    T: Send

impl<T> Sync for Memory<T> where
    T: Sync

impl<T> Unpin for Memory<T> where
    T: Unpin

impl<T> UnwindSafe for Memory<T> where
    T: UnwindSafe

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<!> for T[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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,