We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d711a4a commit 61d2fe0Copy full SHA for 61d2fe0
book/src/formality_core/constructors.md
@@ -0,0 +1,7 @@
1
+# Constructors
2
+
3
+Unless you include `#[customize(constructors)]`, the `#[term]` macro automatically creates constructors as follows:
4
5
+- For a `struct`, defines a `new` method that takes an `impl Upcast<T>` for each of your fields.
6
+- For an `enum`, defines a method per variant (converted to snake-case).
7
+ - If the name of the variant is a Rust keyword like `Struct`, the method will be called `struct_`.
0 commit comments