Trait Decodable

Source
pub trait Decodable<R: IoRead>: Sized {
    type Output;

    // Required method
    fn decode(reader: &mut R) -> IoResult<Self::Output>;
}
Expand description

A type that can be decoded from an I/O reader.

See also Encodable.

Required Associated Types§

Source

type Output

The type produced when decoding.

Required Methods§

Source

fn decode(reader: &mut R) -> IoResult<Self::Output>

Decodes Self from the given reader, returning the decoded value.

§Errors

Returns an IoError if decoding fails.

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<'a> Decodable<&'a mut &[u8]> for &'a str

Source§

type Output = &'a str

Source§

fn decode(reader: &mut &'a mut &[u8]) -> IoResult<Self::Output>

Source§

impl<R: IoRead> Decodable<R> for bool

Source§

impl<R: IoRead> Decodable<R> for char

Source§

impl<R: IoRead> Decodable<R> for i8

Source§

impl<R: IoRead> Decodable<R> for u8

Source§

impl<R: IoRead, const SIZE: usize> Decodable<R> for [u8; SIZE]

Source§

type Output = [u8; SIZE]

Source§

fn decode(reader: &mut R) -> IoResult<Self::Output>

Implementors§

Source§

impl<'a, CodecEndian> Decodable<&'a mut &'a [u8]> for CodecLenValue<&'a str, CodecEndian>
where CodecEndian: CodecEndianLen + Decodable<&'a mut &'a [u8], Output = <CodecEndian as CodecEndianLen>::Len>, <CodecEndian as CodecEndianLen>::Len: TryInto<usize>,

Source§

type Output = &'a str

Source§

impl<D, O, CodecEndian, R> Decodable<R> for CodecLenValue<D, CodecEndian>
where for<'i> D: Decodable<IoTake<&'i mut R>, Output = O>, CodecEndian: Decodable<R, Output = <CodecEndian as CodecEndianLen>::Len> + CodecEndianLen, R: IoRead, for<'r> &'r mut R: IoRead,

Source§

impl<R: IoRead> Decodable<R> for CString

Source§

impl<R: IoRead> Decodable<R> for CodecBe<f32>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<f64>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<i8>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<i16>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<i32>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<i64>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<i128>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<isize>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<u8>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<u16>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<u32>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<u64>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<u128>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<usize>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<NonZero<i8>>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<NonZero<i16>>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<NonZero<i32>>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<NonZero<i64>>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<NonZero<i128>>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<NonZero<isize>>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<NonZero<u8>>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<NonZero<u16>>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<NonZero<u32>>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<NonZero<u64>>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<NonZero<u128>>

Source§

impl<R: IoRead> Decodable<R> for CodecBe<NonZero<usize>>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<f32>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<f64>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<i8>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<i16>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<i32>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<i64>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<i128>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<isize>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<u8>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<u16>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<u32>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<u64>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<u128>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<usize>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<NonZero<i8>>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<NonZero<i16>>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<NonZero<i32>>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<NonZero<i64>>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<NonZero<i128>>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<NonZero<isize>>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<NonZero<u8>>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<NonZero<u16>>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<NonZero<u32>>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<NonZero<u64>>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<NonZero<u128>>

Source§

impl<R: IoRead> Decodable<R> for CodecLe<NonZero<usize>>

Source§

impl<R: IoRead> Decodable<R> for String

Source§

impl<R: IoRead> Decodable<R> for Vec<u8>

Source§

impl<R: IoRead, T: Decodable<R>> Decodable<R> for Box<T>

Source§

type Output = Box<<T as Decodable<R>>::Output>