Expand description
The extism-convert crate is used by the Rust SDK and Rust PDK to provide a shared interface for encoding and decoding values that can be passed to Extism function calls.
A set of types (Json, Msgpack) that can be used to specify a serde encoding are also provided. These are similar to axum extractors - they are implemented as a tuple struct with a single field that is meant to be extracted using pattern matching.
Macros§
- encoding
- The
encodingmacro can be used to create newtypes that implement a particular encoding for the inner value.
Structs§
- Base64
- Base64 conversion
- Error
- The
Errortype, a wrapper around a dynamic error type. - Json
- Json encoding
- Memory
Handle MemoryHandledescribes where in memory a block of data is stored- Msgpack
- Msgpack encoding
- Prost
- Protobuf encoding
- Raw
- Raw does no conversion, it just copies the memory directly. Note: This will only work for types that implement bytemuck::Pod
Traits§
- From
Bytes FromBytesis used to define how a type should be decoded when working with Extism memory. It is used for plugin output and host function input.- From
Bytes Owned FromBytesOwnedis similar toFromBytesbut it doesn’t borrow from the input slice.FromBytesis automatically implemented for all types that implementFromBytesOwned.- ToBytes
ToBytesis used to define how a type should be encoded when working with Extism memory. It is used for plugin input and host function output.