sval-rs / value-bag

Dynamic structured values for Rust
Apache License 2.0
27 stars 3 forks source link

Expose `none` constructor #72

Closed KodrAus closed 9 months ago

KodrAus commented 10 months ago

Internally, ValueBag includes a None variant, but there's no way to construct one. Typically in Rust you'd wrap a value in Option to express nullability, but since ValueBag itself is a container, it would be handy to have a way to distinguish between no value bag and a value bag with a None in it (in JavaScript for example the former is undefined, and the latter is null).

KodrAus commented 9 months ago

It is actually already possible to construct a None variant publicly via ().