Skip to content

Commit

Permalink
feat(definitions): Add a implementation of the specification in Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
eexsty committed Apr 26, 2022
1 parent 27f3cf2 commit 0118e0f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions definitions/rust/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mod specification;
29 changes: 29 additions & 0 deletions definitions/rust/src/specification.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//! # Specification
//!
//! An `serde`-based implementation of the entity generation specification.
//!
use std::collections::HashMap;

use serde::Deserialize;

#[derive(Debug, Clone, Deserialize)]
pub struct SpecificationRoot {
pub name: String,
pub location: RustAndKotlinType,
pub feature_flag: String,
pub fields: HashMap<String, SpecificationField>
}

#[derive(Debug, Clone, Deserialize)]
pub struct RustAndKotlinType {
pub rust: String,
pub kotlin: String
}

#[derive(Debug, Clone, Deserialize)]
pub struct SpecificationField {
pub kind: RustAndKotlinType,
#[serde(default)]
pub sql: Option<String>,
}

0 comments on commit 0118e0f

Please sign in to comment.