aboutsummaryrefslogblamecommitdiffstats
path: root/src/declaration.rs
blob: fe3aac8ea7779a598ffda70db37ded28fd28183e (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11



                                                      
                       





                                      
                   






                      
                                                 







                                                  
// 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,
        }
    }
}