pub struct ClaudeAgentClient { /* private fields */ }Implementations§
Source§impl ClaudeAgentClient
impl ClaudeAgentClient
pub fn spawn_stream_message( options: ClaudeAgentOptions, content: impl Into<String>, ) -> UnboundedReceiver<StreamEvent>
pub fn new(options: ClaudeAgentOptions) -> Result<Self>
pub fn with_transport( options: ClaudeAgentOptions, transport: Box<dyn Transport>, ) -> Result<Self>
pub async fn connect(&mut self) -> Result<()>
pub async fn connect_with_prompt( &mut self, content: impl Into<String>, ) -> Result<()>
pub async fn connect_with_stream<S>(&mut self, stream: S) -> Result<()>
pub async fn send_message( &mut self, content: impl Into<String>, ) -> Result<MessageResponse>
pub async fn query(&mut self, content: impl Into<String>) -> Result<()>
pub async fn query_with_session_id( &mut self, content: impl Into<String>, session_id: impl Into<String>, ) -> Result<()>
pub async fn query_stream<S>(&mut self, stream: S) -> Result<()>
pub async fn query_stream_with_session_id<S>( &mut self, stream: S, session_id: impl Into<String>, ) -> Result<()>
pub async fn receive_response(&mut self) -> Result<Vec<Message>>
pub async fn receive_messages(&mut self) -> Result<Vec<Message>>
pub async fn stream_message( &mut self, content: impl Into<String>, ) -> Result<UnboundedReceiver<StreamEvent>>
pub async fn get_conversation_history(&self) -> Result<Vec<Message>>
pub async fn abort(&mut self) -> Result<()>
pub async fn disconnect(&mut self) -> Result<()>
pub async fn close(self) -> Result<()>
pub async fn interrupt(&mut self) -> Result<()>
pub async fn set_permission_mode(&mut self, mode: PermissionMode) -> Result<()>
pub async fn set_model(&mut self, model: Option<String>) -> Result<()>
pub async fn rewind_files( &mut self, user_message_id: impl Into<String>, ) -> Result<()>
pub async fn reconnect_mcp_server( &mut self, server_name: impl Into<String>, ) -> Result<()>
pub async fn toggle_mcp_server( &mut self, server_name: impl Into<String>, enabled: bool, ) -> Result<()>
pub async fn stop_task(&mut self, task_id: impl Into<String>) -> Result<()>
pub async fn get_mcp_status(&mut self) -> Result<MCPStatusResponse>
pub async fn get_context_usage(&mut self) -> Result<ContextUsageResponse>
pub fn get_server_info(&self) -> Option<&Map<String, Value>>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ClaudeAgentClient
impl !UnwindSafe for ClaudeAgentClient
impl Freeze for ClaudeAgentClient
impl Send for ClaudeAgentClient
impl Sync for ClaudeAgentClient
impl Unpin for ClaudeAgentClient
impl UnsafeUnpin for ClaudeAgentClient
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> 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