use std::collections::HashMap;
use std::fmt;
use std::sync::Arc;
use async_trait::async_trait;
use crate::error::CrawlError;
#[derive(Debug, Clone)]
pub struct BypassResponse {
pub status: u16,
pub content_type: String,
pub body: String,
pub body_bytes: Vec<u8>,
pub headers: HashMap<String, Vec<String>>,
pub final_url: String,
pub cost_usd: Option<f64>,
pub vendor_request_id: Option<String>,
}
#[async_trait]
pub trait BypassProvider: Send + Sync + fmt::Debug {
async fn fetch(&self, url: &str) -> Result<BypassResponse, CrawlError>;
fn vendor_name(&self) -> &'static str;
}
pub type DynBypassProvider = Arc<dyn BypassProvider>;