Plugx Input (work-in-progress)
A simple and flexible data-structure for configuration and state manipulation of plugins.
Package | Documentation | Repository
Features
| Feature | Enables |
|---|---|
| (none) | Core [Input] type, From conversions, [Display] |
serde |
[Serialize]/[Deserialize], infallible [Input::serialize] |
rkyv |
Binary archive via [Input::to_rkyv_bytes] / [Input::from_rkyv_bytes] |
serde or rkyv also exposes [error] and [position] for structured deserialize errors.
= { = "1.1", = ["serde"] }
Demo
use Input;
let mut map = new_map;
map.map_mut.unwrap.insert;
let inner_list = map
.map_mut.unwrap // &mut Hashmap<String, Input>
.get_mut // Option<&mut Input>
.unwrap // &mut Input (which is a list)
.list_mut.unwrap; // &mut Vec<Input>
*inner_list.get_mut.unwrap = 3.14.into;
*inner_list.get_mut.unwrap = true.into;
*inner_list.get_mut.unwrap = "hello world".into;
println!;
// prints:
// {"key": [3.14, true, "hello world"]}
To contributors
I ❤️ PR from everyone, and I appreciate your help but before opening a PR, file an issue and describe your feature, fix, etc.