pub struct WorkflowService<B, Input, Output>where
B: Backend + WireFormatBackend,{ /* private fields */ }Expand description
The main workflow service that orchestrates the execution of workflow steps.
Implementations§
Source§impl<B, Input, Output> WorkflowService<B, Input, Output>where
B: Backend + WireFormatBackend,
impl<B, Input, Output> WorkflowService<B, Input, Output>where
B: Backend + WireFormatBackend,
Sourcepub fn new(
services: HashMap<usize, BoxCloneSyncService<Task<B::Compact>, GoTo<StepResponse>, BoxDynError>>,
backend: B,
) -> Self
pub fn new( services: HashMap<usize, BoxCloneSyncService<Task<B::Compact>, GoTo<StepResponse>, BoxDynError>>, backend: B, ) -> Self
Creates a new WorkflowService with the given services and backend.
Trait Implementations§
Source§impl<B, Input: Clone, Output: Clone> Clone for WorkflowService<B, Input, Output>
impl<B, Input: Clone, Output: Clone> Clone for WorkflowService<B, Input, Output>
Source§fn clone(&self) -> WorkflowService<B, Input, Output>
fn clone(&self) -> WorkflowService<B, Input, Output>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<Input, Output, Current, B, Compact, L, Err> IntoWorkerService<B, WorkflowService<B, Input, Output>> for SteppedFlow<Input, Current, B, L>where
B: Backend<Task = Task<Compact>, Error = Err> + WireFormatBackend<Compact = Compact> + BackendConfig<Args = Input> + Send + Sync + 'static + Sink<Task<Compact>, Error = Err> + Clone + Unpin,
B::Id: Send + 'static + Default + GenerateId,
L: Layer<RootStep<Current>>,
L::Step: Step<Output, B>,
B::Codec: Clone,
Err: Error + Send + Sync + 'static,
Compact: Send + 'static,
impl<Input, Output, Current, B, Compact, L, Err> IntoWorkerService<B, WorkflowService<B, Input, Output>> for SteppedFlow<Input, Current, B, L>where
B: Backend<Task = Task<Compact>, Error = Err> + WireFormatBackend<Compact = Compact> + BackendConfig<Args = Input> + Send + Sync + 'static + Sink<Task<Compact>, Error = Err> + Clone + Unpin,
B::Id: Send + 'static + Default + GenerateId,
L: Layer<RootStep<Current>>,
L::Step: Step<Output, B>,
B::Codec: Clone,
Err: Error + Send + Sync + 'static,
Compact: Send + 'static,
Source§fn into_service(
self,
backend: B,
) -> WorkerService<Self::Backend, WorkflowService<B, Input, Output>>
fn into_service( self, backend: B, ) -> WorkerService<Self::Backend, WorkflowService<B, Input, Output>>
Builds a worker service from the provided backend.
Source§impl<B, Err, Input, Output> Service<Task<<B as WireFormatBackend>::Compact>> for WorkflowService<B, Input, Output>
impl<B, Err, Input, Output> Service<Task<<B as WireFormatBackend>::Compact>> for WorkflowService<B, Input, Output>
Source§type Response = GoTo<StepResponse>
type Response = GoTo<StepResponse>
Responses given by the service.
Source§type Future = Pin<Box<dyn Future<Output = Result<<WorkflowService<B, Input, Output> as Service<Task<<B as WireFormatBackend>::Compact>>>::Response, <WorkflowService<B, Input, Output> as Service<Task<<B as WireFormatBackend>::Compact>>>::Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<<WorkflowService<B, Input, Output> as Service<Task<<B as WireFormatBackend>::Compact>>>::Response, <WorkflowService<B, Input, Output> as Service<Task<<B as WireFormatBackend>::Compact>>>::Error>> + Send>>
The future response value.
Auto Trait Implementations§
impl<B, Input, Output> !RefUnwindSafe for WorkflowService<B, Input, Output>
impl<B, Input, Output> !UnwindSafe for WorkflowService<B, Input, Output>
impl<B, Input, Output> Freeze for WorkflowService<B, Input, Output>where
HashMap<usize, BoxCloneSyncService<Task<<B as WireFormatBackend>::Compact>, GoTo<StepResponse>, Box<dyn Error + Sync + Send>>>: Freeze,
B: Freeze,
PhantomData<(Input, Output)>: Freeze,
impl<B, Input, Output> Send for WorkflowService<B, Input, Output>where
HashMap<usize, BoxCloneSyncService<Task<<B as WireFormatBackend>::Compact>, GoTo<StepResponse>, Box<dyn Error + Sync + Send>>>: Send,
B: Send,
PhantomData<(Input, Output)>: Send,
impl<B, Input, Output> Sync for WorkflowService<B, Input, Output>where
HashMap<usize, BoxCloneSyncService<Task<<B as WireFormatBackend>::Compact>, GoTo<StepResponse>, Box<dyn Error + Sync + Send>>>: Sync,
B: Sync,
PhantomData<(Input, Output)>: Sync,
impl<B, Input, Output> Unpin for WorkflowService<B, Input, Output>where
HashMap<usize, BoxCloneSyncService<Task<<B as WireFormatBackend>::Compact>, GoTo<StepResponse>, Box<dyn Error + Sync + Send>>>: Unpin,
B: Unpin,
PhantomData<(Input, Output)>: Unpin,
impl<B, Input, Output> UnsafeUnpin for WorkflowService<B, Input, Output>where
HashMap<usize, BoxCloneSyncService<Task<<B as WireFormatBackend>::Compact>, GoTo<StepResponse>, Box<dyn Error + Sync + Send>>>: UnsafeUnpin,
B: UnsafeUnpin,
PhantomData<(Input, Output)>: UnsafeUnpin,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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<Args, S, B, O> IntoWorkerService<B, S> for Swhere
B: Backend + BackendConfig<Args = Args>,
<B as BackendConfig>::Kind: FinalizeBackend<B, Args, Backend = O>,
O: Backend<Task = Task<Args>>,
S: Service<<O as Backend>::Task>,
impl<Args, S, B, O> IntoWorkerService<B, S> for Swhere
B: Backend + BackendConfig<Args = Args>,
<B as BackendConfig>::Kind: FinalizeBackend<B, Args, Backend = O>,
O: Backend<Task = Task<Args>>,
S: Service<<O as Backend>::Task>,
Source§impl<T, Request> ServiceExt<Request> for T
impl<T, Request> ServiceExt<Request> for T
Source§fn ready(&mut self) -> Ready<'_, Self, Request> ⓘwhere
Self: Sized,
fn ready(&mut self) -> Ready<'_, Self, Request> ⓘwhere
Self: Sized,
Yields a mutable reference to the service when it is ready to accept a request.
Source§fn ready_oneshot(self) -> ReadyOneshot<Self, Request> ⓘwhere
Self: Sized,
fn ready_oneshot(self) -> ReadyOneshot<Self, Request> ⓘwhere
Self: Sized,
Yields the service when it is ready to accept a request.
Source§fn oneshot(self, req: Request) -> Oneshot<Self, Request> ⓘwhere
Self: Sized,
fn oneshot(self, req: Request) -> Oneshot<Self, Request> ⓘwhere
Self: Sized,
Consume this
Service, calling it with the provided request once it is ready.Source§fn and_then<F>(self, f: F) -> AndThen<Self, F>
fn and_then<F>(self, f: F) -> AndThen<Self, F>
Executes a new future after this service’s future resolves. This does
not alter the behaviour of the
poll_ready method. Read moreSource§fn map_response<F, Response>(self, f: F) -> MapResponse<Self, F>
fn map_response<F, Response>(self, f: F) -> MapResponse<Self, F>
Maps this service’s response value to a different value. This does not
alter the behaviour of the
poll_ready method. Read moreSource§fn map_err<F, Error>(self, f: F) -> MapErr<Self, F>
fn map_err<F, Error>(self, f: F) -> MapErr<Self, F>
Maps this service’s error value to a different value. This does not
alter the behaviour of the
poll_ready method. Read moreSource§fn map_result<F, Response, Error>(self, f: F) -> MapResult<Self, F>
fn map_result<F, Response, Error>(self, f: F) -> MapResult<Self, F>
Maps this service’s result type (
Result<Self::Response, Self::Error>)
to a different value, regardless of whether the future succeeds or
fails. Read moreSource§fn map_request<F, NewRequest>(self, f: F) -> MapRequest<Self, F>
fn map_request<F, NewRequest>(self, f: F) -> MapRequest<Self, F>
Composes a function in front of the service. Read more
Source§fn then<F, Response, Error, Fut>(self, f: F) -> Then<Self, F>
fn then<F, Response, Error, Fut>(self, f: F) -> Then<Self, F>
Composes an asynchronous function after this service. Read more
Source§fn map_future<F, Fut, Response, Error>(self, f: F) -> MapFuture<Self, F>
fn map_future<F, Fut, Response, Error>(self, f: F) -> MapFuture<Self, F>
Composes a function that transforms futures produced by the service. Read more