fix rustdoc warnings on transport links
- Re-export TransportHandle / TransportReader / TransportWriter alongside SubprocessTransport. Without these in the public API, rustdoc refused to resolve [`TransportHandle::close`] from SubprocessTransport's docs. - Inline the close()/end_input() link prose where the broken-link warning fired. cargo doc --no-deps now builds clean.
This commit is contained in:
parent
1ed4d8211f
commit
cf4486202d
2 changed files with 5 additions and 6 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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<Mutex<…>>`-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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue