diff --git a/proxmox-schema/src/schema.rs b/proxmox-schema/src/schema.rs index 79b240f1..39aca451 100644 --- a/proxmox-schema/src/schema.rs +++ b/proxmox-schema/src/schema.rs @@ -1134,9 +1134,12 @@ pub enum ApiStringFormat { /// Use a schema to describe complex types encoded as string. PropertyString(&'static Schema), /// Use a verification function. - VerifyFn(fn(&str) -> Result<(), Error>), + VerifyFn(ApiStringVerifyFn), } +/// Type of a verification function for [`StringSchema`]s. +pub type ApiStringVerifyFn = fn(&str) -> Result<(), Error>; + impl ApiStringFormat { /// Gets the underlying [`&[EnumEntry]`](EnumEntry) list, panics on different formats. pub const fn unwrap_enum_format(&self) -> &'static [EnumEntry] { @@ -1457,6 +1460,7 @@ impl UpdaterType for Vec { type Updater = Option; } +/// Trait signifying that a type contains an API schema. pub trait ApiType { const API_SCHEMA: Schema; } @@ -1490,6 +1494,7 @@ impl Updater for Option { } } +/// Return type schema. Return types may be any schema and additionally be optional. #[cfg_attr(feature = "test-harness", derive(Eq, PartialEq))] pub struct ReturnType { /// A return type may be optional, meaning the method may return null or some fixed data.