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
Trait Implementations§
Auto Trait Implementations§
impl<M> RefUnwindSafe for RelayCell<M>where M: RefUnwindSafe,
impl<M> Send for RelayCell<M>where M: Send,
impl<M> Sync for RelayCell<M>where M: Sync,
impl<M> Unpin for RelayCell<M>where M: Unpin,
impl<M> UnwindSafe for RelayCell<M>where M: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more