Expand description
Move a file to the trash.
§Examples
use std::{fs::File, os::fd::AsFd};
use ashpd::desktop::trash;
async fn run() -> ashpd::Result<()> {
let file = File::open("/home/bilelmoussaoui/adwaita-night.jpg").unwrap();
trash::trash_file(&file.as_fd()).await?;
Ok(())
}
Or by using the Proxy directly
use std::{fs::File, os::fd::AsFd};
use ashpd::desktop::trash::TrashProxy;
async fn run() -> ashpd::Result<()> {
let file = File::open("/home/bilelmoussaoui/Downloads/adwaita-night.jpg").unwrap();
let proxy = TrashProxy::new().await?;
proxy.trash_file(&file.as_fd()).await?;
Ok(())
}
Structs§
- The interface lets sandboxed applications send files to the trashcan.
Functions§
- A handy wrapper around
TrashProxy::trash_file
.