pub struct RelayCell { /* 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
sourceimpl RelayCell
impl RelayCell
sourcepub fn into_streamid_and_msg(self) -> (StreamId, RelayMsg)
pub fn into_streamid_and_msg(self) -> (StreamId, RelayMsg)
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<RawCellBody>
pub fn encode<R: Rng + CryptoRng>(self, rng: &mut R) -> Result<RawCellBody>
Consume this relay message and encode it as a 509-byte padded cell body.
sourcepub fn decode(body: RawCellBody) -> Result<Self>
pub fn decode(body: RawCellBody) -> 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 RefUnwindSafe for RelayCell
impl Send for RelayCell
impl Sync for RelayCell
impl Unpin for RelayCell
impl UnwindSafe for RelayCell
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more