MCPcopy Index your code
hub / github.com/Byron/trash-rs

github.com/Byron/trash-rs @v5.2.6

Chat with this repo
repository ↗ · DeepWiki ↗ · release v5.2.6 ↗ · + Follow
166 symbols 436 edges 14 files 32 documented · 19%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Crates.io Docs.rs CI

About

The trash is a Rust library for moving files and folders to the operating system's Recycle Bin or Trash or Rubbish Bin or what have you :D

The library supports Windows, macOS, and all FreeDesktop Trash compliant environments (including GNOME, KDE, XFCE, and more). See more about the FreeDesktop Trash implementation in the freedesktop.rs file.

Usage

# In Cargo.toml
[dependencies]
trash = "3"
// In main.rs
use std::fs::File;
use trash;

fn main() {
    // Let's create and remove a single file
    File::create_new("remove-me").unwrap();
    trash::delete("remove-me").unwrap();
    assert!(File::open("remove-me").is_err());

    // Now let's remove multiple files at once
    let the_others = ["remove-me-too", "dont-forget-about-me-either"];
    for name in the_others.iter() {
        File::create_new(name).unwrap();
    }
    trash::delete_all(&the_others).unwrap();
    for name in the_others.iter() {
        assert!(File::open(name).is_err());
    }
}

Extension points exported contracts — how you extend this code

TrashContextExtMacos (Interface)
(no doc) [1 implementers]
src/macos/mod.rs

Core symbols most depended-on inside this repo

delete
called by 14
src/lib.rs
delete_all
called by 8
src/lib.rs
resolve
called by 7
src/freedesktop.rs
original_path
called by 6
src/lib.rs
c_buf_to_str
called by 6
src/freedesktop.rs
to_wide_path
called by 6
src/windows.rs
ensure_com_initialized
called by 6
src/windows.rs
purge_all
called by 5
src/lib.rs

Shape

Function 107
Method 36
Class 12
Enum 10
Interface 1

Languages

Rust100%

Modules by API surface

src/freedesktop.rs49 symbols
tests/freedesktop_tests.rs29 symbols
src/lib.rs26 symbols
src/windows.rs17 symbols
src/macos/mod.rs12 symbols
tests/trash.rs11 symbols
src/tests.rs11 symbols
src/macos/tests.rs5 symbols
tests/isolated.rs1 symbols
examples/trash.rs1 symbols
examples/metadata.rs1 symbols
examples/list.rs1 symbols

For agents

$ claude mcp add trash-rs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page