Skip to main content

alpm_buildinfo/build_info/
format.rs

1use alpm_types::SchemaVersion;
2use serde_with::{DisplayFromStr, serde_as};
3
4use crate::BuildInfoSchema;
5
6/// Used internally to detect the BUILDINFO version when deserializing.
7#[serde_as]
8#[derive(Clone, Debug, serde::Deserialize)]
9pub(crate) struct BuildInfoFormat {
10    #[serde_as(as = "DisplayFromStr")]
11    pub format: BuildInfoSchema,
12}
13
14impl From<BuildInfoFormat> for SchemaVersion {
15    fn from(format: BuildInfoFormat) -> Self {
16        format.format.as_ref().clone()
17    }
18}