pub struct Connect<T> { /* private fields */ }Expand description
Connect request
Implementations§
source§impl<T: Address> Connect<T>
 
impl<T: Address> Connect<T>
sourcepub fn new(req: T) -> Connect<T>
 
pub fn new(req: T) -> Connect<T>
Create Connect instance by spliting the string by ‘:’ and convert the second part to u16
sourcepub fn with(req: T, addr: SocketAddr) -> Connect<T>
 
pub fn with(req: T, addr: SocketAddr) -> Connect<T>
Create new Connect instance from host and address. Connector skips name resolution stage for such connect messages.
sourcepub fn set_port(self, port: u16) -> Self
 
pub fn set_port(self, port: u16) -> Self
Use port if address does not provide one.
By default it set to 0
sourcepub fn set_addr(self, addr: Option<SocketAddr>) -> Self
 
pub fn set_addr(self, addr: Option<SocketAddr>) -> Self
Use address.
sourcepub fn set_addrs<I>(self, addrs: I) -> Selfwhere
    I: IntoIterator<Item = SocketAddr>,
 
pub fn set_addrs<I>(self, addrs: I) -> Selfwhere
    I: IntoIterator<Item = SocketAddr>,
Use addresses.
sourcepub fn take_addrs(&mut self) -> ConnectTakeAddrsIter
 
pub fn take_addrs(&mut self) -> ConnectTakeAddrsIter
Takes preresolved addresses of the request.
Trait Implementations§
source§impl<T: PartialEq> PartialEq for Connect<T>
 
impl<T: PartialEq> PartialEq for Connect<T>
source§impl<T: Address> Service<Connect<T>> for Connector<T>
 
impl<T: Address> Service<Connect<T>> for Connector<T>
§type Error = ConnectError
 
type Error = ConnectError
Errors produced by the service when polling readiness or executing call.
source§async fn call(
    &self,
    req: Connect<T>,
    _: ServiceCtx<'_, Self>
) -> Result<Self::Response, Self::Error>
 
async fn call( &self, req: Connect<T>, _: ServiceCtx<'_, Self> ) -> Result<Self::Response, Self::Error>
Process the request and return the response asynchronously. Read more
source§fn poll_ready(&self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
 
fn poll_ready(&self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns 
Ready when the service is able to process requests. Read moresource§impl<T: Address> Service<Connect<T>> for Resolver<T>
 
impl<T: Address> Service<Connect<T>> for Resolver<T>
§type Error = ConnectError
 
type Error = ConnectError
Errors produced by the service when polling readiness or executing call.
source§async fn call(
    &self,
    req: Connect<T>,
    _: ServiceCtx<'_, Self>
) -> Result<Connect<T>, Self::Error>
 
async fn call( &self, req: Connect<T>, _: ServiceCtx<'_, Self> ) -> Result<Connect<T>, Self::Error>
Process the request and return the response asynchronously. Read more
source§fn poll_ready(&self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
 
fn poll_ready(&self, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>>
Returns 
Ready when the service is able to process requests. Read moresource§impl<T: Address, C> ServiceFactory<Connect<T>, C> for Connector<T>
 
impl<T: Address, C> ServiceFactory<Connect<T>, C> for Connector<T>
§type Error = ConnectError
 
type Error = ConnectError
Errors produced by the created services.
source§async fn create(&self, _: C) -> Result<Self::Service, Self::InitError>
 
async fn create(&self, _: C) -> Result<Self::Service, Self::InitError>
Create and return a new service value asynchronously.
source§async fn pipeline(
    &self,
    cfg: Cfg
) -> Result<Pipeline<Self::Service>, Self::InitError>where
    Self: Sized,
 
async fn pipeline(
    &self,
    cfg: Cfg
) -> Result<Pipeline<Self::Service>, Self::InitError>where
    Self: Sized,
Create and return a new service value asynchronously and wrap into a container
source§fn map<F, Res>(
    self,
    f: F
) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
 
fn map<F, Res>( self, f: F ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
Map this service’s output to a different type, returning a new service
of the resulting type.
source§fn map_err<F, E>(
    self,
    f: F
) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
 
fn map_err<F, E>( self, f: F ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
Map this service’s error to a different error, returning a new service.
source§fn map_init_err<F, E>(
    self,
    f: F
) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
 
fn map_init_err<F, E>( self, f: F ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
Map this factory’s init error to a different error, returning a new service.
source§impl<T: Address, C> ServiceFactory<Connect<T>, C> for Resolver<T>
 
impl<T: Address, C> ServiceFactory<Connect<T>, C> for Resolver<T>
§type Error = ConnectError
 
type Error = ConnectError
Errors produced by the created services.
source§async fn create(&self, _: C) -> Result<Self::Service, Self::InitError>
 
async fn create(&self, _: C) -> Result<Self::Service, Self::InitError>
Create and return a new service value asynchronously.
source§async fn pipeline(
    &self,
    cfg: Cfg
) -> Result<Pipeline<Self::Service>, Self::InitError>where
    Self: Sized,
 
async fn pipeline(
    &self,
    cfg: Cfg
) -> Result<Pipeline<Self::Service>, Self::InitError>where
    Self: Sized,
Create and return a new service value asynchronously and wrap into a container
source§fn map<F, Res>(
    self,
    f: F
) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
 
fn map<F, Res>( self, f: F ) -> ServiceChainFactory<MapFactory<Self, F, Req, Res, Cfg>, Req, Cfg>
Map this service’s output to a different type, returning a new service
of the resulting type.
source§fn map_err<F, E>(
    self,
    f: F
) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
 
fn map_err<F, E>( self, f: F ) -> ServiceChainFactory<MapErrFactory<Self, Req, Cfg, F, E>, Req, Cfg>
Map this service’s error to a different error, returning a new service.
source§fn map_init_err<F, E>(
    self,
    f: F
) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
 
fn map_init_err<F, E>( self, f: F ) -> ServiceChainFactory<MapInitErr<Self, Req, Cfg, F, E>, Req, Cfg>
Map this factory’s init error to a different error, returning a new service.
impl<T: Eq> Eq for Connect<T>
impl<T> StructuralPartialEq for Connect<T>
Auto Trait Implementations§
impl<T> Freeze for Connect<T>where
    T: Freeze,
impl<T> RefUnwindSafe for Connect<T>where
    T: RefUnwindSafe,
impl<T> Send for Connect<T>where
    T: Send,
impl<T> Sync for Connect<T>where
    T: Sync,
impl<T> Unpin for Connect<T>where
    T: Unpin,
impl<T> UnwindSafe for Connect<T>where
    T: UnwindSafe,
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