borsh 1.6.1

Binary Object Representation Serializer for Hashing
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! Generate `BorshSchemaCointainer` for `BorshSchemaContainer` and save it into a file.

#![cfg_attr(not(feature = "std"), no_std)]
use borsh::schema_container_of;
use std::fs::File;
use std::io::Write;

fn main() {
    let container = schema_container_of::<borsh::schema::BorshSchemaContainer>();

    println!("{:#?}", container);

    let data = borsh::to_vec(&container).expect("Failed to serialize BorshSchemaContainer");
    let mut file = File::create("schema_schema.dat").expect("Failed to create file");
    file.write_all(&data).expect("Failed to write file");
}