pub struct ManagedBuffer<M: ManagedTypeApi> { /* private fields */ }
Expand description
A byte buffer managed by an external API.
Implementations§
Source§impl<M: ManagedTypeApi> ManagedBuffer<M>
impl<M: ManagedTypeApi> ManagedBuffer<M>
pub fn new() -> Self
pub fn new_from_bytes(bytes: &[u8]) -> Self
pub fn new_random(nr_bytes: usize) -> Self
Sourcepub unsafe fn new_uninit() -> Self
pub unsafe fn new_uninit() -> Self
Creates a new object, without initializing it.
§Safety
The value needs to be initialized after creation, otherwise the VM will halt the first time the value is attempted to be read.
Sourcepub unsafe fn temp_const_ref(
raw_handle: RawHandle,
) -> ManagedRef<'static, M, ManagedBuffer<M>>
pub unsafe fn temp_const_ref( raw_handle: RawHandle, ) -> ManagedRef<'static, M, ManagedBuffer<M>>
Creates a shared managed reference to a given raw handle.
§Safety
The reference points to a shared value. Make sure the handle is not leaked.
Sourcepub unsafe fn temp_const_ref_mut(
raw_handle: RawHandle,
) -> ManagedRefMut<'static, M, ManagedBuffer<M>>
pub unsafe fn temp_const_ref_mut( raw_handle: RawHandle, ) -> ManagedRefMut<'static, M, ManagedBuffer<M>>
Creates a shared managed reference to a given raw handle.
§Safety
The reference points to a shared value. Make sure the handle is not leaked.
pub fn with_buffer_contents<R, F>(&self, f: F) -> R
pub fn with_buffer_contents_mut<F>(&mut self, f: F)
Source§impl<M: ManagedTypeApi> ManagedBuffer<M>
impl<M: ManagedTypeApi> ManagedBuffer<M>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn to_boxed_bytes(&self) -> BoxedBytes
pub fn to_boxed_bytes(&self) -> BoxedBytes
Method provided for convenience in tests, not to be used in contracts.
Sourcepub fn to_vec(&self) -> Vec<u8> ⓘ
pub fn to_vec(&self) -> Vec<u8> ⓘ
Method provided for convenience in tests, not to be used in contracts.
Sourcepub fn load_slice(
&self,
starting_position: usize,
dest_slice: &mut [u8],
) -> Result<(), InvalidSliceError>
pub fn load_slice( &self, starting_position: usize, dest_slice: &mut [u8], ) -> Result<(), InvalidSliceError>
TODO: investigate the impact of using Result<(), ()>
on the wasm output.
pub fn copy_slice( &self, starting_position: usize, slice_len: usize, ) -> Option<ManagedBuffer<M>>
pub fn load_to_byte_array<'a, const N: usize>( &self, array: &'a mut [u8; N], ) -> &'a [u8] ⓘ
Sourcepub fn for_each_batch<const BATCH_SIZE: usize, F: FnMut(&[u8])>(&self, f: F)
pub fn for_each_batch<const BATCH_SIZE: usize, F: FnMut(&[u8])>(&self, f: F)
Loads all bytes of the managed buffer in batches, then applies given closure on each batch.
pub fn overwrite(&mut self, value: &[u8])
pub fn set_slice( &mut self, starting_position: usize, source_slice: &[u8], ) -> Result<(), InvalidSliceError>
pub fn set_random(&mut self, nr_bytes: usize)
pub fn append(&mut self, other: &ManagedBuffer<M>)
pub fn append_bytes(&mut self, slice: &[u8])
Sourcepub fn append_u32_be(&mut self, item: u32)
pub fn append_u32_be(&mut self, item: u32)
Utility function: helps serialize lengths (or any other value of type usize) easier.
Sourcepub fn concat(self, other: ManagedBuffer<M>) -> Self
pub fn concat(self, other: ManagedBuffer<M>) -> Self
Concatenates 2 managed buffers. Consumes both arguments in the process.
Sourcepub fn parse_as_u64(&self) -> Option<u64>
pub fn parse_as_u64(&self) -> Option<u64>
Convenience method for quickly getting a top-decoded u64 from the managed buffer.
TODO: remove this method once TopDecodeInput is implemented for ManagedBuffer reference.
Sourcepub fn hex_expr(&self) -> ManagedBuffer<M>
pub fn hex_expr(&self) -> ManagedBuffer<M>
Produces a hex expression in another managed buffer, made up of “0x” + the hex representation of the data.
Trait Implementations§
Source§impl<Env> AnnotatedValue<Env, ManagedBuffer<<Env as TxEnv>::Api>> for ()where
Env: TxEnv,
impl<Env> AnnotatedValue<Env, ManagedBuffer<<Env as TxEnv>::Api>> for ()where
Env: TxEnv,
fn annotation(&self, _env: &Env) -> ManagedBuffer<Env::Api>
Source§fn to_value(&self, _env: &Env) -> ManagedBuffer<Env::Api>
fn to_value(&self, _env: &Env) -> ManagedBuffer<Env::Api>
.clone()
in some cases.Source§fn into_value(self, env: &Env) -> T
fn into_value(self, env: &Env) -> T
Source§impl<Env> AnnotatedValue<Env, ManagedBuffer<<Env as TxEnv>::Api>> for ManagedBuffer<Env::Api>where
Env: TxEnv,
impl<Env> AnnotatedValue<Env, ManagedBuffer<<Env as TxEnv>::Api>> for ManagedBuffer<Env::Api>where
Env: TxEnv,
fn annotation(&self, _env: &Env) -> ManagedBuffer<Env::Api>
Source§fn to_value(&self, _env: &Env) -> ManagedBuffer<Env::Api>
fn to_value(&self, _env: &Env) -> ManagedBuffer<Env::Api>
.clone()
in some cases.Source§fn into_value(self, _env: &Env) -> ManagedBuffer<Env::Api>
fn into_value(self, _env: &Env) -> ManagedBuffer<Env::Api>
Source§fn with_value_ref<F, R>(&self, _env: &Env, f: F) -> R
fn with_value_ref<F, R>(&self, _env: &Env, f: F) -> R
Source§impl<M: ManagedTypeApi> Clone for ManagedBuffer<M>
impl<M: ManagedTypeApi> Clone for ManagedBuffer<M>
Source§impl<M: ManagedTypeApi> Debug for ManagedBuffer<M>
impl<M: ManagedTypeApi> Debug for ManagedBuffer<M>
Source§impl<M: ManagedTypeApi> Default for ManagedBuffer<M>
impl<M: ManagedTypeApi> Default for ManagedBuffer<M>
Source§impl<M: ManagedTypeApi> Display for ManagedBuffer<M>
impl<M: ManagedTypeApi> Display for ManagedBuffer<M>
Source§impl<M> From<&[u8]> for ManagedBuffer<M>where
M: ManagedTypeApi,
impl<M> From<&[u8]> for ManagedBuffer<M>where
M: ManagedTypeApi,
Source§impl<M, const N: usize> From<&[u8; N]> for ManagedBuffer<M>where
M: ManagedTypeApi,
Syntactic sugar only.
impl<M, const N: usize> From<&[u8; N]> for ManagedBuffer<M>where
M: ManagedTypeApi,
Syntactic sugar only.
Source§impl<M: ManagedTypeApi> From<&ManagedBuffer<M>> for BigFloat<M>
impl<M: ManagedTypeApi> From<&ManagedBuffer<M>> for BigFloat<M>
Source§fn from(item: &ManagedBuffer<M>) -> Self
fn from(item: &ManagedBuffer<M>) -> Self
Source§impl<M: ManagedTypeApi> From<&ManagedBuffer<M>> for BigInt<M>
impl<M: ManagedTypeApi> From<&ManagedBuffer<M>> for BigInt<M>
Source§fn from(item: &ManagedBuffer<M>) -> Self
fn from(item: &ManagedBuffer<M>) -> Self
Source§impl<M: ManagedTypeApi> From<&ManagedBuffer<M>> for BigUint<M>
impl<M: ManagedTypeApi> From<&ManagedBuffer<M>> for BigUint<M>
Source§fn from(item: &ManagedBuffer<M>) -> Self
fn from(item: &ManagedBuffer<M>) -> Self
Source§impl<M> From<&String> for ManagedBuffer<M>where
M: ManagedTypeApi,
impl<M> From<&String> for ManagedBuffer<M>where
M: ManagedTypeApi,
Source§impl<M> From<&str> for ManagedBuffer<M>where
M: ManagedTypeApi,
impl<M> From<&str> for ManagedBuffer<M>where
M: ManagedTypeApi,
Source§impl<M> From<BoxedBytes> for ManagedBuffer<M>where
M: ManagedTypeApi,
impl<M> From<BoxedBytes> for ManagedBuffer<M>where
M: ManagedTypeApi,
Source§fn from(bytes: BoxedBytes) -> Self
fn from(bytes: BoxedBytes) -> Self
Source§impl<M> From<Empty> for ManagedBuffer<M>where
M: ManagedTypeApi,
impl<M> From<Empty> for ManagedBuffer<M>where
M: ManagedTypeApi,
Source§impl<M: ManagedTypeApi> From<ManagedBuffer<M>> for BigFloat<M>
impl<M: ManagedTypeApi> From<ManagedBuffer<M>> for BigFloat<M>
Source§fn from(item: ManagedBuffer<M>) -> Self
fn from(item: ManagedBuffer<M>) -> Self
Source§impl<M: ManagedTypeApi> From<ManagedBuffer<M>> for BigInt<M>
impl<M: ManagedTypeApi> From<ManagedBuffer<M>> for BigInt<M>
Source§fn from(item: ManagedBuffer<M>) -> Self
fn from(item: ManagedBuffer<M>) -> Self
Source§impl<M: ManagedTypeApi> From<ManagedBuffer<M>> for BigUint<M>
impl<M: ManagedTypeApi> From<ManagedBuffer<M>> for BigUint<M>
Source§fn from(item: ManagedBuffer<M>) -> Self
fn from(item: ManagedBuffer<M>) -> Self
Source§impl<M: ManagedTypeApi> From<ManagedBuffer<M>> for EgldOrEsdtTokenIdentifier<M>
impl<M: ManagedTypeApi> From<ManagedBuffer<M>> for EgldOrEsdtTokenIdentifier<M>
Source§fn from(buffer: ManagedBuffer<M>) -> Self
fn from(buffer: ManagedBuffer<M>) -> Self
Source§impl<M> From<ManagedBuffer<M>> for ManagedBufferReadToEnd<M>where
M: ManagedTypeApi,
impl<M> From<ManagedBuffer<M>> for ManagedBufferReadToEnd<M>where
M: ManagedTypeApi,
Source§fn from(buf: ManagedBuffer<M>) -> Self
fn from(buf: ManagedBuffer<M>) -> Self
Source§impl<M> From<ManagedBuffer<M>> for ManagedSCError<M>where
M: ManagedTypeApi + ErrorApi,
impl<M> From<ManagedBuffer<M>> for ManagedSCError<M>where
M: ManagedTypeApi + ErrorApi,
Source§fn from(message: ManagedBuffer<M>) -> Self
fn from(message: ManagedBuffer<M>) -> Self
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
Source§impl<M: ManagedTypeApi> From<ManagedBuffer<M>> for TokenIdentifier<M>
impl<M: ManagedTypeApi> From<ManagedBuffer<M>> for TokenIdentifier<M>
Source§fn from(buffer: ManagedBuffer<M>) -> Self
fn from(buffer: ManagedBuffer<M>) -> Self
Source§impl<M> From<String> for ManagedBuffer<M>where
M: ManagedTypeApi,
impl<M> From<String> for ManagedBuffer<M>where
M: ManagedTypeApi,
Source§impl<M> From<Vec<u8>> for ManagedBuffer<M>where
M: ManagedTypeApi,
impl<M> From<Vec<u8>> for ManagedBuffer<M>where
M: ManagedTypeApi,
Source§impl<M: ManagedTypeApi> ManagedType<M> for ManagedBuffer<M>
impl<M: ManagedTypeApi> ManagedType<M> for ManagedBuffer<M>
type OwnHandle = <M as HandleTypeInfo>::ManagedBufferHandle
fn get_handle(&self) -> M::ManagedBufferHandle
Source§unsafe fn forget_into_handle(self) -> Self::OwnHandle
unsafe fn forget_into_handle(self) -> Self::OwnHandle
Source§fn transmute_from_handle_ref(handle_ref: &M::ManagedBufferHandle) -> &Self
fn transmute_from_handle_ref(handle_ref: &M::ManagedBufferHandle) -> &Self
fn transmute_from_handle_ref_mut( handle_ref: &mut M::ManagedBufferHandle, ) -> &mut Self
fn get_raw_handle(&self) -> RawHandle
fn as_ref(&self) -> ManagedRef<'_, M, Self>
Source§impl<M: ManagedTypeApi> ManagedVecItem for ManagedBuffer<M>
impl<M: ManagedTypeApi> ManagedVecItem for ManagedBuffer<M>
Source§const SKIPS_RESERIALIZATION: bool = false
const SKIPS_RESERIALIZATION: bool = false
u32
).Source§type PAYLOAD = ManagedVecItemPayloadBuffer<4>
type PAYLOAD = ManagedVecItemPayloadBuffer<4>
Source§type Ref<'a> = ManagedRef<'a, M, ManagedBuffer<M>>
type Ref<'a> = ManagedRef<'a, M, ManagedBuffer<M>>
Source§fn read_from_payload(payload: &Self::PAYLOAD) -> Self
fn read_from_payload(payload: &Self::PAYLOAD) -> Self
Source§unsafe fn borrow_from_payload<'a>(payload: &Self::PAYLOAD) -> Self::Ref<'a>
unsafe fn borrow_from_payload<'a>(payload: &Self::PAYLOAD) -> Self::Ref<'a>
Source§fn save_to_payload(self, payload: &mut Self::PAYLOAD)
fn save_to_payload(self, payload: &mut Self::PAYLOAD)
fn payload_size() -> usize
Source§impl<M: ManagedTypeApi> NestedDecode for ManagedBuffer<M>
impl<M: ManagedTypeApi> NestedDecode for ManagedBuffer<M>
Source§fn dep_decode_or_handle_err<I, H>(
input: &mut I,
h: H,
) -> Result<Self, H::HandledErr>where
I: NestedDecodeInput,
H: DecodeErrorHandler,
fn dep_decode_or_handle_err<I, H>(
input: &mut I,
h: H,
) -> Result<Self, H::HandledErr>where
I: NestedDecodeInput,
H: DecodeErrorHandler,
dep_decode
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_decode<I>(input: &mut I) -> Result<Self, DecodeError>where
I: NestedDecodeInput,
fn dep_decode<I>(input: &mut I) -> Result<Self, DecodeError>where
I: NestedDecodeInput,
Source§impl<M: ManagedTypeApi> NestedEncode for ManagedBuffer<M>
impl<M: ManagedTypeApi> NestedEncode for ManagedBuffer<M>
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,
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,
Source§impl<M: ManagedTypeApi> NestedEncodeOutput for ManagedBuffer<M>
impl<M: ManagedTypeApi> NestedEncodeOutput for ManagedBuffer<M>
fn supports_specialized_type<T: TryStaticCast>() -> bool
fn push_specialized<T, C, H>( &mut self, _context: C, value: &T, h: H, ) -> Result<(), H::HandledErr>
Source§impl<M: ManagedTypeApi, const N: usize> PartialEq<&[u8; N]> for ManagedBuffer<M>
impl<M: ManagedTypeApi, const N: usize> PartialEq<&[u8; N]> for ManagedBuffer<M>
Source§impl<M: ManagedTypeApi> PartialEq<[u8]> for ManagedBuffer<M>
impl<M: ManagedTypeApi> PartialEq<[u8]> for ManagedBuffer<M>
Source§impl<M: ManagedTypeApi> PartialEq for ManagedBuffer<M>
impl<M: ManagedTypeApi> PartialEq for ManagedBuffer<M>
Source§impl<M: ManagedTypeApi> SCBinary for ManagedBuffer<M>
impl<M: ManagedTypeApi> SCBinary for ManagedBuffer<M>
fn fmt<F: FormatByteReceiver>(&self, f: &mut F)
Source§impl<M: ManagedTypeApi> SCDisplay for ManagedBuffer<M>
impl<M: ManagedTypeApi> SCDisplay for ManagedBuffer<M>
fn fmt<F: FormatByteReceiver>(&self, f: &mut F)
Source§impl<M: ManagedTypeApi> SCLowerHex for ManagedBuffer<M>
impl<M: ManagedTypeApi> SCLowerHex for ManagedBuffer<M>
fn fmt<F: FormatByteReceiver>(&self, f: &mut F)
Source§impl<M: ManagedTypeApi> TopDecode for ManagedBuffer<M>
impl<M: ManagedTypeApi> TopDecode for ManagedBuffer<M>
Source§fn top_decode_or_handle_err<I, H>(input: I, h: H) -> Result<Self, H::HandledErr>where
I: TopDecodeInput,
H: DecodeErrorHandler,
fn top_decode_or_handle_err<I, H>(input: I, h: H) -> Result<Self, H::HandledErr>where
I: TopDecodeInput,
H: DecodeErrorHandler,
top_decode
that can handle errors as soon as they occur.
For instance it 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_decode<I>(input: I) -> Result<Self, DecodeError>where
I: TopDecodeInput,
fn top_decode<I>(input: I) -> Result<Self, DecodeError>where
I: TopDecodeInput,
Source§impl<M> TopDecodeInput for ManagedBuffer<M>where
M: ManagedTypeApi,
impl<M> TopDecodeInput for ManagedBuffer<M>where
M: ManagedTypeApi,
type NestedBuffer = ManagedBufferNestedDecodeInput<M>
Source§fn into_boxed_slice_u8(self) -> Box<[u8]>
fn into_boxed_slice_u8(self) -> Box<[u8]>
Source§fn into_max_size_buffer<H, const MAX_LEN: usize>(
self,
buffer: &mut [u8; MAX_LEN],
h: H,
) -> Result<&[u8], H::HandledErr>where
H: DecodeErrorHandler,
fn into_max_size_buffer<H, const MAX_LEN: usize>(
self,
buffer: &mut [u8; MAX_LEN],
h: H,
) -> Result<&[u8], H::HandledErr>where
H: DecodeErrorHandler,
into_max_size_buffer_align_right
instead.Source§fn into_max_size_buffer_align_right<H, const MAX_LEN: usize>(
self,
buffer: &mut [u8; MAX_LEN],
h: H,
) -> Result<usize, H::HandledErr>where
H: DecodeErrorHandler,
fn into_max_size_buffer_align_right<H, const MAX_LEN: usize>(
self,
buffer: &mut [u8; MAX_LEN],
h: H,
) -> Result<usize, H::HandledErr>where
H: DecodeErrorHandler,
Source§fn into_i64<H>(self, h: H) -> Result<i64, H::HandledErr>where
H: DecodeErrorHandler,
fn into_i64<H>(self, h: H) -> Result<i64, H::HandledErr>where
H: DecodeErrorHandler,
fn supports_specialized_type<T: TryStaticCast>() -> bool
fn into_specialized<T, H>(self, h: H) -> Result<T, H::HandledErr>where
T: TryStaticCast,
H: DecodeErrorHandler,
fn into_nested_buffer(self) -> Self::NestedBuffer
Source§fn into_u64<H>(self, h: H) -> Result<u64, <H as DecodeErrorHandler>::HandledErr>where
H: DecodeErrorHandler,
fn into_u64<H>(self, h: H) -> Result<u64, <H as DecodeErrorHandler>::HandledErr>where
H: DecodeErrorHandler,
Source§impl<M: ManagedTypeApi> TopEncode for ManagedBuffer<M>
impl<M: ManagedTypeApi> TopEncode for ManagedBuffer<M>
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,
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,
Source§impl<M: ManagedTypeApi> TopEncodeOutput for &mut ManagedBuffer<M>
impl<M: ManagedTypeApi> TopEncodeOutput for &mut ManagedBuffer<M>
Source§type NestedBuffer = ManagedBuffer<M>
type NestedBuffer = ManagedBuffer<M>
NestedEncodeOutput
that can be spawned to gather serializations of children.fn set_slice_u8(self, bytes: &[u8])
fn supports_specialized_type<T: TryStaticCast>() -> bool
Source§fn set_specialized<T, H>(self, value: &T, h: H) -> Result<(), H::HandledErr>where
T: TryStaticCast,
H: EncodeErrorHandler,
fn set_specialized<T, H>(self, value: &T, h: H) -> Result<(), H::HandledErr>where
T: TryStaticCast,
H: EncodeErrorHandler,
else_serialization
is only called when necessary and
is normally compiled out via monomorphization.fn start_nested_encode(&self) -> Self::NestedBuffer
fn finalize_nested_encode(self, nb: Self::NestedBuffer)
fn set_u64(self, value: u64)
fn set_i64(self, value: i64)
Source§impl<M> TryFrom<ManagedBuffer<M>> for ManagedAddress<M>where
M: ManagedTypeApi,
impl<M> TryFrom<ManagedBuffer<M>> for ManagedAddress<M>where
M: ManagedTypeApi,
Source§type Error = DecodeError
type Error = DecodeError
Source§impl<M, const N: usize> TryFrom<ManagedBuffer<M>> for ManagedByteArray<M, N>where
M: ManagedTypeApi,
impl<M, const N: usize> TryFrom<ManagedBuffer<M>> for ManagedByteArray<M, N>where
M: ManagedTypeApi,
Source§type Error = DecodeError
type Error = DecodeError
Source§impl<M: ManagedTypeApi> TryStaticCast for ManagedBuffer<M>
impl<M: ManagedTypeApi> TryStaticCast for ManagedBuffer<M>
fn type_eq<U>() -> boolwhere
U: TryStaticCast,
fn try_cast<U>(self) -> Option<U>where
U: TryStaticCast,
fn try_cast_ref<U>(&self) -> Option<&U>where
U: TryStaticCast,
Source§impl<M: ManagedTypeApi> TypeAbi for ManagedBuffer<M>
impl<M: ManagedTypeApi> TypeAbi for ManagedBuffer<M>
type Unmanaged = Vec<u8>
fn type_name() -> TypeName
fn type_name_rust() -> TypeName
fn type_names() -> TypeNames
Source§fn provide_type_descriptions<TDC: TypeDescriptionContainer>(
accumulator: &mut TDC,
)
fn provide_type_descriptions<TDC: TypeDescriptionContainer>( accumulator: &mut TDC, )
impl<M: ManagedTypeApi> Eq for ManagedBuffer<M>
impl<Env> TxCodeValue<Env> for ManagedBuffer<Env::Api>where
Env: TxEnv,
impl<M> TypeAbiFrom<&[u8]> for ManagedBuffer<M>where
M: ManagedTypeApi,
impl<M, const N: usize> TypeAbiFrom<&[u8; N]> for ManagedBuffer<M>where
M: ManagedTypeApi,
impl<M: ManagedTypeApi> TypeAbiFrom<&BoxedBytes> for ManagedBuffer<M>
impl<M: ManagedTypeApi> TypeAbiFrom<&ManagedBuffer<M>> for BoxedBytes
impl<M> TypeAbiFrom<&ManagedBuffer<M>> for ManagedBuffer<M>where
M: ManagedTypeApi,
impl<M: ManagedTypeApi> TypeAbiFrom<&ManagedBuffer<M>> for String
impl<M: ManagedTypeApi> TypeAbiFrom<&ManagedBuffer<M>> for Vec<u8>
impl<M: ManagedTypeApi> TypeAbiFrom<&String> for ManagedBuffer<M>
impl<M: ManagedTypeApi> TypeAbiFrom<&Vec<u8>> for ManagedBuffer<M>
impl<M> TypeAbiFrom<&str> for ManagedBuffer<M>where
M: ManagedTypeApi,
impl<M: ManagedTypeApi> TypeAbiFrom<BoxedBytes> for ManagedBuffer<M>
impl<M: ManagedTypeApi> TypeAbiFrom<ManagedBuffer<M>> for BoxedBytes
impl<M> TypeAbiFrom<ManagedBuffer<M>> for ManagedBuffer<M>where
M: ManagedTypeApi,
impl<M: ManagedTypeApi> TypeAbiFrom<ManagedBuffer<M>> for String
impl<M: ManagedTypeApi> TypeAbiFrom<ManagedBuffer<M>> for Vec<u8>
impl<M: ManagedTypeApi> TypeAbiFrom<OperationCompletionStatus> for ManagedBuffer<M>
impl<M: ManagedTypeApi> TypeAbiFrom<String> for ManagedBuffer<M>
impl<M: ManagedTypeApi> TypeAbiFrom<Vec<u8>> for ManagedBuffer<M>
Auto Trait Implementations§
impl<M> Freeze for ManagedBuffer<M>
impl<M> RefUnwindSafe for ManagedBuffer<M>
impl<M> Send for ManagedBuffer<M>
impl<M> Sync for ManagedBuffer<M>
impl<M> Unpin for ManagedBuffer<M>
impl<M> UnwindSafe for ManagedBuffer<M>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> TopDecodeMulti for Twhere
T: TopDecode,
impl<T> TopDecodeMulti for Twhere
T: TopDecode,
Source§const IS_SINGLE_VALUE: bool = true
const IS_SINGLE_VALUE: bool = true
fn multi_decode_or_handle_err<I, H>(
input: &mut I,
h: H,
) -> Result<T, <H as DecodeErrorHandler>::HandledErr>where
I: TopDecodeMultiInput,
H: DecodeErrorHandler,
fn multi_decode<I>(input: &mut I) -> Result<Self, DecodeError>where
I: TopDecodeMultiInput,
Source§impl<T> TopDecodeMultiLength for T
impl<T> TopDecodeMultiLength for T
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,
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.