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 strThe profile field holding the oversized value, spelled as the
field is, and dotted for a field inside AckFrequency.
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
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.
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
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
impl Clone for TransportProfileError
Source§impl Debug for TransportProfileError
impl Debug for TransportProfileError
Source§impl Display for TransportProfileError
impl Display for TransportProfileError
Source§impl Error for TransportProfileError
impl Error for TransportProfileError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()