Skip to main content

DialPhase

Enum DialPhase 

Source
pub enum DialPhase {
    Address,
    LocalSocket,
    TlsConfig,
    Connect,
    Handshake,
}
Expand description

Which stage of a dial a DialError came from.

A dial is not one event. dial_quic_to builds a TLS configuration, opens a local socket, asks quinn to start a connection, and only then sends a packet; the four fail for unrelated reasons and only the last of them involves the peer at all. This is that sequence as a value, so a caller can switch on it instead of reading the message a variant renders.

§The caller cannot supply this itself

It knows which call it made, not which stage inside the call died — and the four stages above live inside one call. A probe recording “handshake” for every failure of dial_quic_to is not being careless; it has nothing finer to say until this exists. The one thing it does know that this cannot is which transport it was dialling, which is why Handshake does not distinguish a QUIC handshake from a WebTransport CONNECT: both are a peer answering, and only the caller knows which it asked.

§Exactly one of these means the peer was involved

Handshake, and DialError::is_local is that sentence as a predicate. The other four are decided on this machine with nothing on the wire, so a failure carrying one of them can never be evidence about the peer — which is the direction this distinction is load-bearing in. The converse is weaker and deliberately not claimed: a handshake that timed out is not proof of anything the peer did either, only that the machine got as far as sending.

Variants§

§

Address

Turning what the caller named into somewhere to send — parsing a host:port, resolving it, finding it resolved to nothing.

§

LocalSocket

Opening a local socket to send from. See DialError::LocalSocket.

§

TlsConfig

Building the TLS client configuration: a ca_certs entry that is not a certificate, a cipher suite the crypto provider does not implement.

§

Connect

The stack refusing to start the connection — a server name rustls will not accept, a remote address quinn will not dial. Nothing was sent.

§

Handshake

The handshake, and the only phase in which the peer is involved.

Trait Implementations§

Source§

impl Clone for DialPhase

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for DialPhase

Source§

impl Debug for DialPhase

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for DialPhase

Source§

impl Hash for DialPhase

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for DialPhase

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DialPhase

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more