voxj-codec 0.1.1

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

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