feat(file): make Footer::new public#8602
Conversation
Everything needed to write a Vortex file without the bundled `VortexWriteOptions::write` driver is already public — the `SegmentSink` trait, `accumulate_stats`, `FileStatistics`, `FooterSerializer`, etc. — except constructing the `Footer` itself. Expose `Footer::new` so code that drives the layout/segment-write pipeline directly (e.g. a custom `LayoutStrategy` with its own `SegmentSink`) can build a file entirely on the public API instead of forking the crate. Signed-off-by: Tobias Humig <tobias@firebolt.io>
Merging this PR will improve performance by 12.06%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Simulation | bitwise_not_vortex_buffer_mut[128] |
244.4 ns | 215.3 ns | +13.55% |
| ⚡ | Simulation | bitwise_not_vortex_buffer_mut[1024] |
304.7 ns | 275.6 ns | +10.58% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing tobias-fire:th/public-file-footer-new (febc53b) with develop (9567467)
Footnotes
-
4 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
Rationale for this change
vortex-filealready exposes everything needed to write a Vortex file without the bundledVortexWriteOptions::writedriver — theSegmentSinktrait,accumulate_stats,FileStatistics,FooterSerializer, etc. are all public — except the final step of constructing theFooter.Footer::newispub(crate), so downstream code that drives the layout/segment-write pipeline directly (e.g. a customLayoutStrategypaired with a customSegmentSink) has to either fork the crate or re-implement the writer inside it just to assemble the footer. This closes that single gap.What changes are included in this PR?
Footer::newfrompub(crate)topub.No behavioral change and no new dependencies.
cargo checkandcargo fmt --checkpass locally.What APIs are changed? Are there any user-facing changes?
One additive, non-breaking change:
vortex_file::Footer::newis now public. Nothing else changes.AI assistance disclosure: prepared with an agentic AI coding assistant (Claude Code), per the project's AI policy. The author reviewed the change and verification steps.