/// Spawns a local handler for the given `fidl_fuchsia_io::Directory` request stream.
/// The provided `request_handler` is notified when an incoming request is received.
///
/// # Parameters
/// - `directory_server`: A server request stream from a Directory proxy server endpoint.
/// - `request_handler`: A function that is called with incoming requests to the spawned
///                      `Directory` server.
Spawns a local handler for the given `fidl_fuchsia_io::Directory` request stream.
The provided `request_handler` is notified when an incoming request is received.
Spawns a local handler for the given ` fidl_fuchsia_io :: Directory ` request stream . The provided ` request_handler ` is notified when an incoming request is received .
fn spawn_directory_server<F: 'static>(
        mut directory_server: fio::DirectoryRequestStream,
        request_handler: F,
    ) where
        F: Fn(fio::DirectoryRequest) + Send,
    {
        fasync::Task::spawn(async move {
            while let Some(directory_request) = directory_server.try_next().await.unwrap() {
                request_handler(directory_request);
            }
        })
        .detach();
    }
fn spawn_directory_server < F : ' static > ( mut directory_server : fio :: DirectoryRequestStream , request_handler : F , ) where F : Fn ( fio :: DirectoryRequest ) + Send , { fasync :: Task :: spawn ( async move { while let Some ( directory_request ) = directory_server . try_next ( ) . await . unwrap ( ) { request_handler ( directory_request ) ; } } ) . detach ( ) ; }
Spawns a local handler for the given `fidl_fuchsia_io::Directory` request stream.
Spawns a local handler for the given ` fidl_fuchsia_io :: Directory ` request stream .
directory_server
fio::DirectoryRequestStream
A server request stream from a Directory proxy server endpoint.
A server request stream from a Directory proxy server endpoint .
request_handler
F
A function that is called with incoming requests to the spawned
`Directory` server.
A function that is called with incoming requests to the spawned ` Directory ` server .