microcad_lang/model/attribute/
measure_command.rs1use crate::value::Value;
7
8#[derive(Clone, Debug, Default)]
10pub enum MeasureCommand {
11 #[default]
13 Size,
14
15 Width,
17
18 Height,
20}
21
22impl From<MeasureCommand> for Value {
23 fn from(command: MeasureCommand) -> Self {
24 match command {
25 MeasureCommand::Size => Value::String("size".into()),
26 MeasureCommand::Width => Value::String("width".into()),
27 MeasureCommand::Height => Value::String("height".into()),
28 }
29 }
30}
31
32impl std::fmt::Display for MeasureCommand {
33 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
34 match self {
35 MeasureCommand::Size => write!(f, "Size"),
36 MeasureCommand::Width => write!(f, "Width"),
37 MeasureCommand::Height => write!(f, "Height"),
38 }
39 }
40}