[][src]Trait rdkafka::message::FromBytes

pub trait FromBytes {
    type Error;
    fn from_bytes(_: &[u8]) -> Result<&Self, Self::Error>;
}

Given a reference to a byte array, returns a different view of the same data. No allocation is performed, however the underlying data might be checked for correctness (for example when converting to str).

Associated Types

type Error

The error type that will be used whenever the conversion fails.

Loading content...

Required methods

fn from_bytes(_: &[u8]) -> Result<&Self, Self::Error>

Tries to convert the provided byte slice into a different type.

Loading content...

Implementations on Foreign Types

impl FromBytes for [u8][src]

type Error = ()

impl FromBytes for str[src]

type Error = Utf8Error

Loading content...

Implementors

Loading content...