pub struct Affinity { /* private fields */ }
Expand description
Policy that selects targets based on past successes–if a target was used successfully in a past execution, it will be recommended first.
Trait Implementations§
Source§impl Policy for Affinity
impl Policy for Affinity
Source§type Ordering = AffinityUriIter
type Ordering = AffinityUriIter
Iterator of indices used to order cache items.
Source§fn refresh_cache<'life0, 'life1, 'async_trait, Resolver>(
&'life0 self,
client: &'life1 SrvClient<Resolver, Self>,
) -> Pin<Box<dyn Future<Output = Result<Cache<Self::CacheItem>, Error<Resolver::Error>>> + Send + 'async_trait>>where
Resolver: 'async_trait + SrvResolver,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn refresh_cache<'life0, 'life1, 'async_trait, Resolver>(
&'life0 self,
client: &'life1 SrvClient<Resolver, Self>,
) -> Pin<Box<dyn Future<Output = Result<Cache<Self::CacheItem>, Error<Resolver::Error>>> + Send + 'async_trait>>where
Resolver: 'async_trait + SrvResolver,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Obtains a refreshed cache for a client.
Source§fn order(&self, uris: &[Uri]) -> Self::Ordering
fn order(&self, uris: &[Uri]) -> Self::Ordering
Creates an iterator of indices corresponding to cache items in the
order a
SrvClient
should try using them to perform an operation.Source§fn cache_item_to_uri(item: &Self::CacheItem) -> &Uri
fn cache_item_to_uri(item: &Self::CacheItem) -> &Uri
Converts a reference to a cached item into a reference to a
Uri
.Source§fn note_success(&self, uri: &Uri)
fn note_success(&self, uri: &Uri)
Makes any policy adjustments following a successful execution on
uri
.Source§fn note_failure(&self, uri: &Uri)
fn note_failure(&self, uri: &Uri)
Makes any policy adjustments following a failed execution on
uri
.Auto Trait Implementations§
impl !Freeze for Affinity
impl RefUnwindSafe for Affinity
impl Send for Affinity
impl Sync for Affinity
impl Unpin for Affinity
impl UnwindSafe for Affinity
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