reqwest_cross/traits/
native.rsuse std::future::Future;
pub trait ResponseHandler<Fut, O>:
Send + 'static + FnOnce(reqwest::Result<reqwest::Response>) -> Fut
where
Fut: BoundedFuture<O>,
{
}
impl<T, Fut, O> ResponseHandler<Fut, O> for T
where
T: Send + 'static + FnOnce(reqwest::Result<reqwest::Response>) -> Fut,
Fut: BoundedFuture<O>,
{
}
pub trait DoneHandler<O>: 'static + Send + FnOnce(reqwest::Result<reqwest::Response>) -> O
where
O: BoundedFuture<()>,
{
}
impl<T, O: BoundedFuture<()>> DoneHandler<O> for T where
T: 'static + Send + FnOnce(reqwest::Result<reqwest::Response>) -> O
{
}
pub trait BoundedFuture<O>: Future<Output = O> + Send {}
impl<T, O> BoundedFuture<O> for T where T: Future<Output = O> + Send {}
pub trait UiCallBack: 'static + Send + FnOnce() {}
impl<T> UiCallBack for T where T: 'static + Send + FnOnce() {}
pub trait ValidReturn: Send + 'static {}
impl<T: Send + 'static> ValidReturn for T {}