summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md38
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`.