#[repr(transparent)]
pub struct ManagedBuffer<M: ManagedTypeApi> { /* private fields */ }
Expand description

A byte buffer managed by an external API.

Implementations§

TODO: investigate the impact of using Result<(), ()> on the wasm output.

Loads all bytes of the managed buffer in batches, then applies given closure on each batch.

Utility function: helps serialize lengths (or any other value of type usize) easier.

Convenience method for quickly getting a top-decoded u64 from the managed buffer.

TODO: remove this method once TopDecodeInput is implemented for ManagedBuffer reference.

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

Syntactic sugar only.

Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Implement carefully, since the underlying transmutation is an unsafe operation. For types that wrap a handle to some VM-managed data, make sure the type only contains the handle (plus ZSTs if necessary). For types that just wrap another managed type it is easier, call for the wrapped object. 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
Reference representation of the ManagedVec item. Read more
Parses given bytes as a an owned object.
Parses given bytes as a representation of the object, either owned, or a reference. Read more
Version of 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. 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 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. Read more
NestedEncode to output, using the format of an object nested inside another structure. Does not provide compact version. Read more
Write to the output.
Write a single byte to the output.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Version of 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. Read more
Attempt to deserialize the value from input.
Length of the underlying data, in bytes.
Provides the underlying data as an owned byte slice box. Consumes the input object in the process. Read more
Puts the underlying data into a fixed size byte buffer and returns the populated data slice from this buffer. Read more
Retrieves the underlying data as a pre-parsed u64. Expected to panic if the conversion is not possible. Read more
Retrieves the underlying data as a pre-parsed i64. Expected to panic if the conversion is not possible. Read more
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. Read more
Attempt to serialize the value to ouput.
Type of NestedEncodeOutput that can be spawned to gather serializations of children.
Allows special handling of special types. Also requires an alternative serialization, in case the special handling is not covered. The alternative serialization, else_serialization is only called when necessary and is normally compiled out via monomorphization. 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.
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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Used to optimize single value loading of endpoint arguments.
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. Read more
Attempt to serialize the value to ouput.
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.