Trait DecodeExt

Source
pub trait DecodeExt<X: Default>: Decode<Cfg = X> {
    // Provided method
    fn decode(buf: impl Buf) -> Result<Self, Error> { ... }
}
Expand description

Extension trait providing ergonomic decode method for types requiring no specific configuration.

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

Provided Methods§

Source

fn decode(buf: impl Buf) -> Result<Self, Error>

Decodes 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", so this trait is not object safe.

Implementors§

Source§

impl<X: Default, T: Decode<Cfg = X>> DecodeExt<X> for T