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 options::{ClaudeAgentOptions, Effort, McpServersConfig, PermissionMode, SystemPrompt};
|
||||||
pub use query::query;
|
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
|
/// Crate version, as set in `Cargo.toml`. Sent to the CLI as
|
||||||
/// `CLAUDE_AGENT_SDK_VERSION` in the subprocess env.
|
/// `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
|
/// 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
|
/// 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.
|
/// subprocess to exit.
|
||||||
///
|
///
|
||||||
/// Drop implements best-effort `start_kill()` on the child so an abandoned
|
/// Drop on the handle implements best-effort `start_kill()` on the child so
|
||||||
/// transport doesn't leak a `claude` process.
|
/// an abandoned transport doesn't leak a `claude` process.
|
||||||
///
|
///
|
||||||
/// [`connect`]: SubprocessTransport::connect
|
/// [`connect`]: SubprocessTransport::connect
|
||||||
/// [`close`]: TransportHandle::close
|
|
||||||
pub struct SubprocessTransport {
|
pub struct SubprocessTransport {
|
||||||
options: ClaudeAgentOptions,
|
options: ClaudeAgentOptions,
|
||||||
cli_path: PathBuf,
|
cli_path: PathBuf,
|
||||||
|
|
@ -301,7 +300,7 @@ impl TransportWriter {
|
||||||
guard.take(); // drop ChildStdin → close write end
|
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.
|
/// underlying handle was dropped.
|
||||||
pub async fn is_closed(&self) -> bool {
|
pub async fn is_closed(&self) -> bool {
|
||||||
self.inner.stdin.lock().await.is_none()
|
self.inner.stdin.lock().await.is_none()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue