pub struct ConnectInfo<R> { /* private fields */ }
Expand description

Connection request information.

May contain known/pre-resolved socket address(es) or a host that needs resolving with DNS.

Implementations

Constructs new connection info using a request.

Constructs new connection info from request and known socket address.

Since socket address is known, Connector will skip the DNS resolution step.

Set connection port.

If request provided a port, this will override it.

Set connection socket address.

Set list of addresses.

Set local address to connection with.

Useful in situations where the IP address bound to a particular network interface is known. This would make sure the socket is opened through that interface.

Returns a reference to the connection request.

Returns request hostname.

Returns request port.

Get borrowed iterator of resolved request addresses.

Examples
let addr = SocketAddr::from(([127, 0, 0, 1], 4242));

let conn = ConnectInfo::new("localhost");
let mut addrs = conn.addrs();
assert!(addrs.next().is_none());

let conn = ConnectInfo::with_addr("localhost", addr);
let mut addrs = conn.addrs();
assert_eq!(addrs.next().unwrap(), addr);

Take owned iterator resolved request addresses.

Examples
let addr = SocketAddr::from(([127, 0, 0, 1], 4242));

let mut conn = ConnectInfo::new("localhost");
let mut addrs = conn.take_addrs();
assert!(addrs.next().is_none());

let mut conn = ConnectInfo::with_addr("localhost", addr);
let mut addrs = conn.take_addrs();
assert_eq!(addrs.next().unwrap(), addr);

Trait Implementations

Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Responses given by the service.
Errors produced by the service when polling readiness or executing call.
The future response value.
Returns Ready when the service is able to process requests. Read more
Process the request and return the response asynchronously. Read more
Responses given by the service.
Errors produced by the service when polling readiness or executing call.
The future response value.
Returns Ready when the service is able to process requests. Read more
Process the request and return the response asynchronously. Read more
Responses given by the service.
Errors produced by the service when polling readiness or executing call.
The future response value.
Returns Ready when the service is able to process requests. Read more
Process the request and return the response asynchronously. Read more
Responses given by the created services.
Errors produced by the created services.
Service factory configuration.
The kind of Service created by this factory.
Errors potentially raised while building a service.
The future of the Service instance.g
Create and return a new service asynchronously.
Responses given by the created services.
Errors produced by the created services.
Service factory configuration.
The kind of Service created by this factory.
Errors potentially raised while building a service.
The future of the Service instance.g
Create and return a new service asynchronously.
Responses given by the created services.
Errors produced by the created services.
Service factory configuration.
The kind of Service created by this factory.
Errors potentially raised while building a service.
The future of the Service instance.g
Create and return a new service asynchronously.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more