pub struct ScanMetrics {
pub detections: u32,
pub redacted: u32,
pub restored: u32,
pub blocked: u32,
pub by_entity_type: BTreeMap<String, u32>,
pub latency_us: u64,
}Expand description
A single scanner’s content-free metrics for one run: counts and per-entity-
type tallies plus the scanner’s own latency. Every field is a count, a
verdict, or an entity-type label — never matched content, a redacted
value, or plaintext — so a ScanReport is safe to log or emit wholesale.
The counts are derived by the ScannerStack run loop, not reported by the
scanner itself (the Scanner::scan surface stays a pure
text -> Verdict): the loop times each scan and diffs the shared
Vault’s type-keyed tallies across the call. A transform scanner’s
redacted/by_entity_type is the vault-intern delta; a restore scanner’s
restored is the vault restore-tally delta; a block scanner’s detections/
blocked come from its Verdict.
Fields§
§detections: u32Matches or entities this scanner found. For a transform scanner this is
the number of distinct values redacted; for a block scanner it is 1 on a
hit, 0 otherwise.
redacted: u32Distinct values this scanner transformed/replaced (redactions). 0 for a
pure block scanner, which never rewrites.
restored: u32Sentinels this scanner put back (restore scanners only).
blocked: u32How many times this scanner blocked: 1 when it returned a [Block]
verdict with valid = false, else 0.
by_entity_type: BTreeMap<String, u32>Per-entity-type redaction counts (EMAIL, AWS_ACCESS_KEY…). Keys are
type labels, never values, and the map is empty for a block scanner.
latency_us: u64Wall-clock time spent in this scanner’s Scanner::scan, in microseconds.
Trait Implementations§
Source§impl Clone for ScanMetrics
impl Clone for ScanMetrics
Source§fn clone(&self) -> ScanMetrics
fn clone(&self) -> ScanMetrics
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 ScanMetrics
impl Debug for ScanMetrics
Source§impl Default for ScanMetrics
impl Default for ScanMetrics
Source§fn default() -> ScanMetrics
fn default() -> ScanMetrics
Source§impl PartialEq for ScanMetrics
impl PartialEq for ScanMetrics
Source§fn eq(&self, other: &ScanMetrics) -> bool
fn eq(&self, other: &ScanMetrics) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ScanMetrics
Auto Trait Implementations§
impl Freeze for ScanMetrics
impl RefUnwindSafe for ScanMetrics
impl Send for ScanMetrics
impl Sync for ScanMetrics
impl Unpin for ScanMetrics
impl UnsafeUnpin for ScanMetrics
impl UnwindSafe for ScanMetrics
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more