This crate provides the ConstructorLite derive macro for generating
minimal constructors for a struct from its fields.
It is primarily designed for structs where deriving [Default] is not
possible because some fields don't implement it.
By default, an associated function new() is generated, which expects every
field that is not Option<T> as an argument.
#[constructor(required)].Default from the constructor
function, it can be marked with #[constructor(default)].#[constructor(name = "function_name")].#[constructor(visibility = "pub(super)")].For more advanced uses you might prefer using
derive-new or
derive_builder instead.
```rust use constructor_lite::ConstructorLite;
struct Movie {
title: String,
year: Option
asserteq!( Movie::new("Star Wars".toowned()), Movie { title: "Star Wars".to_owned(), year: None }, ) ```
This project is licensed under the MIT License.
See LICENSE for more information.