Skip to main content

egml_core/model/basic/
code.rs

1/// A coded value optionally qualified by a code-space URI.
2///
3/// Corresponds to `gml:CodeType` in ISO 19136.  The optional `code_space`
4/// attribute is a URI that identifies the code list or dictionary in which
5/// `value` is defined.
6///
7/// # Examples
8///
9/// ```rust
10/// use egml_core::model::basic::Code;
11///
12/// let code = Code {
13///     code_space: Some("https://example.org/codes".to_string()),
14///     value: "WallSurface".to_string(),
15/// };
16/// assert_eq!(code.value, "WallSurface");
17/// ```
18#[derive(Debug, Clone, PartialEq, PartialOrd)]
19pub struct Code {
20    /// Optional URI identifying the code list or dictionary.
21    pub code_space: Option<String>,
22    /// The code value string.
23    pub value: String,
24}