OpenFile

Function OpenFile 

Source
pub fn OpenFile(
    Path: PathBuf,
) -> ActionEffect<Arc<dyn WorkSpaceProvider>, CommonError, ()>
Expand description

Creates an effect that, when executed, will request that the host application open the specified file path in an editor.

It uses the WorkSpaceProvider capability from the environment. The actual implementation will likely involve creating a new document model (if one doesn’t exist) and sending an event to the UI to reveal an editor for it.

§Parameters

  • Path: The PathBuf of the file to open.

§Returns

An ActionEffect that resolves to () on success.