Skip to main content

Fn

Function Fn 

Source
pub fn Fn<S>(
    ServerName: String,
    Address: SocketAddr,
    Router: Router,
    ShutdownSignal: S,
)
where S: Future<Output = ()> + Send + 'static,
Expand description

Spawn a detached tokio task that serves Router on Address until ShutdownSignal resolves.

ยงParameters

  • ServerName - label used in dev-log messages.
  • Address - resolved socket address (callers should run crate::Server::ValidateSocketAddress::Fn first).
  • Router - constructed tonic Router with services already added.
  • ShutdownSignal - any Future<Output = ()> + Send + 'static. When it resolves, the server gracefully stops accepting new connections and drains in-flight calls.