pub struct SafeTokenDisplay<'a>(pub &'a Token);Expand description
Display adapter that emits a Token while escaping the
caller-controlled byte payload of Ident / String / JsonLiteral /
Integer / Float arms.
F-05 (serialization-boundary audit, 2026-05-06): SQL parser error
messages flow into JSON HTTP bodies, JSONL audit rows, gRPC
Status::message, PG3 ErrorResponse, and tracing::warn! log
lines. The default Token Display arms emit raw user bytes for
Token::Ident("foo\nbar") etc., which lets a tenant smuggle CR /
LF / NUL / quote bytes through every downstream sink at once.
This adapter renders user-controlled arms via escape_debug (the
same rules {:?} applies to a &str) and leaves keyword /
punctuation arms untouched so existing snapshot tests and operator
log readability are preserved.
Tuple Fields§
§0: &'a TokenTrait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for SafeTokenDisplay<'a>
impl<'a> RefUnwindSafe for SafeTokenDisplay<'a>
impl<'a> Send for SafeTokenDisplay<'a>
impl<'a> Sync for SafeTokenDisplay<'a>
impl<'a> Unpin for SafeTokenDisplay<'a>
impl<'a> UnsafeUnpin for SafeTokenDisplay<'a>
impl<'a> UnwindSafe for SafeTokenDisplay<'a>
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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>
Wrap the input message
T in a tonic::Request