Skip to main content

FsTaskSpawner

Trait FsTaskSpawner 

Source
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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§