Function zvariant::to_bytes

source ·
pub fn to_bytes<B, T>(ctxt: EncodingContext<B>, value: &T) -> Result<Vec<u8>>
Expand description

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.