pub trait ScionDnsResolver: Send + Sync {
// Required method
fn resolve<'life0, 'life1, 'async_trait>(
&'life0 self,
domain: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ScionIpAddr>, ResolveError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
DNS resolver trait for SCION address discovery.
Implementations return zero or more ScionAddr values for a given domain
name. The resolver is expected to be async and safe to share across tasks.
§Error handling
Implementations SHOULD return ResolveError::NoValidEntries when a lookup
completes but yields no valid SCION TXT entries, which includes a name that
has no TXT records at all and a name that does not exist. Lookups that never
complete (timeout, network error, server failure) SHOULD return
ResolveError::DnsLookup, the only outcome a retry can change; callers
branch on that with ResolveError::is_transient rather than on the
variants. Partial failures SHOULD return the valid addresses and log
warnings for invalid entries.
Required Methods§
Sourcefn resolve<'life0, 'life1, 'async_trait>(
&'life0 self,
domain: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ScionIpAddr>, ResolveError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve<'life0, 'life1, 'async_trait>(
&'life0 self,
domain: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<ScionIpAddr>, ResolveError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Resolve a domain into SCION addresses.
Implementations SHOULD return only valid addresses and log warnings for invalid TXT entries. Errors are reserved for lookup failures or when no valid addresses can be produced.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".