Skip to main content

Module keylog

Module keylog 

Available on crate feature net only.
Expand description

TLS keylog facility used by every TLS implementation supported by rama (and exposed for your own).

The trait at the center is KeyLogSink: a non-blocking, Send + Sync consumer of one NSS-format keylog line per call. The TLS crates feed each handshake’s set_keylog_callback into a sink held behind Arc<dyn KeyLogSink> (the only erasure point); every sink wrapper above that — FileKeyLogSink, RotatingFileKeyLogSink, ToggleableKeyLogSink — is statically dispatched.

Lines arrive at the sink including their trailing newline; implementations persist bytes verbatim.

Structs§

FileKeyLogSink
Sink that appends every line to a single file.
KeyLogToggle
Cheap external handle for toggling a ToggleableKeyLogSink. Holds only the shared AtomicBool; does not retain the inner sink, so it can be stashed in any state container without pinning the sink’s lifetime.
NoopKeyLogSink
Sink that drops every line. Useful as a placeholder default and for the off-state of ToggleableKeyLogSink without changing types.
RotatingFileKeyLogSink
Sink that rotates between bucket-named files.
ToggleableKeyLogSink
Wraps any KeyLogSink in an atomic on/off switch. When off, write_line is a single relaxed-cost atomic load that drops the argument. When on, it forwards to the inner sink.

Enums§

RotationPeriod
Bucket size for RotatingFileKeyLogSink.

Constants§

ROTATING_DEFAULT_PREFIX
Default filename prefix.

Traits§

KeyLogSink
Consumer of TLS keylog lines.

Functions§

normalize_path
open_intent_sink
Resolve a KeyLogIntent into a concrete sink, opening files as needed.