async fn dispatch_capability_ready(
        &self,
        dir_proxy: &DirectoryProxy,
        mode: u32,
        rights: Rights,
        target_path: CapabilityPath,
        target_moniker: AbsoluteMoniker,
    ) -> Result<(), ModelError> {
        let realm = match self.model.upgrade() {
            Some(model) => model.look_up_realm(&target_moniker).await?,
            None => return Err(ModelError::ModelNotAvailable),
        };

        // DirProxy.open fails on absolute paths.
        let path = target_path.to_string();
        let canonicalized_path = io_util::canonicalize_path(&path);
        let (node, server_end) = fidl::endpoints::create_proxy::<NodeMarker>().unwrap();

        dir_proxy
            .open(
                rights.into_legacy(),
                mode,
                &canonicalized_path,
                ServerEnd::new(server_end.into_channel()),
            )
            .map_err(|_| {
                ModelError::open_directory_error(target_moniker.clone(), canonicalized_path)
            })?;

        let event = Event::new(target_moniker, EventPayload::CapabilityReady { path, node });
        realm.hooks.dispatch(&event).await?;

        Ok(())
    }
/// Dispatches an event with the directory at the given `path` inside the `directory`
Dispatches an event with the directory at the given `path` inside the `directory`
Dispatches an event with the directory at the given ` path ` inside the ` directory `
async fn dispatch_capability_ready(
        &self,
        dir_proxy: &DirectoryProxy,
        mode: u32,
        rights: Rights,
        target_path: CapabilityPath,
        target_moniker: AbsoluteMoniker,
    ) -> Result<(), ModelError> {
        let realm = match self.model.upgrade() {
            Some(model) => model.look_up_realm(&target_moniker).await?,
            None => return Err(ModelError::ModelNotAvailable),
        };
        // DirProxy.open fails on absolute paths.
        let path = target_path.to_string();
        let canonicalized_path = io_util::canonicalize_path(&path);
        let (node, server_end) = fidl::endpoints::create_proxy::<NodeMarker>().unwrap();
        dir_proxy
            .open(
                rights.into_legacy(),
                mode,
                &canonicalized_path,
                ServerEnd::new(server_end.into_channel()),
            )
            .map_err(|_| {
                ModelError::open_directory_error(target_moniker.clone(), canonicalized_path)
            })?;
        let event = Event::new(target_moniker, EventPayload::CapabilityReady { path, node });
        realm.hooks.dispatch(&event).await?;
        Ok(())
    }
async fn dispatch_capability_ready ( & self , dir_proxy : & DirectoryProxy , mode : u32 , rights : Rights , target_path : CapabilityPath , target_moniker : AbsoluteMoniker , ) -> Result < ( ) , ModelError > { let realm = match self . model . upgrade ( ) { Some ( model ) => model . look_up_realm ( & target_moniker ) . await ? , None => return Err ( ModelError :: ModelNotAvailable ) , } ; // DirProxy.open fails on absolute paths. let path = target_path . to_string ( ) ; let canonicalized_path = io_util :: canonicalize_path ( & path ) ; let ( node , server_end ) = fidl :: endpoints :: create_proxy :: < NodeMarker > ( ) . unwrap ( ) ; dir_proxy . open ( rights . into_legacy ( ) , mode , & canonicalized_path , ServerEnd :: new ( server_end . into_channel ( ) ) , ) . map_err ( | _ | { ModelError :: open_directory_error ( target_moniker . clone ( ) , canonicalized_path ) } ) ? ; let event = Event :: new ( target_moniker , EventPayload :: CapabilityReady { path , node } ) ; realm . hooks . dispatch ( & event ) . await ? ; Ok ( ( ) ) }
Dispatches an event with the directory at the given `path` inside the `directory`
Dispatches an event with the directory at the given ` path ` inside the ` directory `
&self
dir_proxy
&DirectoryProxy
mode
u32
rights
Rights
target_path
CapabilityPath
target_moniker
AbsoluteMoniker
&self
dir_proxy
&DirectoryProxy
mode
u32
rights
Rights
target_path
CapabilityPath
target_moniker
AbsoluteMoniker