Struct RouterAsService
pub struct RouterAsService<'a, B, S = ()> { /* private fields */ }
A Router converted into a borrowed Service with a fixed body type.
See Router::as_service for more details.
Trait Implementations
impl<B> Service<Request<B>> for RouterAsService<'_, B, ()>
where
B: HttpBody<Data = Bytes> + Send + 'static,
B::Error: Into<BoxError>,
type Response = Response<Body>;type Error = never;type Future = RouteFuture<never>;fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>fn call(&mut self, req: Request<B>) -> Self::Future
impl<B, S> Debug for RouterAsService<'_, B, S>
where
S: Debug,
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl<'a, B, S = ()> !RefUnwindSafe for RouterAsService<'a, B, S>
impl<'a, B, S = ()> !UnwindSafe for RouterAsService<'a, B, S>
impl<'a, B, S> Freeze for RouterAsService<'a, B, S>
where
&'a mut Router<S>: Freeze,
PhantomData<fn(B)>: Freeze,
impl<'a, B, S> Send for RouterAsService<'a, B, S>
where
&'a mut Router<S>: Send,
PhantomData<fn(B)>: Send,
impl<'a, B, S> Sync for RouterAsService<'a, B, S>
where
&'a mut Router<S>: Sync,
PhantomData<fn(B)>: Sync,
impl<'a, B, S> Unpin for RouterAsService<'a, B, S>
where
&'a mut Router<S>: Unpin,
PhantomData<fn(B)>: Unpin,
impl<'a, B, S> UnsafeUnpin for RouterAsService<'a, B, S>
where
&'a mut Router<S>: UnsafeUnpin,
PhantomData<fn(B)>: UnsafeUnpin,
Blanket Implementations
impl<S, R> ServiceExt<R> for RouterAsService<'a, B, S>
where
S: Service<R>,
fn into_make_service(self) -> IntoMakeService<S>fn into_make_service_with_connect_info<C>(self) -> IntoMakeServiceWithConnectInfo<S, C>
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for RouterAsService<'a, B, S>
where
ST: ?Sized,
DT: ?Sized,
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for RouterAsService<'a, B, S>
where
ST: ?Sized,
DT: ?Sized,
impl<T> Any for RouterAsService<'a, B, S>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for RouterAsService<'a, B, S>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for RouterAsService<'a, B, S>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for RouterAsService<'a, B, S>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Instrument for RouterAsService<'a, B, S>
impl<T> Read<Exclusive, BecauseExclusive> for RouterAsService<'a, B, S>
where
T: ?Sized,
impl<T> Same for RouterAsService<'a, B, S>
type Output = T;
impl<T> WithSubscriber for RouterAsService<'a, B, S>
impl<T, Request> ServiceExt<Request> for RouterAsService<'a, B, S>
where
T: Service<Request> + ?Sized,
impl<T, U> Into<U> for RouterAsService<'a, B, S>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for RouterAsService<'a, B, S>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for RouterAsService<'a, B, S>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
impl<V, T> VZip<V> for RouterAsService<'a, B, S>
where
V: MultiLane<T>,
fn vzip(self) -> V