Trait EncodeOption

pub unsafe trait EncodeOption<E>: EncodableOption
where E: ?Sized,
{ // Required method fn encode_option( this: Option<&mut Self>, encoder: &mut E, out: &mut MaybeUninit<Self::EncodedOption>, ) -> Result<(), EncodeError>; }
Expand description

Encodes an optional value.

§Safety

encode_option must initialize all non-padding bytes of out.

Required Methods§

fn encode_option( this: Option<&mut Self>, encoder: &mut E, out: &mut MaybeUninit<Self::EncodedOption>, ) -> Result<(), EncodeError>

Encodes this optional value into an encoder and output.

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<E> EncodeOption<E> for bool
where E: Encoder + ?Sized,

§

fn encode_option( this: Option<&mut bool>, encoder: &mut E, out: &mut MaybeUninit<<bool as EncodableOption>::EncodedOption>, ) -> Result<(), EncodeError>

§

impl<E> EncodeOption<E> for f32
where E: Encoder + ?Sized,

§

fn encode_option( this: Option<&mut f32>, encoder: &mut E, out: &mut MaybeUninit<<f32 as EncodableOption>::EncodedOption>, ) -> Result<(), EncodeError>

§

impl<E> EncodeOption<E> for f64
where E: Encoder + ?Sized,

§

fn encode_option( this: Option<&mut f64>, encoder: &mut E, out: &mut MaybeUninit<<f64 as EncodableOption>::EncodedOption>, ) -> Result<(), EncodeError>

§

impl<E> EncodeOption<E> for i8
where E: Encoder + ?Sized,

§

fn encode_option( this: Option<&mut i8>, encoder: &mut E, out: &mut MaybeUninit<<i8 as EncodableOption>::EncodedOption>, ) -> Result<(), EncodeError>

§

impl<E> EncodeOption<E> for i16
where E: Encoder + ?Sized,

§

fn encode_option( this: Option<&mut i16>, encoder: &mut E, out: &mut MaybeUninit<<i16 as EncodableOption>::EncodedOption>, ) -> Result<(), EncodeError>

§

impl<E> EncodeOption<E> for i32
where E: Encoder + ?Sized,

§

fn encode_option( this: Option<&mut i32>, encoder: &mut E, out: &mut MaybeUninit<<i32 as EncodableOption>::EncodedOption>, ) -> Result<(), EncodeError>

§

impl<E> EncodeOption<E> for i64
where E: Encoder + ?Sized,

§

fn encode_option( this: Option<&mut i64>, encoder: &mut E, out: &mut MaybeUninit<<i64 as EncodableOption>::EncodedOption>, ) -> Result<(), EncodeError>

§

impl<E> EncodeOption<E> for u8
where E: Encoder + ?Sized,

§

fn encode_option( this: Option<&mut u8>, encoder: &mut E, out: &mut MaybeUninit<<u8 as EncodableOption>::EncodedOption>, ) -> Result<(), EncodeError>

§

impl<E> EncodeOption<E> for u16
where E: Encoder + ?Sized,

§

fn encode_option( this: Option<&mut u16>, encoder: &mut E, out: &mut MaybeUninit<<u16 as EncodableOption>::EncodedOption>, ) -> Result<(), EncodeError>

§

impl<E> EncodeOption<E> for u32
where E: Encoder + ?Sized,

§

fn encode_option( this: Option<&mut u32>, encoder: &mut E, out: &mut MaybeUninit<<u32 as EncodableOption>::EncodedOption>, ) -> Result<(), EncodeError>

§

impl<E> EncodeOption<E> for u64
where E: Encoder + ?Sized,

§

fn encode_option( this: Option<&mut u64>, encoder: &mut E, out: &mut MaybeUninit<<u64 as EncodableOption>::EncodedOption>, ) -> Result<(), EncodeError>

§

impl<E> EncodeOption<E> for ()
where E: Encoder + ?Sized,

§

fn encode_option( this: Option<&mut ()>, encoder: &mut E, out: &mut MaybeUninit<<() as EncodableOption>::EncodedOption>, ) -> Result<(), EncodeError>

§

impl<E> EncodeOption<E> for String
where E: Encoder + ?Sized,

§

impl<E, T> EncodeOption<E> for Vec<T>
where E: Encoder + ?Sized, T: Encode<E>,

§

fn encode_option( this: Option<&mut Vec<T>>, encoder: &mut E, out: &mut MaybeUninit<<Vec<T> as EncodableOption>::EncodedOption>, ) -> Result<(), EncodeError>

Implementors§

§

impl<E> EncodeOption<E> for Channel
where E: HandleEncoder + ?Sized,

§

impl<E> EncodeOption<E> for Handle
where E: HandleEncoder + ?Sized,

§

impl<E> EncodeOption<E> for WireF32
where E: Encoder + ?Sized,

§

impl<E> EncodeOption<E> for WireF64
where E: Encoder + ?Sized,

§

impl<E> EncodeOption<E> for WireI16
where E: Encoder + ?Sized,

§

impl<E> EncodeOption<E> for WireI32
where E: Encoder + ?Sized,

§

impl<E> EncodeOption<E> for WireI64
where E: Encoder + ?Sized,

§

impl<E> EncodeOption<E> for WireU16
where E: Encoder + ?Sized,

§

impl<E> EncodeOption<E> for WireU32
where E: Encoder + ?Sized,

§

impl<E> EncodeOption<E> for WireU64
where E: Encoder + ?Sized,

§

impl<E, T, P> EncodeOption<E> for ClientEnd<T, P>
where T: EncodeOption<E>, E: ?Sized,

§

impl<E, T, P> EncodeOption<E> for ServerEnd<T, P>
where T: EncodeOption<E>, E: ?Sized,

impl<___E> EncodeOption<___E> for Box<CalculatorAddRequest>
where ___E: Encoder + ?Sized, CalculatorAddRequest: Encode<___E>,

impl<___E> EncodeOption<___E> for Box<CalculatorAddResponse>
where ___E: Encoder + ?Sized, CalculatorAddResponse: Encode<___E>,

impl<___E> EncodeOption<___E> for Box<DeviceGetEventResponse>
where ___E: Encoder + ?Sized, DeviceGetEventResponse: Encode<___E>,

impl<___E> EncodeOption<___E> for Box<DeviceGetHardwareIdResponse>
where ___E: Encoder + ?Sized, DeviceGetHardwareIdResponse: Encode<___E>,