Trait Encodable

pub trait Encodable {
    type Encoded: Wire;

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

A type which can be encoded as FIDL.

Provided Associated Constants§

const COPY_OPTIMIZATION: CopyOptimization<Self, Self::Encoded> = _

Whether the conversion from Self to Self::Encoded is equivalent to copying the raw bytes of Self.

Copy optimization is disabled by default.

Required Associated Types§

type Encoded: Wire

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 &str

§

type Encoded = WireString<'static>

§

impl Encodable for bool

§

const COPY_OPTIMIZATION: CopyOptimization<bool, bool> = CopyOptimization<bool, bool>::PRIMITIVE

§

type Encoded = bool

§

impl Encodable for f32

§

const COPY_OPTIMIZATION: CopyOptimization<f32, WireF32> = CopyOptimization<f32, WireF32>::PRIMITIVE

§

type Encoded = WireF32

§

impl Encodable for f64

§

const COPY_OPTIMIZATION: CopyOptimization<f64, WireF64> = CopyOptimization<f64, WireF64>::PRIMITIVE

§

type Encoded = WireF64

§

impl Encodable for i8

§

const COPY_OPTIMIZATION: CopyOptimization<i8, i8> = CopyOptimization<i8, i8>::PRIMITIVE

§

type Encoded = i8

§

impl Encodable for i16

§

const COPY_OPTIMIZATION: CopyOptimization<i16, WireI16> = CopyOptimization<i16, WireI16>::PRIMITIVE

§

type Encoded = WireI16

§

impl Encodable for i32

§

const COPY_OPTIMIZATION: CopyOptimization<i32, WireI32> = CopyOptimization<i32, WireI32>::PRIMITIVE

§

type Encoded = WireI32

§

impl Encodable for i64

§

const COPY_OPTIMIZATION: CopyOptimization<i64, WireI64> = CopyOptimization<i64, WireI64>::PRIMITIVE

§

type Encoded = WireI64

§

impl Encodable for u8

§

const COPY_OPTIMIZATION: CopyOptimization<u8, u8> = CopyOptimization<u8, u8>::PRIMITIVE

§

type Encoded = u8

§

impl Encodable for u16

§

const COPY_OPTIMIZATION: CopyOptimization<u16, WireU16> = CopyOptimization<u16, WireU16>::PRIMITIVE

§

type Encoded = WireU16

§

impl Encodable for u32

§

const COPY_OPTIMIZATION: CopyOptimization<u32, WireU32> = CopyOptimization<u32, WireU32>::PRIMITIVE

§

type Encoded = WireU32

§

impl Encodable for u64

§

const COPY_OPTIMIZATION: CopyOptimization<u64, WireU64> = CopyOptimization<u64, WireU64>::PRIMITIVE

§

type Encoded = WireU64

§

impl Encodable for ()

§

const COPY_OPTIMIZATION: CopyOptimization<(), ()> = CopyOptimization<(), ()>::PRIMITIVE

§

type Encoded = ()

§

impl Encodable for String

§

type Encoded = WireString<'static>

§

impl Encodable for WireMessageHeader

§

type Encoded = WireMessageHeader

§

impl<T> Encodable for &[T]
where T: Encodable,

§

type Encoded = WireVector<'static, <T as Encodable>::Encoded>

§

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

§

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

§

type Encoded = <T as Encodable>::Encoded

§

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

§

type Encoded = <T as Encodable>::Encoded

§

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

§

type Encoded = WireVector<'static, <T as Encodable>::Encoded>

§

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

§

type Encoded = WireResult<'static, <T as Encodable>::Encoded, <E as Encodable>::Encoded>

§

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

Implementors§

§

impl Encodable for FrameworkError

§

impl Encodable for Bti

§

impl Encodable for Channel

§

impl Encodable for Clock

§

impl Encodable for Event

§

impl Encodable for EventPair

§

impl Encodable for Exception

§

impl Encodable for Fifo

§

impl Encodable for Guest

§

impl Encodable for Handle

§

impl Encodable for Interrupt

§

impl Encodable for Iob

§

impl Encodable for Iommu

§

impl Encodable for Job

§

impl Encodable for Pager

§

impl Encodable for Pmt

§

impl Encodable for Port

§

impl Encodable for Process

§

impl Encodable for Profile

§

impl Encodable for Resource

§

impl Encodable for Socket

§

impl Encodable for Stream

§

impl Encodable for Thread

§

impl Encodable for Timer

§

impl Encodable for Vcpu

§

impl Encodable for Vmar

§

impl Encodable for Vmo

§

impl Encodable for WireF32

§

const COPY_OPTIMIZATION: CopyOptimization<WireF32, WireF32> = CopyOptimization<WireF32, WireF32>::PRIMITIVE

§

type Encoded = WireF32

§

impl Encodable for WireF64

§

const COPY_OPTIMIZATION: CopyOptimization<WireF64, WireF64> = CopyOptimization<WireF64, WireF64>::PRIMITIVE

§

type Encoded = WireF64

§

impl Encodable for WireI16

§

const COPY_OPTIMIZATION: CopyOptimization<WireI16, WireI16> = CopyOptimization<WireI16, WireI16>::PRIMITIVE

§

type Encoded = WireI16

§

impl Encodable for WireI32

§

const COPY_OPTIMIZATION: CopyOptimization<WireI32, WireI32> = CopyOptimization<WireI32, WireI32>::PRIMITIVE

§

type Encoded = WireI32

§

impl Encodable for WireI64

§

const COPY_OPTIMIZATION: CopyOptimization<WireI64, WireI64> = CopyOptimization<WireI64, WireI64>::PRIMITIVE

§

type Encoded = WireI64

§

impl Encodable for WireU16

§

const COPY_OPTIMIZATION: CopyOptimization<WireU16, WireU16> = CopyOptimization<WireU16, WireU16>::PRIMITIVE

§

type Encoded = WireU16

§

impl Encodable for WireU32

§

const COPY_OPTIMIZATION: CopyOptimization<WireU32, WireU32> = CopyOptimization<WireU32, WireU32>::PRIMITIVE

§

type Encoded = WireU32

§

impl Encodable for WireU64

§

const COPY_OPTIMIZATION: CopyOptimization<WireU64, WireU64> = CopyOptimization<WireU64, WireU64>::PRIMITIVE

§

type Encoded = WireU64

§

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

§

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

§

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

§

type Encoded = WireFlexible<'static, <T as Encodable>::Encoded>

§

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