pub struct InjectionEngine { /* private fields */ }Implementations§
Source§impl InjectionEngine
impl InjectionEngine
pub fn new(router: Arc<MemoryRouter>, context: Arc<SessionContext>) -> Arc<Self> ⓘ
pub async fn set_agent_id(&self, agent_id: &str)
pub async fn refresh_if_needed(&self) -> bool
Sourcepub async fn refresh(&self) -> bool
pub async fn refresh(&self) -> bool
Returns true when the injection state was successfully replaced, so
callers can tell a real refresh from a failed one instead of re-using
stale instructions for the current session.
Sourcepub async fn refresh_if_needed_two_phase(self: &Arc<Self>) -> bool
pub async fn refresh_if_needed_two_phase(self: &Arc<Self>) -> bool
Two-phase refresh — Feature C (paper §2.3 deterministic addressing + async prefetch).
Phase 1 (deterministic, synchronous): MUST-level memories resolved by pure rules, zero embedding calls. Stored immediately so a caller can proceed without waiting on the semantic pipeline.
Phase 2 (prefetch, async): the full layered pipeline runs in the background and replaces the state when it lands. If it fails, the deterministic baseline is kept rather than dropped. A generation counter stops a slow prefetch from clobbering a fresher refresh.
Returns true when a refresh was kicked off (i.e. the context had
changed), mirroring Self::refresh_if_needed.
Sourcepub async fn refresh_two_phase(self: &Arc<Self>) -> bool
pub async fn refresh_two_phase(self: &Arc<Self>) -> bool
Unconditional two-phase refresh. See Self::refresh_if_needed_two_phase.
Sourcepub async fn wait_full(&self, timeout: Duration) -> bool
pub async fn wait_full(&self, timeout: Duration) -> bool
Wait until the injection state was produced by the full pipeline, or
the timeout elapses. Returns true when the state is Full. A
deterministic baseline (or no state at all) returns false after the
timeout — callers must treat that as “proceed with what is available”,
never as an error.
Sourcepub async fn get_phase(&self) -> Option<InjectionPhase>
pub async fn get_phase(&self) -> Option<InjectionPhase>
Current injection phase, if any state exists.
pub async fn get_current_injection(&self) -> Option<String>
pub async fn get_session_id(&self) -> Option<String>
pub async fn get_injected_memory_ids(&self) -> Vec<String>
Auto Trait Implementations§
impl !Freeze for InjectionEngine
impl !RefUnwindSafe for InjectionEngine
impl !UnwindSafe for InjectionEngine
impl Send for InjectionEngine
impl Sync for InjectionEngine
impl Unpin for InjectionEngine
impl UnsafeUnpin for InjectionEngine
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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