Skip to main content

run

Function run 

Source
pub fn run<H, F, I>(name: &str, version: &str, args: I, factory: F) -> ExitCode
where H: ServerHandler, F: Fn() -> H + Send + Sync + 'static, I: IntoIterator, I::Item: Into<String>,
Expand description

Serve factory’s handler as name according to the command line.

This is the whole of main: parse, serve, and turn the outcome into an exit status. A usage error prints the usage text and exits with 2; a transport failure prints the reason and exits with 1.