Registry / utility / builder-pattern

builder-pattern

JSON →
library0.4.2rscratesunverified

A derivable macro for declaring a builder pattern, simplifying struct construction with optional fields.

# Cargo.toml [dependencies] builder-pattern = "0.4.2"
INSTALL
IMPORT
SIG · BUILDER-PATTERN
B
builder-pattern
utilityrustv0.4.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Builder
✓ use builder_pattern::Builder;

Derives a builder for a struct and constructs an instance with chained methods.

use builder_pattern::Builder; #[derive(Builder)] struct Config { name: String, #[default = 42] value: i32, } let config = Config::new().name("test".into()).build().unwrap();
Debug
Known issues
gotchaThe macro requires all fields to have defaults or be explicitly set; missing fields cause a runtime panic.
fix
Use #[default] attributes or ensure all fields are provided before calling .build().
affects: >=0.4.0
Upgrade
Version history
0.4.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
builder-pattern — cargo add builder-pattern · libregistry