[−][src]Struct ink_storage::Memory
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]
T: SpreadLayout,
impl<T> AsRef<T> for Memory<T> where
T: SpreadLayout,
[src]
T: SpreadLayout,
impl<T> Borrow<T> for Memory<T> where
T: SpreadLayout,
[src]
T: SpreadLayout,
impl<T> BorrowMut<T> for Memory<T> where
T: SpreadLayout,
[src]
T: SpreadLayout,
fn borrow_mut(&mut self) -> &mut T
[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]
T: Default,
impl<T> Deref for Memory<T>
[src]
impl<T> DerefMut for Memory<T>
[src]
impl<T> Display for Memory<T> where
T: Display,
[src]
T: Display,
impl<T: Eq> Eq for Memory<T>
[src]
impl<T> From<T> for Memory<T>
[src]
impl<T: Hash> Hash for Memory<T>
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<T: Ord> Ord for Memory<T>
[src]
fn cmp(&self, other: &Memory<T>) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<T: PartialEq> PartialEq<Memory<T>> for Memory<T>
[src]
impl<T: PartialOrd> PartialOrd<Memory<T>> for Memory<T>
[src]
fn partial_cmp(&self, other: &Memory<T>) -> Option<Ordering>
[src]
fn lt(&self, other: &Memory<T>) -> bool
[src]
fn le(&self, other: &Memory<T>) -> bool
[src]
fn gt(&self, other: &Memory<T>) -> bool
[src]
fn ge(&self, other: &Memory<T>) -> bool
[src]
impl<T> SpreadLayout for Memory<T> where
T: Default,
[src]
T: Default,
const FOOTPRINT: u64
[src]
fn pull_spread(_ptr: &mut KeyPtr) -> Self
[src]
fn push_spread(&self, _ptr: &mut KeyPtr)
[src]
fn clear_spread(&self, _ptr: &mut KeyPtr)
[src]
const REQUIRES_DEEP_CLEAN_UP: bool
[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,
T: RefUnwindSafe,
impl<T> Send for Memory<T> where
T: Send,
T: Send,
impl<T> Sync for Memory<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Memory<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Memory<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[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]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,