alpm_buildinfo/build_info/
format.rs

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