pub struct TerminalEventRecord {
pub sequence: u64,
pub kind: TerminalEventKind,
pub payload_preview: Option<String>,
pub redacted: bool,
pub truncated: bool,
}Expand description
One sanitized event-log entry.
For input/output byte events, payload_preview, redacted, and truncated
describe the stored bytes. Diagnostic and command events redact only the
diagnostic message or command line and expose that as the preview, but their
two flags remain false even when the text policy changed or truncated the
string. Warning and resize events are stored without redaction or a preview.
Consumers must therefore not treat redacted == false as proof that no
sanitization occurred, nor assume every nested string was scrubbed.
§Examples
use ailloli_ui_terminal_core::{TerminalEventLog, TerminalSnapshotConfig};
let mut log = TerminalEventLog::new(1);
log.record_output(b"password=abc", &TerminalSnapshotConfig::default());
let record = &log.records[0];
assert_eq!(record.sequence, 1);
assert_eq!(record.payload_preview.as_deref(), Some("password=[redacted]"));
assert!(record.redacted);Fields§
§sequence: u64Recording sequence; normally starts at one and saturates at u64::MAX.
kind: TerminalEventKindSanitized event payload.
payload_preview: Option<String>Lossy byte preview or redacted message/command, depending on event kind.
redacted: boolWhether byte-event sanitization changed retained bytes.
This remains false for non-byte events even if text was redacted.
truncated: boolWhether a byte event exceeded max_event_bytes.
This remains false for non-byte events even if max_text_bytes
truncated a diagnostic message or command line.
Trait Implementations§
Source§impl Clone for TerminalEventRecord
impl Clone for TerminalEventRecord
Source§fn clone(&self) -> TerminalEventRecord
fn clone(&self) -> TerminalEventRecord
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more