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 (because it is one under the hood).

Constructors

this
this()

Map needs an initial capacity.

this
this(Value[string] valueMap)

Construct a new map from an associative array of key, value pairs.

this
this(uint capacity)

Constructs a map that can hold at most capacity elements.

this
this(Map other)

Create a copy of other map.

this
this(Value value)

Create a map from a Value.

this
this(mg_map* ptr)

Create a Map using the given mg_map.

this
this(mg_map* ptr)

Create a Map from a copy of the given mg_map.

Destructor

~this
~this()

Destructor. Destroys the internal mg_map.

Postblit

this(this)
this(this)
Undocumented in source.

Members

Functions

length
auto length()
Undocumented in source. Be warned that the author may not have intended to support it.
opBinaryRight
auto opBinaryRight(char[] key)

Remove given key from map. Return: true if key was removed, false otherwise.

opEquals
bool opEquals(Map other)

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

opEquals
bool opEquals(Value[string] valueMap)

Compares this map with an associative array of key, value pairs. Return: true if same, false otherwise.

opIndex
auto opIndex(string key)

Returns the value associated with the given key. If the given key does not exist, an empty Value is returned. Returns the value associated with the given key.

opIndexAssign
Value opIndexAssign(T value, string key)
Undocumented in source. Be warned that the author may not have intended to support it.
popFront
void popFront()

Move to the next element in the list range.

ptr
const(mg_map*) ptr()

Return pointer to internal mg_map.

toString
const(string) toString()

Return a printable string representation of this map.

Properties

empty
bool empty [@property getter]

Checks if the map as range is empty.

front
auto front [@property getter]

Returns the next element in the map range.

Meta