Skip to main content

Module builder

Module builder 

Source
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.
ServerBuilder
The builder behind Server::builder.

Enums§

DispatchError
Why a tool call did not run.

Type Aliases§

BoxFuture
The future a ToolHandler returns.
BoxReadFuture
The future a ResourceHandler or PromptHandler returns.
PromptHandler
Serves one prompts/get, given the arguments the peer sent.
ResourceHandler
Serves one resources/read, given the URI the peer asked for.
ToolHandler
A tool handler, and what it answers with.