pub struct FragmentCache { /* private fields */ }Expand description
Global cache for tracking fragmented secrets across the entire scan run.
Implementations§
Source§impl FragmentCache
impl FragmentCache
pub fn new(capacity: usize) -> Self
Sourcepub fn record_and_reassemble(
&self,
fragment: SecretFragment,
) -> Vec<Zeroizing<String>>
pub fn record_and_reassemble( &self, fragment: SecretFragment, ) -> Vec<Zeroizing<String>>
Record a fragment and return a list of “complete” candidates if any.
The returned Zeroizing<String> lets the caller scope the
reassembled credential’s lifetime tightly - drop it (or pass it
to a scan that consumes by reference) and the heap copy is zeroed.
Sourcepub fn record_and_reassemble_stamped(
&self,
fragment: SecretFragment,
) -> Vec<ReassembledCandidate>
pub fn record_and_reassemble_stamped( &self, fragment: SecretFragment, ) -> Vec<ReassembledCandidate>
Path/line-stamped variant of [record_and_reassemble]. Returns
each glued candidate together with the provenance of its anchor
(prefix) fragment so the caller can attribute a reassembled
finding to the file that actually contributed the credential,
rather than to whatever chunk’s metadata was in scope when the
join fired. The join semantics (same-path, within-100-line
window) are identical to record_and_reassemble; this just
preserves the anchor’s path/line on the way out.
pub fn clear(&self)
Auto Trait Implementations§
impl !Freeze for FragmentCache
impl !RefUnwindSafe for FragmentCache
impl Send for FragmentCache
impl Sync for FragmentCache
impl Unpin for FragmentCache
impl UnsafeUnpin for FragmentCache
impl UnwindSafe for FragmentCache
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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