Registry / utility / derive-new

derive-new

JSON →
library0.7.0rscratesunverified

Provides a `#[derive(new)]` macro that implements simple constructor functions for structs and enums.

# Cargo.toml [dependencies] derive-new = "0.7.0"
INSTALL
IMPORT
SIG · DERIVE-NEW
D
derive-new
utilityrustv0.7.0
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.

New
use derive_new::New;

Derives a `new` constructor for a struct.

use derive_new::New; #[derive(New)] struct Point { x: f64, y: f64, } fn main() { let p = Point::new(1.0, 2.0); println!("Point: ({}, {})", p.x, p.y); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.7.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
12
Resources
derive-new — cargo add derive-new · libregistry