Skip to main content

fcb_core/reader/
meta.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4pub struct Meta {
5    pub columns: Vec<Column>,
6    #[serde(rename = "featureCount")]
7    pub feature_count: u64,
8}
9
10#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
11pub struct Column {
12    pub index: u16,
13    pub name: String,
14    #[serde(rename = "type")]
15    pub _type: ColumnType,
16    pub title: Option<String>,
17    pub description: Option<String>,
18    pub precision: Option<i32>,
19    pub scale: Option<i32>,
20    pub nullable: Option<bool>,
21    pub unique: Option<bool>,
22    pub primary_key: Option<bool>,
23    pub metadata: Option<String>,
24    #[serde(rename = "attrIndex")]
25    pub attr_index: Option<bool>,
26}
27
28#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
29pub enum ColumnType {
30    Byte,     // Signed 8-bit integer
31    UByte,    // Unsigned 8-bit integer
32    Bool,     // Boolean
33    Short,    // Signed 16-bit integer
34    UShort,   // Unsigned 16-bit integer
35    Int,      // Signed 32-bit integer
36    UInt,     // Unsigned 32-bit integer
37    Long,     // Signed 64-bit integer
38    ULong,    // Unsigned 64-bit integer
39    Float,    // Single precision floating point number
40    Double,   // Double precision floating point number
41    String,   // UTF8 string
42    Json,     // General JSON type intended to be application specific
43    DateTime, // ISO 8601 date time
44    Binary,   // General binary type intended to be application specific
45}