Crate optionable_derive

Crate optionable_derive 

Source
Expand description

This crate is on its own not really usable. It is re-exported together with the required traits in the optionable crate. The relevant docs can be also found there.

This is only a separate crate as derive macros have to be a separate crate.

Attribute Macros§

optionable_kube
Attribute macro to simplify deriving optioned types for kube::CustomResource subfields. For the CustomResource definition itself #[optionable_kube_cr] is the correct attribute macro.
optionable_kube_cr
Attribute macro to simplify deriving optioned types for kube::CustomResource. Must be placed prior to any #[derive(…)] statements for the given type. Has to be used together with #[derive(kube::CustomResource)].

Derive Macros§

Optionable
Derive macro to derive the Optionable trait for structs/enums recursively by generating a type with all fields recursively replaced with Option versions. All non-required fields have to implement the Optionable trait. This trait is already implemented by this library for many primitive types, wrapper and container types.
OptionableKubeCrd
For most use cases just using the attribute macro #[optionable_kube_cr] is likely a better fit.