pub struct Connector { /* private fields */ }Expand description
Tcp connector
Implementations§
Source§impl Connector
impl Connector
Sourcepub fn new(cfg: ResolverConfig, opts: ResolverOpts) -> Self
pub fn new(cfg: ResolverConfig, opts: ResolverOpts) -> Self
Create new connector with resolver configuration
Sourcepub fn with_resolver(
resolver: Resolver<Connect>,
) -> impl Service<Request = Connect, Response = (Connect, TcpStream), Error = ConnectorError> + Clone
pub fn with_resolver( resolver: Resolver<Connect>, ) -> impl Service<Request = Connect, Response = (Connect, TcpStream), Error = ConnectorError> + Clone
Create new connector with custom resolver
Sourcepub fn new_service_with_config<E>(
cfg: ResolverConfig,
opts: ResolverOpts,
) -> impl NewService<(), Request = Connect, Response = (Connect, TcpStream), Error = ConnectorError, InitError = E> + Clone
pub fn new_service_with_config<E>( cfg: ResolverConfig, opts: ResolverOpts, ) -> impl NewService<(), Request = Connect, Response = (Connect, TcpStream), Error = ConnectorError, InitError = E> + Clone
Create new default connector service
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Connector
impl !RefUnwindSafe for Connector
impl Send for Connector
impl Sync for Connector
impl Unpin for Connector
impl !UnwindSafe for Connector
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoService<T> for Twhere
T: Service,
impl<T> IntoService<T> for Twhere
T: Service,
Source§fn into_service(self) -> T
fn into_service(self) -> T
Convert to a
ServiceSource§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn apply_fn<F, B, B1, Out>(
self,
service: B1,
f: F,
) -> AndThenApply<Self, B, F, Out>where
Self: Sized,
F: FnMut(Self::Response, &mut B) -> Out,
Out: IntoFuture,
<Out as IntoFuture>::Error: Into<Self::Error>,
B: Service<Error = Self::Error>,
B1: IntoService<B>,
fn apply_fn<F, B, B1, Out>(
self,
service: B1,
f: F,
) -> AndThenApply<Self, B, F, Out>where
Self: Sized,
F: FnMut(Self::Response, &mut B) -> Out,
Out: IntoFuture,
<Out as IntoFuture>::Error: Into<Self::Error>,
B: Service<Error = Self::Error>,
B1: IntoService<B>,
Apply function to specified service and use it as a next service in
chain.
Source§fn and_then<F, B>(self, service: F) -> AndThen<Self, B>
fn and_then<F, B>(self, service: F) -> AndThen<Self, B>
Call another service after call to this one has resolved successfully. Read more
Source§fn then<B>(self, service: B) -> Then<Self, B>
fn then<B>(self, service: B) -> Then<Self, B>
Chain on a computation for when a call to the service finished,
passing the result of the call to the next service
B. Read more