All features are enabled by default and forwarded to the sourcier-core
engine crate. You only configure features on the sourcier facade.
| Feature | Default | Gates |
|---|---|---|
serde |
yes | Serialize/Deserialize for maps, positions and FeedbackSnapshot; wire-format loading |
view |
yes | LineOffsets, view, view_str, line_offsets, position_from_offset, offset_from_position, display_position |
rt-feedback |
yes | RuntimeFeedback, FeedbackSnapshot, with_feedback on map and builder |
parallel |
no | Multi-threaded line-offset index construction with rayon |
What each feature means for your build
Section titled “What each feature means for your build”serde adds the serialization derives and the payload-compatibility logic.
Tools that keep positions only in memory can drop it.
view adds the per-file line index (a single memchr-accelerated scan, 4
bytes per line) and every byte-extraction and offset-bridge API. Diagnostics
tools almost always keep it; pure id registries can drop it.
rt-feedback adds atomic counters behind Arc<RuntimeFeedback>. No locks
are taken on the reporting path; the cost when unused is the unused code
path.
parallel is opt-in because on a 2-core reference VM the thread-pool
overhead outweighed the scan savings. Enable it on many-core build machines
processing large file sets; it adds the rayon dependency.
Trimming recipes
Section titled “Trimming recipes”Keep only byte extraction:
[dependencies]sourcier = { version = "2.0", default-features = false, features = ["view"] }Keep serialization but no views and no statistics:
[dependencies]sourcier = { version = "2.0", default-features = false, features = ["serde"] }Enable everything including parallelism:
[dependencies]sourcier = { version = "2.0", features = ["parallel"] }MSRV per configuration
Section titled “MSRV per configuration”The minimum supported Rust version is 1.99 for every feature configuration;
CI verifies cargo check across feature combinations.
Next steps
Section titled “Next steps”- Follow for the install commands behind these snippets.
- Follow when deciding between
paralleland the default scan. - Check the for the items each feature gates.
