Skip to main content

stdio

Function stdio 

Source
pub fn stdio<S>(server: Server<S>) -> StdioBuilder<S>
where S: Send + Sync + 'static,
Expand description

Entry point: serve a built Server over the default stdio adapter.

The adapter supplies the transport and nothing else. Concurrency policy, registrations, and lifecycle hooks all belong to the Server that was handed in, and serving reports how the connection ended rather than terminating the process — mapping an Outcome to a process disposition is the binary’s decision (ADR 0018).

let server = lspf::Server::builder(State)
    .build()
    .expect("static registrations are valid");
let outcome = lspf::stdio(server).serve().await?;
std::process::exit(outcome.code());