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
sourceimpl Relay
impl Relay
sourcepub fn new<P>(body: P) -> Self where
P: AsRef<[u8]>,
pub fn new<P>(body: P) -> Self where
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) -> RawCellBody
pub fn into_relay_body(self) -> RawCellBody
Consume this Relay message and return a RelayCellBody for encryption/decryption.
sourcepub fn into_early(self) -> ChanMsg
pub fn into_early(self) -> ChanMsg
Wrap this Relay message into a RelayMsg as a RELAY_EARLY cell.
Trait Implementations
sourceimpl Body for Relay
impl Body for Relay
sourcefn into_message(self) -> ChanMsg
fn into_message(self) -> ChanMsg
Convert this type into a ChanMsg, wrapped as appropriate.
Auto Trait Implementations
impl RefUnwindSafe for Relay
impl Send for Relay
impl Sync for Relay
impl Unpin for Relay
impl UnwindSafe for Relay
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
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more