pub struct ObservedJid<'a>(/* private fields */);Expand description
Privacy-aware Display wrapper for a Jid, for use in tracing fields.
Pseudonymous (LID) and non-personal (newsletter/bot/call, modern group ids)
JIDs render in full, so the same peer/chat correlates across spans. JIDs whose
user is a phone number (Server::carries_phone_number) render the user as
a pn#<token> instead — preserving correlation without leaking the number.
Legacy group/broadcast ids of the form <creator-phone>-<timestamp> get only
the numeric prefix redacted (pn#<token>-<timestamp>), keeping the timestamp.
The token is a keyed hash (SipHash via a process-lifetime random key), not a
plain digest of the number: the phone-number search space is small, so an
unkeyed hash would be reversible by precomputation. The random key lives only
in process memory, so exported traces cannot be brute-forced back to numbers.
It is stable within a process run (correlation works) but not across restarts
(a fresh key each start). Enable the tracing-pii feature to render raw
numbers (local debugging only). The token is computed only while formatting an
already-enabled span, so it costs nothing on disabled call sites.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ObservedJid<'a>
impl<'a> RefUnwindSafe for ObservedJid<'a>
impl<'a> Send for ObservedJid<'a>
impl<'a> Sync for ObservedJid<'a>
impl<'a> Unpin for ObservedJid<'a>
impl<'a> UnsafeUnpin for ObservedJid<'a>
impl<'a> UnwindSafe for ObservedJid<'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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more