Trait Decode

pub unsafe trait Decode<D>
where 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§

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§

§

impl<D> Decode<D> for bool
where D: ?Sized,

§

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

§

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

§

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

§

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

§

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

§

impl<D> Decode<D> for ()
where D: ?Sized,

§

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

§

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

§

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

§

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

§

fn decode(slot: Slot<'_, [T; N]>, decoder: &mut D) -> Result<(), DecodeError>

Implementors§

§

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

§

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

§

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

§

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

§

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

§

impl<D> Decode<D> for WireFrameworkError
where D: ?Sized,

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

impl<D, T> Decode<D> for WireVector<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, T, E> Decode<D> for WireResult<T, E>
where D: Decoder + ?Sized, T: Decode<D>, E: Decode<D>,

§

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

§

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

impl<___D> Decode<___D> for WireCalculatorAddRequest

impl<___D> Decode<___D> for WireCalculatorAddResponse

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

impl<___D> Decode<___D> for WireDeviceGetEventResponse
where ___D: InternalHandleDecoder + ?Sized + HandleDecoder,

impl<___D> Decode<___D> for WireDeviceGetHardwareIdResponse
where ___D: InternalHandleDecoder + ?Sized,