Skip to content

Commit 61d2fe0

Browse files
committed
briefly document constructors
1 parent d711a4a commit 61d2fe0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)