pub trait SrvResolver: Send + Sync {
type Record: SrvRecord;
type Error: Error + 'static;
// Required method
fn get_srv_records_unordered<'life0, 'life1, 'async_trait>(
&'life0 self,
srv: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(Vec<Self::Record>, Instant), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn get_srv_records<'life0, 'life1, 'async_trait>(
&'life0 self,
srv: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(Vec<Self::Record>, Instant), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn order_srv_records(records: &mut [Self::Record], rng: impl Rng) { ... }
}
Expand description
Represents the ability to act as a SRV resolver.
Required Associated Types§
Required Methods§
Sourcefn get_srv_records_unordered<'life0, 'life1, 'async_trait>(
&'life0 self,
srv: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(Vec<Self::Record>, Instant), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_srv_records_unordered<'life0, 'life1, 'async_trait>(
&'life0 self,
srv: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(Vec<Self::Record>, Instant), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Gets the records corresponding to a srv name without sorting by priority or shuffling based on weight, returning them along with the time they’re valid until.
Provided Methods§
Sourcefn get_srv_records<'life0, 'life1, 'async_trait>(
&'life0 self,
srv: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(Vec<Self::Record>, Instant), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_srv_records<'life0, 'life1, 'async_trait>(
&'life0 self,
srv: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(Vec<Self::Record>, Instant), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Gets the records corresponding to a srv name, sorting by priority and shuffling based on weight, returning them along with the time they’re valid until.
Sourcefn order_srv_records(records: &mut [Self::Record], rng: impl Rng)
fn order_srv_records(records: &mut [Self::Record], rng: impl Rng)
Sorts SRV records by priority and weight per RFC 2782.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.