Struct ink_primitives::Key
source · [−]#[repr(transparent)]pub struct Key(_);
Expand description
A key into the smart contract storage.
Note
- The storage of an ink! smart contract can be viewed as a key-value store.
- In order to manipulate its storage an ink! smart contract is required to indicate the respective cells using this primitive type.
- The
Key
type can be compared to a raw pointer and also allows operations similar to pointer arithmetic. - Users usually should not have to deal with this low-level primitive themselves
and instead use the more high-level primitives provided by the
ink_storage
crate.
Implementations
Trait Implementations
sourceimpl AddAssign<&u64> for Key
impl AddAssign<&u64> for Key
sourcefn add_assign(&mut self, rhs: &u64)
fn add_assign(&mut self, rhs: &u64)
Performs the +=
operation. Read more
sourceimpl AddAssign<u64> for Key
impl AddAssign<u64> for Key
sourcefn add_assign(&mut self, rhs: u64)
fn add_assign(&mut self, rhs: u64)
Performs the +=
operation. Read more
sourceimpl Decode for Key
impl Decode for Key
sourceimpl Encode for Key
impl Encode for Key
sourcefn size_hint(&self) -> usize
fn size_hint(&self) -> usize
If possible give a hint of expected size of the encoding. Read more
sourcefn encode_to<O>(&self, output: &mut O) where
O: Output + ?Sized,
fn encode_to<O>(&self, output: &mut O) where
O: Output + ?Sized,
Convert self to a slice and append it to the destination.
sourcefn using_encoded<R, F>(&self, f: F) -> R where
F: FnOnce(&[u8]) -> R,
fn using_encoded<R, F>(&self, f: F) -> R where
F: FnOnce(&[u8]) -> R,
Convert self to a slice and then invoke the given closure with it.
sourcefn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Calculates the encoded size. Read more
sourceimpl Ord for Key
impl Ord for Key
1.21.0 · sourcefn max(self, other: Self) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Key> for Key
impl PartialOrd<Key> for Key
sourcefn partial_cmp(&self, other: &Key) -> Option<Ordering>
fn partial_cmp(&self, other: &Key) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for Key
impl EncodeLike<[u8; 32]> for Key
impl Eq for Key
impl StructuralEq for Key
impl StructuralPartialEq for Key
Auto Trait Implementations
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnwindSafe for Key
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more