pub struct ScanResult {
pub findings: Vec<CredentialFinding>,
}Expand description
The result of a CredentialScanner::scan call.
Fields§
§findings: Vec<CredentialFinding>All credential findings detected in the scanned text, sorted by byte offset.
Implementations§
Source§impl ScanResult
impl ScanResult
Sourcepub fn redact(&self, text: &str) -> String
pub fn redact(&self, text: &str) -> String
Returns a copy of text with every finding replaced by its redacted label.
Overlapping findings are first coalesced into non-overlapping byte spans so no region is ever partially redacted (which previously left raw secret fragments and mangled labels in the output). The merged spans are then spliced in reverse offset order so earlier byte positions remain valid after each replacement. Spans whose boundaries do not fall on UTF-8 character boundaries are skipped rather than spliced, making the former mid-codepoint panic structurally impossible.
Trait Implementations§
Source§impl Clone for ScanResult
impl Clone for ScanResult
Source§fn clone(&self) -> ScanResult
fn clone(&self) -> ScanResult
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ScanResult
impl Debug for ScanResult
impl Eq for ScanResult
Source§impl PartialEq for ScanResult
impl PartialEq for ScanResult
impl StructuralPartialEq for ScanResult
Auto Trait Implementations§
impl Freeze for ScanResult
impl RefUnwindSafe for ScanResult
impl Send for ScanResult
impl Sync for ScanResult
impl Unpin for ScanResult
impl UnsafeUnpin for ScanResult
impl UnwindSafe for ScanResult
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