/// Spawns a server with options for handling `fuchsia.inspect.Tree` requests in
/// the outgoing diagnostics directory.
Spawns a server with options for handling `fuchsia.inspect.Tree` requests in
the outgoing diagnostics directory.
Spawns a server with options for handling ` fuchsia . inspect . Tree ` requests in the outgoing diagnostics directory .
pub fn serve_with_options<'a, ServiceObjTy: ServiceObjTrait>(
    inspector: &Inspector,
    options: service::TreeServerSettings,
    service_fs: &mut ServiceFs<ServiceObjTy>,
) -> Result<(), Error> {
    let (proxy, server) =
        fidl::endpoints::create_proxy::<DirectoryMarker>().map_err(|e| Error::fidl(e.into()))?;
    let inspector_for_fs = inspector.clone();
    let dir = pseudo_directory! {
        TreeMarker::PROTOCOL_NAME => pseudo_fs_service::host(move |stream| {
            let inspector = inspector_for_fs.clone();
            let options = options.clone();
            async move {
                service::handle_request_stream(
                    inspector, options, stream
                    )
                    .await
                    .unwrap_or_else(|e| error!("failed to run server: {:?}", e));
            }
            .boxed()
        }),
    };
    let server_end = server.into_channel().into();
    let scope = ExecutionScope::new();
    dir.open(scope, OPEN_RIGHT_READABLE | OPEN_RIGHT_WRITABLE, 0, Path::dot(), server_end);
    service_fs.add_remote(DIAGNOSTICS_DIR, proxy);
    Ok(())
}
pub fn serve_with_options < ' a , ServiceObjTy : ServiceObjTrait > ( inspector : & Inspector , options : service :: TreeServerSettings , service_fs : & mut ServiceFs < ServiceObjTy > , ) -> Result < ( ) , Error > { let ( proxy , server ) = fidl :: endpoints :: create_proxy :: < DirectoryMarker > ( ) . map_err ( | e | Error :: fidl ( e . into ( ) ) ) ? ; let inspector_for_fs = inspector . clone ( ) ; let dir = pseudo_directory ! { TreeMarker PROTOCOL_NAME pseudo_fs_service host ( move stream { let inspector inspector_for_fs clone ( ) let options options clone ( ) async move { service handle_request_stream ( inspector options stream ) await unwrap_or_else ( e error ( " " e ) ) } boxed ( ) } ) } ; let server_end = server . into_channel ( ) . into ( ) ; let scope = ExecutionScope :: new ( ) ; dir . open ( scope , OPEN_RIGHT_READABLE | OPEN_RIGHT_WRITABLE , 0 , Path :: dot ( ) , server_end ) ; service_fs . add_remote ( DIAGNOSTICS_DIR , proxy ) ; Ok ( ( ) ) }
Spawns a server with options for handling `fuchsia.inspect.Tree` requests in
the outgoing diagnostics directory.
Spawns a server with options for handling ` fuchsia . inspect . Tree ` requests in the outgoing diagnostics directory .
inspector
&Inspector
options
service::TreeServerSettings
service_fs
&mut ServiceFs<ServiceObjTy>