pub struct MemoryStorage<Args> { /* private fields */ }Expand description
In-memory queue that is based on channels
§Example
let mut backend = MemoryStorage::new();§Features
| Feature | Status | Description |
|---|---|---|
Backend | ✅ | Basic Backend functionality |
TaskSink | ✅ | Ability to push new tasks |
Serialization | ❌ | Serialization support for arguments |
PipeExt | ⚠️ | Allow other backends to pipe to this backend |
BackendFactory | ❌ | Share the same storage across multiple workers |
Update | ❌ | Allow updating a task |
FetchById | ❌ | Allow fetching a task by its ID |
Reschedule | ❌ | Reschedule a task |
ResumeById | ❌ | Resume a task by its ID |
ResumeAbandoned | ❌ | Resume abandoned tasks |
Vacuum | ❌ | Vacuum the task storage |
Workflow | ⚠️ | Flexible enough to support workflows |
WaitForCompletion | ⚠️ | Wait for tasks to complete without blocking |
RegisterWorker | ❌ | Allow registering a worker with the backend |
ListWorkers | ❌ | List all workers registered with the backend |
ListTasks | ❌ | List all tasks in the backend |
Key: ✅ : Supported | ⚠️ : Not implemented | ❌ : Not Supported | ❗ Limited support
Tests:
§Backend
#[tokio::main]
async fn main() {
// let mut backend = /* snip */;
async fn task(task: u32, worker: WorkerContext) {
// Do some work
}
let worker = WorkerBuilder::new("backend-test")
.backend(backend)
.build(task);
let _ = worker.stream().take(1).collect::<Vec<_>>().await;
}
§TaskSink
#[tokio::main]
async fn main() {
// let mut backend = /* snip */;
backend.push(42).await.unwrap();
async fn task(task: u32, worker: WorkerContext) {
worker.stop().unwrap();
}
let worker = WorkerBuilder::new("task-sink-test")
.backend(backend)
.build(task);
worker.run().await.unwrap();
}
Implementations§
Source§impl<Args: Send + 'static> MemoryStorage<Args>
impl<Args: Send + 'static> MemoryStorage<Args>
Sourcepub fn new_with(sender: MemorySink<Args>, receiver: BoxedReceiver<Args>) -> Self
pub fn new_with(sender: MemorySink<Args>, receiver: BoxedReceiver<Args>) -> Self
Create a storage given a sender and receiver
Trait Implementations§
Source§impl<Args> Backend for MemoryStorage<Args>
impl<Args> Backend for MemoryStorage<Args>
Source§type Error = MemoryStorageError
type Error = MemoryStorageError
The error type returned by backend operations
Source§fn poll_ready(
&mut self,
cx: &mut Context<'_>,
_: &WorkerContext,
) -> Poll<Result<(), Self::Error>>
fn poll_ready( &mut self, cx: &mut Context<'_>, _: &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<'_>,
_: &WorkerContext,
) -> Poll<Option<Result<Self::Task, Self::Error>>>
fn poll_next( &mut self, cx: &mut Context<'_>, _: &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<'_>,
_: &WorkerContext,
) -> Poll<Result<(), Self::Error>>
fn poll_close( &mut self, cx: &mut Context<'_>, _: &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<Args> BackendConfig for MemoryStorage<Args>
impl<Args> BackendConfig for MemoryStorage<Args>
Source§fn middleware(&mut self, _: &mut WorkerContext) -> Self::Layer
fn middleware(&mut self, _: &mut WorkerContext) -> Self::Layer
Returns the backend’s middleware layer.
Source§impl<Args> Debug for MemoryStorage<Args>
impl<Args> Debug for MemoryStorage<Args>
Source§impl<Args: Send + 'static> Default for MemoryStorage<Args>
impl<Args: Send + 'static> Default for MemoryStorage<Args>
Source§impl<Args> Sink<Task<Args>> for MemoryStorage<Args>
impl<Args> Sink<Task<Args>> for MemoryStorage<Args>
Source§type Error = MemoryStorageError
type Error = MemoryStorageError
The type of value produced by the sink when an error occurs.
Source§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§fn start_send(self: Pin<&mut Self>, item: Task<Args>) -> Result<(), Self::Error>
fn start_send(self: Pin<&mut Self>, item: Task<Args>) -> 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§impl<Args> Stream for MemoryStorage<Args>
impl<Args> Stream for MemoryStorage<Args>
Auto Trait Implementations§
impl<Args> !Freeze for MemoryStorage<Args>
impl<Args> !RefUnwindSafe for MemoryStorage<Args>
impl<Args> !UnwindSafe for MemoryStorage<Args>
impl<Args> Send for MemoryStorage<Args>
impl<Args> Sync for MemoryStorage<Args>
impl<Args> Unpin for MemoryStorage<Args>
impl<Args> UnsafeUnpin for MemoryStorage<Args>where
MemorySink<Args>: UnsafeUnpin,
Mutex<Pin<Box<dyn Stream<Item = Task<Args>> + Send>>>: UnsafeUnpin,
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
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> 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> ⓘ
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<T> StreamExt for T
impl<T> StreamExt for T
Source§fn next(&mut self) -> Next<'_, Self> ⓘwhere
Self: Unpin,
fn next(&mut self) -> Next<'_, Self> ⓘwhere
Self: Unpin,
Creates a future that resolves to the next item in the stream. Read more
Source§fn into_future(self) -> StreamFuture<Self> ⓘ
fn into_future(self) -> StreamFuture<Self> ⓘ
Source§fn map<T, F>(self, f: F) -> Map<Self, F>
fn map<T, F>(self, f: F) -> Map<Self, F>
Maps this stream’s items to a different type, returning a new stream of
the resulting type. Read more
Source§fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
Creates a stream which gives the current iteration count as well as
the next value. Read more
Source§fn filter<Fut, F>(self, f: F) -> Filter<Self, Fut, F>
fn filter<Fut, F>(self, f: F) -> Filter<Self, Fut, F>
Filters the values produced by this stream according to the provided
asynchronous predicate. Read more
Source§fn filter_map<Fut, T, F>(self, f: F) -> FilterMap<Self, Fut, F>
fn filter_map<Fut, T, F>(self, f: F) -> FilterMap<Self, Fut, F>
Filters the values produced by this stream while simultaneously mapping
them to a different type according to the provided asynchronous closure. Read more
Source§fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
Computes from this stream’s items new items of a different type using
an asynchronous closure. Read more
Source§fn collect<C>(self) -> Collect<Self, C> ⓘ
fn collect<C>(self) -> Collect<Self, C> ⓘ
Transforms a stream into a collection, returning a
future representing the result of that computation. Read more
Source§fn unzip<A, B, FromA, FromB>(self) -> Unzip<Self, FromA, FromB> ⓘ
fn unzip<A, B, FromA, FromB>(self) -> Unzip<Self, FromA, FromB> ⓘ
Converts a stream of pairs into a future, which
resolves to pair of containers. Read more
Source§fn concat(self) -> Concat<Self> ⓘ
fn concat(self) -> Concat<Self> ⓘ
Concatenate all items of a stream into a single extendable
destination, returning a future representing the end result. Read more
Source§fn count(self) -> Count<Self> ⓘwhere
Self: Sized,
fn count(self) -> Count<Self> ⓘwhere
Self: Sized,
Drives the stream to completion, counting the number of items. Read more
Source§fn fold<T, Fut, F>(self, init: T, f: F) -> Fold<Self, Fut, T, F> ⓘ
fn fold<T, Fut, F>(self, init: T, f: F) -> Fold<Self, Fut, T, F> ⓘ
Execute an accumulating asynchronous computation over a stream,
collecting all the values into one final result. Read more
Source§fn any<Fut, F>(self, f: F) -> Any<Self, Fut, F> ⓘ
fn any<Fut, F>(self, f: F) -> Any<Self, Fut, F> ⓘ
Execute predicate over asynchronous stream, and return
true if any element in stream satisfied a predicate. Read moreSource§fn all<Fut, F>(self, f: F) -> All<Self, Fut, F> ⓘ
fn all<Fut, F>(self, f: F) -> All<Self, Fut, F> ⓘ
Execute predicate over asynchronous stream, and return
true if all element in stream satisfied a predicate. Read moreSource§fn flatten(self) -> Flatten<Self>
fn flatten(self) -> Flatten<Self>
Flattens a stream of streams into just one continuous stream. Read more
Source§fn flatten_unordered(
self,
limit: impl Into<Option<usize>>,
) -> FlattenUnorderedWithFlowController<Self, ()>
fn flatten_unordered( self, limit: impl Into<Option<usize>>, ) -> FlattenUnorderedWithFlowController<Self, ()>
Available on
target_has_atomic=ptr and crate feature alloc only.Flattens a stream of streams into just one continuous stream. Polls
inner streams produced by the base stream concurrently. Read more
Source§fn flat_map_unordered<U, F>(
self,
limit: impl Into<Option<usize>>,
f: F,
) -> FlatMapUnordered<Self, U, F>
fn flat_map_unordered<U, F>( self, limit: impl Into<Option<usize>>, f: F, ) -> FlatMapUnordered<Self, U, F>
Available on
target_has_atomic=ptr and crate feature alloc only.Maps a stream like
StreamExt::map but flattens nested Streams
and polls them concurrently, yielding items in any order, as they made
available. Read moreSource§fn scan<S, B, Fut, F>(self, initial_state: S, f: F) -> Scan<Self, S, Fut, F>
fn scan<S, B, Fut, F>(self, initial_state: S, f: F) -> Scan<Self, S, Fut, F>
Combinator similar to
StreamExt::fold that holds internal state
and produces a new stream. Read moreSource§fn skip_while<Fut, F>(self, f: F) -> SkipWhile<Self, Fut, F>
fn skip_while<Fut, F>(self, f: F) -> SkipWhile<Self, Fut, F>
Skip elements on this stream while the provided asynchronous predicate
resolves to
true. Read moreSource§fn take_while<Fut, F>(self, f: F) -> TakeWhile<Self, Fut, F>
fn take_while<Fut, F>(self, f: F) -> TakeWhile<Self, Fut, F>
Take elements from this stream while the provided asynchronous predicate
resolves to
true. Read moreSource§fn take_until<Fut>(self, fut: Fut) -> TakeUntil<Self, Fut>
fn take_until<Fut>(self, fut: Fut) -> TakeUntil<Self, Fut>
Take elements from this stream until the provided future resolves. Read more
Source§fn for_each<Fut, F>(self, f: F) -> ForEach<Self, Fut, F> ⓘ
fn for_each<Fut, F>(self, f: F) -> ForEach<Self, Fut, F> ⓘ
Runs this stream to completion, executing the provided asynchronous
closure for each element on the stream. Read more
Source§fn for_each_concurrent<Fut, F>(
self,
limit: impl Into<Option<usize>>,
f: F,
) -> ForEachConcurrent<Self, Fut, F> ⓘ
fn for_each_concurrent<Fut, F>( self, limit: impl Into<Option<usize>>, f: F, ) -> ForEachConcurrent<Self, Fut, F> ⓘ
Available on
target_has_atomic=ptr and crate feature alloc only.Runs this stream to completion, executing the provided asynchronous
closure for each element on the stream concurrently as elements become
available. Read more
Source§fn take(self, n: usize) -> Take<Self>where
Self: Sized,
fn take(self, n: usize) -> Take<Self>where
Self: Sized,
Creates a new stream of at most
n items of the underlying stream. Read moreSource§fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
Creates a new stream which skips
n items of the underlying stream. Read moreSource§fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
Available on crate feature
std only.Catches unwinding panics while polling the stream. Read more
Source§fn boxed<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + Send + 'a>>
fn boxed<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + Send + 'a>>
Available on crate feature
alloc only.Wrap the stream in a Box, pinning it. Read more
Source§fn boxed_local<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a>>where
Self: Sized + 'a,
fn boxed_local<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a>>where
Self: Sized + 'a,
Available on crate feature
alloc only.Wrap the stream in a Box, pinning it. Read more
Source§fn buffered(self, n: usize) -> Buffered<Self>
fn buffered(self, n: usize) -> Buffered<Self>
Available on
target_has_atomic=ptr and crate feature alloc only.An adaptor for creating a buffered list of pending futures. Read more
Source§fn buffer_unordered(self, n: usize) -> BufferUnordered<Self>
fn buffer_unordered(self, n: usize) -> BufferUnordered<Self>
Available on
target_has_atomic=ptr and crate feature alloc only.An adaptor for creating a buffered list of pending futures (unordered). Read more
Source§fn zip<St>(self, other: St) -> Zip<Self, St>
fn zip<St>(self, other: St) -> Zip<Self, St>
An adapter for zipping two streams together. Read more
Source§fn peekable(self) -> Peekable<Self>where
Self: Sized,
fn peekable(self) -> Peekable<Self>where
Self: Sized,
Creates a new stream which exposes a
peek method. Read moreSource§fn chunks(self, capacity: usize) -> Chunks<Self>where
Self: Sized,
fn chunks(self, capacity: usize) -> Chunks<Self>where
Self: Sized,
Available on crate feature
alloc only.An adaptor for chunking up items of the stream inside a vector. Read more
Source§fn ready_chunks(self, capacity: usize) -> ReadyChunks<Self>where
Self: Sized,
fn ready_chunks(self, capacity: usize) -> ReadyChunks<Self>where
Self: Sized,
Available on crate feature
alloc only.An adaptor for chunking up ready items of the stream inside a vector. Read more
Source§fn forward<S>(self, sink: S) -> Forward<Self, S> ⓘ
fn forward<S>(self, sink: S) -> Forward<Self, S> ⓘ
Available on crate feature
sink only.A future that completes after the given stream has been fully processed
into the sink and the sink has been flushed and closed. Read more
Source§fn split<Item>(self) -> (SplitSink<Self, Item>, SplitStream<Self>)
fn split<Item>(self) -> (SplitSink<Self, Item>, SplitStream<Self>)
Available on
target_has_atomic=ptr and crate feature alloc and crate feature sink only.Source§fn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
Do something with each item of this stream, afterwards passing it on. Read more
Source§fn left_stream<B>(self) -> Either<Self, B> ⓘ
fn left_stream<B>(self) -> Either<Self, B> ⓘ
Source§fn right_stream<B>(self) -> Either<B, Self> ⓘ
fn right_stream<B>(self) -> Either<B, Self> ⓘ
Source§fn poll_next_unpin(&mut self, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>where
Self: Unpin,
fn poll_next_unpin(&mut self, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>where
Self: Unpin,
A convenience method for calling
Stream::poll_next on Unpin
stream types.Source§fn select_next_some(&mut self) -> SelectNextSome<'_, Self> ⓘwhere
Self: Unpin + FusedStream,
fn select_next_some(&mut self) -> SelectNextSome<'_, Self> ⓘwhere
Self: Unpin + FusedStream,
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