fuel_core_p2p::codecs

Trait GossipsubCodec

Source
pub trait GossipsubCodec {
    type RequestMessage;
    type ResponseMessage;

    // Required methods
    fn encode(&self, data: Self::RequestMessage) -> Result<Vec<u8>, Error>;
    fn decode(
        &self,
        encoded_data: &[u8],
        gossipsub_topic: GossipTopicTag,
    ) -> Result<Self::ResponseMessage, Error>;
}
Expand description

Implement this in order to handle serialization & deserialization of Gossipsub messages

Required Associated Types§

Required Methods§

Source

fn encode(&self, data: Self::RequestMessage) -> Result<Vec<u8>, Error>

Source

fn decode( &self, encoded_data: &[u8], gossipsub_topic: GossipTopicTag, ) -> Result<Self::ResponseMessage, Error>

Implementors§