fidl_server

Function serve_async_detached

Source
pub fn serve_async_detached<S, H>(stream: S, handler: H)
where S: RequestStream + 'static, S::Ok: Send, H: AsyncRequestHandler<S::Protocol> + 'static,
Expand description

Runs the server in the background and logs the error if one occurs.

This implements the most common case where FIDL service authors serve a RequestStream on some remote task using Task::spawn(...).detach().

When using this function, prefer prefixing your program’s log messages by annotating main() with one of the following:

#[fuchsia::main(logging = true)]
#[fuchsia::main(logging_prefix = "my_prefix")]