aboutsummaryrefslogtreecommitdiffstats
path: root/src/declaration.rs
blob: fe3aac8ea7779a598ffda70db37ded28fd28183e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// SPDX-FileCopyrightText: 2025 cel <cel@bunny.garden>
//
// SPDX-License-Identifier: AGPL-3.0-or-later

/// An XML declaration.
pub struct Declaration {
    pub version_info: VersionInfo,
    pub encoding_decl: Option<String>,
    pub sd_decl: Option<bool>,
}

/// An XML version.
#[derive(Clone, Copy)]
pub enum VersionInfo {
    One,
    OneDotOne,
}

impl Declaration {
    /// Create an XML declaration from a version.
    pub fn version(version: VersionInfo) -> Self {
        Self {
            version_info: version,
            encoding_decl: None,
            sd_decl: None,
        }
    }
}