pub struct AgentConnection(/* private fields */);
Expand description
A connection to a separate agent process over the ACP protocol.
Implementations§
Source§impl AgentConnection
impl AgentConnection
Sourcepub fn connect_to_agent<H: 'static + Client>(
handler: H,
outgoing_bytes: impl Unpin + AsyncWrite,
incoming_bytes: impl Unpin + AsyncRead,
spawn: impl Fn(LocalBoxFuture<'static, ()>) + 'static,
) -> (Self, impl Future<Output = Result<(), Error>>)
pub fn connect_to_agent<H: 'static + Client>( handler: H, outgoing_bytes: impl Unpin + AsyncWrite, incoming_bytes: impl Unpin + AsyncRead, spawn: impl Fn(LocalBoxFuture<'static, ()>) + 'static, ) -> (Self, impl Future<Output = Result<(), Error>>)
Connect to an agent process, handling any incoming requests using the given handler.
Sourcepub fn request<R: AgentRequest + 'static>(
&self,
params: R,
) -> impl Future<Output = Result<R::Response, Error>>
pub fn request<R: AgentRequest + 'static>( &self, params: R, ) -> impl Future<Output = Result<R::Response, Error>>
Send a request to the agent and wait for a response.
Sourcepub fn request_any(
&self,
params: AnyAgentRequest,
) -> impl use<> + Future<Output = Result<AnyAgentResult, Error>>
pub fn request_any( &self, params: AnyAgentRequest, ) -> impl use<> + Future<Output = Result<AnyAgentResult, Error>>
Send an untyped request to the agent and wait for a response.
Sourcepub async fn initialize(
&self,
context_servers: HashMap<String, ContextServer>,
) -> Result<InitializeResponse, Error>
pub async fn initialize( &self, context_servers: HashMap<String, ContextServer>, ) -> Result<InitializeResponse, Error>
Sends an initialization request to the Agent. This will error if the server version is incompatible with the client version.
Auto Trait Implementations§
impl !Freeze for AgentConnection
impl !RefUnwindSafe for AgentConnection
impl Send for AgentConnection
impl Sync for AgentConnection
impl Unpin for AgentConnection
impl !UnwindSafe for AgentConnection
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