Skip to main content

Module fragment_codec

Module fragment_codec 

Source
Expand description

ID remapping for serialized analyzer fragments.

Global IDs aren’t reproducible across runs, so fragments store local ones: counter IDs (TokenId/TextId) as per-file window offsets (rebased on decode), interned IDs (StrId/PathId) as dictionary indices (re-interned on decode). The ID types’ custom serde consults a thread-local session; inactive means passthrough, and an out-of-window ID errors out so the fragment is treated as non-cacheable.

Structs§

DecodeSession
EncodeDicts
Dictionaries produced by an encode session. Stored alongside the encoded payload and used to seed the decode session.
EncodeSession
IdRebase
Rebases decoded local IDs onto a freshly reserved counter range.
IdWindow
Half-open ID window (start, end] matching the pre/post counter values around a single file’s parse + pass1.

Functions§

begin_decode
begin_encode
end_decode
end_encode
Ends the encode session and returns the collected dictionaries.