pub struct CoherenceDriftReport {
pub top: ContextObservation,
pub iframe: ContextObservation,
pub worker: ContextObservation,
pub drifts: Vec<DriftDiagnostic>,
pub freshness: Option<FreshnessReport>,
}Expand description
Aggregate coherence drift report covering top-level, iframe, and (best-effort) worker contexts.
Skipped contexts never panic — they are emitted as
ContextObservation::Skipped markers so callers can attribute
missing coverage to the runtime, not a probe failure.
§Example
use stygian_browser::coherence::{
CoherenceDriftReport, ContextObservation, ContextKind, IdentitySurface,
};
let s = IdentitySurface {
user_agent: Some("Mozilla/5.0 ...".to_string()),
platform: Some("MacIntel".to_string()),
languages: Some("en-US".to_string()),
..IdentitySurface::default()
};
let report = CoherenceDriftReport {
top: ContextObservation::observed(s.clone()),
iframe: ContextObservation::observed(s.clone()),
worker: ContextObservation::skipped("Worker unsupported"),
drifts: Vec::new(),
freshness: None,
};
assert!(report.is_coherent());
assert!(!report.has_hard_drift());
assert_eq!(report.observed_context_count(), 2);Fields§
§top: ContextObservationTop-level document observation.
iframe: ContextObservationSame-origin iframe observation.
worker: ContextObservationDedicated/shared worker observation (best-effort, may be Skipped).
drifts: Vec<DriftDiagnostic>Drift diagnostics comparing all available context pairs.
freshness: Option<FreshnessReport>Optional freshness report attached when the probe was
supplied with a crate::freshness::FreshnessContract.
Implementations§
Source§impl CoherenceDriftReport
impl CoherenceDriftReport
Sourcepub const fn is_coherent(&self) -> bool
pub const fn is_coherent(&self) -> bool
true when no drift diagnostics were emitted (i.e. all
observed contexts are coherent). Skipped contexts are not
counted as drift.
Sourcepub fn has_hard_drift(&self) -> bool
pub fn has_hard_drift(&self) -> bool
true when at least one DriftSeverity::Hard drift is
present. Callers should treat this as a stealth regression.
Sourcepub fn observed_context_count(&self) -> usize
pub fn observed_context_count(&self) -> usize
Number of contexts that were actually observed (not skipped).
Sourcepub fn skipped_context_count(&self) -> usize
pub fn skipped_context_count(&self) -> usize
Number of contexts skipped.
Sourcepub fn hard_drifts(&self) -> impl Iterator<Item = &DriftDiagnostic>
pub fn hard_drifts(&self) -> impl Iterator<Item = &DriftDiagnostic>
Iterate over all DriftSeverity::Hard diagnostics.
Sourcepub fn known_limitations(&self) -> impl Iterator<Item = &DriftDiagnostic>
pub fn known_limitations(&self) -> impl Iterator<Item = &DriftDiagnostic>
Iterate over all DriftSeverity::KnownLimitation diagnostics.
Trait Implementations§
Source§impl Clone for CoherenceDriftReport
impl Clone for CoherenceDriftReport
Source§fn clone(&self) -> CoherenceDriftReport
fn clone(&self) -> CoherenceDriftReport
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CoherenceDriftReport
impl Debug for CoherenceDriftReport
Source§impl<'de> Deserialize<'de> for CoherenceDriftReport
impl<'de> Deserialize<'de> for CoherenceDriftReport
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 CoherenceDriftReport
impl PartialEq for CoherenceDriftReport
Source§impl Serialize for CoherenceDriftReport
impl Serialize for CoherenceDriftReport
impl Eq for CoherenceDriftReport
impl StructuralPartialEq for CoherenceDriftReport
Auto Trait Implementations§
impl Freeze for CoherenceDriftReport
impl RefUnwindSafe for CoherenceDriftReport
impl Send for CoherenceDriftReport
impl Sync for CoherenceDriftReport
impl Unpin for CoherenceDriftReport
impl UnsafeUnpin for CoherenceDriftReport
impl UnwindSafe for CoherenceDriftReport
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.