pub struct RelayCell<M> { /* private fields */ }Expand description
A decoded and parsed relay cell.
Each relay cell represents a message that can be sent along a circuit, along with the ID for an associated stream that the message is meant for.
Implementations§
source§impl<M: RelayMsg> RelayCell<M>
impl<M: RelayMsg> RelayCell<M>
sourcepub fn into_streamid_and_msg(self) -> (StreamId, M)
pub fn into_streamid_and_msg(self) -> (StreamId, M)
Consume this cell and return its components.
sourcepub fn stream_id(&self) -> StreamId
pub fn stream_id(&self) -> StreamId
Return the stream ID for the stream that this cell corresponds to.
sourcepub fn encode<R: Rng + CryptoRng>(self, rng: &mut R) -> Result<BoxedCellBody>
pub fn encode<R: Rng + CryptoRng>(self, rng: &mut R) -> Result<BoxedCellBody>
Consume this relay message and encode it as a 509-byte padded cell body.
sourcepub fn decode(body: BoxedCellBody) -> Result<Self>
pub fn decode(body: BoxedCellBody) -> Result<Self>
Parse a RELAY or RELAY_EARLY cell body into a RelayCell.
Requires that the cryptographic checks on the message have already been performed
sourcepub fn decode_from_reader(r: &mut Reader<'_>) -> Result<Self>
pub fn decode_from_reader(r: &mut Reader<'_>) -> Result<Self>
Parse a RELAY or RELAY_EARLY cell body into a RelayCell from a reader.
Requires that the cryptographic checks on the message have already been performed