[][src]Trait srv_rs::resolver::SrvResolver

pub trait SrvResolver: Send + Sync {
    type Record: SrvRecord;
    type Error: Error + 'static;
#[must_use]    pub 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
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; #[must_use] pub 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
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
pub fn order_srv_records(records: &mut [Self::Record], rng: impl Rng) { ... } }

Represents the ability to act as a SRV resolver.

Associated Types

type Record: SrvRecord[src]

SRV record representation produced by the resolver.

type Error: Error + 'static[src]

Errors encountered during SRV resolution.

Loading content...

Required methods

#[must_use]pub 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
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

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.

Loading content...

Provided methods

#[must_use]pub 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
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

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.

pub fn order_srv_records(records: &mut [Self::Record], rng: impl Rng)[src]

Sorts SRV records by priority and weight per RFC 2782.

Loading content...

Implementations on Foreign Types

impl<C, P> SrvResolver for AsyncResolver<C, P> where
    C: DnsHandle,
    P: ConnectionProvider<Conn = C>, 
[src]

type Record = SRV

type Error = ResolveError

Loading content...

Implementors

impl SrvResolver for LibResolv[src]

type Record = LibResolvSrvRecord

type Error = LibResolvError

Loading content...