pub struct BoxService<S, Request, Response, Error> { /* private fields */ }
Expand description
A boxed Service
, to serve requests with,
for where you require dynamic dispatch.
Implementations§
Source§impl<S, Request, Response, Error> BoxService<S, Request, Response, Error>
impl<S, Request, Response, Error> BoxService<S, Request, Response, Error>
Sourcepub fn new<T>(service: T) -> Selfwhere
T: Service<S, Request, Response = Response, Error = Error>,
pub fn new<T>(service: T) -> Selfwhere
T: Service<S, Request, Response = Response, Error = Error>,
Create a new BoxService
from the given service.
Trait Implementations§
Source§impl<S, Request, Response, Error> Debug for BoxService<S, Request, Response, Error>
impl<S, Request, Response, Error> Debug for BoxService<S, Request, Response, Error>
Source§impl<S, Request, Response, Error> Service<S, Request> for BoxService<S, Request, Response, Error>
impl<S, Request, Response, Error> Service<S, Request> for BoxService<S, Request, Response, Error>
Auto Trait Implementations§
impl<S, Request, Response, Error> Freeze for BoxService<S, Request, Response, Error>
impl<S, Request, Response, Error> !RefUnwindSafe for BoxService<S, Request, Response, Error>
impl<S, Request, Response, Error> Send for BoxService<S, Request, Response, Error>
impl<S, Request, Response, Error> Sync for BoxService<S, Request, Response, Error>
impl<S, Request, Response, Error> Unpin for BoxService<S, Request, Response, Error>
impl<S, Request, Response, Error> !UnwindSafe for BoxService<S, Request, Response, Error>
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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<S, StateIn, StateOut, RequestIn, RequestOut> RequestInspector<StateIn, RequestIn> for S
impl<S, StateIn, StateOut, RequestIn, RequestOut> RequestInspector<StateIn, RequestIn> for S
Source§type Error = <S as Service<StateIn, RequestIn>>::Error
type Error = <S as Service<StateIn, RequestIn>>::Error
The type of error returned by the service.
type RequestOut = RequestOut
type StateOut = StateOut
Source§fn inspect_request(
&self,
ctx: Context<StateIn>,
req: RequestIn,
) -> impl Future<Output = Result<(Context<<S as RequestInspector<StateIn, RequestIn>>::StateOut>, <S as RequestInspector<StateIn, RequestIn>>::RequestOut), <S as RequestInspector<StateIn, RequestIn>>::Error>> + Send
fn inspect_request( &self, ctx: Context<StateIn>, req: RequestIn, ) -> impl Future<Output = Result<(Context<<S as RequestInspector<StateIn, RequestIn>>::StateOut>, <S as RequestInspector<StateIn, RequestIn>>::RequestOut), <S as RequestInspector<StateIn, RequestIn>>::Error>> + Send
Inspect the request, modify it if needed or desired, and return it.