powerplatform_dataverse_service_client/query/
attribute.rs1use std::fmt::Display;
2
3use chrono::{DateTime, Utc};
4use uuid::Uuid;
5
6#[derive(Clone, Debug)]
12pub enum Attribute {
13 Null,
15
16 Boolean(bool),
18
19 Integer(i64),
21
22 Decimal(f64),
24
25 String(String),
27
28 DateTime(DateTime<Utc>),
30
31 Uuid(Uuid),
33}
34
35impl Display for Attribute {
36 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
37 match self {
38 Attribute::Null => f.write_str("null"),
39 Attribute::Boolean(value) => f.write_fmt(format_args!("{}", value)),
40 Attribute::Integer(value) => f.write_fmt(format_args!("{}", value)),
41 Attribute::Decimal(value) => f.write_fmt(format_args!("{}", value)),
42 Attribute::String(value) => f.write_fmt(format_args!("'{}'", value)),
43 Attribute::DateTime(value) => f.write_fmt(format_args!("'{}'", value)),
44 Attribute::Uuid(value) => f.write_fmt(format_args!("'{}'", value.as_hyphenated())),
45 }
46 }
47}