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§

encoding
The encoding macro can be used to create newtypes that implement a particular encoding for the inner value.

Structs§

Base64
Base64 conversion
Error
The Error type, a wrapper around a dynamic error type.
Json
Json encoding
MemoryHandle
MemoryHandle describes 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§

FromBytes
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.
FromBytesOwned
FromBytesOwned is similar to FromBytes but it doesn’t borrow from the input slice. FromBytes is automatically implemented for all types that implement FromBytesOwned.
ToBytes
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.

Derive Macros§

FromBytes
ToBytes