pub trait MarkerBackend: Debug + Send {
Show 15 methods
// Required methods
fn open_run(
&mut self,
manifest: MarkerManifest,
) -> Result<(), EventStoreError>;
fn append_snapshot(
&mut self,
snapshot: &DataCursorSnapshot,
hash: [u8; 32],
) -> Result<(), EventStoreError>;
fn append_hifi(
&mut self,
marker: &HiFiMarker,
hash: [u8; 32],
) -> Result<(), EventStoreError>;
fn append_gap(
&mut self,
gap: &MarkerGap,
hash: [u8; 32],
) -> Result<(), EventStoreError>;
fn put_dict(
&mut self,
entry: &StreamDictEntry,
hash: [u8; 32],
) -> Result<(), EventStoreError>;
fn scan_snapshots(&self) -> Result<Vec<DataCursorSnapshot>, EventStoreError>;
fn scan_hifi(&self) -> Result<Vec<HiFiMarker>, EventStoreError>;
fn scan_gaps(&self) -> Result<Vec<MarkerGap>, EventStoreError>;
fn scan_dict(&self) -> Result<Vec<StreamDictEntry>, EventStoreError>;
fn seal(&mut self, status: RunStatus) -> Result<(), EventStoreError>;
fn manifest(&self) -> Result<MarkerManifest, EventStoreError>;
// Provided methods
fn scan_snapshot_records(
&self,
) -> Result<Option<Vec<StoredMarkerRecord<DataCursorSnapshot>>>, EventStoreError> { ... }
fn scan_hifi_records(
&self,
) -> Result<Option<Vec<StoredMarkerRecord<HiFiMarker>>>, EventStoreError> { ... }
fn scan_gap_records(
&self,
) -> Result<Option<Vec<StoredMarkerRecord<MarkerGap>>>, EventStoreError> { ... }
fn scan_dict_records(
&self,
) -> Result<Option<Vec<StoredMarkerRecord<StreamDictEntry>>>, EventStoreError> { ... }
}Expand description
A durable backend for the data marker sidecar.
Backends persist cursor snapshots, high-fidelity markers, gaps, and the slot dictionary for
one open run at a time, mirroring the EventStore trait for the
marker file. Each durable record is appended with its precomputed integrity hash so a verifier
can recompute and detect tampering. The marker path never blocks trading, so overflow is
recorded as a MarkerGap by the writer rather than failing the caller here.
Required Methods§
Sourcefn open_run(&mut self, manifest: MarkerManifest) -> Result<(), EventStoreError>
fn open_run(&mut self, manifest: MarkerManifest) -> Result<(), EventStoreError>
Opens a run for marker capture with the supplied manifest.
The status is normalized to RunStatus::Running and the per-table counts are zeroed, so
a caller can pass a freshly built or reused manifest without pre-clearing it.
§Errors
Returns EventStoreError::Backend for unclassified backend failures.
Sourcefn append_snapshot(
&mut self,
snapshot: &DataCursorSnapshot,
hash: [u8; 32],
) -> Result<(), EventStoreError>
fn append_snapshot( &mut self, snapshot: &DataCursorSnapshot, hash: [u8; 32], ) -> Result<(), EventStoreError>
Appends a cursor snapshot with its precomputed integrity hash.
§Errors
Returns EventStoreError::Closed when the run is sealed, and
EventStoreError::Backend when no run is open or for unclassified backend failures.
Sourcefn append_hifi(
&mut self,
marker: &HiFiMarker,
hash: [u8; 32],
) -> Result<(), EventStoreError>
fn append_hifi( &mut self, marker: &HiFiMarker, hash: [u8; 32], ) -> Result<(), EventStoreError>
Sourcefn append_gap(
&mut self,
gap: &MarkerGap,
hash: [u8; 32],
) -> Result<(), EventStoreError>
fn append_gap( &mut self, gap: &MarkerGap, hash: [u8; 32], ) -> Result<(), EventStoreError>
Appends a gap covering a dropped range of marker sequences, with its precomputed integrity hash.
§Errors
See append_snapshot.
Sourcefn put_dict(
&mut self,
entry: &StreamDictEntry,
hash: [u8; 32],
) -> Result<(), EventStoreError>
fn put_dict( &mut self, entry: &StreamDictEntry, hash: [u8; 32], ) -> Result<(), EventStoreError>
Records a slot dictionary entry with its precomputed integrity hash, write-once by slot.
A second call for an already-recorded slot is ignored, so the first observed
slot -> (data_cls, identifier) mapping wins and cannot be remapped.
§Errors
See append_snapshot.
Sourcefn scan_snapshots(&self) -> Result<Vec<DataCursorSnapshot>, EventStoreError>
fn scan_snapshots(&self) -> Result<Vec<DataCursorSnapshot>, EventStoreError>
Scans all cursor snapshots in ascending marker_seq order.
§Errors
Returns EventStoreError::Backend when no run is open or for unclassified backend
failures.
Sourcefn scan_hifi(&self) -> Result<Vec<HiFiMarker>, EventStoreError>
fn scan_hifi(&self) -> Result<Vec<HiFiMarker>, EventStoreError>
Sourcefn scan_dict(&self) -> Result<Vec<StreamDictEntry>, EventStoreError>
fn scan_dict(&self) -> Result<Vec<StreamDictEntry>, EventStoreError>
Sourcefn seal(&mut self, status: RunStatus) -> Result<(), EventStoreError>
fn seal(&mut self, status: RunStatus) -> Result<(), EventStoreError>
Seals the open run with the given terminal status.
§Errors
Returns EventStoreError::Backend when status is RunStatus::Running or no run is
open, and EventStoreError::Closed when the run is already sealed.
Sourcefn manifest(&self) -> Result<MarkerManifest, EventStoreError>
fn manifest(&self) -> Result<MarkerManifest, EventStoreError>
Provided Methods§
Sourcefn scan_snapshot_records(
&self,
) -> Result<Option<Vec<StoredMarkerRecord<DataCursorSnapshot>>>, EventStoreError>
fn scan_snapshot_records( &self, ) -> Result<Option<Vec<StoredMarkerRecord<DataCursorSnapshot>>>, EventStoreError>
Scans cursor snapshots with stored integrity hashes when the backend exposes them.
Returns Ok(None) for backends that can only expose decoded records.
§Errors
See scan_snapshots.
Sourcefn scan_hifi_records(
&self,
) -> Result<Option<Vec<StoredMarkerRecord<HiFiMarker>>>, EventStoreError>
fn scan_hifi_records( &self, ) -> Result<Option<Vec<StoredMarkerRecord<HiFiMarker>>>, EventStoreError>
Sourcefn scan_gap_records(
&self,
) -> Result<Option<Vec<StoredMarkerRecord<MarkerGap>>>, EventStoreError>
fn scan_gap_records( &self, ) -> Result<Option<Vec<StoredMarkerRecord<MarkerGap>>>, EventStoreError>
Sourcefn scan_dict_records(
&self,
) -> Result<Option<Vec<StoredMarkerRecord<StreamDictEntry>>>, EventStoreError>
fn scan_dict_records( &self, ) -> Result<Option<Vec<StoredMarkerRecord<StreamDictEntry>>>, EventStoreError>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".