Struct axum::extract::connect_info::ConnectInfo
source · [−]pub struct ConnectInfo<T>(pub T);
Expand description
Extractor for getting connection information produced by a Connected
.
Note this extractor requires you to use
Router::into_make_service_with_connect_info
to run your app
otherwise it will fail at runtime.
See Router::into_make_service_with_connect_info
for more details.
Tuple Fields
0: T
Trait Implementations
sourceimpl<T: Clone> Clone for ConnectInfo<T>
impl<T: Clone> Clone for ConnectInfo<T>
sourcefn clone(&self) -> ConnectInfo<T>
fn clone(&self) -> ConnectInfo<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T: Debug> Debug for ConnectInfo<T>
impl<T: Debug> Debug for ConnectInfo<T>
sourceimpl<B, T> FromRequest<B> for ConnectInfo<T> where
B: Send,
T: Clone + Send + Sync + 'static,
impl<B, T> FromRequest<B> for ConnectInfo<T> where
B: Send,
T: Clone + Send + Sync + 'static,
type Rejection = <Extension<ConnectInfo<T>> as FromRequest<B>>::Rejection
type Rejection = <Extension<ConnectInfo<T>> as FromRequest<B>>::Rejection
If the extractor fails it’ll use this “rejection” type. A rejection is a kind of error that can be converted into a response. Read more
sourcefn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn from_request<'life0, 'async_trait>(
req: &'life0 mut RequestParts<B>
) -> Pin<Box<dyn Future<Output = Result<Self, Self::Rejection>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Perform the extraction.
impl<T: Copy> Copy for ConnectInfo<T>
Auto Trait Implementations
impl<T> RefUnwindSafe for ConnectInfo<T> where
T: RefUnwindSafe,
impl<T> Send for ConnectInfo<T> where
T: Send,
impl<T> Sync for ConnectInfo<T> where
T: Sync,
impl<T> Unpin for ConnectInfo<T> where
T: Unpin,
impl<T> UnwindSafe for ConnectInfo<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more