Expand description
snss — a read-only decoder for Chromium/Brave SNSS session files.
The crate is a pure decoder: it reads bytes and returns a typed model. It has no UI, performs no clipboard or launch side effects, and exposes no write path — mutating Brave’s store is structurally impossible through this API.
Milestone 1 (this module) covers the container framing only: validate the
SNSS header and split the command stream into Records. Higher layers
(Pickle decode, replay) build on top of these records.
Structs§
- Nav
- One back/forward history entry of a tab.
- NavCommand
- A decoded
UpdateTabNavigationcommand: which tab, which back/forward position, and the URL + title recorded at that position. - Record
- One command record from the append-only stream.
- Record
Stream - The result of reading a record stream: the container version, every decoded
Recordin stream order, and any non-fatalWarnings. - Replayed
- The result of replaying one file’s command log.
- Session
Store - A read-only, in-memory snapshot of a Brave profile’s
Sessionsdirectory. - Source
- One decoded session file: its kind, path, and reconstructed windows.
- Tab
- A reconstructed tab: its history and which entry is current.
- Window
- A reconstructed window holding ordered tabs.
Enums§
- Dialect
- Which command-id mapping a file uses.
Session_*/Apps_*files and the recently-closedTabs_*files number their commands differently. - Pickle
Error - A malformed navigation payload. Surfaced as a typed error so the caller can count it as a warning rather than crash or emit a silently-wrong row.
- Snss
Error - A fatal error that prevents producing any model at all.
- Source
Kind - Which on-disk file family a
Sourcecame from. - Warning
- A non-fatal decode anomaly. The model is still usable; warnings record where and why something was skipped so nothing fails silently.
Constants§
- MAGIC
- The 4-byte magic every SNSS file begins with.
- SUPPORTED_
VERSION - The only container version observed in the wild (and the only one supported).
Functions§
- decode_
navigation - Decode an
UpdateTabNavigationpayload into aNavCommand. - read_
records - Read an SNSS command stream from any byte source.
- replay
- Replay an append-only command
RecordStreaminto the logicalWindow/Tab/Navtree, applying last-write-wins per(tab, index)and resolving each tab’s current entry and pinned state.