Expand description
Server — the builder a user of this crate actually touches.
§What it is
A server is a RegistryStore, a Vec of tool handlers, and the
negotiation inputs a connection will need. It is a value, not a running
process: nothing here binds a port or spawns a task. T13 and T14 supply the
transports that take one of these and give it somewhere to run, and until
then a test can drive it in-process.
§Why a builder and not a new
A server needs a name before it needs anything else, and most of what
follows is optional. A Server::new(name, tools, resources, prompts) is
four positional arguments in an order nobody can hold in their head, and it
is wrong in five of the six shapes a caller wants. The builder makes the
order free and names each thing at the call site.
Structs§
- Server
- A server, built.
- Server
Builder - The builder behind
Server::builder.
Enums§
- Dispatch
Error - Why a tool call did not run.
Type Aliases§
- BoxFuture
- The future a
ToolHandlerreturns. - BoxRead
Future - The future a
ResourceHandlerorPromptHandlerreturns. - Prompt
Handler - Serves one
prompts/get, given theargumentsthe peer sent. - Resource
Handler - Serves one
resources/read, given the URI the peer asked for. - Tool
Handler - A tool handler, and what it answers with.