voxj-codec 0.1.0

Encodes voxj types into .voxj / .voxjz documents.
Documentation
1
2
3
4
5
6
7
8
9
use voxj::VoxjSerdeFile;

/// Serializes `file` to pretty-printed `.voxj` JSON bytes with a trailing
/// newline.
pub fn to_voxj_pretty_file_bytes(file: &VoxjSerdeFile) -> serde_json::Result<Vec<u8>> {
    let mut bytes = serde_json::to_vec_pretty(file)?;
    bytes.push(b'\n');
    Ok(bytes)
}