pub trait FsTaskSpawner: Send + Clone + Unpin {
    type SpawnError: Error + Debug + Display + Send + Sync + 'static;
    type FileReadFut: Future<Output = Result<FileReadResult, Self::SpawnError>> + Unpin;

    // Required method
    fn spawn_file_read<F: FnOnce() -> FileReadResult + Send + 'static>(
        fut: F
    ) -> Self::FileReadFut;
}
Expand description

Describes task spawner for FS related tasks

Required Associated Types§

source

type SpawnError: Error + Debug + Display + Send + Sync + 'static

Error processing spawned task

source

type FileReadFut: Future<Output = Result<FileReadResult, Self::SpawnError>> + Unpin

File read future spawned on IO runtime

Required Methods§

source

fn spawn_file_read<F: FnOnce() -> FileReadResult + Send + 'static>( fut: F ) -> Self::FileReadFut

Spawns file reading task task onto runtime.

Object Safety§

This trait is not object safe.

Implementors§