Trait Encodable

Source
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§

Source

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§

Source

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§

Source§

impl Encodable for &str

Source§

type Encoded = WireString<'static>

Source§

impl Encodable for bool

Source§

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

Source§

type Encoded = bool

Source§

impl Encodable for f32

Source§

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

Source§

type Encoded = WireF32

Source§

impl Encodable for f64

Source§

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

Source§

type Encoded = WireF64

Source§

impl Encodable for i8

Source§

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

Source§

type Encoded = i8

Source§

impl Encodable for i16

Source§

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

Source§

type Encoded = WireI16

Source§

impl Encodable for i32

Source§

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

Source§

type Encoded = WireI32

Source§

impl Encodable for i64

Source§

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

Source§

type Encoded = WireI64

Source§

impl Encodable for u8

Source§

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

Source§

type Encoded = u8

Source§

impl Encodable for u16

Source§

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

Source§

type Encoded = WireU16

Source§

impl Encodable for u32

Source§

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

Source§

type Encoded = WireU32

Source§

impl Encodable for u64

Source§

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

Source§

type Encoded = WireU64

Source§

impl Encodable for ()

Source§

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

Source§

type Encoded = ()

Source§

impl Encodable for Channel

Source§

impl Encodable for Handle

Source§

impl Encodable for String

Source§

type Encoded = WireString<'static>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<T: Encodable> Encodable for &T

Source§

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

Source§

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

Source§

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

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§

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

Source§

type Encoded = WireF32

Source§

impl Encodable for WireF64

Source§

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

Source§

type Encoded = WireF64

Source§

impl Encodable for WireI16

Source§

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

Source§

type Encoded = WireI16

Source§

impl Encodable for WireI32

Source§

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

Source§

type Encoded = WireI32

Source§

impl Encodable for WireI64

Source§

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

Source§

type Encoded = WireI64

Source§

impl Encodable for WireU16

Source§

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

Source§

type Encoded = WireU16

Source§

impl Encodable for WireU32

Source§

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

Source§

type Encoded = WireU32

Source§

impl Encodable for WireU64

Source§

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

Source§

type Encoded = WireU64