Skip to main content

unsplash_api/objects/
photo.rs

1use serde::{Deserialize, Serialize};
2use url::Url;
3
4use crate::objects::user::User;
5
6#[derive(Deserialize, Serialize, Debug, Clone)]
7pub struct Photo {
8    pub id: String,
9    pub width: usize,
10    pub height: usize,
11    pub color: String,
12    pub blur_hash: Option<String>,
13    pub urls: PhotoUrls,
14    pub user: User,
15}
16
17#[derive(Deserialize, Serialize, Debug, Clone)]
18pub struct PhotoUrls {
19    pub raw: Url,
20    pub full: Url,
21    pub regular: Url,
22    pub small: Url,
23    pub thumb: Url,
24}