Struct tor_cell::relaycell::RelayMsgOuter
source · pub struct RelayMsgOuter<M> { /* private fields */ }Expand description
A decoded and parsed relay message, along with an optional Stream ID.
This type represents a message that can be sent along a circuit, along with the ID for an associated stream that the message is meant for.
NOTE: This name is a placeholder; we intend to replace it once we have standardized our vocabulary in this area.
Implementations§
source§impl<M: RelayMsg> RelayMsgOuter<M>
impl<M: RelayMsg> RelayMsgOuter<M>
sourcepub fn into_streamid_and_msg(self) -> (Option<StreamId>, M)
pub fn into_streamid_and_msg(self) -> (Option<StreamId>, M)
Consume this cell and return its components.
sourcepub fn stream_id(&self) -> Option<StreamId>
pub fn stream_id(&self) -> Option<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 RelayMsgOuter.
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 RelayMsgOuter from a reader.
Requires that the cryptographic checks on the message have already been performed