Trait Encodable

Source
pub trait Encodable {
    type Encoded: ZeroPadding;

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

A type which can be encoded as FIDL.

Provided Associated Constants§

Source

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§

Source

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§

Source§

impl Encodable for bool

Source§

impl Encodable for f32

Source§

impl Encodable for f64

Source§

impl Encodable for i8

Source§

impl Encodable for i16

Source§

impl Encodable for i32

Source§

impl Encodable for i64

Source§

impl Encodable for u8

Source§

impl Encodable for u16

Source§

impl Encodable for u32

Source§

impl Encodable for u64

Source§

impl Encodable for ()

Source§

impl Encodable for Channel

Source§

impl Encodable for Handle

Source§

impl Encodable for String

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Implementors§

Source§

impl Encodable for WireF32

Source§

impl Encodable for WireF64

Source§

impl Encodable for WireI16

Source§

impl Encodable for WireI32

Source§

impl Encodable for WireI64

Source§

impl Encodable for WireU16

Source§

impl Encodable for WireU32

Source§

impl Encodable for WireU64

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

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

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

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