pub struct AuditFieldEscaper;Expand description
Typed-field guard for audit emission (ADR 0010).
The guard owns the boundary’s escape contract: caller-supplied
bytes always round-trip through a typed AuditValue, never
through format!, never through string concatenation. The
canonical JSON encoder is crate::serde_json::Value::escape_string
(RFC 8259 §7 compliant after F-01 hotfix #181) which the
AuditEvent::to_json_line serializer uses for every string slot.
The other two encoder paths in the codebase
(utils::json::JsonValue::write_json and
grpc::scan_json::write_json_string) are correct after #181 but
not the canonical owner of the audit boundary. Both are marked
#[deprecated] on the audit path and remain in place for
non-audit call sites pending follow-up retirement.
Implementations§
Source§impl AuditFieldEscaper
impl AuditFieldEscaper
Sourcepub fn field(name: &'static str, value: impl Into<AuditValue>) -> AuditField
pub fn field(name: &'static str, value: impl Into<AuditValue>) -> AuditField
Construct a typed audit field. The name is 'static so
the schema key set is fixed at compile time — only value
can carry attacker-influenced bytes, and value is a typed
enum, not a string sink.
Auto Trait Implementations§
impl Freeze for AuditFieldEscaper
impl RefUnwindSafe for AuditFieldEscaper
impl Send for AuditFieldEscaper
impl Sync for AuditFieldEscaper
impl Unpin for AuditFieldEscaper
impl UnsafeUnpin for AuditFieldEscaper
impl UnwindSafe for AuditFieldEscaper
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> 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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request