pub struct Connect<A, B, C, E> { /* private fields */ }Expand description
Creates a hyper connection
This accepts a hyper::client::conn::Builder and provides
a MakeService implementation to create connections from some
target A
Implementations§
Source§impl<A, B, C> Connect<A, B, C, DefaultExecutor>
impl<A, B, C> Connect<A, B, C, DefaultExecutor>
Sourcepub fn new(inner: C) -> Self
pub fn new(inner: C) -> Self
Create a new Connect.
The C argument is used to obtain new session layer instances
(AsyncRead + AsyncWrite). For each new client service returned, a
Service is returned that can be driven by poll_service and to send
requests via call.
Sourcepub fn with_builder(inner: C, builder: Builder) -> Self
pub fn with_builder(inner: C, builder: Builder) -> Self
Create a new Connect with a builder.
Source§impl<A, B, C, E> Connect<A, B, C, E>
impl<A, B, C, E> Connect<A, B, C, E>
Sourcepub fn with_executor(inner: C, builder: Builder, exec: E) -> Self
pub fn with_executor(inner: C, builder: Builder, exec: E) -> Self
Create a new Connect.
The C argument is used to obtain new session layer instances
(AsyncRead + AsyncWrite). For each new client service returned, a
Service is returned that can be driven by poll_service and to send
requests via call.
The E argument is the executor that the background task for the connection
will be spawned on.
Trait Implementations§
Source§impl<A, B, C, E> Service<A> for Connect<A, B, C, E>where
C: HttpMakeConnection<A> + 'static,
B: HttpBody + Send + 'static,
B::Data: Send,
B::Error: Into<Box<dyn Error + Send + Sync>>,
C::Connection: Send + 'static,
E: ConnectExecutor<C::Connection, B> + Clone,
impl<A, B, C, E> Service<A> for Connect<A, B, C, E>where
C: HttpMakeConnection<A> + 'static,
B: HttpBody + Send + 'static,
B::Data: Send,
B::Error: Into<Box<dyn Error + Send + Sync>>,
C::Connection: Send + 'static,
E: ConnectExecutor<C::Connection, B> + Clone,
Source§fn poll_ready(&mut self) -> Poll<(), Self::Error>
fn poll_ready(&mut self) -> Poll<(), Self::Error>
Check if the MakeConnection is ready for a new connection.
Source§fn call(&mut self, target: A) -> Self::Future
fn call(&mut self, target: A) -> Self::Future
Obtains a Connection on a single plaintext h2 connection to a remote.
Source§type Response = Connection<B>
type Response = Connection<B>
Source§type Error = ConnectError<<C as HttpMakeConnection<A>>::Error>
type Error = ConnectError<<C as HttpMakeConnection<A>>::Error>
Source§type Future = ConnectFuture<A, B, C, E>
type Future = ConnectFuture<A, B, C, E>
Auto Trait Implementations§
impl<A, B, C, E> Freeze for Connect<A, B, C, E>
impl<A, B, C, E> !RefUnwindSafe for Connect<A, B, C, E>
impl<A, B, C, E> Send for Connect<A, B, C, E>
impl<A, B, C, E> Sync for Connect<A, B, C, E>
impl<A, B, C, E> Unpin for Connect<A, B, C, E>
impl<A, B, C, E> !UnwindSafe for Connect<A, B, C, E>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<M, S, Target, Request> MakeService<Target, Request> for M
impl<M, S, Target, Request> MakeService<Target, Request> for M
Source§fn poll_ready(
&mut self,
) -> Result<Async<()>, <M as MakeService<Target, Request>>::MakeError>
fn poll_ready( &mut self, ) -> Result<Async<()>, <M as MakeService<Target, Request>>::MakeError>
Ready when the factory is able to process create more services. Read more