Registry / utility / optional-struct

optional-struct

JSON →
library0.5.2rscratesunverified

Macro that generates a struct with all fields wrapped in Option<T> from a given struct.

# Cargo.toml [dependencies] optional_struct = "0.5.2"
INSTALL
IMPORT
SIG · OPTIONAL-STRUCT
O
optional-struct
utilityrustv0.5.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.

OptionalStruct
use optional_struct::OptionalStruct;

Generate an optional version of a struct.

use optional_struct::OptionalStruct; #[derive(OptionalStruct)] struct Config { name: String, age: u32, } fn main() { let opt = OptionalConfig { name: Some("Alice".into()), age: None }; println!("{:?}", opt); }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
0.5.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
4
Meta
1
Amazon
1
Resources
optional-struct — cargo add optional-struct · libregistry