pub fn encode_message<T: Body>(
header: TransactionHeader,
body: T,
) -> Result<Vec<u8>, Error>where
for<'a> <<T as Body>::MarkerAtTopLevel as ValueTypeMarker>::Borrowed<'a>: Encode<T::MarkerAtTopLevel, NoHandleResourceDialect>,
Expand description
Encodes a FIDL transaction message (request or response). Use this for one-way methods, events, and two-way method requests. For two-way method responses:
- use
encode_response_result
if the method has error syntax (strict or flexible). - use
encode_response_flexible
if the method is flexible (no error syntax). - use this method otherwise.