pub struct Extend2 { /* private fields */ }
Expand description
An Extend2 message tells the last relay in a circuit to extend to a new hop.
When a relay (call it R) receives an Extend2 message, it tries to find (or make) a channel to the other relay (R’) described in the list of link specifiers. (A link specifier can be an IP addresses or a cryptographic identity). Once R has such a channel, the it packages the client’s handshake data as a new Create2 message R’. If R’ replies with a Created2 (success) message, R packages that message’s contents in an Extended message. Unlike Extend messages, Extend2 messages can encode any handshake type, and can describe relays in ways other than IPv4 addresses and RSA identities.
Implementations§
source§impl Extend2
impl Extend2
sourcepub fn new(
linkspec: Vec<EncodedLinkSpec>,
handshake_type: HandshakeType,
handshake: Vec<u8>
) -> Self
pub fn new( linkspec: Vec<EncodedLinkSpec>, handshake_type: HandshakeType, handshake: Vec<u8> ) -> Self
Create a new Extend2 cell.
sourcepub fn handshake_type(&self) -> HandshakeType
pub fn handshake_type(&self) -> HandshakeType
Return the type of this handshake.
Trait Implementations§
source§impl Body for Extend2
impl Body for Extend2
source§fn decode_from_reader(r: &mut Reader<'_>) -> Result<Self>
fn decode_from_reader(r: &mut Reader<'_>) -> Result<Self>
Decode a relay cell body from a provided reader.
source§fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
Encode the body of this cell into the end of a writer.
source§impl From<Extend2> for AnyRelayMsg
impl From<Extend2> for AnyRelayMsg
source§fn from(m: Extend2) -> AnyRelayMsg
fn from(m: Extend2) -> AnyRelayMsg
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Extend2
impl RefUnwindSafe for Extend2
impl Send for Extend2
impl Sync for Extend2
impl Unpin for Extend2
impl UnwindSafe for Extend2
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