pub enum Control<E> {
WrBackpressure(WrBackpressure),
Stop(Reason<E>),
}Expand description
Connection control messages
Variants§
WrBackpressure(WrBackpressure)
Write back-pressure is enabled/disabled
Stop(Reason<E>)
Dispatcher is preparing for shutdown.
The control service will receive this message only once. After receiving this message dispatcher stops.
Trait Implementations§
Source§impl<S, E, R> Service<Control<E>> for DefaultControlService<S, E, R, ()>
impl<S, E, R> Service<Control<E>> for DefaultControlService<S, E, R, ()>
Source§async fn call(
&self,
_: Control<E>,
_: ServiceCtx<'_, Self>,
) -> Result<Self::Response, Self::Error>
async fn call( &self, _: Control<E>, _: ServiceCtx<'_, Self>, ) -> Result<Self::Response, Self::Error>
Processes a request and returns the response asynchronously. Read more
Source§async fn ready(&self, ctx: ServiceCtx<'_, Self>) -> Result<(), Self::Error>
async fn ready(&self, ctx: ServiceCtx<'_, Self>) -> Result<(), Self::Error>
Returns when the service is ready to process requests. Read more
Source§fn poll(&self, cx: &mut Context<'_>) -> Result<(), Self::Error>
fn poll(&self, cx: &mut Context<'_>) -> Result<(), Self::Error>
Polls the service from the current async task. Read more
Source§impl<S, E, R, Err> ServiceFactory<Control<E>, S> for DefaultControlService<S, E, R, Err>
impl<S, E, R, Err> ServiceFactory<Control<E>, S> for DefaultControlService<S, E, R, Err>
Source§type Service = DefaultControlService<S, E, R>
type Service = DefaultControlService<S, E, R>
The type of
Service produced by this factory.Source§async fn create(&self, _: S) -> Result<Self::Service, Self::InitError>
async fn create(&self, _: S) -> Result<Self::Service, Self::InitError>
Creates a new service asynchronously and returns it.
Source§async fn pipeline(
&self,
cfg: Cfg,
) -> Result<Pipeline<Self::Service>, Self::InitError>where
Self: Sized,
async fn pipeline(
&self,
cfg: Cfg,
) -> Result<Pipeline<Self::Service>, Self::InitError>where
Self: Sized,
Asynchronously creates a new service and wraps it in a container.
Source§fn map<F, Res>(
self,
f: F,
) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
fn map<F, Res>( self, f: F, ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
Returns a new service that maps this service’s output to a different type.
Source§fn map_err<F, E>(
self,
f: F,
) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
fn map_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
Transforms this service’s error into another error,
producing a new service.
Source§fn map_init_err<F, E>(
self,
f: F,
) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
fn map_init_err<F, E>( self, f: F, ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
Maps this factory’s initialization error to a different error,
returning a new service factory.
Auto Trait Implementations§
impl<E> Freeze for Control<E>where
E: Freeze,
impl<E> !RefUnwindSafe for Control<E>
impl<E> Send for Control<E>where
E: Send,
impl<E> Sync for Control<E>where
E: Sync,
impl<E> Unpin for Control<E>where
E: Unpin,
impl<E> UnsafeUnpin for Control<E>where
E: UnsafeUnpin,
impl<E> !UnwindSafe for Control<E>
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