mirror of
https://github.com/qdrant/qdrant.git
synced 2026-08-05 09:31:05 -05:00
Step 1 of the SegmentReadView migration. * `SegmentReadView` is expanded to its final field set, parameterised over four read-only traits (`IdTrackerRead`, `PayloadIndexRead`, `PayloadStorageRead`, `VectorDataRead`). A `SegmentReadViewFor<'s>` type alias hides the verbosity at call sites for `Segment`. Steps 2-11 only add `impl` methods; the struct shape is now frozen. * `Segment::with_view` borrows the three `AtomicRefCell`-wrapped storages up front and populates every view field; closure bound relaxed `Fn` -> `FnOnce`. * `lookup_internal_id` (Option -> PointIdError conversion) and `read_range` (iterator + take_while) are migrated to the view. The previous Segment-side helpers become thin `with_view` delegators where external callers still rely on them. * Trivial id-tracker getters (`has_point`, `is_empty`, `available_point_count`, `deleted_point_count`, `total_point_count`) stay implemented directly on `Segment` -- one-liners that `ReadOnlySegment` will reimplement just as cheaply, no shared logic to factor out. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>