Trait coset::CborSerializable [−][src]
pub trait CborSerializable: Serialize + DeserializeOwned { fn from_reader<R: Read>(reader: R) -> Result<Self> { ... } fn from_slice(slice: &[u8]) -> Result<Self> { ... } fn to_vec(&self) -> Result<Vec<u8>> { ... } fn to_writer<W: Write>(&self, writer: W) -> Result<()> { ... } }
Expand description
Extension trait that adds serialization/deserialization methods.
Provided methods
fn from_reader<R: Read>(reader: R) -> Result<Self>
[src]
Expand description
Create an object instance by reading serialized CBOR data from std::io::Read
instance.
fn from_slice(slice: &[u8]) -> Result<Self>
[src]
Expand description
Create an object instance from serialized CBOR data in a slice.
fn to_vec(&self) -> Result<Vec<u8>>
[src]
Expand description
Serialize this object to a vector.
fn to_writer<W: Write>(&self, writer: W) -> Result<()>
[src]
Expand description
Serialize this object to a std::io::Write
instance.