multiversx_sc_snippets::imports

Trait ManagedType

source
pub trait ManagedType<M>: Sized
where M: ManagedTypeApi,
{ type OwnHandle: HandleConstraints; // Required methods fn get_handle(&self) -> Self::OwnHandle; fn transmute_from_handle_ref(handle_ref: &Self::OwnHandle) -> &Self; // Provided methods fn get_raw_handle(&self) -> i32 { ... } fn as_ref(&self) -> ManagedRef<'_, M, Self> { ... } }
Expand description

Commonalities between all managed types.

Required Associated Types§

Required Methods§

source

fn get_handle(&self) -> Self::OwnHandle

source

fn transmute_from_handle_ref(handle_ref: &Self::OwnHandle) -> &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.

Provided Methods§

source

fn get_raw_handle(&self) -> i32

source

fn as_ref(&self) -> ManagedRef<'_, M, Self>

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<A> ManagedType<A> for StorageKey<A>
where A: ManagedTypeApi + ErrorApi + 'static,

source§

impl<M> ManagedType<M> for BigFloat<M>
where M: ManagedTypeApi,

source§

impl<M> ManagedType<M> for BigInt<M>
where M: ManagedTypeApi,

source§

impl<M> ManagedType<M> for BigUint<M>
where M: ManagedTypeApi,

source§

impl<M> ManagedType<M> for EllipticCurve<M>
where M: ManagedTypeApi,

source§

impl<M> ManagedType<M> for ManagedAddress<M>
where M: ManagedTypeApi,

source§

impl<M> ManagedType<M> for ManagedArgBuffer<M>
where M: ManagedTypeApi + 'static,

source§

impl<M> ManagedType<M> for ManagedBuffer<M>
where M: ManagedTypeApi,

source§

impl<M> ManagedType<M> for ManagedMap<M>
where M: ManagedTypeApi,

source§

impl<M> ManagedType<M> for TokenIdentifier<M>
where M: ManagedTypeApi,

source§

impl<M, T> ManagedType<M> for ManagedVec<M, T>

source§

impl<M, T> ManagedType<M> for MultiValueManagedVec<M, T>

source§

impl<M, const N: usize> ManagedType<M> for ManagedByteArray<M, N>
where M: ManagedTypeApi,