use std::time::Duration;
use crate::{ErrorCategory, RetryClassification};
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum RequestEventKind {
AttemptStarted,
AttemptSucceeded,
AttemptFailed,
RetryScheduled,
RegionRedirected,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct RequestEvent<'a> {
pub kind: RequestEventKind,
pub method: &'a str,
pub attempt: u32,
pub error_category: Option<ErrorCategory>,
pub retry_classification: Option<RetryClassification>,
pub retry_delay: Option<Duration>,
}
pub trait RequestObserver: Send + Sync {
fn on_event(&self, event: RequestEvent<'_>);
}