fn serve_and_install_svc_dirs(
        &mut self,
        ns: &mut fsys::ComponentNamespace,
        svc_dirs: HashMap<String, fvfs::directory::simple::Simple<'static>>,
    ) -> Result<(), ModelError> {
        for (target_dir_path, mut pseudo_dir) in svc_dirs {
            let (client_end, server_end) =
                create_endpoints::<NodeMarker>().expect("could not create node proxy endpoints");
            pseudo_dir.open(
                OPEN_RIGHT_READABLE,
                MODE_TYPE_DIRECTORY,
                &mut iter::empty(),
                server_end,
            );
            let (abort_handle, abort_registration) = AbortHandle::new_pair();
            self.dir_abort_handles.push(abort_handle);
            let future = Abortable::new(pseudo_dir, abort_registration);

            // The future for a pseudo directory will never terminate, so we must start up a new
            // task here to run the future instead of calling await on it directly. This is
            // wrapped in an async move {await!();}` block like to drop the unused return value.
            fasync::spawn(async move {
                let _ = await!(future);
            });

            ns.paths.push(target_dir_path.as_str().to_string());
            let client_end = ClientEnd::new(client_end.into_channel()); // coerce to ClientEnd<Dir>
            ns.directories.push(client_end);
        }
        Ok(())
    }
/// serve_and_install_svc_dirs will take all of the pseudo directories collected in
/// svc_dirs (as populated by add_service_use calls), start them as abortable futures, and
/// install them in the namespace. The abortable handles are saved in the IncomingNamespace, to
/// be called when the IncomingNamespace is dropped.
serve_and_install_svc_dirs will take all of the pseudo directories collected in
svc_dirs (as populated by add_service_use calls), start them as abortable futures, and
install them in the namespace. The abortable handles are saved in the IncomingNamespace, to
be called when the IncomingNamespace is dropped.
serve_and_install_svc_dirs will take all of the pseudo directories collected in svc_dirs ( as populated by add_service_use calls ) start them as abortable futures and install them in the namespace . The abortable handles are saved in the IncomingNamespace to be called when the IncomingNamespace is dropped .
fn serve_and_install_svc_dirs(
        &mut self,
        ns: &mut fsys::ComponentNamespace,
        svc_dirs: HashMap<String, fvfs::directory::simple::Simple<'static>>,
    ) -> Result<(), ModelError> {
        for (target_dir_path, mut pseudo_dir) in svc_dirs {
            let (client_end, server_end) =
                create_endpoints::<NodeMarker>().expect("could not create node proxy endpoints");
            pseudo_dir.open(
                OPEN_RIGHT_READABLE,
                MODE_TYPE_DIRECTORY,
                &mut iter::empty(),
                server_end,
            );
            let (abort_handle, abort_registration) = AbortHandle::new_pair();
            self.dir_abort_handles.push(abort_handle);
            let future = Abortable::new(pseudo_dir, abort_registration);
            // The future for a pseudo directory will never terminate, so we must start up a new
            // task here to run the future instead of calling await on it directly. This is
            // wrapped in an async move {await!();}` block like to drop the unused return value.
            fasync::spawn(async move {
                let _ = await!(future);
            });
            ns.paths.push(target_dir_path.as_str().to_string());
            let client_end = ClientEnd::new(client_end.into_channel()); // coerce to ClientEnd<Dir>
            ns.directories.push(client_end);
        }
        Ok(())
    }
fn serve_and_install_svc_dirs ( & mut self , ns : & mut fsys :: ComponentNamespace , svc_dirs : HashMap < String , fvfs :: directory :: simple :: Simple < ' static > > , ) -> Result < ( ) , ModelError > { for ( target_dir_path , mut pseudo_dir ) in svc_dirs { let ( client_end , server_end ) = create_endpoints :: < NodeMarker > ( ) . expect ( " " ) ; pseudo_dir . open ( OPEN_RIGHT_READABLE , MODE_TYPE_DIRECTORY , & mut iter :: empty ( ) , server_end , ) ; let ( abort_handle , abort_registration ) = AbortHandle :: new_pair ( ) ; self . dir_abort_handles . push ( abort_handle ) ; let future = Abortable :: new ( pseudo_dir , abort_registration ) ; // The future for a pseudo directory will never terminate, so we must start up a new // task here to run the future instead of calling await on it directly. This is // wrapped in an async move {await!();}` block like to drop the unused return value. fasync :: spawn ( async move { let _ = await ! ( future ) ; } ) ; ns . paths . push ( target_dir_path . as_str ( ) . to_string ( ) ) ; let client_end = ClientEnd :: new ( client_end . into_channel ( ) ) ; // coerce to ClientEnd<Dir> ns . directories . push ( client_end ) ; } Ok ( ( ) ) }
serve_and_install_svc_dirs will take all of the pseudo directories collected in
svc_dirs (as populated by add_service_use calls), start them as abortable futures, and
install them in the namespace.
serve_and_install_svc_dirs will take all of the pseudo directories collected in svc_dirs ( as populated by add_service_use calls ) start them as abortable futures and install them in the namespace .
&mut self
ns
&mut fsys::ComponentNamespace
svc_dirs
HashMap<String, fvfs::directory::simple::Simple<'static>>
&mut self
ns
&mut fsys::ComponentNamespace
svc_dirs
HashMap<String, fvfs::directory::simple::Simple<'static>>