[−][src]Struct tokio_serde_cbor::Codec
Implementations
impl<'de, Dec: Deserialize<'de>, Enc: Serialize> Codec<Dec, Enc>
[src]
pub fn new() -> Self
[src]
Creates a new codec
pub fn sd(self, sd: SdMode) -> Self
[src]
Turns the internal encoder into one with confifured self-describe behaviour.
pub fn packed(self, packed: bool) -> Self
[src]
Turns the internal encoder into one with configured packed encoding.
If packed
is true, it omits the field names from the encoded data. That makes it smaller,
but it also means the decoding end must know the exact order of fields and it can't be
something like python, which would want to get a dictionary out of it.
Trait Implementations
impl<Dec: Clone, Enc: Clone> Clone for Codec<Dec, Enc>
[src]
impl<Dec: Debug, Enc: Debug> Debug for Codec<Dec, Enc>
[src]
impl<'de, Dec: Deserialize<'de>, Enc: Serialize> Decoder for Codec<Dec, Enc>
[src]
type Item = Dec
The type of decoded frames.
type Error = Error
The type of unrecoverable frame decoding errors. Read more
pub fn decode(&mut self, src: &mut BytesMut) -> Result<Option<Dec>, Error>
[src]
pub fn decode_eof(
&mut self,
buf: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>
[src]
&mut self,
buf: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>
pub fn framed<T>(self, io: T) -> Framed<T, Self> where
T: AsyncRead + AsyncWrite,
[src]
T: AsyncRead + AsyncWrite,
impl<'de, Dec: Deserialize<'de>, Enc: Serialize> Default for Codec<Dec, Enc>
[src]
impl<'de, Dec: Deserialize<'de>, Enc: Serialize> Encoder<Enc> for Codec<Dec, Enc>
[src]
Auto Trait Implementations
impl<Dec, Enc> RefUnwindSafe for Codec<Dec, Enc>
[src]
impl<Dec, Enc> Send for Codec<Dec, Enc>
[src]
impl<Dec, Enc> Sync for Codec<Dec, Enc>
[src]
impl<Dec, Enc> Unpin for Codec<Dec, Enc>
[src]
impl<Dec, Enc> UnwindSafe for Codec<Dec, Enc>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,