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§
Sourcetype FileReadFut: Future<Output = Result<FileReadResult, Self::SpawnError>> + Unpin
type FileReadFut: Future<Output = Result<FileReadResult, Self::SpawnError>> + Unpin
File read future spawned on IO runtime
Required Methods§
Sourcefn spawn_file_read<F: FnOnce() -> FileReadResult + Send + 'static>(
fut: F,
) -> Self::FileReadFut
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", so this trait is not object safe.
Implementors§
Source§impl FsTaskSpawner for DummyWorker
impl FsTaskSpawner for DummyWorker
type SpawnError = Infallible
type FileReadFut = Ready<Result<Result<Bytes, Error>, <DummyWorker as FsTaskSpawner>::SpawnError>>
Source§impl FsTaskSpawner for TokioWorker
Available on crate feature tokio only.
impl FsTaskSpawner for TokioWorker
Available on crate feature
tokio only.