Struct mtop_client::DiscoveryDefault
source · pub struct DiscoveryDefault { /* private fields */ }Expand description
Service discovery implementation for finding Memcached servers using DNS.
Different types of DNS records and different behaviors are used based on the
presence of specific prefixes for hostnames. See resolve_by_proto for details.
Implementations§
source§impl DiscoveryDefault
impl DiscoveryDefault
pub fn new(client: DnsClient) -> Self
sourcepub async fn resolve(&self, name: &str) -> Result<Vec<Server>, MtopError>
pub async fn resolve(&self, name: &str) -> Result<Vec<Server>, MtopError>
Resolve a hostname to one or multiple Memcached servers based on DNS records
and the presence of proto+ prefixes on the hostnames.
dns+will resolve a hostname into multiple A and AAAA records and use the IP addresses from the records as Memcached servers.dnssrv+will resolve a hostname into multiple SRV records and use the unresolved targets from the SRV records as Memcached servers. Resolution of the targets to IP addresses will happen at connection time using the system resolver.- No prefix with an IPv4 or IPv6 address will use the IP address as a Memcached server.
- No prefix with a non-IP address will use the host as a Memcached server. Resolution of the host to an IP address will happen at connection time using the system resolver.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for DiscoveryDefault
impl !RefUnwindSafe for DiscoveryDefault
impl Send for DiscoveryDefault
impl Sync for DiscoveryDefault
impl Unpin for DiscoveryDefault
impl !UnwindSafe for DiscoveryDefault
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