Registry / utility / getset

getset

JSON →
library0.1.6rscratesunverified

Procedural macro for generating basic getters and setters on struct fields.

# Cargo.toml [dependencies] getset = "0.1.6"
INSTALL
IMPORT
SIG · GETSET
G
getset
utilityrustv0.1.6
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.

Getters
use getset::Getters;

Derives a getter method for a struct field.

use getset::Getters; #[derive(Getters)] struct MyStruct { #[get = "pub"] value: i32, } fn main() { let s = MyStruct { value: 42 }; println!("{}", s.value()); }
Debug
Known issues
gotchaRequires explicit attribute annotations for each field.
fix
Add #[get = "pub"] or #[set] attributes to fields.
affects: >=0.1.0
Upgrade
Version history
0.1.6latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
getset — cargo add getset · libregistry