Struct elrond_wasm::types::ManagedVec [−][src]
pub struct ManagedVec<M, T> where
M: ManagedTypeApi,
T: ManagedVecItem, { /* fields omitted */ }
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
Retrieves element at index, if the index is valid. Warning! Ownership around this method is murky, managed items are copied without respecting ownership. TODO: Find a way to fix it by returning some kind of reference to the item, not the owned type.
New ManagedVec
instance with 1 element in it.
Appends all the contents of another managed vec at the end of the current one. Consumes the other vec in the process.
Temporarily converts self to a Vec<T>
.
All operations performed on the temporary vector get saved back to the underlying buffer.
pub fn iter(&self) -> ManagedVecIterator<'_, M, T>ⓘNotable traits for ManagedVecIterator<'a, M, T>impl<'a, M, T> Iterator for ManagedVecIterator<'a, M, T> where
M: ManagedTypeApi,
T: ManagedVecItem, type Item = T;
impl<'a, M, T> Iterator for ManagedVecIterator<'a, M, T> where
M: ManagedTypeApi,
T: ManagedVecItem, type Item = T;
Trait Implementations
impl<M, T> Debug for ManagedVec<M, T> where
M: ManagedTypeApi,
T: ManagedVecItem + Debug + Clone,
impl<M, T> Debug for ManagedVec<M, T> where
M: ManagedTypeApi,
T: ManagedVecItem + Debug + Clone,
impl<M, T> From<&'_ ManagedVec<M, T>> for ManagedMultiResultVec<M, T> where
M: ManagedTypeApi,
T: ManagedVecItem + TopEncode,
impl<M, T> From<&'_ ManagedVec<M, T>> for ManagedMultiResultVec<M, T> where
M: ManagedTypeApi,
T: ManagedVecItem + TopEncode,
Performs the conversion.
Performs the conversion.
impl<M, T> From<ManagedVec<M, T>> for ManagedMultiResultVec<M, T> where
M: ManagedTypeApi,
T: ManagedVecItem + TopEncode + 'static,
impl<M, T> From<ManagedVec<M, T>> for ManagedMultiResultVec<M, T> where
M: ManagedTypeApi,
T: ManagedVecItem + TopEncode + 'static,
Performs the conversion.
impl<M, T> From<ManagedVec<M, T>> for ManagedCountedMultiResultVec<M, T> where
M: ManagedTypeApi,
T: ManagedVecItem,
impl<M, T> From<ManagedVec<M, T>> for ManagedCountedMultiResultVec<M, T> where
M: ManagedTypeApi,
T: ManagedVecItem,
Performs the conversion.
impl<M, T> From<ManagedVec<M, T>> for ManagedMultiResultVecEager<M, T> where
M: ManagedTypeApi,
T: ManagedVecItem,
impl<M, T> From<ManagedVec<M, T>> for ManagedMultiResultVecEager<M, T> where
M: ManagedTypeApi,
T: ManagedVecItem,
Performs the conversion.
impl<M, T, I> From<Vec<I, Global>> for ManagedVec<M, T> where
M: ManagedTypeApi,
T: ManagedVecItem,
I: Into<T>,
impl<M, T, I> From<Vec<I, Global>> for ManagedVec<M, T> where
M: ManagedTypeApi,
T: ManagedVecItem,
I: Into<T>,
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,
Size of the data stored in the underlying ManagedBuffer
.
If true, then the encoding of the item is identical to the payload,
and no further conversion is necessary
(the underlying buffer can be used as-is during serialization).
False for all managed types, but true for basic types (like u32
). Read more
impl<M, T> NestedDecode for ManagedVec<M, T> where
M: ManagedTypeApi,
T: ManagedVecItem + NestedDecode,
impl<M, T> NestedDecode for ManagedVec<M, T> where
M: ManagedTypeApi,
T: ManagedVecItem + NestedDecode,
Attempt to deserialise the value from input, using the format of an object nested inside another structure. In case of success returns the deserialized value and the number of bytes consumed during the operation. Read more
fn dep_decode_or_exit<I, ExitCtx>(
input: &mut I,
c: ExitCtx,
exit: fn(ExitCtx, DecodeError) -> !
) -> Self where
I: NestedDecodeInput,
ExitCtx: Clone,
fn dep_decode_or_exit<I, ExitCtx>(
input: &mut I,
c: ExitCtx,
exit: fn(ExitCtx, DecodeError) -> !
) -> Self where
I: NestedDecodeInput,
ExitCtx: Clone,
Version of top_decode
that exits quickly in case of error.
Its purpose is to create smaller implementations
in cases where the application is supposed to exit directly on decode error. Read more
impl<M, T> NestedEncode for ManagedVec<M, T> where
M: ManagedTypeApi,
T: ManagedVecItem + NestedEncode,
impl<M, T> NestedEncode for ManagedVec<M, T> where
M: ManagedTypeApi,
T: ManagedVecItem + NestedEncode,
NestedEncode to output, using the format of an object nested inside another structure. Does not provide compact version. Read more
fn dep_encode_or_exit<O, ExitCtx>(
&self,
dest: &mut O,
c: ExitCtx,
exit: fn(ExitCtx, EncodeError) -> !
) where
O: NestedEncodeOutput,
ExitCtx: Clone,
fn dep_encode_or_exit<O, ExitCtx>(
&self,
dest: &mut O,
c: ExitCtx,
exit: fn(ExitCtx, EncodeError) -> !
) where
O: NestedEncodeOutput,
ExitCtx: Clone,
Version of top_decode
that exits quickly in case of error.
Its purpose is to create smaller implementations
in cases where the application is supposed to exit directly on decode error. Read more
impl<M, T> PartialEq<ManagedVec<M, T>> for ManagedVec<M, T> where
M: ManagedTypeApi,
T: ManagedVecItem + PartialEq,
impl<M, T> PartialEq<ManagedVec<M, T>> for ManagedVec<M, T> where
M: ManagedTypeApi,
T: ManagedVecItem + PartialEq,
impl<M, T> TopDecode for ManagedVec<M, T> where
M: ManagedTypeApi,
T: ManagedVecItem + NestedDecode,
impl<M, T> TopDecode for ManagedVec<M, T> where
M: ManagedTypeApi,
T: ManagedVecItem + NestedDecode,
Attempt to deserialize the value from input.
fn top_decode_or_exit<I, ExitCtx>(
input: I,
c: ExitCtx,
exit: fn(ExitCtx, DecodeError) -> !
) -> Self where
I: TopDecodeInput,
ExitCtx: Clone,
fn top_decode_or_exit<I, ExitCtx>(
input: I,
c: ExitCtx,
exit: fn(ExitCtx, DecodeError) -> !
) -> Self where
I: TopDecodeInput,
ExitCtx: Clone,
Version of top_decode
that exits quickly in case of error.
Its purpose is to create smaller implementations
in cases where the application is supposed to exit directly on decode error. Read more
impl<M, T> TopEncode for ManagedVec<M, T> where
M: ManagedTypeApi,
T: ManagedVecItem + NestedEncode,
impl<M, T> TopEncode for ManagedVec<M, T> where
M: ManagedTypeApi,
T: ManagedVecItem + NestedEncode,
Attempt to serialize the value to ouput.
fn top_encode_or_exit<O, ExitCtx>(
&self,
output: O,
c: ExitCtx,
exit: fn(ExitCtx, EncodeError) -> !
) where
O: TopEncodeOutput,
ExitCtx: Clone,
fn top_encode_or_exit<O, ExitCtx>(
&self,
output: O,
c: ExitCtx,
exit: fn(ExitCtx, EncodeError) -> !
) where
O: TopEncodeOutput,
ExitCtx: Clone,
Version of top_decode
that exits quickly in case of error.
Its purpose is to create smaller bytecode implementations
in cases where the application is supposed to exit directly on decode error. Read more
A type can provide more than its own description. For instance, a struct can also provide the descriptions of the type of its fields. TypeAbi doesn’t care for the exact accumulator type, which is abstracted by the TypeDescriptionContainer trait. Read more
Auto Trait Implementations
impl<M, T> RefUnwindSafe for ManagedVec<M, T> where
M: RefUnwindSafe,
T: RefUnwindSafe,
impl<M, T> Send for ManagedVec<M, T> where
M: Send,
T: Send,
impl<M, T> Sync for ManagedVec<M, T> where
M: Sync,
T: Sync,
impl<M, T> Unpin for ManagedVec<M, T> where
M: Unpin,
T: Unpin,
impl<M, T> UnwindSafe for ManagedVec<M, T> where
M: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more