pub enum DaemonReadiness {
Warming = 0,
Ready = 1,
}Expand description
Two-phase daemon readiness state (issues #910/#911, revised by #1970).
Why: The embedder cold-init (CoreML compile, 30-120 s) must never block
the fast text/KG/BM25 paths that don’t need it. Originally (#910/#911)
this state gated a hard-error preflight that rejected every
memory_remember/memory_recall call outright while Warming — mirrored
from trusty-search’s staged pipeline, #1970 replaced that with graceful
degradation: writes persist immediately and defer embedding to a
background task, reads return BM25 + L0/L1 results and simply omit the
vector lane, all keyed off this same state.
What: Two stable values stored atomically. Warming (0) is the initial
state; Ready (1) is set once the embedder has been successfully
initialised by spawn_startup_tasks. The transition is one-way and
lock-free: a single AtomicU8 compare-and-swap.
Test: daemon_readiness_transitions_warming_to_ready in this module;
degraded-path coverage in tools::tests
(remember_succeeds_and_defers_embedding_while_state_is_warming,
recall_falls_back_to_bm25_and_l0_l1_while_warming).
Variants§
Warming = 0
Embedder cold-init (and/or pin scan) still in progress.
Ready = 1
Embedder initialised; all handlers may proceed normally.
Implementations§
Source§impl DaemonReadiness
impl DaemonReadiness
Sourcepub fn from_u8(v: u8) -> Self
pub fn from_u8(v: u8) -> Self
Decode the raw atomic value.
Why: centralises the 0 → Warming, else Ready mapping so every
caller loads a meaningful enum rather than comparing raw integers.
What: returns Warming for 0, Ready for any other value (only
1 is ever written).
Test: daemon_readiness_from_u8 in this module.
Trait Implementations§
Source§impl Clone for DaemonReadiness
impl Clone for DaemonReadiness
Source§fn clone(&self) -> DaemonReadiness
fn clone(&self) -> DaemonReadiness
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for DaemonReadiness
Source§impl Debug for DaemonReadiness
impl Debug for DaemonReadiness
impl Eq for DaemonReadiness
Source§impl PartialEq for DaemonReadiness
impl PartialEq for DaemonReadiness
Source§fn eq(&self, other: &DaemonReadiness) -> bool
fn eq(&self, other: &DaemonReadiness) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DaemonReadiness
Auto Trait Implementations§
impl Freeze for DaemonReadiness
impl RefUnwindSafe for DaemonReadiness
impl Send for DaemonReadiness
impl Sync for DaemonReadiness
impl Unpin for DaemonReadiness
impl UnsafeUnpin for DaemonReadiness
impl UnwindSafe for DaemonReadiness
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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