Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return path to trashed item #38

Open
alexnedelcu opened this issue Aug 25, 2021 · 6 comments · May be fixed by #109
Open

Return path to trashed item #38

alexnedelcu opened this issue Aug 25, 2021 · 6 comments · May be fixed by #109
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@alexnedelcu
Copy link

It would be a great addition to this crate to know what the destination path of the trashed item. Can't think of a better way than returning it after calling delete().

@juanPabloMiceli
Copy link

juanPabloMiceli commented May 2, 2023

I also think this would be a great addition! Maybe also exporting home_trash() in order to be able to query it without having to delete something. I don't mind doing the change myself.

@juanPabloMiceli
Copy link

Should we also return the removed item path in delete()/delete_all()? I didn't make that change because I am afraid that could be a breaking change.

@Byron
Copy link
Owner

Byron commented May 3, 2023

Feel free to do what you have to, making a breaking release (with corresponding semver change) is not a problem. Let's be sure we return some type like TrashPath that can be resolved to a single path with AsRef and Into just to be able to also handle systems where maybe a single trash item is handled by multiple files.

@juanPabloMiceli
Copy link

Not sure if I fully understand you. Could you describe a situation in which a trash item is handled by multiple files?

@Byron
Copy link
Owner

Byron commented May 13, 2023

I don't know all possible implementations nor can I predict the future. In a situation like this, it's a good idea to have a custom type that can act like a std::path::Path while allowing future extension with methods that people might find useful. I hope that helps.

@jackpot51
Copy link
Contributor

jackpot51 commented Jul 11, 2024

I have implemented returning Vec<TrashItem> from the delete functions here: #109

@Byron Byron linked a pull request Jul 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants