Skip to main content

TransportProfileError

Enum TransportProfileError 

Source
pub enum TransportProfileError {
    VarIntRange {
        field: &'static str,
        value: u64,
    },
    KeepAliveNotBelowIdle {
        keep_alive: Duration,
        idle: Duration,
    },
    MtuInverted {
        min: u16,
        initial: u16,
    },
    MtuBelowFloor {
        field: &'static str,
        value: u16,
        floor: u16,
    },
    TimeThreshold(f32),
}
Expand description

Why a TransportProfile cannot be honoured.

No Eq: TransportProfileError::TimeThreshold carries an f32, and the one value that most wants reporting — NaN — is not equal to itself. PartialEq is what an f32 admits, and it is enough for a test to compare a returned error against an expected one.

Deliberately not #[non_exhaustive]: tests/transport_exhaustive.rs builds one profile per variant, calls TransportProfile::validate, and matches what comes back with no _ arm — a match a crate outside this one can only write while the attribute is absent. A sixth variant fails that build until a profile someone could actually write is shown to reach it, which is the check worth having: not that the variant exists, but that it is a refusal an author can trip over and therefore fix. The attribute would replace all of that with a wildcard arm that silently accepts anything.

Variants§

§

VarIntRange

A value above 2^62 - 1, which is the largest number QUIC’s variable length integer encoding can carry.

Caught here rather than at connect time, where quinn returns it without naming a field and the leg carries on with a default the author never asked for.

Fields

§field: &'static str

The profile field holding the oversized value, spelled as the field is, and dotted for a field inside AckFrequency.

§value: u64

The value that does not fit.

§

KeepAliveNotBelowIdle

A keep-alive interval at or above the idle timeout.

Such a keep-alive cannot prevent the timeout it exists to prevent: the connection has already been closed by the time the packet that would have saved it is due.

Fields

§keep_alive: Duration

The configured keep-alive interval.

§idle: Duration

The idle timeout it fails to stay below.

§

MtuInverted

A minimum MTU above the initial MTU.

The minimum is the floor MTU discovery may fall back to and the initial is where it starts, so a floor above the start describes a range with nothing in it.

Fields

§min: u16

The configured minimum MTU.

§initial: u16

The initial MTU it exceeds.

§

MtuBelowFloor

An MTU below the 1200 bytes QUIC guarantees.

quinn’s initial_mtu and min_mtu setters both raise a smaller value to 1200 without a word, so a profile modelling a constrained path at 900 bytes validates, applies, reports applied, and runs at 1200. Refused here, naming the field, because a configured value that is quietly replaced is the failure this crate exists to make impossible.

Fields

§field: &'static str

Which of initial_mtu or min_mtu holds the value.

§value: u16

The value that would have been raised.

§floor: u16

The floor it is below, which is always 1200.

§

TimeThreshold(f32)

A loss-detection time threshold that is not a usable multiplier.

It multiplies the round-trip estimate, so at or below 1.0 it declares a packet lost before an acknowledgement for it could have arrived, and a non-finite value is not a multiplier at all.

Trait Implementations§

Source§

impl Clone for TransportProfileError

Source§

fn clone(&self) -> TransportProfileError

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 Debug for TransportProfileError

Source§

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

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

impl Display for TransportProfileError

Source§

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

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

impl Error for TransportProfileError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<TransportProfileError> for ControlError

Source§

fn from(source: TransportProfileError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for TransportProfileError

Source§

fn eq(&self, other: &TransportProfileError) -> 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 TransportProfileError

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.

Source§

impl<T> Instrument for T

Source§

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

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

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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