Skip to main content

Crate geop_ops_parts_derive

Crate geop_ops_parts_derive 

Source
Expand description

Derives that describe geop_ops_parts operations to anything that edits programs — a UI generates its forms from these descriptions instead of knowing each operation by hand.

  • #[derive(OperationArgs)] on an operation’s arguments struct: every field carries #[arg(<ArgKind>)] saying what kind of value it holds (and so how it is entered), and its doc comment becomes its description.
  • #[derive(Operations)] on the enum of all operations: every variant Name(NameArgs) dispatches to the unit struct Name, which implements Operation; its doc comment describes the operation and #[operation(label = "...")] gives its short name.

Derive Macros§

OperationArgs
impl OperationArgs: the schema of every field, from its #[arg(<ArgKind expression>)] and its doc comment.
Operations
Dispatch, conversions and schemas for the enum of every operation.