yazi/yazi-fs/src/trash/unsupported/trash.rs
三咲雅 misaki masa 2c3f174eb5
Some checks failed
Cachix / Publish Flake (push) Has been cancelled
Check / clippy (push) Has been cancelled
Check / rustfmt (push) Has been cancelled
Check / stylua (push) Has been cancelled
Draft / build-unix (gcc-aarch64-linux-gnu, ubuntu-latest, aarch64-unknown-linux-gnu) (push) Has been cancelled
Draft / build-unix (gcc-i686-linux-gnu, ubuntu-latest, i686-unknown-linux-gnu) (push) Has been cancelled
Draft / build-unix (gcc-riscv64-linux-gnu, ubuntu-latest, riscv64gc-unknown-linux-gnu) (push) Has been cancelled
Draft / build-unix (gcc-sparc64-linux-gnu, ubuntu-latest, sparc64-unknown-linux-gnu) (push) Has been cancelled
Draft / build-unix (macos-latest, aarch64-apple-darwin) (push) Has been cancelled
Draft / build-unix (macos-latest, x86_64-apple-darwin) (push) Has been cancelled
Draft / build-unix (ubuntu-latest, x86_64-unknown-linux-gnu) (push) Has been cancelled
Draft / build-windows (windows-latest, aarch64-pc-windows-msvc) (push) Has been cancelled
Draft / build-windows (windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
Draft / build-musl (aarch64-unknown-linux-musl) (push) Has been cancelled
Draft / build-musl (x86_64-unknown-linux-musl) (push) Has been cancelled
Draft / build-snap (amd64, ubuntu-latest) (push) Has been cancelled
Draft / build-snap (arm64, ubuntu-24.04-arm) (push) Has been cancelled
Test / test (macos-latest) (push) Has been cancelled
Test / test (ubuntu-latest) (push) Has been cancelled
Test / test (windows-latest) (push) Has been cancelled
Draft / snap (push) Has been cancelled
Draft / draft (push) Has been cancelled
Draft / nightly (push) Has been cancelled
feat: allow restoring trashed items recursively (#4159)
2026-07-25 11:39:19 +08:00

50 lines
1.7 KiB
Rust

use std::{io, path::Path};
use super::super::{TrashEntries, TrashEntry, TrashId};
use crate::{cha::Cha, file::File};
pub struct Trash;
impl Trash {
pub fn new() -> io::Result<Self> { Ok(Self) }
pub fn list(&self, _entry: Option<&TrashEntry>) -> io::Result<Vec<TrashEntry>> {
Err(io::Error::new(io::ErrorKind::Unsupported, "trash is not supported on this platform"))
}
pub fn entry(&self, _id: &TrashId) -> io::Result<TrashEntry> {
Err(io::Error::new(io::ErrorKind::Unsupported, "trash is not supported on this platform"))
}
pub fn metadata(&self, _entry: &TrashEntry, _: bool) -> io::Result<Cha> {
Err(io::Error::new(io::ErrorKind::Unsupported, "trash is not supported on this platform"))
}
pub(crate) fn revalidate(
&self,
_entry: Option<&TrashEntry>,
_current: &File,
) -> io::Result<Option<File>> {
Err(io::Error::new(io::ErrorKind::Unsupported, "trash is not supported on this platform"))
}
pub fn remove_file(&self, _entry: &TrashEntry) -> io::Result<()> {
Err(io::Error::new(io::ErrorKind::Unsupported, "trash is not supported on this platform"))
}
pub fn remove_dir(&self, _entry: &TrashEntry) -> io::Result<()> {
Err(io::Error::new(io::ErrorKind::Unsupported, "trash is not supported on this platform"))
}
pub fn restore(&self, _entries: TrashEntries) -> io::Result<()> {
Err(io::Error::new(io::ErrorKind::Unsupported, "trash is not supported on this platform"))
}
pub fn rename(&self, _entry: &TrashEntry, _path: &Path) -> io::Result<()> {
Err(io::Error::new(io::ErrorKind::Unsupported, "trash is not supported on this platform"))
}
pub fn empty(&self) -> io::Result<()> {
Err(io::Error::new(io::ErrorKind::Unsupported, "trash is not supported on this platform"))
}
}