diff --git a/src/lib.rs b/src/lib.rs index c90f8b6..035d804 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -125,7 +125,7 @@ pub use messages::{ }; pub use options::{ClaudeAgentOptions, Effort, McpServersConfig, PermissionMode, SystemPrompt}; pub use query::query; -pub use transport::SubprocessTransport; +pub use transport::{SubprocessTransport, TransportHandle, TransportReader, TransportWriter}; /// Crate version, as set in `Cargo.toml`. Sent to the CLI as /// `CLAUDE_AGENT_SDK_VERSION` in the subprocess env. diff --git a/src/transport.rs b/src/transport.rs index 1afa235..0e089e1 100644 --- a/src/transport.rs +++ b/src/transport.rs @@ -53,14 +53,13 @@ const MINIMUM_CLAUDE_CODE_VERSION: (u32, u32, u32) = (2, 0, 0); /// /// The reader half is consumed by the message-pump task; the writer half is /// cloned freely (`Arc>`-backed) and used to push user-message -/// frames. The handle is what you call [`close`] on to wait for the +/// frames. Call [`TransportHandle::close`] on the handle to wait for the /// subprocess to exit. /// -/// Drop implements best-effort `start_kill()` on the child so an abandoned -/// transport doesn't leak a `claude` process. +/// Drop on the handle implements best-effort `start_kill()` on the child so +/// an abandoned transport doesn't leak a `claude` process. /// /// [`connect`]: SubprocessTransport::connect -/// [`close`]: TransportHandle::close pub struct SubprocessTransport { options: ClaudeAgentOptions, cli_path: PathBuf, @@ -301,7 +300,7 @@ impl TransportWriter { guard.take(); // drop ChildStdin → close write end } - /// True if stdin has already been closed via [`end_input`] or the + /// True if stdin has already been closed via [`Self::end_input`] or the /// underlying handle was dropped. pub async fn is_closed(&self) -> bool { self.inner.stdin.lock().await.is_none()