pub struct Http3ProductionProfile {
pub enabled: bool,
pub alpn_order: Vec<String>,
pub quic_idle_timeout_ms: u64,
pub quic_preset: QuicTuningPreset,
pub allow_h3_draft: bool,
pub fallback_on_h3_error: bool,
}Available on crate feature
http3-profile only.Expand description
Fields§
§enabled: boolWhether HTTP/3 is enabled.
alpn_order: Vec<String>Ordered ALPN preference, e.g. ["h3", "h2", "http/1.1"].
quic_idle_timeout_ms: u64QUIC idle timeout in milliseconds.
quic_preset: QuicTuningPresetQUIC tuning preset.
allow_h3_draft: boolAccept draft h3 tokens (for example h3-29) as h3 route.
fallback_on_h3_error: boolWhether failed HTTP/3 handshakes should fallback to H2/H1.
Implementations§
Source§impl Http3ProductionProfile
impl Http3ProductionProfile
Sourcepub fn production_baseline() -> Self
pub fn production_baseline() -> Self
Sourcepub fn quic_tuning(&self) -> QuicTuning
pub fn quic_tuning(&self) -> QuicTuning
Sourcepub fn route_for_alpn(&self, negotiated_alpn: Option<&[u8]>) -> ProtocolRoute
pub fn route_for_alpn(&self, negotiated_alpn: Option<&[u8]>) -> ProtocolRoute
Sourcepub fn route_for_client_alpns(
&self,
client_offered_alpns: &[Vec<u8>],
) -> ProtocolRoute
pub fn route_for_client_alpns( &self, client_offered_alpns: &[Vec<u8>], ) -> ProtocolRoute
Selects a route from offered client ALPN tokens and server preference.
§Examples
use http_handle::http3_profile::{Http3ProductionProfile, ProtocolRoute};
let p = Http3ProductionProfile::default();
let offered = vec![b"h2".to_vec()];
assert_eq!(p.route_for_client_alpns(&offered), ProtocolRoute::Http2);§Panics
This function does not panic.
Sourcepub fn fallback_chain(&self) -> Vec<ProtocolRoute>
pub fn fallback_chain(&self) -> Vec<ProtocolRoute>
Sourcepub fn resolve_route(
&self,
negotiated_alpn: Option<&[u8]>,
h3_handshake_ok: bool,
) -> RouteDecision
pub fn resolve_route( &self, negotiated_alpn: Option<&[u8]>, h3_handshake_ok: bool, ) -> RouteDecision
Resolves final route with explicit fallback decision tree and reason.
§Examples
use http_handle::http3_profile::{Http3ProductionProfile, RouteReason};
let p = Http3ProductionProfile::default();
let d = p.resolve_route(Some(b"h3"), false);
assert!(matches!(d.reason, RouteReason::H3HandshakeFailedFallback));§Panics
This function does not panic.
Sourcepub fn telemetry_line(&self, decision: &RouteDecision) -> String
pub fn telemetry_line(&self, decision: &RouteDecision) -> String
Serializes a compact fallback telemetry line for logs.
§Examples
use http_handle::http3_profile::{Http3ProductionProfile, RouteDecision, RouteReason, ProtocolRoute};
let p = Http3ProductionProfile::default();
let d = RouteDecision { selected: ProtocolRoute::Http2, reason: RouteReason::Negotiated, negotiated_alpn: Some("h2".into()), fallback_chain: vec![ProtocolRoute::Http3, ProtocolRoute::Http2] };
let line = p.telemetry_line(&d);
assert!(line.contains("http3.route"));§Panics
This function does not panic.
Trait Implementations§
Source§impl Clone for Http3ProductionProfile
impl Clone for Http3ProductionProfile
Source§fn clone(&self) -> Http3ProductionProfile
fn clone(&self) -> Http3ProductionProfile
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Http3ProductionProfile
impl Debug for Http3ProductionProfile
Source§impl Default for Http3ProductionProfile
impl Default for Http3ProductionProfile
Source§impl PartialEq for Http3ProductionProfile
impl PartialEq for Http3ProductionProfile
impl Eq for Http3ProductionProfile
impl StructuralPartialEq for Http3ProductionProfile
Auto Trait Implementations§
impl Freeze for Http3ProductionProfile
impl RefUnwindSafe for Http3ProductionProfile
impl Send for Http3ProductionProfile
impl Sync for Http3ProductionProfile
impl Unpin for Http3ProductionProfile
impl UnsafeUnpin for Http3ProductionProfile
impl UnwindSafe for Http3ProductionProfile
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.