osquery_rust/plugin/table/
column_def.rs1use strum_macros::Display;
2
3#[derive(Clone, Debug)]
6pub struct ColumnDef {
7 name: String,
8 t: ColumnType,
9}
10
11#[derive(Clone, Display, Debug)]
12#[strum(serialize_all = "UPPERCASE")]
13pub enum ColumnType {
14 Text,
16 Integer,
18 BigInt,
20 Double,
22}
23
24impl ColumnDef {
25 pub fn new(name: &str, t: ColumnType) -> Self {
26 ColumnDef {
27 name: name.to_owned(),
28 t,
29 }
30 }
31
32 pub(crate) fn name(&self) -> String {
33 self.name.to_string()
34 }
35
36 pub(crate) fn t(&self) -> String {
37 self.t.to_string()
38 }
39}