proxmox/proxmox-api-macro
Wolfgang Bumiller f5d15872f4 api-macro: add api_get_default!() macro
When writing an #[api] function, one can now access default
values by parameter name (see test_default_option in
tests/options.rs):

    #[api(...)]
    pub fn func(value: Option<isize>) {
        println!(
            "value: {}",
            value.unwrap_or(api_get_default!("value")),
        );
    }

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-03-19 15:49:34 +01:00
..
debian bump api-macro to 0.1.5 2020-03-19 09:58:02 +01:00
src api-macro: add api_get_default!() macro 2020-03-19 15:49:34 +01:00
tests api-macro: add api_get_default!() macro 2020-03-19 15:49:34 +01:00
Cargo.toml bump api-macro to 0.1.5 2020-03-19 09:58:02 +01:00