pub struct AiClientHandle {
pub queue_len: Arc<AtomicUsize>,
/* private fields */
}Expand description
Clone-able handle onto a running (or idle) AI supervisor task.
Fields are pub(crate) so a later task’s commands.rs tests can build a
handle directly from a channel + ArcSwap without going through
spawn.
Fields§
§queue_len: Arc<AtomicUsize>AUX‑4: shared with the supervisor loop; read by the headerline renderer.
Implementations§
Source§impl AiClientHandle
impl AiClientHandle
Sourcepub fn start(&self, provider: ProviderConfig)
pub fn start(&self, provider: ProviderConfig)
Ask the supervisor to start provider. Non-blocking; the result
surfaces later via AiClientHandle::snapshot and the provider’s
AiLogger ring.
Sourcepub fn prompt(&self, text: String)
pub fn prompt(&self, text: String)
Ask the supervisor to send text as a prompt on the active session.
Non-blocking; if no session is open the supervisor drops the prompt
and logs a Warn-level “prompt dropped: no active session” record
to the subsystem-wide AiLogger ring instead of sending it.
Sourcepub fn interrupt(&self)
pub fn interrupt(&self)
AU‑3: interrupt the active turn without ending the session.
Non-blocking; the supervisor forwards an ACP session/cancel. If no
session is open it’s a no-op. Distinct from AiClientHandle::stop,
which tears the session (and provider child) down.
Sourcepub fn set_auto_accept(&self, on: bool)
pub fn set_auto_accept(&self, on: bool)
AU‑5: set trust mode. Non-blocking; the supervisor applies the flag and
republishes AiState.
Sourcepub fn toggle_auto_accept(&self) -> bool
pub fn toggle_auto_accept(&self) -> bool
AU‑5: flip trust mode, returning the value it was flipped to (from the current snapshot). Non-blocking; the supervisor applies + republishes.
Source§impl AiClientHandle
impl AiClientHandle
Sourcepub fn spawn(
runtime: &Handle,
logger: AiLogger,
conv_store: ConversationStore,
diff_bus: Option<ProgrammaticDiffBus>,
) -> AiClientHandle
pub fn spawn( runtime: &Handle, logger: AiLogger, conv_store: ConversationStore, diff_bus: Option<ProgrammaticDiffBus>, ) -> AiClientHandle
Spawn the supervisor task on runtime and return a handle onto it.
The supervisor owns the provider child + Connection + active
SessionId for as long as the task runs (until every clone of the
returned handle is dropped, which closes the command channel). All
protocol I/O happens on the supervisor task, never on the caller’s
thread.
Trait Implementations§
Source§impl Clone for AiClientHandle
impl Clone for AiClientHandle
Source§fn clone(&self) -> AiClientHandle
fn clone(&self) -> AiClientHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for AiClientHandle
impl RefUnwindSafe for AiClientHandle
impl Send for AiClientHandle
impl Sync for AiClientHandle
impl Unpin for AiClientHandle
impl UnsafeUnpin for AiClientHandle
impl UnwindSafe for AiClientHandle
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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