FromBuf

Trait FromBuf 

Source
pub trait FromBuf: Sized {
    // Required method
    fn from_buf<B>(buffer: B) -> Result<Self>
       where B: Buf;
}
Expand description

Objects which implement FromBuf are capable of constructing themselves by reading bytes from a Buf

Required Methods§

Source

fn from_buf<B>(buffer: B) -> Result<Self>
where B: Buf,

read an instance of Self from a buffer

§Errors

This method will return an error if the number of bytes remaining in the buffer is insufficent, or if the type cannot be parsed from the bytes.

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§