diff options
| author | Mica White <botahamec@outlook.com> | 2026-06-07 07:16:55 -0400 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2026-06-07 07:16:55 -0400 |
| commit | d555b1e96770406cbf3a7d8aeb56785dfb7ab8d4 (patch) | |
| tree | 620e75c9f68dfd9d62dc73ef00ddec1605f7ca48 /README.md | |
| parent | 67fc414e1e490da951bd0fd037f8ad179a0c0824 (diff) | |
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..56d6b19 --- /dev/null +++ b/README.md @@ -0,0 +1,38 @@ +# Feluments + +A macro to provide optional arguments to Rust. + +This crate works by providing a derive macro to implement builders for structs, +and also providing a macro as a shorthand for builders. + +```rust +use feluments::*; + +#[derive(Debug, PartialEq, Eq, Builder)] +#[builder(vis = pub)] +struct Foo { + #[builder(default = 45)] + x: i32, + #[builder(into)] + y: String, + #[builder(optional)] + z: () +} + +build!(Foo { x: 32, y: "baz" }), +``` + +The above `build!` macro expands to the following: + +```rust +Foo::builder().x(32).y("baz").build() +``` + +Although this library provides a `Builder` derive macro to make the `build!` +macro work, the `build!` macro is also compatible with other builder crates, +such as [bon](https://bon-rs.com/), [buildstructor](https://crates.io/crates/buildstructor), +or [typed-builder](https://crates.io/crates/typed-builder). + +## Contributing + +To contribute to this codebase, send your patch file to `botahamec@outlook.com`. |
