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

Length of the underlying buffer in bytes.

Number of items.

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.

Removes all items while retaining the handle.

Temporarily converts self to a Vec<T>. All operations performed on the temporary vector get saved back to the underlying buffer.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

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

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

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

NestedEncode to output, using the format of an object nested inside another structure. Does not provide compact version. Read more

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

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Attempt to deserialize the value from input.

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

Attempt to serialize the value to ouput.

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

It is semantically equivalent to any list of T.

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

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.