pub struct Create2 { /* private fields */ }Expand description
A Create2 message create a circuit on the current channel.
To create a circuit, the client sends a Create2 cell containing a handshake of a given type; the relay responds with a Created2 cell containing a reply.
Currently, most Create2 cells contain a client-side instance of the “ntor” handshake.
Implementations§
source§impl Create2
impl Create2
sourcepub fn new<B>(handshake_type: HandshakeType, handshake: B) -> Self
pub fn new<B>(handshake_type: HandshakeType, handshake: B) -> Self
Wrap a typed handshake as a Create2 message
sourcepub fn handshake_type(&self) -> HandshakeType
pub fn handshake_type(&self) -> HandshakeType
Return the type of this handshake.
Trait Implementations§
source§impl Body for Create2
impl Body for Create2
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 Create2
impl ChanMsg for Create2
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<Create2> for AnyChanMsg
impl From<Create2> for AnyChanMsg
source§fn from(m: Create2) -> AnyChanMsg
fn from(m: Create2) -> AnyChanMsg
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Create2
impl RefUnwindSafe for Create2
impl Send for Create2
impl Sync for Create2
impl Unpin for Create2
impl UnwindSafe for Create2
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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>
Converts
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>
Converts
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