reqwest-lb 0.3.1

The reqwest load balancer middleware
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::supplier::Supplier;
use std::convert::Infallible;
use std::future::{ready, Ready};

impl<T: IntoIterator + Clone> Supplier for T {
    type Element = T::Item;
    type Error = Infallible;
    type Future = Ready<Result<Vec<Self::Element>, Self::Error>>;

    fn get(&self) -> Self::Future {
        let elements = self.clone();
        ready(Ok(elements.into_iter().collect()))
    }
}