Skip to main content

ReadExt

Trait ReadExt 

Source
pub trait ReadExt: Read<Cfg = ()> {
    // Provided method
    fn read(buf: &mut impl Buf) -> Result<Self, Error> { ... }
}
Expand description

Extension trait providing ergonomic read method for types requiring no configuration (i.e. Cfg = ()).

Import this trait to use the .read(buf) method as a shorthand for .read_cfg(buf, ()).

Provided Methods§

Source

fn read(buf: &mut impl Buf) -> Result<Self, Error>

Reads a value using the default () config.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T: Read<Cfg = ()>> ReadExt for T