pub struct CaptureConfig {
pub path: PathBuf,
pub redact: bool,
pub queue: usize,
pub hep: Option<HepConfig>,
}Expand description
How a capture is configured (Config::capture).
Fields§
§path: PathBufWhere to write the pcapng file. Created, or truncated if it exists.
redact: boolWhether to strip credentials before writing (§13.3). On by default.
Turning it off is for a lab capture against a test registrar, where there is no secret worth removing and redaction would hide the digest bug the capture was taken to find. Never turn it off for a capture that will leave the machine.
queue: usizeHow many records may queue for the writer before records are dropped.
Dropped rather than blocking the driver: see the module note. A dropped record is counted in
crate::CaptureCounts::dropped, never silent.
hep: Option<HepConfig>Optional HEP3 export of the same redacted records written to the pcapng file.
HEP is always best effort: the collector socket is non-blocking and failures increment
crate::CaptureCounts::hep_dropped without failing the endpoint or the call. A HEP
export may not be combined with Self::without_redaction.
Implementations§
Source§impl CaptureConfig
impl CaptureConfig
Sourcepub fn new(path: impl Into<PathBuf>) -> Self
pub fn new(path: impl Into<PathBuf>) -> Self
A redacting capture at path, with a queue deep enough for a burst.
Sourcepub fn with_hep(self, hep: HepConfig) -> Self
pub fn with_hep(self, hep: HepConfig) -> Self
Send each redacted capture record to a HEP3 collector as well as the pcapng file.
Sourcepub fn without_redaction(self) -> Self
pub fn without_redaction(self) -> Self
Keep credentials in the file.
Named so that it cannot be reached without saying what it does at the call site.
Trait Implementations§
Source§impl Clone for CaptureConfig
impl Clone for CaptureConfig
Source§fn clone(&self) -> CaptureConfig
fn clone(&self) -> CaptureConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CaptureConfig
impl RefUnwindSafe for CaptureConfig
impl Send for CaptureConfig
impl Sync for CaptureConfig
impl Unpin for CaptureConfig
impl UnsafeUnpin for CaptureConfig
impl UnwindSafe for CaptureConfig
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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