SchemaVariant

Represents a data type which can hold different kinds of values but always exactly one or none at a time. Types is a list of types the variant can hold. By default type IDs are assigned from the stringof value which is the type name without module name. You can pass custom type names by passing a string following the type. Those will affect the type value in the serialized bson and the convenience access function names. Serializes the Bson as {"type": "T", "value": "my value here"}

Constructors

this
this(T value)
Undocumented in source.

Members

Aliases

Fields
alias Fields = parseSpecs!Specs
Undocumented in source.
Types
alias Types = specTypes!Specs
Undocumented in source.

Functions

checkType
void checkType()
Undocumented in source. Be warned that the author may not have intended to support it.
isType
bool isType()
Undocumented in source. Be warned that the author may not have intended to support it.
opAssign
void opAssign(T value)
Undocumented in source. Be warned that the author may not have intended to support it.
type
string type()
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

fromBson
SchemaVariant!Specs fromBson(Bson bson)
Undocumented in source. Be warned that the author may not have intended to support it.
toBson
Bson toBson(SchemaVariant!Specs value)
Undocumented in source. Be warned that the author may not have intended to support it.

Templates

hasType
template hasType(T)
Undocumented in source.
typeIndex
template typeIndex(T)
Undocumented in source.

Variables

value
Algebraic!Types value;
Undocumented in source.

Meta