module std.ser.formats
std.ser.formats — the built-in formats under the names of the standard (formats.oxl/json/msgpack/cbor, II.1).
Example:
use std.ser { encode, formats }
fn main() io {
let a = encode(&7, formats.msgpack)!
let b = encode(&7, formats.cbor)!
print("{a.len()} {b.len()}")
}Вывод
1 1
Константы
cbor | CBOR (RFC 8949, D-7600). |
json | Canonical protobuf JSON mapping. |
msgpack | MessagePack (D-7600). |
oxl | The OxL binary format (protobuf 3 wire encoding, §9.3); the default of encode / decode. |