feat: add useful derives to structs/enums

This commit is contained in:
Radical 2025-05-20 13:18:29 +02:00
parent ea057c1db3
commit 0c6c5174b5
2 changed files with 4 additions and 1 deletions

View file

@ -11,6 +11,7 @@ use serde::Deserialize;
use url::Url; use url::Url;
/// Endpoints for Edge Storage API /// Endpoints for Edge Storage API
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Endpoint { pub enum Endpoint {
/// Uses https://storage.bunnycdn.com as endpoint /// Uses https://storage.bunnycdn.com as endpoint
Frankfurt, Frankfurt,
@ -54,7 +55,7 @@ impl TryInto<Url> for Endpoint {
} }
/// File information returned by list /// File information returned by list
#[derive(Deserialize, Debug)] #[derive(Deserialize, Debug, Clone)]
#[serde(rename_all = "PascalCase")] #[serde(rename_all = "PascalCase")]
pub struct ListFile { pub struct ListFile {
/// ?? /// ??
@ -90,6 +91,7 @@ pub struct ListFile {
} }
/// Edge Storage API for bunny /// Edge Storage API for bunny
#[derive(Debug, Clone)]
pub struct Storage { pub struct Storage {
pub(crate) url: Url, pub(crate) url: Url,
pub(crate) reqwest: Arc<Client>, pub(crate) reqwest: Arc<Client>,

View file

@ -31,6 +31,7 @@ pub mod edge_storage;
pub mod error; pub mod error;
/// API Client for bunny /// API Client for bunny
#[derive(Debug, Clone)]
pub struct Client { pub struct Client {
/// Used to interact with the Edge Storage API /// Used to interact with the Edge Storage API
pub storage: edge_storage::Storage, pub storage: edge_storage::Storage,