pub struct OptimizedClient { /* private fields */ }Expand description
Optimized client with improved performance characteristics
Implementations§
Source§impl OptimizedClient
impl OptimizedClient
Sourcepub fn new(options: ClaudeCodeOptions, mode: ClientMode) -> Result<Self>
pub fn new(options: ClaudeCodeOptions, mode: ClientMode) -> Result<Self>
Create a new optimized client
Sourcepub async fn query(&self, prompt: String) -> Result<Vec<Message>>
pub async fn query(&self, prompt: String) -> Result<Vec<Message>>
Execute a one-shot query with automatic retry
Sourcepub async fn query_with_retry(
&self,
prompt: String,
max_retries: u32,
initial_delay: Duration,
) -> Result<Vec<Message>>
pub async fn query_with_retry( &self, prompt: String, max_retries: u32, initial_delay: Duration, ) -> Result<Vec<Message>>
Execute a query with custom retry configuration
Sourcepub async fn start_interactive_session(&self) -> Result<()>
pub async fn start_interactive_session(&self) -> Result<()>
Start an interactive session
Sourcepub async fn send_interactive(&self, prompt: String) -> Result<()>
pub async fn send_interactive(&self, prompt: String) -> Result<()>
Send a message in interactive mode
Sourcepub async fn receive_interactive(&self) -> Result<Vec<Message>>
pub async fn receive_interactive(&self) -> Result<Vec<Message>>
Receive messages in interactive mode
Sourcepub async fn process_batch(
&self,
prompts: Vec<String>,
) -> Result<Vec<Result<Vec<Message>>>>
pub async fn process_batch( &self, prompts: Vec<String>, ) -> Result<Vec<Result<Vec<Message>>>>
Process a batch of queries concurrently
Sourcepub async fn end_interactive_session(&self) -> Result<()>
pub async fn end_interactive_session(&self) -> Result<()>
End interactive session
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OptimizedClient
impl !RefUnwindSafe for OptimizedClient
impl Send for OptimizedClient
impl Sync for OptimizedClient
impl Unpin for OptimizedClient
impl !UnwindSafe for OptimizedClient
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
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