Skip to main content

Module node

Module node 

Source

Structs§

Attrs
A collection of node attributes stored as key-value pairs. Uses a Vec internally for better cache locality with small attribute counts (typically 3-6). 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.
Node
NodeRef
OwnedNodeRef
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.

Enums§

AttrsRef
Covariant attribute container for decoded nodes.
NodeContent
NodeContentRef
NodeStr
Borrowed-or-inline string for decoded nodes. Short owned values (≤24 bytes) are stored inline via CompactString, avoiding heap allocation.
NodeValue
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.
ValueRef
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.

Type Aliases§

NodeVec