https://github.com/rogpeppe/fstream
Experiment in async directory tree streaming using Rust
https://github.com/rogpeppe/fstream
Last synced: 2 months ago
JSON representation
Experiment in async directory tree streaming using Rust
- Host: GitHub
- URL: https://github.com/rogpeppe/fstream
- Owner: rogpeppe
- Created: 2021-05-04T10:22:23.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-16T14:28:14.000Z (almost 4 years ago)
- Last Synced: 2025-03-01T11:34:49.879Z (3 months ago)
- Language: Rust
- Size: 43.9 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This repository holds a little proof-of-concept experiment, taking some ideas from an old [Inferno command](http://www.vitanuova.com/inferno/man/1/fs.html) and seeing how they might turn out when implemented in Rust.
The basic idea is to use a channel to transfer a stream of directory and file data and implement transformation primitives in terms of that, somewhat reminiscent of a Unix pipeline.
Unlike a Unix pipe, the channel protocol allows for feedback, so a task at the end of the pipeline can affect the code that's walking the directory, causing it to skip reading a file, for example.
To make things interesting, instead of using the channel directly, the primitives use an API that uses Rust ownership to make it impossible to use the protocol incorrectly. I can't quite decide if it works out quite nicely or it's harder to understand and more complex than necessary. :)