pub struct AcpAgent { /* private fields */ }Expand description
A running ACP agent subprocess.
Implementations§
Source§impl AcpAgent
impl AcpAgent
Sourcepub fn spawn<S, F>(
command: &[S],
cwd: &Path,
capabilities: ClientCapabilities,
sink: F,
) -> Result<Self>
pub fn spawn<S, F>( command: &[S], cwd: &Path, capabilities: ClientCapabilities, sink: F, ) -> Result<Self>
Spawn command and connect to it.
command is an argv array — never a shell string, and never assembled into one
(ARCHITECTURE.md §11). sink receives every event; the app wraps it in
AppMessage::Agent so agent traffic wakes the main loop exactly as filesystem
traffic does.
Sourcepub fn connect<F>(
stdin: Box<dyn Write + Send>,
stdout: Box<dyn BufRead + Send>,
capabilities: ClientCapabilities,
sink: F,
) -> Self
pub fn connect<F>( stdin: Box<dyn Write + Send>, stdout: Box<dyn BufRead + Send>, capabilities: ClientCapabilities, sink: F, ) -> Self
Connect over arbitrary streams.
Exists so the transport can be driven by in-memory pipes in tests: everything
except spawn is then exercised without an agent installed.
Trait Implementations§
Source§impl AgentService for AcpAgent
impl AgentService for AcpAgent
Source§fn poll(&mut self) -> Vec<AgentEvent>
fn poll(&mut self) -> Vec<AgentEvent>
Always empty.
Events reach the app through the sink, not by polling: the main loop blocks on its
message channel, so a client that only answered when asked would never be asked.
The scripted agent uses poll; both end at Model::on_agent_event.
fn integration(&self) -> AgentIntegration
fn capabilities(&self) -> ClientCapabilities
Source§fn send(&mut self, request: AgentRequest)
fn send(&mut self, request: AgentRequest)
Queue work for the agent. Never blocks the caller.
Auto Trait Implementations§
impl Freeze for AcpAgent
impl RefUnwindSafe for AcpAgent
impl Send for AcpAgent
impl Sync for AcpAgent
impl Unpin for AcpAgent
impl UnsafeUnpin for AcpAgent
impl UnwindSafe for AcpAgent
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