Struct libp2p::gossipsub::protocol::GossipsubCodec [−][src]
pub struct GossipsubCodec { /* fields omitted */ }
Implementations
Trait Implementations
type Item = HandlerEvent
type Item = HandlerEvent
The type of items returned by decode
type Error = GossipsubHandlerError
type Error = GossipsubHandlerError
The type of decoding errors.
pub fn decode(
&mut self,
src: &mut BytesMut
) -> Result<Option<<GossipsubCodec as Decoder>::Item>, <GossipsubCodec as Decoder>::Error>
[src]
pub fn decode(
&mut self,
src: &mut BytesMut
) -> Result<Option<<GossipsubCodec as Decoder>::Item>, <GossipsubCodec as Decoder>::Error>
[src]Decode an item from the src BytesMut
into an item
fn decode_eof(
&mut self,
src: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>
fn decode_eof(
&mut self,
src: &mut BytesMut
) -> Result<Option<Self::Item>, Self::Error>
Called when the input stream reaches EOF, signaling a last attempt to decode Read more
type Item = Rpc
type Item = Rpc
The type of items consumed by encode
type Error = GossipsubHandlerError
type Error = GossipsubHandlerError
The type of encoding errors.
pub fn encode(
&mut self,
item: <GossipsubCodec as Encoder>::Item,
dst: &mut BytesMut
) -> Result<(), <GossipsubCodec as Encoder>::Error>
[src]
pub fn encode(
&mut self,
item: <GossipsubCodec as Encoder>::Item,
dst: &mut BytesMut
) -> Result<(), <GossipsubCodec as Encoder>::Error>
[src]Encodes an item into the BytesMut
provided by dst.
Auto Trait Implementations
impl RefUnwindSafe for GossipsubCodec
impl Send for GossipsubCodec
impl Sync for GossipsubCodec
impl Unpin for GossipsubCodec
impl UnwindSafe for GossipsubCodec