Skip to main content

Module prelude

Module prelude 

Source
Expand description

Re-exports of the most commonly used traits, macros, and Borsh items.

Re-exports§

pub use crate::serializer::Deserializer;
pub use crate::serializer::Serializable;
pub use crate::serializer::Serializer;
pub use crate::payload;
pub use crate::payload;

Macros§

deserialize
Load item using Serializer deserialization. crate::serializer::Serializer is 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 wrapping Cursor<Vec<u8>>. This struct acts as a helper for storing and loading items into a Vec<u8> buffer.
reader
Consume a crate::payload::Payload and produce a Cursor<Vec<u8>> reader over its bytes.
serialize
Store item using Serializer serialization. crate::serializer::Serializer is 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::Version from major and minor version numbers.
writer
Borrow a crate::payload::Payload as a mutable Cursor<Vec<u8>> writer.

Traits§

BorshDeserialize
A data-structure that can be de-serialized from binary format by NBOR.
BorshSerialize
A data-structure that can be serialized into binary format by NBOR.

Derive Macros§

BorshDeserialize

BorshSerialize