pub struct CliChannelHandle {
pub incoming_tx: Sender<IncomingMessage>,
/* private fields */
}Expand description
Handle to the CLI channel, used to inject messages from the readline loop.
Fields§
§incoming_tx: Sender<IncomingMessage>Sender for injecting incoming messages into the gateway pipeline.
Implementations§
Source§impl CliChannelHandle
impl CliChannelHandle
Sourcepub fn from_channel(channel: &CliChannel) -> Self
pub fn from_channel(channel: &CliChannel) -> Self
Creates a handle from a CliChannel.
Sourcepub async fn send_user_message(&self, content: String) -> Result<()>
pub async fn send_user_message(&self, content: String) -> Result<()>
Send a user message into the gateway pipeline.
Sourcepub fn touch_session(&self)
pub fn touch_session(&self)
Touch the session (update activity).
Sourcepub fn reset_session(&self)
pub fn reset_session(&self)
Reset the session (create a new one).
Sourcepub fn session_id(&self) -> Uuid
pub fn session_id(&self) -> Uuid
Get the current session ID.
Sourcepub fn set_processing(&self, value: bool)
pub fn set_processing(&self, value: bool)
Mark that a request is being processed.
Sourcepub fn is_processing(&self) -> bool
pub fn is_processing(&self) -> bool
Check whether a request is currently being processed.
Sourcepub async fn send_switch_model(&self, model_id: &str) -> Result<()>
pub async fn send_switch_model(&self, model_id: &str) -> Result<()>
Send a switch_model action to the gateway.
The gateway detects the action metadata and routes to EngineApi::set_model()
instead of the orchestrator.
Sourcepub async fn send_switch_persona(&self, persona_id: &str) -> Result<()>
pub async fn send_switch_persona(&self, persona_id: &str) -> Result<()>
Send a switch_persona action to the gateway.
The gateway detects the action metadata and routes to PersonaApi::set_active()
instead of the orchestrator.
Trait Implementations§
Source§impl Clone for CliChannelHandle
impl Clone for CliChannelHandle
Source§fn clone(&self) -> CliChannelHandle
fn clone(&self) -> CliChannelHandle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CliChannelHandle
impl RefUnwindSafe for CliChannelHandle
impl Send for CliChannelHandle
impl Sync for CliChannelHandle
impl Unpin for CliChannelHandle
impl UnsafeUnpin for CliChannelHandle
impl UnwindSafe for CliChannelHandle
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
Mutably borrows from an owned value. Read more
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,
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>
Converts
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>
Converts
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