mirror of
https://github.com/euzu/tuliprox.git
synced 2026-10-12 02:42:30 +02:00
25 lines
568 B
Rust
25 lines
568 B
Rust
use actix_web::web;
|
|
use serde::{Deserialize, Serialize};
|
|
use crate::config::Config;
|
|
|
|
pub(crate) struct AppState {
|
|
pub config: Config,
|
|
}
|
|
|
|
#[derive(Deserialize, Serialize, Debug, Clone)]
|
|
pub(crate) struct PlaylistRequest {
|
|
pub(crate) url: String,
|
|
}
|
|
|
|
impl From<web::Json<PlaylistRequest>> for PlaylistRequest {
|
|
fn from(req: web::Json<PlaylistRequest>) -> Self {
|
|
PlaylistRequest {
|
|
url: String::from(&req.url),
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Deserialize, Serialize, Debug, Clone)]
|
|
pub(crate) struct ServerConfig {
|
|
pub sources: Vec<String>,
|
|
} |