From 3edddb0aea423a6f41da7597aec1836b015bc6bb Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sun, 19 Feb 2023 16:17:13 +0100 Subject: api errors in json --- common/src/api.rs | 15 +++++++++++++++ common/src/lib.rs | 1 + 2 files changed, 16 insertions(+) create mode 100644 common/src/api.rs (limited to 'common/src') diff --git a/common/src/api.rs b/common/src/api.rs new file mode 100644 index 0000000..c01053c --- /dev/null +++ b/common/src/api.rs @@ -0,0 +1,15 @@ +use serde::{Deserialize, Serialize}; +use crate::{DirectoryInfo, ItemInfo}; + +#[derive(Debug, Clone, Serialize, Deserialize)] +pub enum ApiNode { + Directory { + identifier: String, + info: DirectoryInfo, + children: Vec, + }, + Item { + identifier: String, + info: ItemInfo, + }, +} diff --git a/common/src/lib.rs b/common/src/lib.rs index 28ce5a8..080e061 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -1,4 +1,5 @@ pub mod r#impl; +pub mod api; use bincode::{Decode, Encode}; use serde::{Deserialize, Serialize}; -- cgit v1.2.3-70-g09d2