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