Trait Encodable

pub trait Encodable {
    type Encoded: ZeroPadding;

    const COPY_OPTIMIZATION: CopyOptimization<Self> = _;
}
Expand description

A type which can be encoded as FIDL.

Provided Associated Constants§

const COPY_OPTIMIZATION: CopyOptimization<Self> = _

An optimization flag that allows the bytes of this type to be copied directly during encoding instead of calling encode.

This optimization is disabled by default. To enable this optimization, you must unsafely attest that Self is trivially copyable using CopyOptimization::enable or CopyOptimization::enable_if.

Required Associated Types§

type Encoded: ZeroPadding

The wire type for the value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

§

impl Encodable for bool

§

impl Encodable for f32

§

impl Encodable for f64

§

impl Encodable for i8

§

impl Encodable for i16

§

impl Encodable for i32

§

impl Encodable for i64

§

impl Encodable for u8

§

impl Encodable for u16

§

impl Encodable for u32

§

impl Encodable for u64

§

impl Encodable for ()

§

impl Encodable for String

§

impl Encodable for WireMessageHeader

§

type Encoded = WireMessageHeader

§

impl<T> Encodable for Option<T>
where T: EncodableOption,

§

impl<T> Encodable for Box<T>
where T: Encodable,

§

type Encoded = <T as Encodable>::Encoded

§

impl<T> Encodable for Vec<T>
where T: Encodable,

§

impl<T, E> Encodable for Result<T, E>
where T: Encodable, E: Encodable,

§

impl<T, const N: usize> Encodable for [T; N]
where T: Encodable,

Implementors§

§

impl Encodable for FrameworkError

§

impl Encodable for Channel

§

impl Encodable for Handle

§

impl Encodable for WireF32

§

impl Encodable for WireF64

§

impl Encodable for WireI16

§

impl Encodable for WireI32

§

impl Encodable for WireI64

§

impl Encodable for WireU16

§

impl Encodable for WireU32

§

impl Encodable for WireU64

§

impl<T> Encodable for Flexible<T>
where T: Encodable,

§

impl<T, E> Encodable for FlexibleResult<T, E>
where T: Encodable, E: Encodable,

§

impl<T, P> Encodable for ClientEnd<T, P>
where T: Encodable,

§

impl<T, P> Encodable for ServerEnd<T, P>
where T: Encodable,