pub struct Pipe<S, Into, Args, Ctx> { /* private fields */ }Expand description
A generic pipe that wraps a Stream and passes it to a backend
§Features
| Feature | Status | Description |
|---|---|---|
TaskSink | ✅ | Ability to push new tasks |
InheritsFeatures | ✅ ❗ | Inherits features from the underlying backend |
Key: ✅ : Supported | ⚠️ : Not implemented | ❌ : Not Supported | ❗ Limited support
Examples:
Implementations§
Trait Implementations§
Source§impl<Args, Ctx, S, TSink, Err> Backend<Args> for Pipe<S, TSink, Args, Ctx>where
S: Stream<Item = Result<Args, Err>> + Send + 'static,
TSink: Backend<Args, Context = Ctx> + Sink<Task<Args, Ctx, TSink::IdType>> + Clone + Unpin + Send + 'static,
<TSink as Backend<Args>>::Error: Into<BoxDynError> + Send + Sync + 'static,
TSink::Beat: Send + 'static,
TSink::IdType: Send + Clone + 'static,
TSink::Stream: Send + 'static,
Args: Send + 'static,
Ctx: Send + 'static + Default,
Err: Into<BoxDynError> + Send + Sync + 'static,
<TSink as Sink<Task<Args, Ctx, TSink::IdType>>>::Error: Into<BoxDynError> + Send + Sync + 'static,
impl<Args, Ctx, S, TSink, Err> Backend<Args> for Pipe<S, TSink, Args, Ctx>where
S: Stream<Item = Result<Args, Err>> + Send + 'static,
TSink: Backend<Args, Context = Ctx> + Sink<Task<Args, Ctx, TSink::IdType>> + Clone + Unpin + Send + 'static,
<TSink as Backend<Args>>::Error: Into<BoxDynError> + Send + Sync + 'static,
TSink::Beat: Send + 'static,
TSink::IdType: Send + Clone + 'static,
TSink::Stream: Send + 'static,
Args: Send + 'static,
Ctx: Send + 'static + Default,
Err: Into<BoxDynError> + Send + Sync + 'static,
<TSink as Sink<Task<Args, Ctx, TSink::IdType>>>::Error: Into<BoxDynError> + Send + Sync + 'static,
Source§type Stream = Pin<Box<dyn Stream<Item = Result<Option<Task<Args, Ctx, <Pipe<S, TSink, Args, Ctx> as Backend<Args>>::IdType>>, PipeError>> + Send>>
type Stream = Pin<Box<dyn Stream<Item = Result<Option<Task<Args, Ctx, <Pipe<S, TSink, Args, Ctx> as Backend<Args>>::IdType>>, PipeError>> + Send>>
A stream of tasks provided by the backend.
Source§type Beat = Pin<Box<dyn Stream<Item = Result<(), PipeError>> + Send>>
type Beat = Pin<Box<dyn Stream<Item = Result<(), PipeError>> + Send>>
A stream representing heartbeat signals.
Source§type Codec = <TSink as Backend<Args>>::Codec
type Codec = <TSink as Backend<Args>>::Codec
The codec used for serialization/deserialization of tasks.
Source§fn heartbeat(&self, worker: &WorkerContext) -> Self::Beat
fn heartbeat(&self, worker: &WorkerContext) -> Self::Beat
Returns a heartbeat stream for the given worker.
Source§fn middleware(&self) -> Self::Layer
fn middleware(&self) -> Self::Layer
Returns the backend’s middleware layer.
Source§fn poll(self, worker: &WorkerContext) -> Self::Stream
fn poll(self, worker: &WorkerContext) -> Self::Stream
Polls the backend for tasks for the given worker.
Auto Trait Implementations§
impl<S, Into, Args, Ctx> Freeze for Pipe<S, Into, Args, Ctx>
impl<S, Into, Args, Ctx> RefUnwindSafe for Pipe<S, Into, Args, Ctx>
impl<S, Into, Args, Ctx> Send for Pipe<S, Into, Args, Ctx>
impl<S, Into, Args, Ctx> Sync for Pipe<S, Into, Args, Ctx>
impl<S, Into, Args, Ctx> Unpin for Pipe<S, Into, Args, Ctx>
impl<S, Into, Args, Ctx> UnwindSafe for Pipe<S, Into, Args, Ctx>
Blanket Implementations§
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