Struct multiversx_sc::storage::storage_key::StorageKey
source · pub struct StorageKey<A>where
A: ManagedTypeApi + ErrorApi + 'static,{ /* private fields */ }
Implementations§
source§impl<A> StorageKey<A>where
A: ManagedTypeApi + ErrorApi + 'static,
impl<A> StorageKey<A>where
A: ManagedTypeApi + ErrorApi + 'static,
pub fn new(base_key: &[u8]) -> Self
pub fn append_bytes(&mut self, bytes: &[u8])
pub fn append_managed_buffer(&mut self, buffer: &ManagedBuffer<A>)
pub fn append_item<T>(&mut self, item: &T)where
T: NestedEncode,
pub fn to_boxed_bytes(&self) -> BoxedBytes
Trait Implementations§
source§impl<M: ManagedTypeApi> Clone for StorageKey<M>
impl<M: ManagedTypeApi> Clone for StorageKey<M>
source§impl<M: ManagedTypeApi> From<&str> for StorageKey<M>
impl<M: ManagedTypeApi> From<&str> for StorageKey<M>
source§impl<M: ManagedTypeApi> From<ManagedBuffer<M>> for StorageKey<M>
impl<M: ManagedTypeApi> From<ManagedBuffer<M>> for StorageKey<M>
source§fn from(buffer: ManagedBuffer<M>) -> Self
fn from(buffer: ManagedBuffer<M>) -> Self
Converts to this type from the input type.
source§impl<M, const N: usize> From<ManagedByteArray<M, N>> for StorageKey<M>where
M: ManagedTypeApi + ErrorApi,
impl<M, const N: usize> From<ManagedByteArray<M, N>> for StorageKey<M>where
M: ManagedTypeApi + ErrorApi,
source§fn from(mba: ManagedByteArray<M, N>) -> Self
fn from(mba: ManagedByteArray<M, N>) -> Self
Converts to this type from the input type.
source§impl<A> ManagedType<A> for StorageKey<A>where
A: ManagedTypeApi + ErrorApi + 'static,
impl<A> ManagedType<A> for StorageKey<A>where
A: ManagedTypeApi + ErrorApi + 'static,
type OwnHandle = <A as HandleTypeInfo>::ManagedBufferHandle
fn get_handle(&self) -> A::ManagedBufferHandle
source§fn transmute_from_handle_ref(handle_ref: &A::ManagedBufferHandle) -> &Self
fn transmute_from_handle_ref(handle_ref: &A::ManagedBufferHandle) -> &Self
Implement carefully, since the underlying transmutation is an unsafe operation.
For types that wrap a handle to some VM-managed data,
make sure the type only contains the handle (plus ZSTs if necessary).
For types that just wrap another managed type it is easier, call for the wrapped object.
fn get_raw_handle(&self) -> RawHandle
fn as_ref(&self) -> ManagedRef<'_, M, Self>
Auto Trait Implementations§
impl<A> CodecFromSelf for StorageKey<A>
impl<A> RefUnwindSafe for StorageKey<A>
impl<A> Send for StorageKey<A>
impl<A> Sync for StorageKey<A>
impl<A> Unpin for StorageKey<A>
impl<A> UnwindSafe for StorageKey<A>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more