Crate extism_convert
source ·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§
- The
encoding
macro can be used to create newtypes that implement a particular encoding for the inner value.
Structs§
- Base64 conversion
- The
Error
type, a wrapper around a dynamic error type. - Json encoding
MemoryHandle
describes where in memory a block of data is stored- Msgpack encoding
- Protobuf encoding
- Raw does no conversion, it just copies the memory directly. Note: This will only work for types that implement bytemuck::Pod
Traits§
FromBytes
is used to define how a type should be decoded when working with Extism memory. It is used for plugin output and host function input.ToBytes
is used to define how a type should be encoded when working with Extism memory. It is used for plugin input and host function output.