pub struct FileSplitStore { /* private fields */ }Expand description
File-backed split store for persistent runs (metadata + epoch/sampler state).
Implementations§
Source§impl FileSplitStore
impl FileSplitStore
pub fn open<P: Into<PathBuf>>( path: P, ratios: SplitRatios, seed: u64, ) -> Result<Self, SamplerError>
pub fn default_path() -> PathBuf
pub fn default_path_in_dir<P: AsRef<Path>>(dir: P) -> PathBuf
Trait Implementations§
Source§impl Debug for FileSplitStore
impl Debug for FileSplitStore
Source§impl EpochStateStore for FileSplitStore
impl EpochStateStore for FileSplitStore
fn load_epoch_meta( &self, ) -> Result<HashMap<SplitLabel, PersistedSplitMeta>, SamplerError>
fn load_epoch_hashes( &self, label: SplitLabel, ) -> Result<Option<PersistedSplitHashes>, SamplerError>
fn store_epoch_meta( &self, meta: &HashMap<SplitLabel, PersistedSplitMeta>, ) -> Result<(), SamplerError>
fn store_epoch_hashes( &self, label: SplitLabel, hashes: &PersistedSplitHashes, ) -> Result<(), SamplerError>
Source§impl SamplerStateStore for FileSplitStore
impl SamplerStateStore for FileSplitStore
fn load_sampler_state( &self, ) -> Result<Option<PersistedSamplerState>, SamplerError>
fn store_sampler_state( &self, state: &PersistedSamplerState, ) -> Result<(), SamplerError>
Source§impl SplitStore for FileSplitStore
impl SplitStore for FileSplitStore
fn label_for(&self, id: &RecordId) -> Option<SplitLabel>
fn upsert(&self, id: RecordId, label: SplitLabel) -> Result<(), SamplerError>
fn ratios(&self) -> SplitRatios
Source§fn ensure(&self, id: RecordId) -> Result<SplitLabel, SamplerError>
fn ensure(&self, id: RecordId) -> Result<SplitLabel, SamplerError>
Returns the split label for
id.Auto Trait Implementations§
impl !Freeze for FileSplitStore
impl RefUnwindSafe for FileSplitStore
impl Send for FileSplitStore
impl Sync for FileSplitStore
impl Unpin for FileSplitStore
impl UnsafeUnpin for FileSplitStore
impl UnwindSafe for FileSplitStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more