use std::{fmt, pin::Pin};
use http::{HeaderMap, StatusCode, Uri};
use crate::error::BoxError;
pub struct Attempt<'a> {
pub(crate) status: StatusCode,
pub(crate) headers: &'a HeaderMap,
pub(crate) location: &'a Uri,
pub(crate) previous: &'a Uri,
}
pub enum Action {
Follow,
Stop,
Pending(Pin<Box<dyn Future<Output = Action> + Send>>),
Error(BoxError),
}
impl fmt::Debug for Action {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
Action::Follow => f.debug_tuple("Follow").finish(),
Action::Stop => f.debug_tuple("Stop").finish(),
Action::Pending(_) => f.debug_tuple("Pending").finish(),
Action::Error(_) => f.debug_tuple("Error").finish(),
}
}
}