pub struct SyncClient { /* private fields */ }Expand description
Synchronous client for communicating with Claude
Implementations§
Source§impl SyncClient
impl SyncClient
Sourcepub fn new(child: Child) -> Result<Self>
pub fn new(child: Child) -> Result<Self>
Create a new synchronous client from an existing child process
Sourcepub fn with_defaults() -> Result<Self>
pub fn with_defaults() -> Result<Self>
Create a new synchronous client with default settings
Sourcepub fn query(&mut self, input: ClaudeInput) -> Result<Vec<ClaudeOutput>>
pub fn query(&mut self, input: ClaudeInput) -> Result<Vec<ClaudeOutput>>
Send a query and collect all responses
Sourcepub fn query_stream(
&mut self,
input: ClaudeInput,
) -> Result<ResponseIterator<'_>>
pub fn query_stream( &mut self, input: ClaudeInput, ) -> Result<ResponseIterator<'_>>
Send a query and return an iterator over responses
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SyncClient
impl RefUnwindSafe for SyncClient
impl Send for SyncClient
impl Sync for SyncClient
impl Unpin for SyncClient
impl UnwindSafe for SyncClient
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