Skip to main content

Module embed_enum_collection

Module embed_enum_collection 

Source
Expand description

Tests for Vec<enum> where the element is a unit (data-less) enum. Such an enum is a scalar discriminant, so the collection is stored as a document array and offers the scalar-collection operators (contains, len, …). Gated on document_collections, like the struct-embed collections in type_document.

Functions§

vec_enum_contains_and_len
The scalar-collection operators unlocked by the emitted Scalar impl: contains(variant) matches on discriminant membership and len() filters on cardinality.
vec_enum_create_get
A Vec<unit-enum> round-trips through INSERT and a fresh fetch: the discriminants are stored as a document array and reloaded back to variants.