tokio-fs-ext 0.4.1

Extend tokio fs to be compatible with native and wasm
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use tokio::sync::mpsc;

use super::{FsOffload, FsTask};

pub struct Server {
    pub(super) receiver: mpsc::Receiver<FsTask>,
}

impl Server {
    pub async fn serve(mut self, offload: impl FsOffload) {
        while let Some(task) = self.receiver.recv().await {
            task.execute(&offload).await;
        }
    }
}