Skip to main content

Crate patchable_macro

Crate patchable_macro 

Source
Expand description

§Patchable Macro

Procedural macros backing the patchable crate.

Provided macros:

  • #[patchable_model]: injects Patchable/Patch derives; with the serde Cargo feature enabled for this macro crate it also adds serde::Serialize and applies #[serde(skip)] to fields marked #[patchable(skip)].

  • #[derive(Patchable)]: generates the companion <Struct>Patch type and the Patchable impl; with the impl_from Cargo feature it also generates From<Struct> for the patch type.

  • #[derive(Patch)]: generates the Patch implementation and recursively patches fields annotated with #[patchable].

Feature flags are evaluated in the patchable-macro crate itself. See context for details about the generated patch struct and trait implementations.

Attribute Macros§

patchable_model
Attribute macro that augments a struct with Patchable/Patch derives.

Derive Macros§

Patch
Derive macro that generates the Patch trait implementation.
Patchable
Derive macro that generates the companion Patch type and Patchable impl.