#[derive(Groupped)]
{
// Attributes available to this derive:
#[group]
}
Expand description
derive macro Groupped
Derive macro for automatically implementing the Groupped trait on a struct.
The #[derive(Groupped)] macro:
- Implements
Groupped<Group>where the group is specified via#[group(GroupName)]. - Registers the type via
register_type!so it’s included in the program enum. - Generates
Into<AnyOutput<Group>>andInto<ChainProcess<Group>>conversions. - Adds
to_chain()andto_render()methods to the struct.
§Syntax
ⓘ
#[derive(Groupped)]
#[group(MyProgram)] // optional; defaults to `ThisProgram`
struct MyStruct {
field: String,
}§Example
ⓘ
use mingling::{Groupped, macros::{chain, gen_program, renderer, r_println}};
#[derive(Groupped)]
#[group(ThisProgram)]
struct Greeting {
name: String,
}This is equivalent to using pack! but works with custom structs that
have named fields. For simple wrappers, prefer pack!.