Trait Decode

Source
pub unsafe trait Decode<D: ?Sized> {
    // Required method
    fn decode(slot: Slot<'_, Self>, decoder: &mut D) -> Result<(), DecodeError>;
}
Expand description

Decodes a value from the given slot.

§Safety

If decode returns Ok, then the provided slot must now contain a valid value of the implementing type.

Required Methods§

Source

fn decode(slot: Slot<'_, Self>, decoder: &mut D) -> Result<(), DecodeError>

Decodes a value into a slot using a decoder.

If decoding succeeds, slot will contain a valid value. If decoding fails, an error will be returned.

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<D: ?Sized> Decode<D> for bool

Source§

fn decode(slot: Slot<'_, Self>, _: &mut D) -> Result<(), DecodeError>

Source§

impl<D: ?Sized> Decode<D> for i8

Source§

fn decode(_: Slot<'_, Self>, _: &mut D) -> Result<(), DecodeError>

Source§

impl<D: ?Sized> Decode<D> for u8

Source§

fn decode(_: Slot<'_, Self>, _: &mut D) -> Result<(), DecodeError>

Source§

impl<D: ?Sized, T: Decode<D>, const N: usize> Decode<D> for [T; N]

Source§

fn decode(slot: Slot<'_, Self>, decoder: &mut D) -> Result<(), DecodeError>

Implementors§

Source§

impl<D, T, E> Decode<D> for WireResult<T, E>
where D: Decoder + ?Sized, T: Decode<D>, E: Decode<D>,

Source§

impl<D: Decoder + ?Sized> Decode<D> for WireOptionalString

Source§

impl<D: Decoder + ?Sized> Decode<D> for WireString

Source§

impl<D: Decoder + ?Sized, T: Decode<D>> Decode<D> for WireBox<T>

Source§

impl<D: Decoder + ?Sized, T: Decode<D>> Decode<D> for WireOptionalVector<T>

Source§

impl<D: Decoder + ?Sized, T: Decode<D>> Decode<D> for WireVector<T>

Source§

impl<D: HandleDecoder + ?Sized> Decode<D> for WireChannel

Source§

impl<D: HandleDecoder + ?Sized> Decode<D> for WireOptionalChannel

Source§

impl<D: HandleDecoder + ?Sized> Decode<D> for WireOptionalHandle

Source§

impl<D: HandleDecoder + ?Sized> Decode<D> for WireHandle

Source§

impl<D: ?Sized> Decode<D> for WireF32

Source§

impl<D: ?Sized> Decode<D> for WireF64

Source§

impl<D: ?Sized> Decode<D> for WireI16

Source§

impl<D: ?Sized> Decode<D> for WireI32

Source§

impl<D: ?Sized> Decode<D> for WireI64

Source§

impl<D: ?Sized> Decode<D> for WireU16

Source§

impl<D: ?Sized> Decode<D> for WireU32

Source§

impl<D: ?Sized> Decode<D> for WireU64

impl<D, T, P> Decode<D> for ClientEnd<T, P>
where D: ?Sized, T: Decode<D>,

impl<D, T, P> Decode<D> for ServerEnd<T, P>
where D: ?Sized, T: Decode<D>,

impl<___D> Decode<___D> for WireCalculatorAddRequest

impl<___D> Decode<___D> for WireCalculatorAddResponse

impl<___D> Decode<___D> for WireDivisionError
where ___D: ?Sized,

impl<D, T> Decode<D> for WireFlexible<T>
where D: Decoder + ?Sized, T: Decode<D>,

impl<D, T, E> Decode<D> for WireFlexibleResult<T, E>
where D: Decoder + ?Sized, T: Decode<D>, E: Decode<D>,

impl<D: ?Sized> Decode<D> for WireMessageHeader