pub struct ClaudeClient {
pub cli_path: String,
}Expand description
Builder / factory for Claude sessions.
Holds configuration that applies to every session spawned by this client,
such as the path to the claude binary.
Fields§
§cli_path: StringPath to the claude CLI binary.
Implementations§
Source§impl ClaudeClient
impl ClaudeClient
Sourcepub fn with_cli_path(cli_path: impl Into<String>) -> Self
pub fn with_cli_path(cli_path: impl Into<String>) -> Self
Create a new client with a custom path to the Claude CLI binary.
Sourcepub async fn spawn(&self, opts: SessionOptions) -> Result<Session>
pub async fn spawn(&self, opts: SessionOptions) -> Result<Session>
Spawn a new Claude session with the given options.
This starts the claude subprocess and returns a Session handle
for sending messages and receiving events.
§Errors
Returns SdkError::ProcessSpawn if the claude binary cannot be
found or started.
Trait Implementations§
Source§impl Clone for ClaudeClient
impl Clone for ClaudeClient
Source§fn clone(&self) -> ClaudeClient
fn clone(&self) -> ClaudeClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ClaudeClient
impl Debug for ClaudeClient
Auto Trait Implementations§
impl Freeze for ClaudeClient
impl RefUnwindSafe for ClaudeClient
impl Send for ClaudeClient
impl Sync for ClaudeClient
impl Unpin for ClaudeClient
impl UnsafeUnpin for ClaudeClient
impl UnwindSafe for ClaudeClient
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