Struct ConnectInfo
pub struct ConnectInfo<T>(pub T);
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.
Fields
0: T
Trait Implementations
impl<S, T> FromRequestParts<S> for ConnectInfo<T>
where
S: Send + Sync,
T: Clone + Send + Sync + 'static,
type Rejection = <Extension<ConnectInfo<T>> as FromRequestParts<S>>::Rejection;async fn from_request_parts(parts: &mut Parts, state: &S) -> Result<Self, Self::Rejection>
impl<T> Deref for ConnectInfo<T>
type Target = T;fn deref(&self) -> &Self::Target
impl<T> DerefMut for ConnectInfo<T>
fn deref_mut(&mut self) -> &mut Self::Target
impl<T: Clone> Clone for ConnectInfo<T>
fn clone(&self) -> ConnectInfo<T>
impl<T: Copy> Copy for ConnectInfo<T>
impl<T: Debug> Debug for ConnectInfo<T>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl<T> Freeze for ConnectInfo<T>
where
T: Freeze,
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> UnsafeUnpin for ConnectInfo<T>
where
T: UnsafeUnpin,
impl<T> UnwindSafe for ConnectInfo<T>
where
T: UnwindSafe,
Blanket Implementations
impl<P, T> Receiver for ConnectInfo<T>
where
P: Deref<Target = T> + ?Sized,
T: ?Sized,
type Target = T;
impl<R> Rng for ConnectInfo<T>
where
R: RngCore + ?Sized,
impl<R> TryCryptoRng for ConnectInfo<T>
where
R: CryptoRng + ?Sized,
impl<R> TryRngCore for ConnectInfo<T>
where
R: RngCore + ?Sized,
type Error = never;fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>fn try_fill_bytes(&mut self, dst: &mut [u8]) -> Result<(), <R as TryRngCore>::Error>
impl<S, T> FromRequest<S, ViaParts> for ConnectInfo<T>
where
S: Send + Sync,
T: FromRequestParts<S>,
type Rejection = <T as FromRequestParts<S>>::Rejection;fn from_request(req: Request<Body>, state: &S) -> impl Future<Output = Result<T, <T as FromRequest<S, ViaParts>>::Rejection>>
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for ConnectInfo<T>
where
ST: ?Sized,
DT: ?Sized,
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for ConnectInfo<T>
where
ST: ?Sized,
DT: ?Sized,
impl<T> Any for ConnectInfo<T>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for ConnectInfo<T>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for ConnectInfo<T>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for ConnectInfo<T>
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> CryptoRng for ConnectInfo<T>
where
T: DerefMut,
<T as Deref>::Target: CryptoRng,
impl<T> From<T> for ConnectInfo<T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> FromRef<T> for ConnectInfo<T>
where
T: Clone,
fn from_ref(input: &T) -> T
impl<T> Instrument for ConnectInfo<T>
impl<T> Read<Exclusive, BecauseExclusive> for ConnectInfo<T>
where
T: ?Sized,
impl<T> RngCore for ConnectInfo<T>
where
T: DerefMut,
<T as Deref>::Target: RngCore,
fn next_u32(&mut self) -> u32fn next_u64(&mut self) -> u64fn fill_bytes(&mut self, dst: &mut [u8])
impl<T> Same for ConnectInfo<T>
type Output = T;
impl<T> ToOwned for ConnectInfo<T>
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T> WithSubscriber for ConnectInfo<T>
impl<T, U> Into<U> for ConnectInfo<T>
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 ConnectInfo<T>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for ConnectInfo<T>
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 ConnectInfo<T>
where
V: MultiLane<T>,
fn vzip(self) -> V