Was this page helpful?
HostMap¶
HostMap()
Represents an associative-array of hosts that can be iterated. It creates an internal copy when adding or removing, making it safe to iterate using the values() method within async operations.
Constructor¶
new HostMap()
Source
Extends¶
- events.EventEmitter
Methods¶
clear()
Source
Deprecated
Not supported by the driver. Usage will throw an error.
forEach(callback)
Executes a provided function once per map element.
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
Source
get(key) → {Host}
Gets a host by key or undefined if not found.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
String |
Source
Returns:
- Type
- Host
keys() → {Array:.<String:>}
Returns an array of host addresses.
Source
Returns:
remove()
Source
Deprecated
Not supported by the driver. Usage will throw an error.
removeMultiple()
Source
Deprecated
Not supported by the driver. Usage will throw an error.
set()
Source
Deprecated
Not supported by the driver. Usage will throw an error.
values() → {Array:.<Host:>}
Returns a shallow copy of the values of the map.
Source
Returns:
- Type
- Array:.<Host:>
(package, static) fromRust(hostsList)
Converts a list of HostWrapper from Rust to a HostMap
Parameters:
| Name | Type | Description |
|---|---|---|
hostsList |
Array:.<_rust.HostWrapper:> |
Source