Struct multiversx_sc::types::ManagedRef
source · pub struct ManagedRef<'a, M, T>where
M: ManagedTypeApi,
T: ManagedType<M>,{ /* private fields */ }Expand description
A very efficient reference to a managed type, with copy semantics.
It copies the handle and knows how to deref back.
Implementations§
source§impl<'a, M, T> ManagedRef<'a, M, T>where
M: ManagedTypeApi,
T: ManagedType<M>,
impl<'a, M, T> ManagedRef<'a, M, T>where M: ManagedTypeApi, T: ManagedType<M>,
source§impl<'a, M, T> ManagedRef<'a, M, T>where
M: ManagedTypeApi,
T: ManagedType<M> + Clone,
impl<'a, M, T> ManagedRef<'a, M, T>where M: ManagedTypeApi, T: ManagedType<M> + Clone,
pub fn clone_value(&self) -> T
Trait Implementations§
source§impl<'a, M, T> Borrow<T> for ManagedRef<'a, M, T>where
M: ManagedTypeApi,
T: ManagedType<M>,
impl<'a, M, T> Borrow<T> for ManagedRef<'a, M, T>where M: ManagedTypeApi, T: ManagedType<M>,
source§impl<'a, M, T> Clone for ManagedRef<'a, M, T>where
M: ManagedTypeApi,
T: ManagedType<M>,
impl<'a, M, T> Clone for ManagedRef<'a, M, T>where M: ManagedTypeApi, T: ManagedType<M>,
source§impl<'a, M, T> Debug for ManagedRef<'a, M, T>where
M: ManagedTypeApi,
T: ManagedType<M> + Debug,
impl<'a, M, T> Debug for ManagedRef<'a, M, T>where M: ManagedTypeApi, T: ManagedType<M> + Debug,
source§impl<'a, M, T> Deref for ManagedRef<'a, M, T>where
M: ManagedTypeApi,
T: ManagedType<M>,
impl<'a, M, T> Deref for ManagedRef<'a, M, T>where M: ManagedTypeApi, T: ManagedType<M>,
source§impl<'a, M, T> From<&'a T> for ManagedRef<'a, M, T>where
M: ManagedTypeApi,
T: ManagedType<M>,
impl<'a, M, T> From<&'a T> for ManagedRef<'a, M, T>where M: ManagedTypeApi, T: ManagedType<M>,
source§impl<'a, M, T> NestedEncode for ManagedRef<'a, M, T>where
M: ManagedTypeApi,
T: ManagedType<M> + NestedEncode,
impl<'a, M, T> NestedEncode for ManagedRef<'a, M, T>where M: ManagedTypeApi, T: ManagedType<M> + NestedEncode,
source§fn dep_encode_or_handle_err<O, H>(
&self,
dest: &mut O,
h: H
) -> Result<(), H::HandledErr>where
O: NestedEncodeOutput,
H: EncodeErrorHandler,
fn dep_encode_or_handle_err<O, H>( &self, dest: &mut O, h: H ) -> Result<(), H::HandledErr>where O: NestedEncodeOutput, H: EncodeErrorHandler,
Version of
dep_encode that can handle errors as soon as they occur.
For instance in can exit immediately and make sure that if it returns, it is a success.
By not deferring error handling, this can lead to somewhat smaller bytecode.source§fn dep_encode<O>(&self, dest: &mut O) -> Result<(), EncodeError>where
O: NestedEncodeOutput,
fn dep_encode<O>(&self, dest: &mut O) -> Result<(), EncodeError>where O: NestedEncodeOutput,
NestedEncode to output, using the format of an object nested inside another structure.
Does not provide compact version.
source§impl<'a, M, T> PartialEq<ManagedRef<'a, M, T>> for ManagedRef<'a, M, T>where
M: ManagedTypeApi,
T: ManagedType<M> + PartialEq,
impl<'a, M, T> PartialEq<ManagedRef<'a, M, T>> for ManagedRef<'a, M, T>where M: ManagedTypeApi, T: ManagedType<M> + PartialEq,
source§impl<'a, M, T> TopEncode for ManagedRef<'a, M, T>where
M: ManagedTypeApi,
T: ManagedType<M> + TopEncode,
impl<'a, M, T> TopEncode for ManagedRef<'a, M, T>where M: ManagedTypeApi, T: ManagedType<M> + TopEncode,
source§fn top_encode_or_handle_err<O, H>(
&self,
output: O,
h: H
) -> Result<(), H::HandledErr>where
O: TopEncodeOutput,
H: EncodeErrorHandler,
fn top_encode_or_handle_err<O, H>( &self, output: O, h: H ) -> Result<(), H::HandledErr>where O: TopEncodeOutput, H: EncodeErrorHandler,
Version of
top_encode that can handle errors as soon as they occur.
For instance in can exit immediately and make sure that if it returns, it is a success.
By not deferring error handling, this can lead to somewhat smaller bytecode.source§fn top_encode<O>(&self, output: O) -> Result<(), EncodeError>where
O: TopEncodeOutput,
fn top_encode<O>(&self, output: O) -> Result<(), EncodeError>where O: TopEncodeOutput,
Attempt to serialize the value to ouput.
impl<'a, M, T> Eq for ManagedRef<'a, M, T>where M: ManagedTypeApi, T: ManagedType<M> + PartialEq,
Auto Trait Implementations§
impl<'a, M, T> CodecFromSelf for ManagedRef<'a, M, T>where M: CodecFromSelf, T: CodecFromSelf, <T as ManagedType<M>>::OwnHandle: CodecFromSelf,
impl<'a, M, T> RefUnwindSafe for ManagedRef<'a, M, T>where M: RefUnwindSafe, T: RefUnwindSafe, <T as ManagedType<M>>::OwnHandle: RefUnwindSafe,
impl<'a, M, T> Send for ManagedRef<'a, M, T>where M: Send, T: Sync, <T as ManagedType<M>>::OwnHandle: Send,
impl<'a, M, T> Sync for ManagedRef<'a, M, T>where M: Sync, T: Sync, <T as ManagedType<M>>::OwnHandle: Sync,
impl<'a, M, T> Unpin for ManagedRef<'a, M, T>where M: Unpin, <T as ManagedType<M>>::OwnHandle: Unpin,
impl<'a, M, T> UnwindSafe for ManagedRef<'a, M, T>where M: UnwindSafe, T: RefUnwindSafe, <T as ManagedType<M>>::OwnHandle: UnwindSafe,
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
source§impl<T> SCCodec for Twhere
T: TopEncode,
impl<T> SCCodec for Twhere T: TopEncode,
fn fmt<F>(&self, f: &mut F)where F: FormatByteReceiver,
source§impl<T> TopEncodeMulti for Twhere
T: TopEncode,
impl<T> TopEncodeMulti for Twhere T: TopEncode,
source§fn multi_encode_or_handle_err<O, H>(
&self,
output: &mut O,
h: H
) -> Result<(), <H as EncodeErrorHandler>::HandledErr>where
O: TopEncodeMultiOutput,
H: EncodeErrorHandler,
fn multi_encode_or_handle_err<O, H>( &self, output: &mut O, h: H ) -> Result<(), <H as EncodeErrorHandler>::HandledErr>where O: TopEncodeMultiOutput, H: EncodeErrorHandler,
Version of
top_encode that can handle errors as soon as they occur.
For instance in can exit immediately and make sure that if it returns, it is a success.
By not deferring error handling, this can lead to somewhat smaller bytecode.source§fn multi_encode<O>(&self, output: &mut O) -> Result<(), EncodeError>where
O: TopEncodeMultiOutput,
fn multi_encode<O>(&self, output: &mut O) -> Result<(), EncodeError>where O: TopEncodeMultiOutput,
Attempt to serialize the value to ouput.