Skip to main content

Module jid

Module jid 

Source

Structs§

DeviceKey
Borrowing key for device identity (user, server, device). Use with HashSet for O(1) lookups.
Jid
JidRef
ObservedJid
Privacy-aware Display wrapper for a Jid, for use in tracing fields.
ParsedJidParts
Intermediate result from fast JID parsing. This avoids allocations by returning byte indices into the original string.

Enums§

JidError
Server
Known WhatsApp server identifiers.

Constants§

BOT_SERVER
BROADCAST_SERVER
DEFAULT_USER_SERVER
GROUP_SERVER
HIDDEN_USER_SERVER
HOSTED_LID_SERVER
HOSTED_SERVER
INTEROP_SERVER
LEGACY_USER_SERVER
MESSENGER_SERVER
NEWSLETTER_SERVER
PSA_USER
SERVER_JID
STATUS_BROADCAST_USER

Traits§

JidExt

Functions§

observe_str
Privacy-aware redaction of a JID supplied as a string (e.g. a group jid &str in a span field). Parses it and applies Jid::observe; if it does not parse, falls back to a keyed token so a raw number can never leak. Honors tracing-pii.
observe_token
Per-process keyed token for a sensitive string: a SipHash with a random key created once per process. Stable within a run (so the same value correlates across spans) but not precomputable from the input, so exported traces cannot be brute-forced back to the original (e.g. an E.164 phone number). Public so other layers can redact non-Jid identifiers (e.g. a Signal ProtocolAddress name, which embeds a phone number) with the same keyed scheme.
parse_jid_fast
Single-pass JID parser optimized for hot paths. Scans the input string once to find all relevant separators (@, :) and returns slices into the original string without allocation.
parse_jid_ref
Parse the allocation-free JID shapes into the same borrowed type used by the binary decoder.
push_jid_to_compact
Write the JID display representation directly into a CompactString, bypassing fmt::Display and dyn Write dispatch entirely.
push_jid_to_string
Write the JID display representation directly into a String, bypassing fmt::Display and dyn Write dispatch entirely.

Type Aliases§

MessageId
MessageServerId