[−][src]Trait postcard::flavors::SerFlavor
The SerFlavor trait acts as a combinator/middleware interface that can be used to pass bytes through storage or modification flavors. See the module level documentation for more information and examples.
Associated Types
type Output
The Output
type is what this flavor "resolves" to when the serialization is complete.
For storage flavors, this is typically a concrete type. For modification flavors, this is
typically a generic parameter for the storage flavor they are wrapped around.
Required methods
fn try_push(&mut self, data: u8) -> Result<(), ()>
The try_push() trait method can be used to push a single byte to be modified and/or stored
fn release(self) -> Result<Self::Output, ()>
The release() trait method finalizes the modification or storage operation, and resolved into
the type defined by SerFlavor::Output
associated type.
Provided methods
fn try_extend(&mut self, data: &[u8]) -> Result<(), ()>
The try_extend() trait method can be implemented when there is a more efficient way of processing multiple bytes at once, such as copying a slice to the output, rather than iterating over one byte at a time.
Implementors
impl SerFlavor for StdVec
[src]
type Output = Vec<u8>
fn try_extend(&mut self, data: &[u8]) -> Result<(), ()>
[src]
fn try_push(&mut self, data: u8) -> Result<(), ()>
[src]
fn release(self) -> Result<Self::Output, ()>
[src]
impl<'a> SerFlavor for Slice<'a>
[src]
type Output = &'a mut [u8]
fn try_extend(&mut self, data: &[u8]) -> Result<(), ()>
[src]
fn try_push(&mut self, data: u8) -> Result<(), ()>
[src]
fn release(self) -> Result<Self::Output, ()>
[src]
impl<'a, B> SerFlavor for Cobs<B> where
B: SerFlavor + IndexMut<usize, Output = u8>,
[src]
B: SerFlavor + IndexMut<usize, Output = u8>,
type Output = <B as SerFlavor>::Output
fn try_push(&mut self, data: u8) -> Result<(), ()>
[src]
fn release(self) -> Result<Self::Output, ()>
[src]
impl<'a, B> SerFlavor for HVec<B> where
B: ArrayLength<u8>,
[src]
B: ArrayLength<u8>,