A collection of node attributes stored as key-value pairs.
Stored inline for small attribute counts (typically 3-6) for cache locality
and to avoid a per-node heap allocation; see AttrsVec.
Values can be either strings or JIDs, avoiding stringification overhead for JID attributes.
Keys use Cow<'static, str> to avoid heap allocation for compile-time-known strings
(e.g., “type”, “id”, “to”) which are the vast majority of attribute keys.
A decoded node that owns its decompressed buffer. The inner NodeRef
borrows string/byte payloads directly from the buffer, avoiding copies.
Container allocations (attribute Vec, child Vec) still occur during decode.
An owned attribute value that can be either a string or a structured JID.
This avoids string allocation for JID attributes by storing the JID directly,
eliminating format/parse overhead when routing logic needs the JID.
A decoded attribute value that can be either a string or a structured JID.
This avoids string allocation when decoding JID tokens - the JidRef is returned
directly and only converted to a string when actually needed.
Inline backing store for Attrs. A plain Vec paid one heap allocation
per node on the encode hot path just for the backing buffer. Capacity 2 is
the measured sweet spot: the per-recipient fanout nodes (to, enc) carry
1-2 attributes and stay inline, while stanza roots with 3+ attrs spill once
per stanza. A larger inline array (4) grows Node enough that moving it
through children Vecs costs more than the spared spills save.