multiio 0.2.3

A unified I/O orchestration library for CLI/server applications
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::fmt::Debug;

use async_trait::async_trait;
use tokio::io::AsyncRead;

#[async_trait]
pub trait AsyncInputProvider: Send + Sync + Debug {
    /// Returns a unique identifier for this input source.
    fn id(&self) -> &str;

    /// Open and return a new async readable stream.
    async fn open(&self) -> std::io::Result<Box<dyn AsyncRead + Unpin + Send>>;
}