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 moresourceimpl 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 moresourceimpl 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) -> Rwhere
F: FnOnce(&[u8]) -> R,
fn using_encoded<R, F>(&self, f: F) -> Rwhere
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 · sourceconst fn max(self, other: Self) -> Self
const fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourceconst fn min(self, other: Self) -> Self
const fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
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>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const 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 moreimpl 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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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