pub enum InternalPayload<'a> {
Truth(&'a str),
Lie(&'a str),
}Expand description
Zero-allocation internal payload for SOC logging.
Returned by InternalContext::payload(). This type borrows from the
underlying context and allows loggers to format output without heap allocation.
§Variants
Truth(&str): Authentic diagnostic messageLie(&str): Deceptive message (should be prefixed in logs)
§Performance
The borrowed lifetime ties this to the parent InternalContext, preventing
accidental persistence of sensitive data beyond the logging operation.
§No Copy Policy
While this type only contains &str (which is Copy), we deliberately do not
derive Copy to maintain consistency with the module’s no-duplication philosophy.
Use Clone if you need to store the payload temporarily.
§Usage Pattern
match context.payload() {
Some(InternalPayload::Truth(msg)) => soc_log!("DIAG: {}", msg),
Some(InternalPayload::Lie(msg)) => soc_log!("LIE: {}", msg),
None => {
// Sensitive - requires explicit access
let access = SocAccess::acquire();
if let Some(sensitive) = context.expose_sensitive(&access) {
secure_log_encrypted(sensitive);
}
}
}Variants§
Implementations§
Trait Implementations§
Source§impl<'a> Clone for InternalPayload<'a>
impl<'a> Clone for InternalPayload<'a>
Source§fn clone(&self) -> InternalPayload<'a>
fn clone(&self) -> InternalPayload<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for InternalPayload<'a>
impl<'a> Debug for InternalPayload<'a>
Source§impl<'a> Display for InternalPayload<'a>
impl<'a> Display for InternalPayload<'a>
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Format payload with classification prefix for logging.
§Output Format
- Truth: Raw message (no prefix)
- Lie:
[LIE] {message}
§Rationale
The [LIE] prefix prevents SOC analysts from mistaking deceptive content
for authentic diagnostic data when reviewing logs. This is critical when
logs may be exported to systems that lack context classification.