rev: release-0.15 scopes/doc/module-Map.rst -rw-r--r-- 1.6 KiB View raw Log this file
e53de6d7cb89 — Leonard Ritter * win32 build fix 1 year, 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Map
===

This module implements a key -> value store and mathematical sets using
hashtables.

.. type:: Map

   An opaque type of supertype `Struct`.

   .. inline:: (__as cls T)
   .. inline:: (__countof self)
   .. fn:: (__drop self)
   .. inline:: (__typecall cls opts...)
   .. fn:: (clear self)
   .. fn:: (discard self key)
      
      erases a key -> value association from the map; if the map
      does not contain this key, nothing happens.
   .. fn:: (dump self)
   .. fn:: (get self key)
      
      returns the value associated with key or raises an error
   .. fn:: (getdefault self key value)
      
      returns the value associated with key or raises an error
   .. fn:: (in? self key)
   .. fn:: (set self key value)
      
      inserts a new key -> value association into map; key can be the
      output of any custom hash function. If the key already exists,
      it will be updated.
   .. fn:: (terseness self)
      
      computes the hashmap load as a normal between 0.0 and 1.0
.. type:: MapError

   A plain type of supertype `CEnum` and of storage type `i32`.

.. type:: Set

   An opaque type of supertype `Struct`.

   .. inline:: (__as cls T)
   .. inline:: (__countof self)
   .. fn:: (__drop self)
   .. inline:: (__typecall cls opts...)
   .. fn:: (clear self)
   .. fn:: (discard self key)
      
      erases a key -> value association from the map; if the map
      does not contain this key, nothing happens.
   .. fn:: (dump self)
   .. fn:: (in? self key)
   .. fn:: (insert self key)
      
      inserts a new key into set
   .. fn:: (terseness self)
      
      computes the hashmap load as a normal between 0.0 and 1.0