aboutsummaryrefslogtreecommitdiff
path: root/common/src
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-02-19 16:17:13 +0100
committermetamuffin <metamuffin@disroot.org>2023-02-19 16:17:13 +0100
commit3edddb0aea423a6f41da7597aec1836b015bc6bb (patch)
treef1df038aae2a89037f71ae8fc4342b88df3d210d /common/src
parent5a1ff49fe38451451a55266e86a9e9aedecfb44d (diff)
downloadjellything-3edddb0aea423a6f41da7597aec1836b015bc6bb.tar
jellything-3edddb0aea423a6f41da7597aec1836b015bc6bb.tar.bz2
jellything-3edddb0aea423a6f41da7597aec1836b015bc6bb.tar.zst
api errors in json
Diffstat (limited to 'common/src')
-rw-r--r--common/src/api.rs15
-rw-r--r--common/src/lib.rs1
2 files changed, 16 insertions, 0 deletions
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<String>,
+ },
+ 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};