# HostMap

<div class="jsdoc-content"><header>
    
        <h2><span class="attribs"><span class="type-signature"></span></span>HostMap<span class="signature">()</span><span class="type-signature"></span></h2>
        
            <div class="class-description"><p>Represents an associative-array of <a href="Host.html">hosts</a> 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.</p></div>
        
    
</header>


    
        

    
    </div>

## Constructor

<div class="jsdoc-content">
    

    
    <h4 class="name" id="HostMap"><span class="type-signature"></span>new HostMap<span class="signature">()</span><span class="type-signature"></span></h4>
    

    















<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/host.js#L152" target="_blank" rel="noopener">host.js, line 152</a></p></div>




















    
    

    
        </div>

## Extends

<div class="jsdoc-content">

        


    <ul>
        <li>events.EventEmitter</li>
    </ul>


    

    

    

    

    

    

    

    
        </div>

## Methods

<div class="jsdoc-content">

        
            

    

    
    <h4 class="name" id="clear"><span class="type-signature"></span>clear<span class="signature">()</span><span class="type-signature"></span></h4>
    

    















<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/host.js#L239" target="_blank" rel="noopener">host.js, line 239</a></p></div>
<div class="admonition warning"><p class="admonition-title">Deprecated</p><p>Not supported by the driver. Usage will throw an error.</p></div>




















        
            

    

    
    <h4 class="name" id="forEach"><span class="type-signature"></span>forEach<span class="signature">(callback)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Executes a provided function once per map element.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>callback</code></td>
            

            <td class="type">
            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/host.js#L178" target="_blank" rel="noopener">host.js, line 178</a></p></div>




















        
            

    

    
    <h4 class="name" id="get"><span class="type-signature"></span>get<span class="signature">(key)</span><span class="type-signature"> &rarr; {<a href="Host.html">Host</a>}</span></h4>
    

    



<div class="description">
    <p>Gets a <a href="Host.html">host</a> by key or undefined if not found.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>key</code></td>
            

            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/host.js#L190" target="_blank" rel="noopener">host.js, line 190</a></p></div>















<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type"><a href="Host.html">Host</a></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="keys"><span class="type-signature"></span>keys<span class="signature">()</span><span class="type-signature"> &rarr; {Array&lt;String>}</span></h4>
    

    



<div class="description">
    <p>Returns an array of host addresses.</p>
</div>













<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/host.js#L198" target="_blank" rel="noopener">host.js, line 198</a></p></div>















<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Array&lt;String></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id="remove"><span class="type-signature"></span>remove<span class="signature">()</span><span class="type-signature"></span></h4>
    

    















<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/host.js#L205" target="_blank" rel="noopener">host.js, line 205</a></p></div>
<div class="admonition warning"><p class="admonition-title">Deprecated</p><p>Not supported by the driver. Usage will throw an error.</p></div>




















        
            

    

    
    <h4 class="name" id="removeMultiple"><span class="type-signature"></span>removeMultiple<span class="signature">()</span><span class="type-signature"></span></h4>
    

    















<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/host.js#L212" target="_blank" rel="noopener">host.js, line 212</a></p></div>
<div class="admonition warning"><p class="admonition-title">Deprecated</p><p>Not supported by the driver. Usage will throw an error.</p></div>




















        
            

    

    
    <h4 class="name" id="set"><span class="type-signature"></span>set<span class="signature">()</span><span class="type-signature"></span></h4>
    

    















<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/host.js#L219" target="_blank" rel="noopener">host.js, line 219</a></p></div>
<div class="admonition warning"><p class="admonition-title">Deprecated</p><p>Not supported by the driver. Usage will throw an error.</p></div>




















        
            

    

    
    <h4 class="name" id="values"><span class="type-signature"></span>values<span class="signature">()</span><span class="type-signature"> &rarr; {Array&lt;<a href="Host.html">Host</a>>}</span></h4>
    

    



<div class="description">
    <p>Returns a shallow copy of the values of the map.</p>
</div>













<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/host.js#L227" target="_blank" rel="noopener">host.js, line 227</a></p></div>















<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Array&lt;<a href="Host.html">Host</a>></span>


    </dd>
</dl>

    





        
            

    

    
    <h4 class="name" id=".fromRust"><span class="type-signature">(package, static) </span>fromRust<span class="signature">(hostsList)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Converts a list of HostWrapper from Rust to a HostMap</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>hostsList</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array&lt;_rust.HostWrapper></span>


            
            </td>

            

            

            <td class="description last"></td>
        </tr>

    
    </tbody>
</table>






<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/host.js#L256" target="_blank" rel="noopener">host.js, line 256</a></p></div></div>
