pub struct SrvClient<Resolver, Policy: Policy = Affinity> { /* private fields */ }Expand description
Client for intelligently performing operations on a service located by SRV records.
§Usage
After being created by SrvClient::new or SrvClient::new_with_resolver,
operations can be performed on the service pointed to by a SrvClient with
the execute and execute_stream methods.
§DNS Resolvers
The resolver used to lookup SRV records is determined by a client’s
SrvResolver, and can be set with SrvClient::resolver.
§SRV Target Selection Policies
SRV target selection order is determined by a client’s Policy,
and can be set with SrvClient::policy.
Implementations§
Source§impl<Resolver: SrvResolver, Policy: Policy> SrvClient<Resolver, Policy>
impl<Resolver: SrvResolver, Policy: Policy> SrvClient<Resolver, Policy>
Sourcepub async fn get_fresh_uri_candidates(
&self,
) -> Result<(Vec<Url>, Instant), Error<Resolver::Error>>
pub async fn get_fresh_uri_candidates( &self, ) -> Result<(Vec<Url>, Instant), Error<Resolver::Error>>
Gets a fresh set of SRV records from a client’s DNS resolver and parses their target/port pairs into URIs, which are returned along with the time they’re valid until–i.e., the time a cache containing these URIs should expire.
Source§impl<Resolver, Policy: Policy> SrvClient<Resolver, Policy>
impl<Resolver, Policy: Policy> SrvClient<Resolver, Policy>
Sourcepub fn policy<P: Policy>(self, policy: P) -> SrvClient<Resolver, P>
pub fn policy<P: Policy>(self, policy: P) -> SrvClient<Resolver, P>
Sets the policy of the client.
Sourcepub fn http_scheme(self, http_scheme: Scheme) -> Self
pub fn http_scheme(self, http_scheme: Scheme) -> Self
Sets the http scheme of the client.
Sourcepub fn path_prefix(self, path_prefix: impl ToString) -> Self
pub fn path_prefix(self, path_prefix: impl ToString) -> Self
Sets the path prefix of the client.