Map

Sized sequence of pairs of keys and values. Maximum possible map size allowed by Bolt protocol is uint.max.

Map may contain a mixture of different types as values. A map owns all keys and values stored in it.

Can be used like a standard D hash map.

Constructors

this
this(Map other)

Create a shallow copy of other map.

this
this(Value value)

Create a map from a Value.

this
this(mg_map* ptr)

Create a Map from a copy of the given mg_map.

Members

Functions

empty
bool empty()

Checks if the map as range is empty.

front
auto front()

Returns the next element in the map range.

opBinaryRight
auto opBinaryRight(char[] key)

Checks if the map contains the given key. Return: true if map contains key, false otherwise.

opEquals
bool opEquals(Map other)

Compares this map with other. Return: true if same, false otherwise.

opIndex
auto opIndex(string key)

Returns the value associated with the given key.

popFront
void popFront()

Move to the next element in the list range.

ptr
auto ptr()

Return pointer to internal mg_map.

toHash
size_t toHash()

Return the hash code for this map.

toString
string toString()

Return a printable string representation of this map.

Properties

length
uint length [@property getter]

Returns the number of key / value pairs in this map.

Meta