proxmox/proxmox-api-macro
Wolfgang Bumiller cb9d57b453 put API_SCHEMA variable into ApiType trait
This way we can assign `API_SCHEMA` constants to `Option`
types.

Here's why:

The api-macro generated code usese `T::API_SCHEMA` when
building ObjectSchemas.

For Updaters we replace `T` with
  `<T as Updatable>::Updater`

This means for "simple" wrappers like our `Authid` or
`Userid`, the ObjectSchema will try to refer to
  `<Authid as Updatable>::Updater::API_SCHEMA`
which resolves to:
  `Option<Authid>::API_SCHEMA`
which does not exist, for which we cannot add a normal
`impl` block to add the schema variable, since `Option` is
not "ours".

But we now have a blanket implementation of `ApiType` for
`Option<T> where T: ApiType` which just points to the
original `T::API_SCHEMA`.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-08-12 10:15:13 +02:00
..
debian proxmox-api-macro: bump version to 0.4.0 2021-07-20 17:45:29 +02:00
src put API_SCHEMA variable into ApiType trait 2021-08-12 10:15:13 +02:00
tests put API_SCHEMA variable into ApiType trait 2021-08-12 10:15:13 +02:00
Cargo.toml proxmox-api-macro: bump version to 0.4.0 2021-07-20 17:45:29 +02:00