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 resume_session(session_uuid: Uuid) -> Result<Self>
pub fn resume_session(session_uuid: Uuid) -> Result<Self>
Resume a previous session by UUID This creates a new client that resumes an existing session
Sourcepub fn resume_session_with_model(
session_uuid: Uuid,
model: &str,
) -> Result<Self>
pub fn resume_session_with_model( session_uuid: Uuid, model: &str, ) -> Result<Self>
Resume a previous session with a specific model
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
Sourcepub fn session_uuid(&self) -> Result<Uuid>
pub fn session_uuid(&self) -> Result<Uuid>
Get the session UUID if available Returns an error if no response has been received yet
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