Module ashpd::documents [−][src]
Expand description
Interact with the documents store or transfer files across apps.
Examples
use ashpd::documents::{DocumentsProxy, Permission}; async fn run() -> Result<(), ashpd::Error> { let connection = zbus::azync::Connection::new_session().await?; let proxy = DocumentsProxy::new(&connection).await?; println!("{:#?}", proxy.mount_point().await?); for (doc_id, host_path) in proxy.list("org.mozilla.firefox").await? { if doc_id == "f2ee988d" { let info = proxy.info(&doc_id).await?; println!("{:#?}", info); } } proxy .grant_permissions( "f2ee988d", "org.mozilla.firefox", &[Permission::GrantPermissions], ) .await?; proxy .revoke_permissions("f2ee988d", "org.mozilla.firefox", &[Permission::Write]) .await?; proxy.delete("f2ee988d").await?; Ok(()) }
Structs
DocumentsProxy | The interface lets sandboxed applications make files from the outside world available to sandboxed applications in a controlled way. |
FileTransferProxy | The interface operates as a middle-man between apps when transferring files via drag-and-drop or copy-paste, taking care of the necessary exporting of files in the document portal. |
Enums
Flags | |
Permission | The possible permissions to grant to a specific application for a specific document. |
Type Definitions
Permissions | A |