Trait Decode

Source
pub unsafe trait Decode<D: ?Sized>: Wire {
    // 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 will contain a valid decoded value after the decoder is committed.

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 decoded value after the decoder is committed. 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> Decode<D> for ()

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<'static, T, E>
where D: Decoder + ?Sized, T: Decode<D>, E: Decode<D>,

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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