Skip to content

Commit 0e63f2d

Browse files
committed
docs(sacp): fix all rustdoc link warnings
- Fix MatchMessage links in jsonrpc.rs - Fix DynamicHandlerRegistration reference (was private) - Fix Self::connection_cx reference (method didn't exist) - Fix McpServerConnect links in mcp_server module - Fix SessionBuilder::with_mcp_server and JrConnectionBuilder links - Fix McpServerBuilder::tool_fn links in lib.rs macros
1 parent 6f6e319 commit 0e63f2d

6 files changed

Lines changed: 18 additions & 19 deletions

File tree

src/sacp/src/jsonrpc.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ impl<H: JrMessageHandler, R: JrResponder<H::Link>> JrConnectionBuilder<H, R> {
10711071
///
10721072
/// # Borrow Checker Considerations
10731073
///
1074-
/// You may find that [`MatchMessage`] is a better choice than this method
1074+
/// You may find that [`MatchMessage`](`crate::util::MatchMessage`) is a better choice than this method
10751075
/// for implementing custom handlers. It offers a very similar API to
10761076
/// [`JrConnectionBuilder`] but is structured to apply each test one at a time
10771077
/// (sequentially) instead of setting them all up at once. This sequential approach
@@ -1106,7 +1106,7 @@ impl<H: JrMessageHandler, R: JrResponder<H::Link>> JrConnectionBuilder<H, R> {
11061106
/// ```
11071107
///
11081108
/// You can work around this by using `apply()` to process messages one at a time,
1109-
/// or use [`MatchMessage`] which provides a similar API but applies handlers sequentially:
1109+
/// or use [`MatchMessage`](`crate::util::MatchMessage`) which provides a similar API but applies handlers sequentially:
11101110
///
11111111
/// ```ignore
11121112
/// use sacp::{MessageCx, Handled};
@@ -1837,7 +1837,7 @@ impl<Link: JrLink> JrConnectionCx<Link> {
18371837
///
18381838
/// If they decline to handle the message, then the message is passed to the regular registered handlers.
18391839
///
1840-
/// The handler will stay registered until the [`DynamicHandlerRegistration`] is dropped.
1840+
/// The handler will stay registered until the returned registration guard is dropped.
18411841
pub fn add_dynamic_handler(
18421842
&self,
18431843
handler: impl JrMessageHandler<Link = Link> + 'static,
@@ -1893,11 +1893,10 @@ impl<Link: JrLink> Drop for DynamicHandlerRegistration<Link> {
18931893
///
18941894
/// 1. **Respond to the request** - Use [`respond`](Self::respond) or
18951895
/// [`respond_with_result`](Self::respond_with_result) to send the response
1896-
/// 2. **Send other messages** - Use [`connection_cx`](Self::connection_cx) to access the
1897-
/// underlying [`JrConnectionCx`], giving access to
1898-
/// [`send_request`](JrConnectionCx::send_request),
1899-
/// [`send_notification`](JrConnectionCx::send_notification), and
1900-
/// [`spawn`](JrConnectionCx::spawn)
1896+
/// 2. **Send other messages** - Use the [`JrConnectionCx`] parameter passed to your
1897+
/// handler, which provides [`send_request`](`JrConnectionCx::send_request`),
1898+
/// [`send_notification`](`JrConnectionCx::send_notification`), and
1899+
/// [`spawn`](`JrConnectionCx::spawn`)
19011900
///
19021901
/// # Example
19031902
///

src/sacp/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ mod session;
147147
pub use session::*;
148148

149149
/// This is a hack that must be given as the final argument of
150-
/// [`McpServerBuilder::tool_fn`] when defining tools.
150+
/// [`McpServerBuilder::tool_fn`](`crate::mcp_server::McpServerBuilder::tool_fn`) when defining tools.
151151
/// Look away, lest ye be blinded by its vileness!
152152
///
153153
/// Fine, if you MUST know, it's a horrific workaround for not having
@@ -162,7 +162,7 @@ macro_rules! tool_fn_mut {
162162
}
163163

164164
/// This is a hack that must be given as the final argument of
165-
/// [`McpServerBuilder::tool_fn`] when defining stateless concurrent tools.
165+
/// [`McpServerBuilder::tool_fn`](`crate::mcp_server::McpServerBuilder::tool_fn`) when defining stateless concurrent tools.
166166
/// See [`tool_fn_mut!`] for the gory details.
167167
#[macro_export]
168168
macro_rules! tool_fn {

src/sacp/src/mcp_server/builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ where
242242

243243
/// Create an MCP server from this builder.
244244
///
245-
/// This builder can be attached to new sessions (see [`SessionBuilder::with_mcp_server`])
246-
/// or served up as part of a proxy (see [`JrConnectionBuilder::with_mcp_server`]).
245+
/// This builder can be attached to new sessions (see [`SessionBuilder::with_mcp_server`](`crate::SessionBuilder::with_mcp_server`))
246+
/// or served up as part of a proxy (see [`JrConnectionBuilder::with_mcp_server`](`crate::JrConnectionBuilder::with_mcp_server`)).
247247
pub fn build(self) -> McpServer<Link, Responder> {
248248
McpServer::new(
249249
McpServerBuilt {

src/sacp/src/mcp_server/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
//!
2424
//! ## Custom MCP Server Implementations
2525
//!
26-
//! You can implement [`McpServerConnect`] to create custom MCP servers:
26+
//! You can implement [`McpServerConnect`](`crate::mcp_server::McpServerConnect`) to create custom MCP servers:
2727
//!
2828
//! ```rust,ignore
2929
//! use sacp::mcp_server::{McpServer, McpServerConnect, McpContext};

src/sacp/src/mcp_server/server.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ use crate::{
1717

1818
/// An MCP server that can be attached to ACP connections.
1919
///
20-
/// `McpServer` wraps an [`McpServerConnect`] implementation and can be used either:
21-
/// - As a message handler via [`JrConnectionBuilder::with_handler`], automatically
20+
/// `McpServer` wraps an [`McpServerConnect`](`super::McpServerConnect`) implementation and can be used either:
21+
/// - As a message handler via [`JrConnectionBuilder::with_handler`](`crate::JrConnectionBuilder::with_handler`), automatically
2222
/// attaching to new sessions
23-
/// - Manually via [`Self::into_dynamic_handler`] for more control
23+
/// - Manually for more control
2424
///
2525
/// # Creating an MCP Server
2626
///
@@ -33,7 +33,7 @@ use crate::{
3333
/// .build();
3434
/// ```
3535
///
36-
/// Or implement [`McpServerConnect`] for custom server behavior:
36+
/// Or implement [`McpServerConnect`](`super::McpServerConnect`) for custom server behavior:
3737
///
3838
/// ```rust,ignore
3939
/// let server = McpServer::new(MyCustomServerConnect);
@@ -65,7 +65,7 @@ impl<Link: JrLink, Responder: JrResponder<Link>> McpServer<Link, Responder>
6565
where
6666
Link: HasPeer<AgentPeer>,
6767
{
68-
/// Create an MCP server from something that implements the [`McpServerConnect`] trait.
68+
/// Create an MCP server from something that implements the [`McpServerConnect`](`super::McpServerConnect`) trait.
6969
///
7070
/// # See also
7171
///

src/sacp/src/session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ where
328328
/// [`start_session`](Self::start_session) which block the current task.
329329
///
330330
/// This should not be used from inside a message handler like
331-
/// [`JrConnectionBuilder::on_receive_request`] or [`JrMessageHandler`]
331+
/// [`JrConnectionBuilder::on_receive_request`](`crate::JrConnectionBuilder::on_receive_request`) or [`JrMessageHandler`]
332332
/// implementations.
333333
pub fn block_task(self) -> SessionBuilder<Link, Responder, Blocking> {
334334
SessionBuilder {

0 commit comments

Comments
 (0)