pub struct RelayPool { /* private fields */ }Implementations§
Source§impl RelayPool
impl RelayPool
Sourcepub fn shuffled_urls(&self) -> Vec<String>
pub fn shuffled_urls(&self) -> Vec<String>
Shuffle in place, sort failed to back, return all URLs.
Sourcepub fn shuffled_urls_n(&self, n: usize) -> Vec<String>
pub fn shuffled_urls_n(&self, n: usize) -> Vec<String>
Shuffle in place, sort failed to back, return up to n URLs.
pub fn mark_failed(&self, url: &str)
pub fn mark_alive(&self, url: &str)
Sourcepub fn refresh(&self, new_urls: impl IntoIterator<Item = String>)
pub fn refresh(&self, new_urls: impl IntoIterator<Item = String>)
Add new URLs to the pool.
pub fn is_empty(&self) -> bool
pub fn urls(&self) -> Vec<String>
Auto Trait Implementations§
impl !Freeze for RelayPool
impl RefUnwindSafe for RelayPool
impl Send for RelayPool
impl Sync for RelayPool
impl Unpin for RelayPool
impl UnsafeUnpin for RelayPool
impl UnwindSafe for RelayPool
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more