pub trait TaskSink<Args>: Backend {
// Required methods
fn push(
&mut self,
task: Args,
) -> impl Future<Output = Result<(), TaskSinkError<Self::Error>>> + Send;
fn push_bulk(
&mut self,
tasks: Vec<Args>,
) -> impl Future<Output = Result<(), TaskSinkError<Self::Error>>> + Send;
fn push_stream(
&mut self,
tasks: impl Stream<Item = Args> + Unpin + Send,
) -> impl Future<Output = Result<(), TaskSinkError<Self::Error>>> + Send;
fn push_task(
&mut self,
task: Task<Args, Self::Context, Self::IdType>,
) -> impl Future<Output = Result<(), TaskSinkError<Self::Error>>> + Send;
fn push_all(
&mut self,
tasks: impl Stream<Item = Task<Args, Self::Context, Self::IdType>> + Unpin + Send,
) -> impl Future<Output = Result<(), TaskSinkError<Self::Error>>> + Send;
}Expand description
Extends Backend to allow pushing tasks into the backend
Required Methods§
Sourcefn push(
&mut self,
task: Args,
) -> impl Future<Output = Result<(), TaskSinkError<Self::Error>>> + Send
fn push( &mut self, task: Args, ) -> impl Future<Output = Result<(), TaskSinkError<Self::Error>>> + Send
Allows pushing a single task into the backend
Sourcefn push_bulk(
&mut self,
tasks: Vec<Args>,
) -> impl Future<Output = Result<(), TaskSinkError<Self::Error>>> + Send
fn push_bulk( &mut self, tasks: Vec<Args>, ) -> impl Future<Output = Result<(), TaskSinkError<Self::Error>>> + Send
Allows pushing multiple tasks into the backend in bulk
Sourcefn push_stream(
&mut self,
tasks: impl Stream<Item = Args> + Unpin + Send,
) -> impl Future<Output = Result<(), TaskSinkError<Self::Error>>> + Send
fn push_stream( &mut self, tasks: impl Stream<Item = Args> + Unpin + Send, ) -> impl Future<Output = Result<(), TaskSinkError<Self::Error>>> + Send
Allows pushing tasks from a stream into the backend
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.