pub fn to_vec<T>(value: &T) -> Result<Vec<u8>, JsonError>where T: Serialize,
Serialize a value to a JSON byte vector.
Uses pre-allocated buffer with estimated capacity for better performance.