pub struct Extend2 {
linkspec: Vec<EncodedLinkSpec>,
handshake_type: HandshakeType,
handshake: Vec<u8>,
}
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.
Fields§
§linkspec: Vec<EncodedLinkSpec>
A vector of “link specifiers”
These link specifiers describe where to find the target relay that the recipient should extend to. They include things like IP addresses and identity keys.
handshake_type: HandshakeType
Type of handshake to be sent in a CREATE2 cell
handshake: Vec<u8>
Body of the handshake to be sent in a CREATE2 cell
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>
Source§impl From<Extend2> for AnyRelayMsg
impl From<Extend2> for AnyRelayMsg
Source§fn from(m: Extend2) -> AnyRelayMsg
fn from(m: Extend2) -> AnyRelayMsg
Source§impl HasMemoryCostStructural for Extend2
impl HasMemoryCostStructural for Extend2
Source§fn indirect_memory_cost(&self, et: EnabledToken) -> usize
fn indirect_memory_cost(&self, et: EnabledToken) -> usize
Source§impl RelayMsg for Extend2
impl RelayMsg for Extend2
Source§fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
Source§fn decode_from_reader(cmd: RelayCmd, r: &mut Reader<'_>) -> Result<Self>
fn decode_from_reader(cmd: RelayCmd, r: &mut Reader<'_>) -> Result<Self>
cmd
from reader r
.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§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> HasMemoryCost for Twhere
T: HasMemoryCostStructural,
impl<T> HasMemoryCost for Twhere
T: HasMemoryCostStructural,
§fn memory_cost(&self, et: EnabledToken) -> usize
fn memory_cost(&self, et: EnabledToken) -> usize
self
, in bytes Read more§impl<T> HasTypedMemoryCost<T> for Twhere
T: HasMemoryCost,
impl<T> HasTypedMemoryCost<T> for Twhere
T: HasMemoryCost,
§fn typed_memory_cost(&self, enabled: EnabledToken) -> TypedMemoryCost<T>
fn typed_memory_cost(&self, enabled: EnabledToken) -> TypedMemoryCost<T>
TypedMemoryCost<T>
rather than a raw usize
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more