pub struct EyeballSet<F, T, E> { /* private fields */ }Expand description
Implements the Happy Eyeballs algorithm for connecting to a set of addresses.
This algorithm is used to connect to a set of addresses in parallel, with a delay between each attempt. The first successful connection is returned.
When the timeout is not set, the algorithm will attempt to connect to only
one address at a time.
To connect to all addresses simultaneously, set the timeout to zero.
Implementations§
Source§impl<F, T, E> EyeballSet<F, T, E>
impl<F, T, E> EyeballSet<F, T, E>
Sourcepub fn new(configuration: EyeballConfiguration) -> Self
pub fn new(configuration: EyeballConfiguration) -> Self
Create a new EyeballSet with an optional timeout.
The timeout is the amount of time between individual connection attempts.
Source§impl<F, T, E> EyeballSet<F, T, E>
impl<F, T, E> EyeballSet<F, T, E>
Sourcepub async fn finish(&mut self) -> Result<T, HappyEyeballsError<E>>
pub async fn finish(&mut self) -> Result<T, HappyEyeballsError<E>>
Finish the happy eyeballs algorithm, returning the first successful connection.
Trait Implementations§
Source§impl<F, T, E> Extend<F> for EyeballSet<F, T, E>
impl<F, T, E> Extend<F> for EyeballSet<F, T, E>
Source§fn extend<I: IntoIterator<Item = F>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = F>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<F, T, E> IntoFuture for EyeballSet<F, T, E>
impl<F, T, E> IntoFuture for EyeballSet<F, T, E>
Source§type Output = Result<T, HappyEyeballsError<E>>
type Output = Result<T, HappyEyeballsError<E>>
The output that the future will produce on completion.
Source§type IntoFuture = Pin<Box<dyn Future<Output = <EyeballSet<F, T, E> as IntoFuture>::Output> + Send>>
type IntoFuture = Pin<Box<dyn Future<Output = <EyeballSet<F, T, E> as IntoFuture>::Output> + Send>>
Which kind of future are we turning this into?
Source§fn into_future(self) -> Self::IntoFuture
fn into_future(self) -> Self::IntoFuture
Creates a future from a value. Read more
Auto Trait Implementations§
impl<F, T, E> !Freeze for EyeballSet<F, T, E>
impl<F, T, E> !RefUnwindSafe for EyeballSet<F, T, E>
impl<F, T, E> Send for EyeballSet<F, T, E>
impl<F, T, E> Sync for EyeballSet<F, T, E>
impl<F, T, E> Unpin for EyeballSet<F, T, E>
impl<F, T, E> !UnwindSafe for EyeballSet<F, T, E>
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