pub struct AcpSession { /* private fields */ }Expand description
A live ACP session (the AgentSession impl).
Reading is INLINE in AcpSession::next_event (no reader task), which
keeps memory bounded by [BoundedLines] and is deadlock-free for this
protocol: the peer blocks waiting for each permission answer, and the
read loop answers permission requests synchronously as they arrive, so
stdin writes never wait on a peer that is itself waiting on a full
stdout pipe.
Trait Implementations§
Source§impl AgentSession for AcpSession
impl AgentSession for AcpSession
Source§fn session_id(&self) -> String
fn session_id(&self) -> String
The session id actually in use (== spec.session_id unless resumed).
Source§fn next_event<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<AgentEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn next_event<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<AgentEvent>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Next event from the session stream;
None when the stream is closed.Source§fn send_user_message<'life0, 'life1, 'async_trait>(
&'life0 mut self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn send_user_message<'life0, 'life1, 'async_trait>(
&'life0 mut self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Inject a user message (streaming-input sessions only; error otherwise).
Source§fn abort<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn abort<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Terminate the underlying process/stream. Must kill the whole process
tree and work on Windows (no bare POSIX signal assumptions — §9).
Source§fn exit_status(&self) -> Option<SessionExit>
fn exit_status(&self) -> Option<SessionExit>
Available after the stream has closed.
Source§impl Drop for AcpSession
Available on Unix only.
impl Drop for AcpSession
Available on Unix only.
Auto Trait Implementations§
impl !RefUnwindSafe for AcpSession
impl !UnwindSafe for AcpSession
impl Freeze for AcpSession
impl Send for AcpSession
impl Sync for AcpSession
impl Unpin for AcpSession
impl UnsafeUnpin for AcpSession
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