pub struct TransportObservation {
pub http2_settings: Option<Http2SettingsObservation>,
pub http2_pseudo_header_order: Option<Vec<String>>,
pub http2_header_order: Option<Vec<String>>,
pub http3_perk_text: Option<String>,
pub http3_perk_hash: Option<String>,
pub alpn_protocols: Option<Vec<String>>,
}Expand description
Live transport-layer observations consumed by
score.
Every field is optional so callers can supply only the
observations they actually captured. Missing observations are
surfaced in the TransportCompatibility::coverage
marker.
Fields§
§http2_settings: Option<Http2SettingsObservation>Observed HTTP/2 SETTINGS frame.
http2_pseudo_header_order: Option<Vec<String>>Observed HTTP/2 pseudo-header order (e.g. :method,
:authority, :scheme, :path).
http2_header_order: Option<Vec<String>>Observed HTTP/2 header order (after pseudo-headers).
http3_perk_text: Option<String>HTTP/3 perk text observed from the live connection (already
consumed by tls_validation::TransportDiagnostic).
http3_perk_hash: Option<String>HTTP/3 perk hash observed from the live connection.
alpn_protocols: Option<Vec<String>>Observed ALPN protocol list (e.g. ["h2", "http/1.1"]).
Implementations§
Source§impl TransportObservation
impl TransportObservation
Sourcepub fn from_settings(settings: &[(u32, u32)]) -> Self
pub fn from_settings(settings: &[(u32, u32)]) -> Self
Build an observation seeded with the supplied HTTP/2 SETTINGS
frame. Used by the unit tests and the integration tests that
compare against the tls_validation reference captures.
§Example
use stygian_browser::tls_validation::CHROME_136_HTTP2_SETTINGS;
use stygian_browser::transport_realism::TransportObservation;
let obs = TransportObservation::from_settings(CHROME_136_HTTP2_SETTINGS);
assert!(obs.http2_settings.is_some());Sourcepub fn with_pseudo_header_order<I, S>(self, order: I) -> Self
pub fn with_pseudo_header_order<I, S>(self, order: I) -> Self
Attach a pseudo-header order observation.
Sourcepub fn with_header_order<I, S>(self, order: I) -> Self
pub fn with_header_order<I, S>(self, order: I) -> Self
Attach a header order observation.
Sourcepub fn with_http3_perk_text(self, text: impl Into<String>) -> Self
pub fn with_http3_perk_text(self, text: impl Into<String>) -> Self
Attach a single HTTP/3 perk text observation.
Sourcepub fn with_http3_perk_hash(self, hash: impl Into<String>) -> Self
pub fn with_http3_perk_hash(self, hash: impl Into<String>) -> Self
Attach a single HTTP/3 perk hash observation.
Sourcepub fn chrome_136_reference() -> Self
pub fn chrome_136_reference() -> Self
Convenience: build an observation that exactly matches the Chrome 136 reference captures.
§Example
use stygian_browser::transport_realism::TransportObservation;
let obs = TransportObservation::chrome_136_reference();
assert!(obs.http2_settings.is_some());
assert!(obs.http2_header_order.is_some());
assert!(obs.http2_pseudo_header_order.is_some());
assert!(obs.alpn_protocols.is_some());Sourcepub const fn has_http2(&self) -> bool
pub const fn has_http2(&self) -> bool
true when the observation carries any HTTP/2 surface
(http2_settings, http2_pseudo_header_order, or
http2_header_order).
Sourcepub const fn http2_observation_count(&self) -> usize
pub const fn http2_observation_count(&self) -> usize
Number of HTTP/2 observations that were supplied.
Trait Implementations§
Source§impl Clone for TransportObservation
impl Clone for TransportObservation
Source§fn clone(&self) -> TransportObservation
fn clone(&self) -> TransportObservation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TransportObservation
impl Debug for TransportObservation
Source§impl Default for TransportObservation
impl Default for TransportObservation
Source§fn default() -> TransportObservation
fn default() -> TransportObservation
Source§impl<'de> Deserialize<'de> for TransportObservation
impl<'de> Deserialize<'de> for TransportObservation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for TransportObservation
impl PartialEq for TransportObservation
Source§impl Serialize for TransportObservation
impl Serialize for TransportObservation
impl Eq for TransportObservation
impl StructuralPartialEq for TransportObservation
Auto Trait Implementations§
impl Freeze for TransportObservation
impl RefUnwindSafe for TransportObservation
impl Send for TransportObservation
impl Sync for TransportObservation
impl Unpin for TransportObservation
impl UnsafeUnpin for TransportObservation
impl UnwindSafe for TransportObservation
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
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
key and return true if they are equal.