Struct Route

pub struct Route<E = Infallible>(/* private field */);

How routes are stored inside a Router.

You normally shouldn't need to care about this type. It's used in Router::layer.

Trait Implementations

impl<B, E> Service<Request<B>> for Route<E> where B: HttpBody<Data = Bytes> + Send + 'static, B::Error: Into<BoxError>,

type Response = Response<Body>;
type Error = E;
type Future = RouteFuture<E>;
fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
fn call(&mut self, req: Request<B>) -> Self::Future

impl<E> Clone for Route<E>

fn clone(&self) -> Self

impl<E> Debug for Route<E>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Auto Trait Implementations

impl<E = never> !RefUnwindSafe for Route<E>

impl<E = never> !UnwindSafe for Route<E>

impl<E> Freeze for Route<E> where BoxCloneSyncService<Request<Body>, Response<Body>, E>: Freeze,

impl<E> Send for Route<E> where BoxCloneSyncService<Request<Body>, Response<Body>, E>: Send,

impl<E> Sync for Route<E> where BoxCloneSyncService<Request<Body>, Response<Body>, E>: Sync,

impl<E> Unpin for Route<E> where BoxCloneSyncService<Request<Body>, Response<Body>, E>: Unpin,

impl<E> UnsafeUnpin for Route<E> where BoxCloneSyncService<Request<Body>, Response<Body>, E>: UnsafeUnpin,

Blanket Implementations

impl<S, R> ServiceExt<R> for Route<E> 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 Route<E> where ST: ?Sized, DT: ?Sized,

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for Route<E> where ST: ?Sized, DT: ?Sized,

impl<T> Any for Route<E> where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for Route<E> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for Route<E> where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for Route<E> where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for Route<E>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> FromRef<T> for Route<E> where T: Clone,

fn from_ref(input: &T) -> T

impl<T> Instrument for Route<E>

impl<T> Read<Exclusive, BecauseExclusive> for Route<E> where T: ?Sized,

impl<T> Same for Route<E>

type Output = T;

impl<T> ToOwned for Route<E> where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T> WithSubscriber for Route<E>

impl<T, Request> ServiceExt<Request> for Route<E> where T: Service<Request> + ?Sized,

impl<T, U> Into<U> for Route<E> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for Route<E> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for Route<E> 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 Route<E> where V: MultiLane<T>,

fn vzip(self) -> V