pub struct PeerNetMsgCodec {
inner_codec: LengthCodec,
}Expand description
Length-prefixed bincode codec for the peer data-plane wire.
Fields§
§inner_codec: LengthCodecImplementations§
Trait Implementations§
Source§impl Clone for PeerNetMsgCodec
impl Clone for PeerNetMsgCodec
Source§fn clone(&self) -> PeerNetMsgCodec
fn clone(&self) -> PeerNetMsgCodec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Codec<Buffer> for PeerNetMsgCodec
impl Codec<Buffer> for PeerNetMsgCodec
type Message = PeerNetMsg
type Error = Error
Source§fn encode(&self, src: &PeerNetMsg, dst: &mut ByteBuffer) -> Result<usize, Error>
fn encode(&self, src: &PeerNetMsg, dst: &mut ByteBuffer) -> Result<usize, Error>
Encode a message into the wire buffer.
Source§fn decode(
&self,
src: &mut ByteBuffer,
) -> Result<Option<(usize, PeerNetMsg)>, Error>
fn decode( &self, src: &mut ByteBuffer, ) -> Result<Option<(usize, PeerNetMsg)>, Error>
Decode a message from the wire buffer.
Returns
Some((bytes_consumed, message)) on success,
None if more data is needed.Auto Trait Implementations§
impl Freeze for PeerNetMsgCodec
impl RefUnwindSafe for PeerNetMsgCodec
impl Send for PeerNetMsgCodec
impl Sync for PeerNetMsgCodec
impl Unpin for PeerNetMsgCodec
impl UnsafeUnpin for PeerNetMsgCodec
impl UnwindSafe for PeerNetMsgCodec
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more