[][src]Function zvariant::to_bytes_for_signature

pub fn to_bytes_for_signature<B, T: ?Sized>(
    ctxt: EncodingContext<B>,
    signature: &Signature<'_>,
    value: &T
) -> Result<Vec<u8>> where
    B: ByteOrder,
    T: Serialize

Serialize T that has the given signature, to a new byte vector.

Use this function instead of to_bytes if the value being serialized does not implement Type. See from_slice_for_signature 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_for_signature if you'd want to potentially pass FDs.