Macro system done in theory

too afraid to begin debugging, resting for a moment
This commit is contained in:
2025-09-03 16:05:26 +02:00
parent 051b5e666f
commit 7031f3a7d8
51 changed files with 1463 additions and 458 deletions

View File

@@ -1,4 +1,4 @@
/// A shorthand for mapping over enums with identical structure. Used for
/// A shorthand for mapping over enums with similar structure. Used for
/// converting between owned enums and the corresponding API enums that only
/// differ in the type of their fields.
///
@@ -7,7 +7,11 @@
/// match_mapping!(self, ThisType => OtherType {
/// EmptyVariant,
/// TupleVariant(foo => intern(foo), bar.clone()),
/// StructVariant{ a.to_api(), b }
/// StructVariant{ a.to_api(), b },
/// DedicatedConverter(value () convert)
/// } {
/// ThisType::DimorphicVariant(c) => OtherType::CorrespondingVariant(c.left(), c.right()),
/// ThisType::UnexpectedVariant => panic!(),
/// })
/// ```
#[macro_export]