atac 0.19.0

Arguably a Terminal API Client. Feature-full, free, open-source, offline and account-less.
use image::DynamicImage;
use serde::{Deserialize, Serialize};

#[derive(Default, Debug, Clone, Serialize, Deserialize)]
pub struct RequestResponse {
    #[serde(skip)]
    pub duration: Option<String>,

    #[serde(skip)]
    pub status_code: Option<String>,

    pub content: Option<ResponseContent>,

    pub cookies: Option<String>,
    pub headers: Vec<(String, String)>
}

#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum ResponseContent {
    Body(String),
    Image(ImageResponse)
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ImageResponse {
    pub data: Vec<u8>,
    #[serde(skip)]
    pub image: Option<DynamicImage>
}