Lexicon Module, codegen current lexicons
Use esquema (github:fatfingers23/esquema@9ef00b9) to generate rust code
for the lexicons that we have.
Currently, esquema doesn't seem to support top level integer types. I've
opted to temporarily remove `indexProgress` from my.spoor.log.activity
while compiling, and then adding it back afterwards.
I could compile esquema with the following added to my flake.nix
```
nativeBuildInputs = with pkgs; [
pkg-config
openssl
openssl.dev
];
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
```
at a later date I will add it as a dependency, but I spent a while
trying to package esquema to no results.
This commit is contained in:
parent
0210da9708
commit
090cb6631e
11 changed files with 245 additions and 0 deletions
28
src/lexicons/my/spoor/content/external.rs
Normal file
28
src/lexicons/my/spoor/content/external.rs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// @generated - This file is generated by esquema-codegen (forked from atrium-codegen). DO NOT EDIT.
|
||||
//!Definitions for the `my.spoor.content.external` namespace.
|
||||
use atrium_api::types::TryFromUnknown;
|
||||
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct RecordData {
|
||||
///User defined overrides for the returned content
|
||||
#[serde(skip_serializing_if = "core::option::Option::is_none")]
|
||||
pub overrides: core::option::Option<atrium_api::types::Union<RecordOverridesRefs>>,
|
||||
///All the data needed to query the content from the source
|
||||
pub queryable: atrium_api::types::Union<RecordQueryableRefs>,
|
||||
///An nsid for a specific data source. The domain authority governs how to process the queryable
|
||||
pub source: atrium_api::types::string::Nsid,
|
||||
#[serde(skip_serializing_if = "core::option::Option::is_none")]
|
||||
pub titles: core::option::Option<Vec<crate::my::spoor::content::defs::Title>>,
|
||||
}
|
||||
pub type Record = atrium_api::types::Object<RecordData>;
|
||||
impl From<atrium_api::types::Unknown> for RecordData {
|
||||
fn from(value: atrium_api::types::Unknown) -> Self {
|
||||
Self::try_from_unknown(value).unwrap()
|
||||
}
|
||||
}
|
||||
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||
#[serde(tag = "$type")]
|
||||
pub enum RecordOverridesRefs {}
|
||||
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
|
||||
#[serde(tag = "$type")]
|
||||
pub enum RecordQueryableRefs {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue