/// Encode a FIDL type into some bytes
Encode a FIDL type into some bytes
Encode a FIDL type into some bytes
pub fn encode_fidl_with_context(
    ctx: Context,
    value: &mut impl fidl::encoding::Persistable,
) -> Result<Vec<u8>, Error> {
    if ctx.use_persistent_header {
        fidl::encoding::encode_persistent_with_context(
            &fidl::encoding::Context { wire_format_version: fidl::encoding::WireFormatVersion::V1 },
            value,
        )
        .map_err(Into::into)
    } else {
        let (mut bytes, mut handles) = (Vec::new(), Vec::new());
        fidl::encoding::Encoder::encode_with_context(
            &fidl::encoding::Context { wire_format_version: fidl::encoding::WireFormatVersion::V1 },
            &mut bytes,
            &mut handles,
            value,
        )?;
        assert_eq!(handles.len(), 0);
        Ok(bytes)
    }
}
pub fn encode_fidl_with_context ( ctx : Context , value : & mut impl fidl :: encoding :: Persistable , ) -> Result < Vec < u8 > , Error > { if ctx . use_persistent_header { fidl :: encoding :: encode_persistent_with_context ( & fidl :: encoding :: Context { wire_format_version : fidl :: encoding :: WireFormatVersion :: V1 } , value , ) . map_err ( Into :: into ) } else { let ( mut bytes , mut handles ) = ( Vec :: new ( ) , Vec :: new ( ) ) ; fidl :: encoding :: Encoder :: encode_with_context ( & fidl :: encoding :: Context { wire_format_version : fidl :: encoding :: WireFormatVersion :: V1 } , & mut bytes , & mut handles , value , ) ? ; assert_eq ! ( handles len ( ) 0 ) ; Ok ( bytes ) } }
Encode a FIDL type into some bytes
Encode a FIDL type into some bytes
ctx
Context
value
&mut impl fidl::encoding::Persistable