Crate borsh

Source
Expand description

§Crate features

§Ecosystem features

  • std - When enabled, borsh uses the standard library. Disabling this feature will result in building the crate in no_std environment.

    To carter such builds, Borsh offers io module which includes a items which are used in BorshSerialize and BorshDeserialize traits. Most notably io::Read, io::Write and io::Result.

    When std feature is enabled, those items are re-exports of corresponding std::io items. Otherwise they are borsh-specific types which mimic behaviour of corresponding standard types.

§Default features

  • std - enabled by default.

§Other features

§Config aliases

§Shortcuts

Following pages are highlighted here just to give reader a chance at learning that they exist.

Re-exports§

pub use de::BorshDeserialize;
pub use de::from_reader;
pub use de::from_slice;
pub use ser::BorshSerialize;

Modules§

de
error
io
Subset of std::io which is used as part of borsh public API.
ser

Functions§

object_length
Serializes an object without allocation to compute and return its length
to_vec
Serialize an object into a vector of bytes.
to_writer
Serializes an object directly into a Writer.

Derive Macros§

BorshDeserialize
Derive macro available if borsh is built with features = ["derive"].
BorshSerialize
Derive macro available if borsh is built with features = ["derive"].