fn try_from(message: pb::GossipMessage) -> Result<Self, Self::Error> {
        let body = message.body.ok_or(MissingField("GossipMessage::body"))?;
        let message = match body {
            Body::Advert(a) => Self::Advert(a.try_into()?),
            Body::ChunkRequest(r) => Self::ChunkRequest(r.try_into()?),
            Body::Chunk(c) => Self::Chunk(c.try_into()?),
            Body::RetransmissionRequest(r) => Self::RetransmissionRequest(r.try_into()?),
        };
        Ok(message)
    }
/// The function attempts to convert the given
/// Protobuf gossip message into a *Gossip* message.
The function attempts to convert the given
Protobuf gossip message into a *Gossip* message.
The function attempts to convert the given Protobuf gossip message into a * Gossip * message .
fn try_from(message: pb::GossipMessage) -> Result<Self, Self::Error> {
        let body = message.body.ok_or(MissingField("GossipMessage::body"))?;
        let message = match body {
            Body::Advert(a) => Self::Advert(a.try_into()?),
            Body::ChunkRequest(r) => Self::ChunkRequest(r.try_into()?),
            Body::Chunk(c) => Self::Chunk(c.try_into()?),
            Body::RetransmissionRequest(r) => Self::RetransmissionRequest(r.try_into()?),
        };
        Ok(message)
    }
fn try_from ( message : pb :: GossipMessage ) -> Result < Self , Self :: Error > { let body = message . body . ok_or ( MissingField ( " " ) ) ? ; let message = match body { Body :: Advert ( a ) => Self :: Advert ( a . try_into ( ) ? ) , Body :: ChunkRequest ( r ) => Self :: ChunkRequest ( r . try_into ( ) ? ) , Body :: Chunk ( c ) => Self :: Chunk ( c . try_into ( ) ? ) , Body :: RetransmissionRequest ( r ) => Self :: RetransmissionRequest ( r . try_into ( ) ? ) , } ; Ok ( message ) }
The function attempts to convert the given
Protobuf gossip message into a *Gossip* message.
The function attempts to convert the given Protobuf gossip message into a * Gossip * message .
message
pb::GossipMessage
message
pb::GossipMessage