pub struct Pipeline<S> { /* private fields */ }
Expand description
Container for a service.
Container allows to call enclosed service and adds support of shared readiness.
Implementations§
Source§impl<S> Pipeline<S>
impl<S> Pipeline<S>
Sourcepub async fn ready<R>(&self) -> Result<(), S::Error>where
S: Service<R>,
pub async fn ready<R>(&self) -> Result<(), S::Error>where
S: Service<R>,
Returns when the pipeline is able to process requests.
Sourcepub async fn call<R>(&self, req: R) -> Result<S::Response, S::Error>where
S: Service<R>,
pub async fn call<R>(&self, req: R) -> Result<S::Response, S::Error>where
S: Service<R>,
Wait for service readiness and then create future object that resolves to service result.
Sourcepub fn call_static<R>(&self, req: R) -> PipelineCall<S, R> ⓘwhere
S: Service<R> + 'static,
R: 'static,
pub fn call_static<R>(&self, req: R) -> PipelineCall<S, R> ⓘwhere
S: Service<R> + 'static,
R: 'static,
Wait for service readiness and then create future object that resolves to service result.
Sourcepub fn call_nowait<R>(&self, req: R) -> PipelineCall<S, R> ⓘwhere
S: Service<R> + 'static,
R: 'static,
pub fn call_nowait<R>(&self, req: R) -> PipelineCall<S, R> ⓘwhere
S: Service<R> + 'static,
R: 'static,
Call service and create future object that resolves to service result.
Note, this call does not check service readiness.
Sourcepub fn is_shutdown(&self) -> bool
pub fn is_shutdown(&self) -> bool
Check if shutdown is initiated.
pub fn poll<R>(&self, cx: &mut Context<'_>) -> Result<(), S::Error>where
S: Service<R>,
Sourcepub fn bind<R>(self) -> PipelineBinding<S, R>where
S: Service<R> + 'static,
R: 'static,
pub fn bind<R>(self) -> PipelineBinding<S, R>where
S: Service<R> + 'static,
R: 'static,
Get current pipeline.
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for Pipeline<S>
impl<S> !RefUnwindSafe for Pipeline<S>
impl<S> !Send for Pipeline<S>
impl<S> !Sync for Pipeline<S>
impl<S> Unpin for Pipeline<S>
impl<S> !UnwindSafe for Pipeline<S>
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