pub struct QuirkMatch {
pub severity: QuirkSeverity,
pub host_suffix: &'static str,
pub required_scheme: Scheme,
pub description: &'static str,
pub observed_scheme: Scheme,
pub observed_port: Option<u16>,
}Expand description
A single vendor-quirk match produced by check.
Carries the static VendorQuirk record (for severity /
host_suffix / description / required_scheme) plus the
observed values from the ProxyUrl that triggered the match.
The password component of the URL is never copied into the
match — the security note at the module top is binding.
The struct is Clone so matches can be retained across log
emissions and HTTP responses without lifetime gymnastics.
§Example
use stygian_proxy::vendor_quirks::{check, ProxyUrl, QuirkSeverity};
let url = ProxyUrl::parse("http://user@brd.superproxy.io:22225").unwrap();
let m = &check(&url)[0];
assert_eq!(m.severity, QuirkSeverity::Warning);
assert_eq!(m.host_suffix, "brd.superproxy.io");
assert_eq!(m.observed_scheme, stygian_proxy::vendor_quirks::Scheme::Http);
assert_eq!(m.observed_port, Some(22225));Fields§
§severity: QuirkSeveritySeverity of the matched quirk (mirrors quirk.severity).
host_suffix: &'static strHost suffix that triggered the match (mirrors quirk.host_suffix).
required_scheme: SchemeRequired scheme per the quirk (mirrors quirk.required_scheme).
description: &'static strHuman-readable description (mirrors quirk.description).
observed_scheme: SchemeThe URL’s observed scheme at match time.
observed_port: Option<u16>The URL’s observed port at match time.
Trait Implementations§
Source§impl Clone for QuirkMatch
impl Clone for QuirkMatch
Source§fn clone(&self) -> QuirkMatch
fn clone(&self) -> QuirkMatch
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QuirkMatch
impl Debug for QuirkMatch
impl Eq for QuirkMatch
Source§impl PartialEq for QuirkMatch
impl PartialEq for QuirkMatch
impl StructuralPartialEq for QuirkMatch
Auto Trait Implementations§
impl Freeze for QuirkMatch
impl RefUnwindSafe for QuirkMatch
impl Send for QuirkMatch
impl Sync for QuirkMatch
impl Unpin for QuirkMatch
impl UnsafeUnpin for QuirkMatch
impl UnwindSafe for QuirkMatch
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.