refactor: move next_trial_id counter from Study into Storage trait

This commit is contained in:
Manuel Raimann
2026-02-11 23:32:15 +01:00
parent d14f4e0792
commit d2e36ec304
5 changed files with 56 additions and 46 deletions
+6
View File
@@ -42,6 +42,12 @@ pub trait Storage<V>: Send + Sync {
/// lock for efficient, allocation-free access.
fn trials_arc(&self) -> &Arc<RwLock<Vec<CompletedTrial<V>>>>;
/// Atomically returns the next unique trial ID.
///
/// Each call increments an internal counter so that consecutive
/// calls always produce distinct IDs.
fn next_trial_id(&self) -> u64;
/// Reload from an external source (e.g. a file written by another
/// process). Returns `true` if the in-memory buffer was updated.
///