pub struct WithCodec<B, NewCodec> { /* private fields */ }Expand description
A Backend wrapper that swaps out the serialization codec entirely (JSON,
MessagePack, Protobuf, …) without touching storage logic.
§Features
| Feature | Status | Description |
|---|---|---|
Backend | ✅ | Basic Backend functionality |
TaskSink | ✅ | Ability to push new tasks |
InheritsFeatures | ✅ ❗ | Inherits features from the underlying backend |
Key: ✅ : Supported | ⚠️ : Not implemented | ❌ : Not Supported | ❗ Limited support
Tests:
Implementations§
Trait Implementations§
Source§impl<B, NewCodec> Backend for WithCodec<B, NewCodec>where
B: Backend,
impl<B, NewCodec> Backend for WithCodec<B, NewCodec>where
B: Backend,
Source§fn poll_ready(
&mut self,
cx: &mut Context<'_>,
worker: &WorkerContext,
) -> Poll<Result<(), Self::Error>>
fn poll_ready( &mut self, cx: &mut Context<'_>, worker: &WorkerContext, ) -> Poll<Result<(), Self::Error>>
Polls whether the backend is ready for the worker to request more work. Read more
Source§fn poll_next(
&mut self,
cx: &mut Context<'_>,
worker: &WorkerContext,
) -> Poll<Option<Result<Self::Task, Self::Error>>>
fn poll_next( &mut self, cx: &mut Context<'_>, worker: &WorkerContext, ) -> Poll<Option<Result<Self::Task, Self::Error>>>
Polls the backend for the next available task for this worker. Read more
Source§fn poll_close(
&mut self,
cx: &mut Context<'_>,
worker: &WorkerContext,
) -> Poll<Result<(), Self::Error>>
fn poll_close( &mut self, cx: &mut Context<'_>, worker: &WorkerContext, ) -> Poll<Result<(), Self::Error>>
Flushes/releases any resources the backend holds (pending acks,
open subscriptions, connections) before the worker fully shuts down.
Source§impl<B, NewCodec> BackendConfig for WithCodec<B, NewCodec>where
B: BackendConfig,
impl<B, NewCodec> BackendConfig for WithCodec<B, NewCodec>where
B: BackendConfig,
Source§type Args = <B as BackendConfig>::Args
type Args = <B as BackendConfig>::Args
The type of argument this backend emits
Source§type Kind = <B as BackendConfig>::Kind
type Kind = <B as BackendConfig>::Kind
This defines the kind of Backend
Source§type Config = <B as BackendConfig>::Config
type Config = <B as BackendConfig>::Config
The config for the backend
Source§type Layer = <B as BackendConfig>::Layer
type Layer = <B as BackendConfig>::Layer
The type representing backend middleware layer.
Source§fn middleware(&mut self, worker: &mut WorkerContext) -> Self::Layer
fn middleware(&mut self, worker: &mut WorkerContext) -> Self::Layer
Returns the backend’s middleware layer.
Source§impl<B, C> ListAllTasks for WithCodec<B, C>where
B: ListAllTasks + Send + Sync + Backend + BackendConfig + WireFormatBackend,
C: Send + Sync + 'static + Codec<B::Args, Compact = B::Compact>,
impl<B, C> ListAllTasks for WithCodec<B, C>where
B: ListAllTasks + Send + Sync + Backend + BackendConfig + WireFormatBackend,
C: Send + Sync + 'static + Codec<B::Args, Compact = B::Compact>,
Source§impl<B, C> ListQueues for WithCodec<B, C>where
B: ListQueues + Send + Sync + Backend + BackendConfig + WireFormatBackend,
C: Send + Sync + 'static + Codec<B::Args, Compact = B::Compact>,
impl<B, C> ListQueues for WithCodec<B, C>where
B: ListQueues + Send + Sync + Backend + BackendConfig + WireFormatBackend,
C: Send + Sync + 'static + Codec<B::Args, Compact = B::Compact>,
Source§impl<B, C> ListWorkers for WithCodec<B, C>where
B: ListWorkers + Send + Sync + Backend + BackendConfig + WireFormatBackend,
C: Send + Sync + 'static + Codec<B::Args, Compact = B::Compact>,
impl<B, C> ListWorkers for WithCodec<B, C>where
B: ListWorkers + Send + Sync + Backend + BackendConfig + WireFormatBackend,
C: Send + Sync + 'static + Codec<B::Args, Compact = B::Compact>,
Source§async fn list_workers(&self) -> Result<Vec<RunningWorker>, Self::Error>
async fn list_workers(&self) -> Result<Vec<RunningWorker>, Self::Error>
List all registered workers in the current queue
Source§async fn list_all_workers(&self) -> Result<Vec<RunningWorker>, Self::Error>
async fn list_all_workers(&self) -> Result<Vec<RunningWorker>, Self::Error>
List all registered workers in all queues
Source§impl<B, C> RegisterWorker for WithCodec<B, C>where
B: RegisterWorker + Send + Sync + Backend + BackendConfig + WireFormatBackend,
C: Send + Sync + 'static + Codec<B::Args, Compact = B::Compact>,
impl<B, C> RegisterWorker for WithCodec<B, C>where
B: RegisterWorker + Send + Sync + Backend + BackendConfig + WireFormatBackend,
C: Send + Sync + 'static + Codec<B::Args, Compact = B::Compact>,
Source§impl<B, C> Reschedule for WithCodec<B, C>where
B: Reschedule + Send + Sync + Backend + BackendConfig + WireFormatBackend,
B::Task: Send,
C: Send + Sync + 'static + Codec<B::Args, Compact = B::Compact>,
impl<B, C> Reschedule for WithCodec<B, C>where
B: Reschedule + Send + Sync + Backend + BackendConfig + WireFormatBackend,
B::Task: Send,
C: Send + Sync + 'static + Codec<B::Args, Compact = B::Compact>,
Source§impl<B, C> ResumeAbandoned for WithCodec<B, C>where
B: ResumeAbandoned + Send + Sync + Backend + BackendConfig + WireFormatBackend,
C: Send + Sync + 'static + Codec<B::Args, Compact = B::Compact>,
impl<B, C> ResumeAbandoned for WithCodec<B, C>where
B: ResumeAbandoned + Send + Sync + Backend + BackendConfig + WireFormatBackend,
C: Send + Sync + 'static + Codec<B::Args, Compact = B::Compact>,
Source§impl<B, C> ResumeById for WithCodec<B, C>where
B: ResumeById + Send + Sync + Backend + BackendConfig + WireFormatBackend,
C: Send + Sync + 'static + Codec<B::Args, Compact = B::Compact>,
impl<B, C> ResumeById for WithCodec<B, C>where
B: ResumeById + Send + Sync + Backend + BackendConfig + WireFormatBackend,
C: Send + Sync + 'static + Codec<B::Args, Compact = B::Compact>,
Source§impl<B, NewCodec, T, Err> Sink<T> for WithCodec<B, NewCodec>
impl<B, NewCodec, T, Err> Sink<T> for WithCodec<B, NewCodec>
Source§fn start_send(self: Pin<&mut Self>, item: T) -> Result<(), Self::Error>
fn start_send(self: Pin<&mut Self>, item: T) -> Result<(), Self::Error>
Begin the process of sending a value to the sink.
Each call to this function must be preceded by a successful call to
poll_ready which returned Poll::Ready(Ok(())). Read moreSource§fn poll_ready(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>
fn poll_ready( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Result<(), Self::Error>>
Attempts to prepare the
Sink to receive a value. Read moreSource§impl<B, C> Vacuum for WithCodec<B, C>
impl<B, C> Vacuum for WithCodec<B, C>
Source§impl<Output, B, C> WaitForCompletion<Output> for WithCodec<B, C>where
B: WaitForCompletion<Output> + Sync + Send + Backend + BackendConfig + WireFormatBackend,
Output: 'static,
C: Send + Sync + 'static + Codec<B::Args, Compact = B::Compact>,
impl<Output, B, C> WaitForCompletion<Output> for WithCodec<B, C>where
B: WaitForCompletion<Output> + Sync + Send + Backend + BackendConfig + WireFormatBackend,
Output: 'static,
C: Send + Sync + 'static + Codec<B::Args, Compact = B::Compact>,
Source§type ResultStream = Pin<Box<dyn Stream<Item = Result<TaskResult<Output>, <WithCodec<B, C> as Backend>::Error>> + Send>>
type ResultStream = Pin<Box<dyn Stream<Item = Result<TaskResult<Output>, <WithCodec<B, C> as Backend>::Error>> + Send>>
The result stream type yielding task results
Source§fn wait_for(
&mut self,
task_ids: impl IntoIterator<Item = TaskId>,
) -> Self::ResultStream
fn wait_for( &mut self, task_ids: impl IntoIterator<Item = TaskId>, ) -> Self::ResultStream
Wait for multiple tasks to complete, yielding results as they become available
Source§async fn check_status(
&mut self,
task_ids: impl IntoIterator<Item = TaskId> + Send,
) -> Result<Vec<TaskResult<Output>>, Self::Error>
async fn check_status( &mut self, task_ids: impl IntoIterator<Item = TaskId> + Send, ) -> Result<Vec<TaskResult<Output>>, Self::Error>
Check current status of tasks without waiting
Source§fn wait_for_single(&mut self, task_id: TaskId) -> Self::ResultStream
fn wait_for_single(&mut self, task_id: TaskId) -> Self::ResultStream
Wait for a single task to complete, yielding its result
Source§impl<B, NewCodec, Args> WireFormatBackend for WithCodec<B, NewCodec>
impl<B, NewCodec, Args> WireFormatBackend for WithCodec<B, NewCodec>
Auto Trait Implementations§
impl<B, NewCodec> Freeze for WithCodec<B, NewCodec>
impl<B, NewCodec> RefUnwindSafe for WithCodec<B, NewCodec>where
B: RefUnwindSafe,
NewCodec: RefUnwindSafe,
impl<B, NewCodec> Send for WithCodec<B, NewCodec>
impl<B, NewCodec> Sync for WithCodec<B, NewCodec>
impl<B, NewCodec> Unpin for WithCodec<B, NewCodec>
impl<B, NewCodec> UnsafeUnpin for WithCodec<B, NewCodec>where
B: UnsafeUnpin,
NewCodec: UnsafeUnpin,
impl<B, NewCodec> UnwindSafe for WithCodec<B, NewCodec>where
B: UnwindSafe,
NewCodec: UnwindSafe,
Blanket Implementations§
Source§impl<B> BackendExt for Bwhere
B: Backend,
impl<B> BackendExt for Bwhere
B: Backend,
Source§fn poll_next_args(
&mut self,
cx: &mut Context<'_>,
worker: &WorkerContext,
) -> Poll<Option<Result<Task<Self::Args>, PollNextArgsError<Self>>>>
fn poll_next_args( &mut self, cx: &mut Context<'_>, worker: &WorkerContext, ) -> Poll<Option<Result<Task<Self::Args>, PollNextArgsError<Self>>>>
A convenience method for calling
poll_next and decoding the Args in one step,
returning a Task<Self::Args, ..> instead of Task<Self::Compact, ..>.Source§fn pipe_to<Dst>(self, backend: Dst) -> Pipe<Dst, Self>where
Self: Sized,
fn pipe_to<Dst>(self, backend: Dst) -> Pipe<Dst, Self>where
Self: Sized,
Pipes every task polled from this backend into
sink Read moreSource§fn inspect_err<F>(self, f: F) -> InspectErr<Self, F>
fn inspect_err<F>(self, f: F) -> InspectErr<Self, F>
Attaches a callback
F to be run on each error produced while polling the backend.Source§fn map_err<F, E2>(self, f: F) -> MapErr<Self, F>
fn map_err<F, E2>(self, f: F) -> MapErr<Self, F>
Maps errors produced by the backend from
Self::Error into E2, useful for
heterogeneous composed backends.Source§fn with_codec<NewCodec>(self, codec: NewCodec) -> WithCodec<Self, NewCodec>
fn with_codec<NewCodec>(self, codec: NewCodec) -> WithCodec<Self, NewCodec>
Swaps out the backend’s serialization codec entirely (JSON,
MessagePack, Protobuf, …) without touching storage logic.
Source§fn poll_with_stream<S>(self, stream: S) -> PollWith<Self, StreamStrategy<S>>
fn poll_with_stream<S>(self, stream: S) -> PollWith<Self, StreamStrategy<S>>
Wake the worker when a stream receives a new item
Source§fn poll_with_interval(
self,
duration: Duration,
) -> PollWith<Self, IntervalStrategy>where
Self: Sized,
fn poll_with_interval(
self,
duration: Duration,
) -> PollWith<Self, IntervalStrategy>where
Self: Sized,
Available on crate feature
sleep only.Wake the worker periodically
Source§fn poll_with_backoff(
self,
interval: Duration,
config: BackoffConfig,
) -> PollWith<Self, BackoffStrategy>where
Self: Sized,
fn poll_with_backoff(
self,
interval: Duration,
config: BackoffConfig,
) -> PollWith<Self, BackoffStrategy>where
Self: Sized,
Available on crate feature
sleep only.Wake the worker periodically with a backoff
Source§fn poll_with_strategy<S>(self, strategy: S) -> PollWith<Self, S>where
Self: Sized,
S: PollStrategy,
fn poll_with_strategy<S>(self, strategy: S) -> PollWith<Self, S>where
Self: Sized,
S: PollStrategy,
Wake the worker with a custom strategy
Source§fn instrumented(self, span: Span) -> Instrumented<Self>where
Self: Sized,
fn instrumented(self, span: Span) -> Instrumented<Self>where
Self: Sized,
Available on crate feature
tracing only.Provides a span to decorate emitted events
Source§fn before_start<F, Fut>(self, f: F) -> BeforeStart<Self, Self::Error>
fn before_start<F, Fut>(self, f: F) -> BeforeStart<Self, Self::Error>
Runs an async callback once, before the backend’s first
poll_ready is delegated.Source§fn before_stop<F, Fut>(self, f: F) -> BeforeStop<Self, Self::Error>
fn before_stop<F, Fut>(self, f: F) -> BeforeStop<Self, Self::Error>
Runs an async callback once, before the backend’s poll_close is called.
Source§fn after_start<F, Fut>(self, f: F) -> AfterStart<Self, Self::Error>
fn after_start<F, Fut>(self, f: F) -> AfterStart<Self, Self::Error>
Runs an async callback once, after the backend’s first
poll_ready is successful.Source§fn after_stop<F, Fut>(self, f: F) -> AfterStop<Self, Self::Error>
fn after_stop<F, Fut>(self, f: F) -> AfterStop<Self, Self::Error>
Runs an async callback once, after the worker has stopped and backend has cleaned up.
Source§fn interleave<S>(self, stream: S) -> Interleave<Self, S>
fn interleave<S>(self, stream: S) -> Interleave<Self, S>
Interleaves the external stream with the backend.
Source§fn wake_on_push(self) -> WakeOnPush<Self>where
Self: Sized,
fn wake_on_push(self) -> WakeOnPush<Self>where
Self: Sized,
Wakes the worker when a new item is pushed
Available on crate feature
shared only.Create a cloneable handle to the inner backend where all handles are clone.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<R> CryptoRng for R
impl<B, Args, Kind> Expose<Args, Kind> for Bwhere
B: Backend + Metrics + ListWorkers + ListQueues + ListAllTasks + ListTasks + TaskSink<Args, Kind>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
impl<R> RngCore for Rwhere
R: Rng,
Source§impl<R> RngExt for R
impl<R> RngExt for R
Source§fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
Return a random value via the
StandardUniform distribution. Read moreSource§fn random_iter<T>(self) -> Iter<StandardUniform, Self, T> ⓘ
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T> ⓘ
Source§fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Generate a random value in the given range. Read more
Source§fn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
Return a bool with a probability
p of being true. Read moreSource§fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
Return a bool with a probability of
numerator/denominator of being
true. Read moreSource§fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
Sample a new value, using the given distribution. Read more
Source§fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T> ⓘwhere
D: Distribution<T>,
Self: Sized,
fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T> ⓘwhere
D: Distribution<T>,
Self: Sized,
Create an iterator that generates values using the given distribution. Read more
Source§impl<T, Item> SinkExt<Item> for T
impl<T, Item> SinkExt<Item> for T
Source§fn with<U, Fut, F, E>(self, f: F) -> With<Self, Item, U, Fut, F>
fn with<U, Fut, F, E>(self, f: F) -> With<Self, Item, U, Fut, F>
Composes a function in front of the sink. Read more
Source§fn with_flat_map<U, St, F>(self, f: F) -> WithFlatMap<Self, Item, U, St, F>
fn with_flat_map<U, St, F>(self, f: F) -> WithFlatMap<Self, Item, U, St, F>
Composes a function in front of the sink. Read more
Source§fn sink_map_err<E, F>(self, f: F) -> SinkMapErr<Self, F>
fn sink_map_err<E, F>(self, f: F) -> SinkMapErr<Self, F>
Transforms the error returned by the sink.
Source§fn sink_err_into<E>(self) -> SinkErrInto<Self, Item, E>
fn sink_err_into<E>(self) -> SinkErrInto<Self, Item, E>
Map this sink’s error to a different error type using the
Into trait. Read moreSource§fn buffer(self, capacity: usize) -> Buffer<Self, Item>where
Self: Sized,
fn buffer(self, capacity: usize) -> Buffer<Self, Item>where
Self: Sized,
Available on crate feature
alloc only.Adds a fixed-size buffer to the current sink. Read more
Source§fn flush(&mut self) -> Flush<'_, Self, Item> ⓘwhere
Self: Unpin,
fn flush(&mut self) -> Flush<'_, Self, Item> ⓘwhere
Self: Unpin,
Flush the sink, processing all pending items. Read more
Source§fn send(&mut self, item: Item) -> Send<'_, Self, Item> ⓘwhere
Self: Unpin,
fn send(&mut self, item: Item) -> Send<'_, Self, Item> ⓘwhere
Self: Unpin,
A future that completes after the given item has been fully processed
into the sink, including flushing. Read more
Source§fn feed(&mut self, item: Item) -> Feed<'_, Self, Item> ⓘwhere
Self: Unpin,
fn feed(&mut self, item: Item) -> Feed<'_, Self, Item> ⓘwhere
Self: Unpin,
A future that completes after the given item has been received
by the sink. Read more
Source§fn send_all<'a, St>(&'a mut self, stream: &'a mut St) -> SendAll<'a, Self, St> ⓘ
fn send_all<'a, St>(&'a mut self, stream: &'a mut St) -> SendAll<'a, Self, St> ⓘ
A future that completes after the given stream has been fully processed
into the sink, including flushing. Read more
Source§fn right_sink<Si1>(self) -> Either<Si1, Self> ⓘ
fn right_sink<Si1>(self) -> Either<Si1, Self> ⓘ
Source§fn poll_ready_unpin(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>where
Self: Unpin,
fn poll_ready_unpin(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>>where
Self: Unpin,
A convenience method for calling
Sink::poll_ready on Unpin
sink types.Source§fn start_send_unpin(&mut self, item: Item) -> Result<(), Self::Error>where
Self: Unpin,
fn start_send_unpin(&mut self, item: Item) -> Result<(), Self::Error>where
Self: Unpin,
A convenience method for calling
Sink::start_send on Unpin
sink types.Source§impl<Args, S, E, C> TaskSink<Args, Durable> for Swhere
S: Sink<Task<<C as Codec<Args>>::Compact>, Error = E> + Unpin + Backend<Error = E> + WireFormatBackend<Codec = C> + BackendConfig<Args = Args, Kind = Durable> + Send,
Args: Send,
<C as Codec<Args>>::Compact: Send,
C: Codec<Args> + Clone + Send + Sync,
E: Send,
<C as Codec<Args>>::Error: Error + Send + Sync + 'static,
impl<Args, S, E, C> TaskSink<Args, Durable> for Swhere
S: Sink<Task<<C as Codec<Args>>::Compact>, Error = E> + Unpin + Backend<Error = E> + WireFormatBackend<Codec = C> + BackendConfig<Args = Args, Kind = Durable> + Send,
Args: Send,
<C as Codec<Args>>::Compact: Send,
C: Codec<Args> + Clone + Send + Sync,
E: Send,
<C as Codec<Args>>::Error: Error + Send + Sync + 'static,
Source§fn start_send(
self: Pin<&mut S>,
item: Task<Args>,
) -> Result<(), TaskSinkError<<S as Backend>::Error>>
fn start_send( self: Pin<&mut S>, item: Task<Args>, ) -> Result<(), TaskSinkError<<S as Backend>::Error>>
Begins sending a task to the sink. Read more
Source§fn poll_ready(
self: Pin<&mut S>,
cx: &mut Context<'_>,
) -> Poll<Result<(), TaskSinkError<<S as Backend>::Error>>>
fn poll_ready( self: Pin<&mut S>, cx: &mut Context<'_>, ) -> Poll<Result<(), TaskSinkError<<S as Backend>::Error>>>
Polls the sink until it is ready to accept another task. Read more
Source§fn poll_flush(
self: Pin<&mut S>,
cx: &mut Context<'_>,
) -> Poll<Result<(), TaskSinkError<<S as Backend>::Error>>>
fn poll_flush( self: Pin<&mut S>, cx: &mut Context<'_>, ) -> Poll<Result<(), TaskSinkError<<S as Backend>::Error>>>
Polls the sink until all previously submitted tasks have been flushed. Read more
Source§fn poll_close(
self: Pin<&mut S>,
cx: &mut Context<'_>,
) -> Poll<Result<(), TaskSinkError<<S as Backend>::Error>>>
fn poll_close( self: Pin<&mut S>, cx: &mut Context<'_>, ) -> Poll<Result<(), TaskSinkError<<S as Backend>::Error>>>
Polls the sink until it has been closed. Read more
Source§async fn push(
&mut self,
task: Args,
) -> Result<(), TaskSinkError<<S as Backend>::Error>>
async fn push( &mut self, task: Args, ) -> Result<(), TaskSinkError<<S as Backend>::Error>>
Pushes a single task into the backend. Read more
Source§async fn push_bulk(
&mut self,
tasks: Vec<Args>,
) -> Result<(), TaskSinkError<<S as Backend>::Error>>
async fn push_bulk( &mut self, tasks: Vec<Args>, ) -> Result<(), TaskSinkError<<S as Backend>::Error>>
Pushes multiple tasks into the backend. Read more
Source§async fn push_stream(
&mut self,
tasks: impl Stream<Item = Args> + Unpin + Send,
) -> Result<(), TaskSinkError<<S as Backend>::Error>>
async fn push_stream( &mut self, tasks: impl Stream<Item = Args> + Unpin + Send, ) -> Result<(), TaskSinkError<<S as Backend>::Error>>
Pushes tasks from a stream into the backend. Read more
Source§impl<Args, S, E> TaskSink<Args, Ephemeral> for S
impl<Args, S, E> TaskSink<Args, Ephemeral> for S
Source§fn start_send(
self: Pin<&mut S>,
item: Task<Args>,
) -> Result<(), TaskSinkError<<S as Backend>::Error>>
fn start_send( self: Pin<&mut S>, item: Task<Args>, ) -> Result<(), TaskSinkError<<S as Backend>::Error>>
Begins sending a task to the sink. Read more
Source§fn poll_ready(
self: Pin<&mut S>,
cx: &mut Context<'_>,
) -> Poll<Result<(), TaskSinkError<<S as Backend>::Error>>>
fn poll_ready( self: Pin<&mut S>, cx: &mut Context<'_>, ) -> Poll<Result<(), TaskSinkError<<S as Backend>::Error>>>
Polls the sink until it is ready to accept another task. Read more
Source§fn poll_flush(
self: Pin<&mut S>,
cx: &mut Context<'_>,
) -> Poll<Result<(), TaskSinkError<<S as Backend>::Error>>>
fn poll_flush( self: Pin<&mut S>, cx: &mut Context<'_>, ) -> Poll<Result<(), TaskSinkError<<S as Backend>::Error>>>
Polls the sink until all previously submitted tasks have been flushed. Read more
Source§fn poll_close(
self: Pin<&mut S>,
cx: &mut Context<'_>,
) -> Poll<Result<(), TaskSinkError<<S as Backend>::Error>>>
fn poll_close( self: Pin<&mut S>, cx: &mut Context<'_>, ) -> Poll<Result<(), TaskSinkError<<S as Backend>::Error>>>
Polls the sink until it has been closed. Read more
Source§async fn push(
&mut self,
args: Args,
) -> Result<(), TaskSinkError<<S as Backend>::Error>>
async fn push( &mut self, args: Args, ) -> Result<(), TaskSinkError<<S as Backend>::Error>>
Pushes a single task into the backend. Read more
Source§async fn push_bulk(
&mut self,
tasks: Vec<Args>,
) -> Result<(), TaskSinkError<<S as Backend>::Error>>
async fn push_bulk( &mut self, tasks: Vec<Args>, ) -> Result<(), TaskSinkError<<S as Backend>::Error>>
Pushes multiple tasks into the backend. Read more
Source§async fn push_stream(
&mut self,
tasks: impl Stream<Item = Args> + Unpin + Send,
) -> Result<(), TaskSinkError<<S as Backend>::Error>>
async fn push_stream( &mut self, tasks: impl Stream<Item = Args> + Unpin + Send, ) -> Result<(), TaskSinkError<<S as Backend>::Error>>
Pushes tasks from a stream into the backend. Read more