Expand description
Declarative helpers for storing and loading values with Borsh: serialization macros and length-prefixed payload buffers used to persist and exchange data across the workflow-rs crates.
Re-exports§
pub use borsh;
Modules§
- macros
- Declarative macros for storing and loading items via Borsh and
serializer::Serializer. - payload
- Helper
payload::Payloadwrappers that length-prefix serialized data into a byte buffer. - prelude
- Re-exports of the most commonly used traits, macros, and Borsh items.
- result
- Type aliases for the standard library I/O error and result types used throughout the crate.
- serializer
- The
serializer::Serializerandserializer::Deserializertraits and their implementations. - tests
- Unit tests exercising the serialization traits and macros.
Macros§
- deserialize
- Load item using Serializer deserialization.
crate::serializer::Serializeris meant to provide custom serialization over Borsh that can be used to store additional metadata such as struct version. - load
- Load item using Borsh deserialization
- payload
- Create Payload struct - a
#repr[transparent]struct wrappingCursor<Vec<u8>>. This struct acts as a helper for storing and loading items into aVec<u8>buffer. - reader
- Consume a
crate::payload::Payloadand produce aCursor<Vec<u8>>reader over its bytes. - serialize
- Store item using Serializer serialization.
crate::serializer::Serializeris meant to provide custom serialization over Borsh that can be used to store additional metadata such as struct version. - store
- Store item using Borsh serialization
- version
- Construct a
crate::payload::Versionfrom major and minor version numbers. - writer
- Borrow a
crate::payload::Payloadas a mutableCursor<Vec<u8>>writer.