/// Serializes the given data structure as a JSON byte vector

Serializes the given data structure as a JSON byte vector
Serializes the given data structure as a JSON byte vector
pub fn to_array<T>(value: &T, buf: &mut [u8]) -> Result<usize, Error>
where T: ser::Serialize + ?Sized {
    let mut ser = Serializer::new(buf);
    value.serialize(&mut ser)?;
    Ok(ser.pos)
}
pub fn to_array < T > ( value : & T , buf : & mut [ u8 ] ) -> Result < usize , Error > where T : ser :: Serialize + ? Sized { let mut ser = Serializer :: new ( buf ) ; value . serialize ( & mut ser ) ? ; Ok ( ser . pos ) }
Serializes the given data structure as a JSON byte vector
Serializes the given data structure as a JSON byte vector
value
&T
buf
&mut [u8]