summaryrefslogtreecommitdiffstats
path: root/src/types.rs
diff options
context:
space:
mode:
authorMinijackson <minijackson@riseup.net>2019-12-18 20:56:53 +0100
committerMinijackson <minijackson@riseup.net>2019-12-18 20:56:53 +0100
commitde896baff7e97fac4dde79078c9a2fa1c652576b (patch)
tree512b67b91d64e51d63f7ac5ff925a5c96d9aaf3c /src/types.rs
parent860b73f1644ecd6548ae403ec483625fb7b625ea (diff)
downloadposeidoc-de896baff7e97fac4dde79078c9a2fa1c652576b.tar.gz
poseidoc-de896baff7e97fac4dde79078c9a2fa1c652576b.zip
Big refactoring
- entities should be more coherent when parsing multiple files - well defined, language agnostic entity tree - each module has its own configuration - less dead code
Diffstat (limited to 'src/types.rs')
-rw-r--r--src/types.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/types.rs b/src/types.rs
new file mode 100644
index 0000000..82f9c65
--- /dev/null
+++ b/src/types.rs
@@ -0,0 +1,22 @@
1use serde_derive::{Serialize, Deserialize};
2
3use std::collections::BTreeMap;
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
6pub struct Poseidoc {
7 pub config: toml::Value,
8 pub entities: BTreeMap<String, Entity>,
9}
10
11#[derive(Debug, Clone, Serialize, Deserialize)]
12pub struct Entity {
13 pub name: String,
14 //location: SourceLocation
15 pub language: String,
16 pub kind: String,
17 pub brief_description: String,
18 pub documentation: String,
19 pub children: BTreeMap<String, BTreeMap<String, Entity>>,
20}
21
22// TODO: use newtype for language, entity kind, entity ID