pub struct Relay { /* private fields */ }Expand description
A Relay cell - that is, one transmitted over a circuit.
Once a circuit has been established, relay cells can be sent over it. Clients can send relay cells to any relay on the circuit. Any relay on the circuit can send relay cells to the client, either directly (if it is the first hop), or indirectly through the intermediate hops.
A different protocol is defined over the relay cells; it is implemented in the crate::relaycell module.
Implementations§
source§impl Relay
impl Relay
sourcepub fn new<P>(body: P) -> Selfwhere
P: AsRef<[u8]>,
pub fn new<P>(body: P) -> Selfwhere P: AsRef<[u8]>,
Construct a Relay message from a slice containing its contents.
sourcepub fn from_raw(body: RawCellBody) -> Self
pub fn from_raw(body: RawCellBody) -> Self
Construct a Relay message from its body.
sourcepub fn into_relay_body(self) -> BoxedCellBody
pub fn into_relay_body(self) -> BoxedCellBody
Consume this Relay message and return a BoxedCellBody for encryption/decryption.
sourcepub fn into_early(self) -> AnyChanMsg
pub fn into_early(self) -> AnyChanMsg
Wrap this Relay message into a RelayMsg as a RELAY_EARLY cell.
Trait Implementations§
source§impl Body for Relay
impl Body for Relay
source§fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
Consume this message and encode its body onto
w. Read moresource§fn decode_from_reader(r: &mut Reader<'_>) -> Result<Self>
fn decode_from_reader(r: &mut Reader<'_>) -> Result<Self>
Decode a channel cell body from a provided reader.
source§impl ChanMsg for Relay
impl ChanMsg for Relay
source§fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
Write the body of this message (not including length or command).
source§impl From<Box<[u8; 509], Global>> for Relay
impl From<Box<[u8; 509], Global>> for Relay
source§fn from(original: BoxedCellBody) -> Relay
fn from(original: BoxedCellBody) -> Relay
Converts to this type from the input type.
source§impl From<Relay> for AnyChanMsg
impl From<Relay> for AnyChanMsg
source§fn from(m: Relay) -> AnyChanMsg
fn from(m: Relay) -> AnyChanMsg
Converts to this type from the input type.
source§impl From<Relay> for RelayEarly
impl From<Relay> for RelayEarly
source§fn from(original: Relay) -> RelayEarly
fn from(original: Relay) -> RelayEarly
Converts to this type from the input type.
source§impl From<RelayEarly> for Relay
impl From<RelayEarly> for Relay
source§fn from(original: RelayEarly) -> Self
fn from(original: RelayEarly) -> Self
Converts to this type from the input type.