Expand description
Every call into the trash crate runs on one dedicated thread.
The crate documents undefined behaviour when it is called from more than one thread at a time on Linux/FreeBSD, and on Windows it initializes COM per calling thread. A single long-lived worker satisfies both: calls are serialized, and COM is set up once (spec §7.3).
Spec: docs/specs/SPEC_FILE_BROWSER_PANE_2026_10_01.md §7.3, §9.1.5.
Statics§
- WORKER 🔒
- The worker’s queue.
Noneif the thread could not be started, in which case every trash call fails cleanly instead of panicking a handler.
Functions§
- context 🔒
- A
TrashContextthat, on macOS, usesNSFileManagerrather than the crate’s default of scripting Finder: the Finder route raises an Automation prompt (“AgentMux wants to control Finder”), and once refused, later deletes silently do nothing (spec §9.1.5). - describe 🔒
- A readable clause for a
trash::Error, whose ownDisplayis itsDebugdump. - path_
key 🔒 - A path’s identity for matching a trashed item’s original location: the display form, case-folded on Windows, whose filesystems are case-insensitive and whose Recycle Bin reports plain (non-verbatim) paths.
- restore_
paths - Put each of
targetsback from the Trash: for each, the most recently trashed item whose original location is that path. Must be called on the trash thread (viarun). One result per target, in order. - run
- Run
fon the trash thread and wait for its answer without blocking the async runtime. - trash_
path - Move
pathto the Trash. Must be called on the trash thread (viarun). The crate trashes a link itself, not its target. - worker 🔒
Type Aliases§
- Job 🔒