x-variant

Crates.iox-variant
lib.rsx-variant
version0.1.1
sourcesrc
created_at2024-05-01 20:48:46.031602
updated_at2024-05-21 13:55:42.772511
descriptionVariant is a dynamic type container
homepagehttps://github.com/libark/x
repositoryhttps://github.com/libark/x
max_upload_size
id1227068
size43,105
Zhou Wei (libark)

documentation

https://docs.rs/x-variant

README

x-variant

Version Documentation License License

Variant is a dynamic type container that can hold any type of value, and can change the type at runtime.

Example

[dependencies]
x-variant= "0.1"
use x_variant::Variant;

let mut v = Variant::new();
v.set(12);
i: i32 = v.get();
v.set("Hello, world!");

// Array
let mut v = Variant::new();
v[100] = "test".into();

// Dictionary
let mut v = Variant::new();
v["key"] = "value".into();
v["x"]["y"] = 3.1415926f64.into();
Commit count: 1

cargo fmt