pub trait SegmentEnumerator: Send + Sync {
// Required method
fn list_segments(&self) -> OperationResult<HashMap<Uuid, PathBuf>>;
}Expand description
Enumerates the segments that make up the shard, keyed by their UUID.
The follower delegates discovery to an enumerator, chosen by whoever knows the backend:
- the default (
ManifestSegmentEnumerator, wired byopen_mmap) reads the leader’s segment manifest; LocalSegmentEnumeratorscans the localsegments/directory;- an S3 follower can supply its own (e.g. reading the manifest over object storage).
Called on every refresh, so it must reflect the current
set. The returned paths are segment directory paths interpreted relative to the backend root
(e.g. segments/<uuid>), matching what ReadOnlySegment::open expects.
Required Methods§
fn list_segments(&self) -> OperationResult<HashMap<Uuid, PathBuf>>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".