Skip to main content

QueueClient

Struct QueueClient 

Source
pub struct QueueClient { /* private fields */ }
Expand description

A client that connects to an existing queue owner via Unix socket and enqueues prompts for processing.

Implementations§

Source§

impl QueueClient

Source

pub async fn connect(session_key: &str) -> Result<Self>

Connect to the queue owner’s Unix socket for the given session key.

Source

pub async fn prompt( &mut self, messages: Vec<String>, renderer: &mut dyn OutputRenderer, _permission_mode: &PermissionMode, ) -> Result<PromptResult>

Send a prompt to the queue owner and stream response events back through the renderer. Returns the final PromptResult when the owner finishes processing.

Source

pub async fn enqueue_only(&mut self, messages: Vec<String>) -> Result<usize>

Send a prompt and wait only for the Queued acknowledgement, returning the queue position. This is used by --no-wait mode so the CLI can exit immediately after confirming the prompt was accepted.

Source

pub async fn set_mode(&mut self, mode: &str) -> Result<()>

Send a set-mode request to the queue owner.

Source

pub async fn set_config(&mut self, key: &str, value: &str) -> Result<()>

Send a set-config request to the queue owner.

Source

pub async fn cancel(&mut self) -> Result<()>

Send a cancel request to the queue owner.

Source

pub async fn status(&mut self) -> Result<String>

Request status from the queue owner.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoMaybeUndefined<T> for T

Source§

impl<T> IntoOption<T> for T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.