Trait EncodeRef

pub unsafe trait EncodeRef<E>: Encode<E>
where E: ?Sized,
{ // Required method fn encode_ref( &self, encoder: &mut E, out: &mut MaybeUninit<Self::Encoded>, ) -> Result<(), EncodeError>; }
Expand description

Encodes a reference.

§Safety

encode must initialize all non-padding bytes of out.

Required Methods§

fn encode_ref( &self, encoder: &mut E, out: &mut MaybeUninit<Self::Encoded>, ) -> Result<(), EncodeError>

Encodes this reference 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> EncodeRef<E> for bool
where E: ?Sized,

§

fn encode_ref( &self, _: &mut E, out: &mut MaybeUninit<<bool as Encodable>::Encoded>, ) -> Result<(), EncodeError>

§

impl<E> EncodeRef<E> for f32
where E: ?Sized,

§

fn encode_ref( &self, _: &mut E, out: &mut MaybeUninit<<f32 as Encodable>::Encoded>, ) -> Result<(), EncodeError>

§

impl<E> EncodeRef<E> for f64
where E: ?Sized,

§

fn encode_ref( &self, _: &mut E, out: &mut MaybeUninit<<f64 as Encodable>::Encoded>, ) -> Result<(), EncodeError>

§

impl<E> EncodeRef<E> for i8
where E: ?Sized,

§

fn encode_ref( &self, _: &mut E, out: &mut MaybeUninit<<i8 as Encodable>::Encoded>, ) -> Result<(), EncodeError>

§

impl<E> EncodeRef<E> for i16
where E: ?Sized,

§

fn encode_ref( &self, _: &mut E, out: &mut MaybeUninit<<i16 as Encodable>::Encoded>, ) -> Result<(), EncodeError>

§

impl<E> EncodeRef<E> for i32
where E: ?Sized,

§

fn encode_ref( &self, _: &mut E, out: &mut MaybeUninit<<i32 as Encodable>::Encoded>, ) -> Result<(), EncodeError>

§

impl<E> EncodeRef<E> for i64
where E: ?Sized,

§

fn encode_ref( &self, _: &mut E, out: &mut MaybeUninit<<i64 as Encodable>::Encoded>, ) -> Result<(), EncodeError>

§

impl<E> EncodeRef<E> for u8
where E: ?Sized,

§

fn encode_ref( &self, _: &mut E, out: &mut MaybeUninit<<u8 as Encodable>::Encoded>, ) -> Result<(), EncodeError>

§

impl<E> EncodeRef<E> for u16
where E: ?Sized,

§

fn encode_ref( &self, _: &mut E, out: &mut MaybeUninit<<u16 as Encodable>::Encoded>, ) -> Result<(), EncodeError>

§

impl<E> EncodeRef<E> for u32
where E: ?Sized,

§

fn encode_ref( &self, _: &mut E, out: &mut MaybeUninit<<u32 as Encodable>::Encoded>, ) -> Result<(), EncodeError>

§

impl<E> EncodeRef<E> for u64
where E: ?Sized,

§

fn encode_ref( &self, _: &mut E, out: &mut MaybeUninit<<u64 as Encodable>::Encoded>, ) -> Result<(), EncodeError>

§

impl<E> EncodeRef<E> for ()
where E: ?Sized,

§

fn encode_ref( &self, _: &mut E, out: &mut MaybeUninit<<() as Encodable>::Encoded>, ) -> Result<(), EncodeError>

§

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

§

fn encode_ref( &self, encoder: &mut E, out: &mut MaybeUninit<<String as Encodable>::Encoded>, ) -> Result<(), EncodeError>

§

impl<E> EncodeRef<E> for WireMessageHeader
where E: ?Sized,

§

fn encode_ref( &self, _: &mut E, out: &mut MaybeUninit<<WireMessageHeader as Encodable>::Encoded>, ) -> Result<(), EncodeError>

§

impl<E, T> EncodeRef<E> for Option<T>
where T: EncodeOptionRef<E>, E: ?Sized,

§

fn encode_ref( &self, encoder: &mut E, out: &mut MaybeUninit<<Option<T> as Encodable>::Encoded>, ) -> Result<(), EncodeError>

§

impl<E, T> EncodeRef<E> for Box<T>
where T: EncodeRef<E>, E: ?Sized,

§

fn encode_ref( &self, encoder: &mut E, out: &mut MaybeUninit<<Box<T> as Encodable>::Encoded>, ) -> Result<(), EncodeError>

§

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

§

fn encode_ref( &self, encoder: &mut E, out: &mut MaybeUninit<<Vec<T> as Encodable>::Encoded>, ) -> Result<(), EncodeError>

§

impl<E, T, const N: usize> EncodeRef<E> for [T; N]
where T: EncodeRef<E>, E: ?Sized,

§

fn encode_ref( &self, encoder: &mut E, out: &mut MaybeUninit<<[T; N] as Encodable>::Encoded>, ) -> Result<(), EncodeError>

§

impl<Enc, T, E> EncodeRef<Enc> for Result<T, E>
where Enc: Encoder + ?Sized, T: EncodeRef<Enc>, E: EncodeRef<Enc>,

§

fn encode_ref( &self, encoder: &mut Enc, out: &mut MaybeUninit<<Result<T, E> as Encodable>::Encoded>, ) -> Result<(), EncodeError>

Implementors§

§

impl<E> EncodeRef<E> for FrameworkError
where E: ?Sized,

§

impl<E> EncodeRef<E> for WireF32
where E: ?Sized,

§

impl<E> EncodeRef<E> for WireF64
where E: ?Sized,

§

impl<E> EncodeRef<E> for WireI16
where E: ?Sized,

§

impl<E> EncodeRef<E> for WireI32
where E: ?Sized,

§

impl<E> EncodeRef<E> for WireI64
where E: ?Sized,

§

impl<E> EncodeRef<E> for WireU16
where E: ?Sized,

§

impl<E> EncodeRef<E> for WireU32
where E: ?Sized,

§

impl<E> EncodeRef<E> for WireU64
where E: ?Sized,

§

impl<E, T> EncodeRef<E> for Flexible<T>
where E: Encoder + ?Sized, T: EncodeRef<E>,

§

impl<E, T, P> EncodeRef<E> for ClientEnd<T, P>
where T: EncodeRef<E>, P: 'static, E: ?Sized,

§

impl<E, T, P> EncodeRef<E> for ServerEnd<T, P>
where T: EncodeRef<E>, P: 'static, E: ?Sized,

§

impl<Enc, T, E> EncodeRef<Enc> for FlexibleResult<T, E>
where Enc: Encoder + ?Sized, T: EncodeRef<Enc>, E: EncodeRef<Enc>,