[−][src]Struct keebrs::codec::PostCardCodec
Codec for arbitrary types via PostCard
Implementations
impl<T> PostCardCodec<T> where
T: DeserializeOwned,
[src]
T: DeserializeOwned,
pub fn stream<S: Read, B: Default + AsRef<[u8]> + AsMut<[u8]>>(
stream: S
) -> Framed<S, Self, B>
[src]
stream: S
) -> Framed<S, Self, B>
Wrap a [Read] to create a stream of messages
impl<T> PostCardCodec<T>
[src]
pub fn framed<S, B: Default + AsRef<[u8]> + AsMut<[u8]>>(
stream: S
) -> Framed<S, Self, B>
[src]
stream: S
) -> Framed<S, Self, B>
Wrap a stream to create a sink or stream for messages
impl<T> PostCardCodec<T> where
T: Serialize,
[src]
T: Serialize,
pub fn sink<S: Write, B: Default + AsRef<[u8]> + AsMut<[u8]>>(
stream: S
) -> Framed<S, Self, B>
[src]
stream: S
) -> Framed<S, Self, B>
Wrap a [Write] to create a sink for messages
Trait Implementations
impl<T> Decode for PostCardCodec<T> where
T: DeserializeOwned,
[src]
T: DeserializeOwned,
type Item = T
The item being decoded
type Error = Error
The error that may arise from a decode operation Read more
fn decode(&mut self, buf: &mut [u8]) -> (usize, DecodeResult<T, Error>)
[src]
impl<T> Default for PostCardCodec<T>
[src]
impl<T> Encode for PostCardCodec<T> where
T: Serialize,
[src]
T: Serialize,
Auto Trait Implementations
impl<T> Send for PostCardCodec<T> where
T: Send,
T: Send,
impl<T> Sync for PostCardCodec<T> where
T: Sync,
T: Sync,
impl<T> Unpin for PostCardCodec<T> where
T: Unpin,
T: Unpin,
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> Same<T> for T
type Output = T
Should always be Self
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>,