Go to file
Wolfgang Bumiller 4f042f8133 api-macro: support external types
See the test example:

assuming a `pub struct Foo` which implements `Serialize` and
`Deserialize`, we also expect it to provide a
`pub const Foo::API_SCHEMA: &Schema` like so:

    #[derive(Deserialize, Serialize)]
    pub struct StrongString(String);
    impl StrongString {
        pub const API_SCHEMA: &'static Schema =
            &StringSchema::new("Some generic string")
                .format(&ApiStringFormat::Enum(&["a", "b"]))
                .schema();
    }

Then we can use:

    #[api(
        input: {
            properties: {
                arg: { type: StrongString },
            }
        },
        ...
    )]
    fn my_api_func(arg: StrongString) -> Result<...> {
        ...
    }

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2019-11-28 10:42:35 +01:00
proxmox rename sorted-data to proxmox-sortable_macro 2019-11-21 13:10:37 +01:00
proxmox-api formatting fixup 2019-11-25 15:07:18 +01:00
proxmox-api-macro api-macro: support external types 2019-11-28 10:42:35 +01:00
proxmox-sortable-macro sortable-macro: fixup handle_error 2019-11-26 14:20:30 +01:00
proxmox-sys add tools::parse submodule, move hex_nibble to it 2019-11-14 09:59:04 +01:00
proxmox-tools import the new api definitions 2019-11-21 13:30:28 +01:00
.gitignore import Cargo.lock 2019-08-09 08:44:48 +02:00
Cargo.toml delete the old api macro stuff 2019-11-21 13:13:18 +01:00
Makefile run 'cargo fmt -- --check' in check target 2019-11-25 15:08:53 +01:00
rust-toolchain update toolchain to stable 2019-11-08 11:51:21 +01:00
rustfmt.toml initial import, starting with vec & io helpers 2019-06-06 14:00:25 +02:00