pub struct Session { /* private fields */ }Implementations§
Source§impl Session
impl Session
pub fn open(store: WarmStartStore, key: Fingerprint) -> Self
Sourcepub fn preload(&self, entry: WarmStartEntry)
pub fn preload(&self, entry: WarmStartEntry)
Stash a near-match payload that the next Self::try_load call
should return in preference to looking up this session’s key.
Used by the workflow dispatcher to seed a fresh fit’s outer loop from a related but not-exact-fingerprint prior fit (e.g., cross-validation folds of the same model). The exact-key keyspace remains untouched by this — checkpoint and finalize writes still go to the session’s own key.
pub fn key(&self) -> &Fingerprint
pub fn run_id(&self) -> &str
pub fn store(&self) -> &WarmStartStore
Sourcepub fn try_load(&self) -> Option<WarmStartEntry>
pub fn try_load(&self) -> Option<WarmStartEntry>
Read the best entry currently on disk for this session’s key. Lookup is read-only against the store and may return entries from other runs (the whole point of cross-run resume).
If a near-match seed has been preloaded via Self::preload,
the seed is returned in preference to the store lookup AND
consumed (so subsequent calls fall back to the store). This
makes the session a unified abstraction over “exact-key hit”
and “hierarchical-prefix seed.”
Sourcepub fn try_load_with_source(&self) -> Option<LoadedEntry>
pub fn try_load_with_source(&self) -> Option<LoadedEntry>
Read the best available warm-start entry and report whether it came from this session’s exact key or from a preloaded near-match seed.
Callers that only need a seed can use Self::try_load. Callers that
may skip expensive validation on a finalized exact hit need this source
bit so a near-match prefix seed is never mistaken for a completed fit.
Sourcepub fn peek_load(&self) -> Option<WarmStartEntry>
pub fn peek_load(&self) -> Option<WarmStartEntry>
Read the currently available warm-start entry without consuming a preloaded near-match seed.
This is intentionally separate from Self::try_load: callers that
only need to make a scheduling decision (for example, whether to run an
expensive cold-start pilot) must not drain the preloaded seed that the
outer optimizer is about to consume.
Sourcepub fn peek_load_with_source(&self) -> Option<LoadedEntry>
pub fn peek_load_with_source(&self) -> Option<LoadedEntry>
Read the currently available warm-start entry with source metadata, without consuming a preloaded near-match seed.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more