pub struct ManagedVec<M, T>where
M: ManagedTypeApi,
T: ManagedVecItem,{ /* private fields */ }Expand description
A list of items that lives inside a managed buffer.
Items can be either stored there in full (e.g. u32),
or just via handle (e.g. BigUint<M>).
Implementations§
Source§impl<M, T> ManagedVec<M, T>where
M: ManagedTypeApi,
T: ManagedVecItem,
impl<M, T> ManagedVec<M, T>where
M: ManagedTypeApi,
T: ManagedVecItem,
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.
Source§impl<M, T> ManagedVec<M, T>where
M: ManagedTypeApi,
T: ManagedVecItem,
impl<M, T> ManagedVec<M, T>where
M: ManagedTypeApi,
T: ManagedVecItem,
Sourcepub fn try_get(&self, index: usize) -> Option<T::Ref<'_>>
pub fn try_get(&self, index: usize) -> Option<T::Ref<'_>>
Retrieves the element at index, or None if the index is out of range.
Sourcepub fn to_array_of_refs<const N: usize>(&self) -> Option<[T::Ref<'_>; N]>
pub fn to_array_of_refs<const N: usize>(&self) -> Option<[T::Ref<'_>; N]>
Extracts all elements to an array, if the length matches exactly.
The resulting array contains mere references to the items, as defined in ManagedVecItem.
Sourcepub fn get(&self, index: usize) -> T::Ref<'_>
pub fn get(&self, index: usize) -> T::Ref<'_>
Retrieves element at index, if the index is valid. Otherwise, signals an error and terminates execution.
Sourcepub fn is_single_item(&self) -> Option<T::Ref<'_>>
pub fn is_single_item(&self) -> Option<T::Ref<'_>>
If it contains precisely one item, will return Some with a reference to that item.
Will return None for zero or more than one item.
Sourcepub fn get_mut(&mut self, index: usize) -> ManagedVecRefMut<'_, M, T>
pub fn get_mut(&mut self, index: usize) -> ManagedVecRefMut<'_, M, T>
Returns a mutable guard for the element at index, allowing in-place modification.
Signals an error and terminates execution if the index is out of range.
Sourcepub fn set(&mut self, index: usize, item: T) -> Result<T, InvalidSliceError>
pub fn set(&mut self, index: usize, item: T) -> Result<T, InvalidSliceError>
Replaces the element at index with item, returning the displaced element.
Signals an error and terminates execution if the index is out of range.
Sourcepub fn clone_range(&self, start_index: usize, end_index: usize) -> Option<Self>where
T: Clone,
pub fn clone_range(&self, start_index: usize, end_index: usize) -> Option<Self>where
T: Clone,
Returns a new ManagedVec containing the elements in the half-open range
[start_index, end_index). Returns None if the range is invalid
(start_index > end_index or end_index > self.len()).
§Cloning strategy
The implementation chooses between two paths based on whether T owns
VM-level resources (i.e. T::requires_drop()):
-
Copy-like types (
T::requires_drop() == false, e.g.u32,u64, fixed-size structs of plain integers): the relevant slice of the underlying managed buffer is copied in a single VM call. No per-item work is done. -
Handle-owning types (
T::requires_drop() == true, e.g.BigUint,ManagedBuffer, or any struct containing them): copying raw bytes would alias the integer handles stored in the payload, causing both the original vec and the returned vec to attempt freeing the same VM object on drop (double-free). Instead each item in the range is cloned individually, allocating a fresh independent VM object for every element.
Sourcepub fn slice(&self, start_index: usize, end_index: usize) -> Option<Self>where
T: Clone,
👎Deprecated since 0.66.2: Please use method clone_range instead.
pub fn slice(&self, start_index: usize, end_index: usize) -> Option<Self>where
T: Clone,
Please use method clone_range instead.
Deprecated alias for [clone_range].
Sourcepub fn take(&mut self, index: usize) -> T
pub fn take(&mut self, index: usize) -> T
Removes and returns the element at index, shifting the remaining elements.
Signals an error and terminates execution if the index is out of range.
Sourcepub fn remove(&mut self, index: usize)
pub fn remove(&mut self, index: usize)
Removes and drops the element at index, shifting the remaining elements.
Signals an error and terminates execution if the index is out of range.
Sourcepub fn from_single_item(item: T) -> Self
pub fn from_single_item(item: T) -> Self
New ManagedVec instance with 1 element in it.
Sourcepub fn overwrite_with_single_item(&mut self, item: T)
pub fn overwrite_with_single_item(&mut self, item: T)
Replaces all contents of the vec with a single item, dropping all previous elements.
Sourcepub fn append_vec(&mut self, v: ManagedVec<M, T>)
pub fn append_vec(&mut self, v: ManagedVec<M, T>)
Appends all the contents of another managed vec at the end of the current one. Consumes the other vec in the process.
Sourcepub fn into_vec(self) -> Vec<T>
pub fn into_vec(self) -> Vec<T>
Converts the ManagedVec into a standard Vec<T>, consuming the vec in the process.
Sourcepub fn with_self_as_vec<R, F>(&mut self, f: F) -> R
pub fn with_self_as_vec<R, F>(&mut self, f: F) -> R
Temporarily converts self to a Vec<T>.
All operations performed on the temporary vector get saved back to the underlying buffer.
Sourcepub fn iter(&self) -> ManagedVecRefIterator<'_, M, T> ⓘ
pub fn iter(&self) -> ManagedVecRefIterator<'_, M, T> ⓘ
Returns an iterator over shared references to the elements of the vec.
Sourcepub fn as_multi(&self) -> &MultiValueManagedVec<M, T>
pub fn as_multi(&self) -> &MultiValueManagedVec<M, T>
Creates a reference to an identical object, but one which behaves like a multi-value-vec.
Source§impl<M, T> ManagedVec<M, T>
impl<M, T> ManagedVec<M, T>
pub fn sort(&mut self)
Please use method sort_unstable instead.
pub fn sort_by<F>(&mut self, compare: F)
Please use method sort_unstable_by instead.
pub fn sort_by_key<K, F>(&mut self, f: F)
Please use method sort_unstable_by_key instead.
pub fn sort_by_cached_key<K, F>(&mut self, f: F)
pub fn sort_unstable(&mut self)
pub fn sort_unstable_by<F>(&mut self, compare: F)
pub fn sort_unstable_by_key<K, F>(&mut self, f: F)
pub fn is_sorted(&self) -> bool
Source§impl<M, T> ManagedVec<M, T>
impl<M, T> ManagedVec<M, T>
Source§impl<M, T> ManagedVec<M, T>
impl<M, T> ManagedVec<M, T>
Source§impl<M: ManagedTypeApi> ManagedVec<M, EsdtTokenPayment<M>>
impl<M: ManagedTypeApi> ManagedVec<M, EsdtTokenPayment<M>>
Sourcepub fn as_multi_egld_or_esdt_payment(&self) -> &MultiEgldOrEsdtPayment<M>
pub fn as_multi_egld_or_esdt_payment(&self) -> &MultiEgldOrEsdtPayment<M>
Zero-cost conversion that loosens the EGLD restriction.
It is always safe to do, since the 2 types are guaranteed to have the same layout.
Sourcepub fn into_multi_egld_or_esdt_payment(self) -> MultiEgldOrEsdtPayment<M>
pub fn into_multi_egld_or_esdt_payment(self) -> MultiEgldOrEsdtPayment<M>
Zero-cost conversion that loosens the EGLD restriction.
It is always safe to do, since the 2 types are guaranteed to have the same layout.
Sourcepub fn into_payment_vec(self) -> PaymentVec<M>
pub fn into_payment_vec(self) -> PaymentVec<M>
Zero-cost conversion that loosens the EGLD restriction.
It is always safe to do, since the 2 types are guaranteed to have the same layout.
Source§impl<M> ManagedVec<M, EgldOrEsdtTokenPayment<M>>where
M: ManagedTypeApi,
impl<M> ManagedVec<M, EgldOrEsdtTokenPayment<M>>where
M: ManagedTypeApi,
Sourcepub fn to_single_esdt(self) -> EsdtTokenPayment<M>
pub fn to_single_esdt(self) -> EsdtTokenPayment<M>
Requires that this is a single ESDT payment, and returns it, crashes otherwise.
Sourcepub fn into_multi_value(
self,
) -> MultiValueEncoded<M, EgldOrEsdtTokenPaymentMultiValue<M>>
pub fn into_multi_value( self, ) -> MultiValueEncoded<M, EgldOrEsdtTokenPaymentMultiValue<M>>
Converts to a multi-value object, in this case a multi-value list of triples:
[(token identifier, payment, nonce)]
Sourcepub fn into_payment_vec(self) -> PaymentVec<M>
pub fn into_payment_vec(self) -> PaymentVec<M>
Converts to the newer PaymentVec (ManagedVec
Source§impl<M: ManagedTypeApi> ManagedVec<M, Payment<M>>
impl<M: ManagedTypeApi> ManagedVec<M, Payment<M>>
Sourcepub fn as_multi_egld_or_esdt_payment(&self) -> &MultiEgldOrEsdtPayment<M>
pub fn as_multi_egld_or_esdt_payment(&self) -> &MultiEgldOrEsdtPayment<M>
Converts to the legacy MultiEgldOrEsdtPayment.
It is always safe to do, since the 2 types are guaranteed to have the same layout.
Sourcepub fn into_multi_egld_or_esdt_payment(self) -> MultiEgldOrEsdtPayment<M>
pub fn into_multi_egld_or_esdt_payment(self) -> MultiEgldOrEsdtPayment<M>
Converts to the legacy MultiEgldOrEsdtPayment.
It is always safe to do, since the 2 types are guaranteed to have the same layout.
Trait Implementations§
Source§impl<M, T> AsRef<ManagedVec<M, T>> for ManagedVec<M, T>where
M: ManagedTypeApi,
T: ManagedVecItem,
impl<M, T> AsRef<ManagedVec<M, T>> for ManagedVec<M, T>where
M: ManagedTypeApi,
T: ManagedVecItem,
Source§fn as_ref(&self) -> &ManagedVec<M, T>
fn as_ref(&self) -> &ManagedVec<M, T>
Source§impl<M, T> Clone for ManagedVec<M, T>
impl<M, T> Clone for ManagedVec<M, T>
Source§impl<M, T> Debug for ManagedVec<M, T>
impl<M, T> Debug for ManagedVec<M, T>
Source§impl<M, T> Default for ManagedVec<M, T>where
M: ManagedTypeApi,
T: ManagedVecItem,
impl<M, T> Default for ManagedVec<M, T>where
M: ManagedTypeApi,
T: ManagedVecItem,
Source§impl<M, T> Drop for ManagedVec<M, T>where
M: ManagedTypeApi,
T: ManagedVecItem,
impl<M, T> Drop for ManagedVec<M, T>where
M: ManagedTypeApi,
T: ManagedVecItem,
impl<M, T> Eq for ManagedVec<M, T>
Source§impl<M, V> Extend<V> for ManagedVec<M, V>where
M: ManagedTypeApi,
V: ManagedVecItem,
impl<M, V> Extend<V> for ManagedVec<M, V>where
M: ManagedTypeApi,
V: ManagedVecItem,
Source§fn extend<T: IntoIterator<Item = V>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = V>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)Source§impl<A> From<ManagedVec<A, EgldOrEsdtTokenPayment<A>>> for BackTransfers<A>where
A: ManagedTypeApi,
impl<A> From<ManagedVec<A, EgldOrEsdtTokenPayment<A>>> for BackTransfers<A>where
A: ManagedTypeApi,
Source§fn from(value: MultiEgldOrEsdtPayment<A>) -> Self
fn from(value: MultiEgldOrEsdtPayment<A>) -> Self
Source§impl<M> From<ManagedVec<M, ManagedBuffer<M>>> for ManagedArgBuffer<M>where
M: ManagedTypeApi,
impl<M> From<ManagedVec<M, ManagedBuffer<M>>> for ManagedArgBuffer<M>where
M: ManagedTypeApi,
Source§fn from(data: ManagedVec<M, ManagedBuffer<M>>) -> Self
fn from(data: ManagedVec<M, ManagedBuffer<M>>) -> Self
Source§impl<M, T> From<ManagedVec<M, T>> for MultiValueEncoded<M, T>
impl<M, T> From<ManagedVec<M, T>> for MultiValueEncoded<M, T>
Source§fn from(v: ManagedVec<M, T>) -> Self
fn from(v: ManagedVec<M, T>) -> Self
Source§impl<M, T> From<ManagedVec<M, T>> for MultiValueManagedVec<M, T>where
M: ManagedTypeApi,
T: ManagedVecItem,
impl<M, T> From<ManagedVec<M, T>> for MultiValueManagedVec<M, T>where
M: ManagedTypeApi,
T: ManagedVecItem,
Source§fn from(managed_vec: ManagedVec<M, T>) -> Self
fn from(managed_vec: ManagedVec<M, T>) -> Self
Source§impl<M, T> From<ManagedVec<M, T>> for MultiValueManagedVecCounted<M, T>where
M: ManagedTypeApi,
T: ManagedVecItem,
impl<M, T> From<ManagedVec<M, T>> for MultiValueManagedVecCounted<M, T>where
M: ManagedTypeApi,
T: ManagedVecItem,
Source§fn from(v: ManagedVec<M, T>) -> Self
fn from(v: ManagedVec<M, T>) -> Self
Source§impl<M, T, I> From<Vec<I>> for ManagedVec<M, T>
impl<M, T, I> From<Vec<I>> for ManagedVec<M, T>
Source§impl<M, V> FromIterator<V> for ManagedVec<M, V>where
M: ManagedTypeApi,
V: ManagedVecItem,
impl<M, V> FromIterator<V> for ManagedVec<M, V>where
M: ManagedTypeApi,
V: ManagedVecItem,
Source§fn from_iter<T: IntoIterator<Item = V>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = V>>(iter: T) -> Self
Source§impl<M, T> IntoIterator for ManagedVec<M, T>where
M: ManagedTypeApi,
T: ManagedVecItem,
impl<M, T> IntoIterator for ManagedVec<M, T>where
M: ManagedTypeApi,
T: ManagedVecItem,
Source§impl<'a, M, T> IntoIterator for &'a ManagedVec<M, T>where
M: ManagedTypeApi,
T: ManagedVecItem,
impl<'a, M, T> IntoIterator for &'a ManagedVec<M, T>where
M: ManagedTypeApi,
T: ManagedVecItem,
Source§impl<M, T> IntoMultiValue for ManagedVec<M, T>
impl<M, T> IntoMultiValue for ManagedVec<M, T>
type MultiValue = MultiValueEncoded<M, <T as IntoMultiValue>::MultiValue>
fn into_multi_value(self) -> Self::MultiValue
Source§impl<M, T> ManagedType<M> for ManagedVec<M, T>where
M: ManagedTypeApi,
T: ManagedVecItem,
impl<M, T> ManagedType<M> for ManagedVec<M, T>where
M: ManagedTypeApi,
T: ManagedVecItem,
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 get_raw_handle_unchecked(&self) -> RawHandle
fn as_ref(&self) -> ManagedRef<'_, M, Self>
Source§impl<M, T> ManagedVecItem for ManagedVec<M, T>where
M: ManagedTypeApi,
T: ManagedVecItem,
impl<M, T> ManagedVecItem for ManagedVec<M, T>where
M: ManagedTypeApi,
T: ManagedVecItem,
Source§const SKIPS_RESERIALIZATION: bool = false
const SKIPS_RESERIALIZATION: bool = false
u32).Source§type PAYLOAD = ManagedVecItemPayloadBuffer<UInt<UInt<UInt<UTerm, B1>, B0>, B0>>
type PAYLOAD = ManagedVecItemPayloadBuffer<UInt<UInt<UInt<UTerm, B1>, B0>, B0>>
Source§type Ref<'a> = ManagedRef<'a, M, ManagedVec<M, T>>
type Ref<'a> = ManagedRef<'a, M, ManagedVec<M, T>>
Source§unsafe fn read_from_payload(payload: &Self::PAYLOAD) -> Self
unsafe 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)
Source§fn requires_drop() -> bool
fn requires_drop() -> bool
fn payload_size() -> usize
fn temp_decode<F, R>(payload: &Self::PAYLOAD, f: F) -> Rwhere
F: FnOnce(&Self) -> R,
Source§impl<M, T> NestedDecode for ManagedVec<M, T>
impl<M, T> NestedDecode for ManagedVec<M, T>
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, T> NestedEncode for ManagedVec<M, T>
impl<M, T> NestedEncode for ManagedVec<M, T>
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, T> PartialEq for ManagedVec<M, T>
impl<M, T> PartialEq for ManagedVec<M, T>
Source§impl<M, T> TopDecode for ManagedVec<M, T>
impl<M, T> TopDecode for ManagedVec<M, T>
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, T> TopEncode for ManagedVec<M, T>
impl<M, T> TopEncode for ManagedVec<M, T>
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> TopEncodeMultiOutput for ManagedVec<M, ManagedBuffer<M>>where
M: ManagedTypeApi,
impl<M> TopEncodeMultiOutput for ManagedVec<M, ManagedBuffer<M>>where
M: ManagedTypeApi,
fn push_single_value<T, H>(
&mut self,
arg: &T,
h: H,
) -> Result<(), H::HandledErr>where
T: TopEncode,
H: EncodeErrorHandler,
Source§fn push_multi_specialized<T, H>(
&mut self,
_arg: &T,
h: H,
) -> Result<(), <H as EncodeErrorHandler>::HandledErr>where
T: TryStaticCast,
H: EncodeErrorHandler,
fn push_multi_specialized<T, H>(
&mut self,
_arg: &T,
h: H,
) -> Result<(), <H as EncodeErrorHandler>::HandledErr>where
T: TryStaticCast,
H: EncodeErrorHandler,
Source§impl<M, T> TypeAbi for ManagedVec<M, T>
impl<M, T> TypeAbi for ManagedVec<M, T>
type Unmanaged = Vec<<T as TypeAbi>::Unmanaged>
Source§fn type_name_rust() -> TypeName
fn type_name_rust() -> TypeName
Source§fn provide_type_descriptions<TDC: TypeDescriptionContainer>(
accumulator: &mut TDC,
)
fn provide_type_descriptions<TDC: TypeDescriptionContainer>( accumulator: &mut TDC, )
fn type_names() -> TypeNames
impl<M, T, U> TypeAbiFrom<ManagedVec<M, U>> for ManagedVec<M, T>
impl<M, T, U> TypeAbiFrom<ManagedVec<M, U>> for Vec<T>
impl<M, T, U> TypeAbiFrom<Vec<U>> for ManagedVec<M, T>
Auto Trait Implementations§
impl<M, T> Freeze for ManagedVec<M, T>
impl<M, T> RefUnwindSafe for ManagedVec<M, T>
impl<M, T> Send for ManagedVec<M, T>
impl<M, T> Sync for ManagedVec<M, T>
impl<M, T> Unpin for ManagedVec<M, T>
impl<M, T> UnsafeUnpin for ManagedVec<M, T>
impl<M, T> UnwindSafe for ManagedVec<M, T>
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> MultiValueConstLength for T
impl<T> MultiValueConstLength for T
Source§const MULTI_VALUE_CONST_LEN: usize = 1
const MULTI_VALUE_CONST_LEN: usize = 1
Source§impl<T> MultiValueLength for T
impl<T> MultiValueLength for T
Source§fn multi_value_len(&self) -> usize
fn multi_value_len(&self) -> usize
impl<O, T> ProxyArg<O> for Twhere
O: TypeAbiFrom<T>,
T: TopEncodeMulti,
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> 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.