Expand description
The versioned session.json schema.
Coordinates are stored twice per selection: px (monitor-local physical
pixels — the authoritative space everything is drawn and cropped in) and
global_px (derived: monitor origin + local). Per-monitor scale lets
consumers reconstruct logical points; the schema does not pretend there
is a universal logical space.
Re-exports§
pub use crate::geometry::MAX_COORD;
Structs§
- AppInfo
- Line
Record - A measure’s two endpoints, flat rather than nested, so a consumer
reads
axinstead ofa.xfor a thing that is always exactly two points. - Measure
Record - One measurement, with its derived values precomputed so a consumer never re-derives geometry to read a number off a ruler.
- Monitor
Record - Selection
Record - Session
File - Target
Record - The
--targetwindow as it stood at the instant of the freeze.
Enums§
- Capture
Kind - How the session’s frames were obtained. Optional in the schema — sessions written before it existed simply lack it.
- Monitor
Match - How a saved
MonitorRecordresolved against the displays attached now. Both non-Missingvariants carry an index into the candidate slice that was searched. - Session
Error - Why a session file is not usable, even though it parsed.
Constants§
- APP_
NAME - MAX_
LABEL_ LEN - The longest label a selection or measure may carry — a ceiling derived from filenames, not a number anyone picked.
- SCHEMA_
VERSION
Functions§
- distinct_
labels - The labels a
--labelcould have matched, in session order, deduplicated ASCII case-insensitively; unlabeled selections contribute nothing. - match_
monitor - Resolve a session’s monitor against the live enumeration by identity — name, size and scale — rather than by enumeration index.
- restore_
measures - The measures a saved session carries, back as editable rulers.
- restore_
selections - Rebuild editable selections from a saved session — the inverse of
SessionFile::build. Shapes come back in monitor-local px; rects reclaim theirrot_degmetadata, triangles keep rotation baked in their vertices (their records never carryrot_deg), and circles are rotation-free. Feed the result toSelectionSet::seed. - select_
by_ label - The selections a
--labelrestricts to, paired with their index in the session — the identity every report row carries.Noneselects everything. Matching is ASCII case-insensitive, as the window matcher is.