proxmox/proxmox-schema
Wolfgang Bumiller fca5218749 schema: add const fn unwrap_*_schema/format methods
'unwrap_' because they will panic and as `const fn` since
panic in const fn is now possible

Note that const evaluation will only be triggered when
actually used in const context, so to ensure *compile time*
checks, use something like this:

    const FOO_SCHEMA: &AllOfSchema =
        SomeType::API_SCHEMA.unwrap_all_of_schema();
    then_use(FOO_SCHEMA);

or to use the list of enum values of an enum string type
with compile time checks:

    const LIST: &'static [EnumEntry] =
        AnEnumStringType::API_SCHEMA
            .unwrap_string_schema()
            .unwrap_format()
            .unwrap_enum_format();
    for values in LIST {
        ...
    }

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-02-22 09:35:06 +01:00
..
debian bump proxmox-schema to 1.2.1 2022-02-17 12:06:15 +01:00
src schema: add const fn unwrap_*_schema/format methods 2022-02-22 09:35:06 +01:00
tests schema: rustfmt 2022-02-11 14:05:05 +01:00
Cargo.toml bump proxmox-schema to 1.2.1 2022-02-17 12:06:15 +01:00