Struct aversion::util::cbor::CborData [−][src]
pub struct CborData<RW> { /* fields omitted */ }
Expand description
A DataSource
and/or DataSink
using the CBOR serialization format.
CborData
works with any type that implements Read
or Write
.
That includes files, network sockets, and memory buffers.
It implements the DataSource
trait if the inner type implements Read
,
and implements the DataSink
trait if the inner type implements Write
.
Implementations
Consume the CborData
, returning the inner data type.
Trait Implementations
type Error = CborDataError
type Error = CborDataError
A user-defined error type. Read more
type Error = CborDataError
type Error = CborDataError
A user-defined error type. Read more
type Header = BasicHeader
type Header = BasicHeader
A user-defined header struct. Read more
Read a header from the data source. Read more
fn read_message<T>(&mut self, header: &BasicHeader) -> Result<T, CborDataError> where
T: DeserializeOwned,
fn read_message<T>(&mut self, header: &BasicHeader) -> Result<T, CborDataError> where
T: DeserializeOwned,
Read a message from the data source. Read more
An unknown message id was received. Read more
An unknown version of a known message was received. Read more
Expected a specific message type, but got a different message id. Read more
Auto Trait Implementations
impl<RW> RefUnwindSafe for CborData<RW> where
RW: RefUnwindSafe,
impl<RW> UnwindSafe for CborData<RW> where
RW: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn expect_message<T>(&mut Self) -> Result<T, <Src as DataSource>::Error> where
Src: DataSource,
T: MessageId + UpgradeLatest,
pub fn expect_message<T>(&mut Self) -> Result<T, <Src as DataSource>::Error> where
Src: DataSource,
T: MessageId + UpgradeLatest,
Read a specific message type from the DataSource
. Read more