Async filesystem facade for Rust!

Overview

floppy-disk

floppy disk is a WIP, async-only filesystem facade for Rust.

What?

Have you ever worked with std::fs? tokio::fs? Then you've probably realised that testing filesystem code is difficult and sometimes scary. Is that fs::remove_dir_all really safe to run?

The point of floppy disk is to fix this. Rather than always using the real filesystem, floppy disk lets you choose a backend for your filesystem access, via the FloppyDisk trait. Current implementations include in-memory and real filesystem via Tokio. This way, you can use the real filesystem when you need, but have your tests hit a fake in-memory filesystem instead.

Features

  • Pluggable filesystem backends
    • In-memory
    • Tokio
  • Write-your-own with the FloppyDisk trait
  • Fully-async
    • Light evil involved

Caveats

  • floppy disk is a 0.x.y project! You probably don't want to use it in production.
  • async-only! There is some small bridging to sync code, like MemFile implementing Read/Write/Seek, but this is mostly a hack to make working with sync-only external libraries (ex. ar) easier.
  • in-memory fs may not be performant-enough

Example usage

floppy disk attempts to recreate the std::fs API 1:1, with the caveat of being async-only.

let fs = ...; // MemFloppyDisk::new() | TokioFloppyDisk::new()
fs.create_dir_all("/foo/bar").await?;
fs.write("/foo/bar/baz.txt", b"hello world").await?;
let contents = fs.read_to_string("/foo/bar/baz.txt").await?;
assert_eq!(contents, "hello world");
You might also like...
A simple Rust library for OpenAI API, free from complex async operations and redundant dependencies.

OpenAI API for Rust A community-maintained library provides a simple and convenient way to interact with the OpenAI API. No complex async and redundan

⚡️ Blazing fast terminal file manager written in Rust, based on async I/O.

Yazi - ⚡️ Blazing Fast Terminal File Manager Yazi ("duck" in Chinese) is a terminal file manager written in Rust, based on non-blocking async I/O. It

Use any async Rust library from PHP!

php-tokio - Use any async Rust library from PHP! Created by Daniil Gentili (@danog). This library allows you to use any async rust library from PHP, a

A lightweight async Web crawler in Rust, optimized for concurrent scraping while respecting `robots.txt` rules.

🕷️ crawly A lightweight and efficient web crawler in Rust, optimized for concurrent scraping while respecting robots.txt rules. 🚀 Features Concurren

Rust Server Components. JSX-like syntax and async out of the box.

RSCx - Rust Server Components RSCx is a server-side HTML rendering engine library with a neat developer experience and great performance. Features: al

A minimal readline with multiline and async support
A minimal readline with multiline and async support

RustyLine Async A minimal readline with multiline and async support. Inspired by rustyline , async-readline & termion-async-input.

An async autocompletion framework for Neovim
An async autocompletion framework for Neovim

⚡ nvim-compleet This plugin is still in early development. 📖 Table of Contents Installation Features Configuration Sources Commands Mappings Colors R

Russh - Async (tokio) SSH2 client and server rimplementation

Russh Async (tokio) SSH2 client and server rimplementation. This is a fork of Thrussh by Pierre-Étienne Meunier which adds: More safety guarantees AES

Fully-typed, async, reusable state management and synchronization for Dioxus 🧬

dioxus-query 🦀 ⚡ Fully-typed, async, reusable state management and synchronization for Dioxus 🧬. Inspired by TanStack Query. ⚠️ Work in progress ⚠️

Owner
amy null
sometimes my code works. usually not. pronouns in preferred order. platform team lead @massdriver-cloud.
amy null
fd is a program to find entries in your filesystem. It is a simple, fast and user-friendly alternative to find

fd is a program to find entries in your filesystem. It is a simple, fast and user-friendly alternative to find. While it does not aim to support all of find's powerful functionality, it provides sensible (opinionated) defaults for a majority of use cases.

David Peter 25.9k Jan 9, 2023
This utility traverses through your filesystem looking for open-source dependencies that are seeking donations by parsing README.md and FUNDING.yml files

This utility traverses through your filesystem looking for open-source dependencies that are seeking donations by parsing README.md and FUNDING.yml files

Mufeed VH 38 Dec 30, 2022
A slightly smart clipboard tool - leverage the filesystem to persist across machines after shutdown.

clipd A slightly smart clipboard using the filesystem under ~/.clipd to persist after shutdown. cowsay "clipd is great" | clipd copy clipd paste ____

null 5 Aug 9, 2022
Quickly find all blackhole directories with a huge amount of filesystem entries in a flat structure

findlargedir About Findlargedir is a tool specifically written to help quickly identify "black hole" directories on an any filesystem having more than

Dinko Korunic 24 Jan 1, 2023
Provides filesystem access for the Rhai scripting language.

About rhai-fs This crate provides filesystem access for the Rhai scripting language. Usage Cargo.toml [dependencies] rhai-fs = "0.1.2" Rhai script //

Rhai - Embedded scripting language and engine for Rust 6 Dec 5, 2022
Nimbus - A virtual, networked filesystem with strong upfront safety guarantees

The Nimbus Filesystem Nimbus is a virtual, networked filesystem that provides upfront safety guarantees to a user, intended for personal use. In parti

Max Fan 3 Jan 10, 2023
A small in-memory filesystem using FUSE.

slabfs A small in-memory filesystem using FUSE. Running Simply run: RUST_LOG="slabfs=trace" cargo r -r -- <mountpoint> To suppress most log messages:

Carlos López 2 Jul 7, 2023
A filesystem driver that allows you to view your Blackboard course contents as if they were normal files and folders on your system!

BlackboardFS Blackboard: noun A website so bad that it might as well be a network drive. BlackboardFS is a filesystem driver that allows you to view y

null 22 Sep 4, 2023
FUSE filesystem that provides FizzBuzz.txt(8 Exabyte)

FizzBuzzFS root@8a2db3fc6292:/# cd /mnt/FizzBuzz/ root@8a2db3fc6292:/mnt/FizzBuzz# ls -l total 9007199254740992 -rw-r--r-- 1 501 dialout 9223372036854

todesking 8 Oct 1, 2023
⚡ Blazing fast async/await HTTP client for Python written on Rust using reqwests

Reqsnaked Reqsnaked is a blazing fast async/await HTTP client for Python written on Rust using reqwests. Works 15% faster than aiohttp on average RAII

Yan Kurbatov 8 Mar 2, 2023