Function zvariant::to_bytes[][src]

pub fn to_bytes<B, T: ?Sized>(
    ctxt: EncodingContext<B>,
    value: &T
) -> Result<Vec<u8>> where
    B: ByteOrder,
    T: Serialize + Type

Serialize T as a byte vector.

See from_slice documentation for an example of how to use this function.

Panics

This function will panic if the value to serialize contains file descriptors. Use to_bytes_fds if you’d want to potentially pass FDs.