From 7715609629a9931ad8e299684d9c85e7998d6ed1 Mon Sep 17 00:00:00 2001 From: trivernis Date: Sun, 10 Oct 2021 11:38:43 +0200 Subject: [PATCH] Implement Deserialize and Serialize for all types Signed-off-by: trivernis --- mediarepo-daemon/mediarepo-socket/src/types/requests.rs | 4 ++-- mediarepo-daemon/mediarepo-socket/src/types/responses.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mediarepo-daemon/mediarepo-socket/src/types/requests.rs b/mediarepo-daemon/mediarepo-socket/src/types/requests.rs index 0472571..d0e50f1 100644 --- a/mediarepo-daemon/mediarepo-socket/src/types/requests.rs +++ b/mediarepo-daemon/mediarepo-socket/src/types/requests.rs @@ -1,6 +1,6 @@ -use serde::Deserialize; +use serde::{Deserialize, Serialize}; -#[derive(Deserialize)] +#[derive(Serialize, Deserialize)] pub struct AddFileRequest { pub path: String, } diff --git a/mediarepo-daemon/mediarepo-socket/src/types/responses.rs b/mediarepo-daemon/mediarepo-socket/src/types/responses.rs index fe1c38d..d0a66f6 100644 --- a/mediarepo-daemon/mediarepo-socket/src/types/responses.rs +++ b/mediarepo-daemon/mediarepo-socket/src/types/responses.rs @@ -1,9 +1,9 @@ use chrono::NaiveDateTime; use mediarepo_model::file::File; use mediarepo_model::file_type::FileType; -use serde::Serialize; +use serde::{Deserialize, Serialize}; -#[derive(Clone, Debug, Serialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] pub struct FileResponse { pub name: Option, pub comment: Option, @@ -28,7 +28,7 @@ impl From for FileResponse { } } -#[derive(Clone, Debug, Serialize)] +#[derive(Clone, Debug, Deserialize, Serialize)] pub struct InfoResponse { pub name: String, pub version: String,