Import std.collections.immutable
std.collections.immutable
ImmutableArray<T>, ImmutableMap<K, V>, and ImmutableSet<T>: collections that never change,
so any thread can read one. A change gives a new collection, which shares all of the old one's
nodes but the ones on the way down to what changed, in a balanced tree, about log(Count) of
them. Their values are Sendable, as the collections are.
std/collections/immutable.fb
Types
ImmutableArray
struct
@DebugElements Public Struct ImmutableArray<T: Sendable> Implements Iterable<T>, Defaultable, Sendable
An array that never changes: each change gives a new one, which shares what it can with the old, so threads can share it.
std/collections/immutable.fb, line 30
-
An empty one.
-
One with the
values, in order, all read first. -
How many values it holds.
-
The value at
index, which panics outside it. -
A copy with
valueatindexin place of what's there. -
A copy with
valueadded at the end. -
A copy with each of the
valuesadded at the end, in order, all read first. -
A copy with
valueatindex, moving what's there and after it along, whereindexis from 0 to Count. -
A copy without the value at
index. -
Whether it holds
value. -
The values, in order, in a new array.
-
An empty one.
-
The values, in order.
ImmutableArrayIterator
struct
Public Struct ImmutableArrayIterator<T: Sendable> Implements Iterator<T>
An ImmutableArray's values in order: the nodes on the way down to the next one.
std/collections/immutable.fb, line 246
-
The next value, or Null when there are no more.
Doc from
std.core.iterator.Iterator.Next.
ImmutableMap
struct
@DebugEntries Public Struct ImmutableMap<K, V> Implements Iterable<(K, V)>, Defaultable, Sendable
A Map that never changes: each change gives a new one, which shares what it can with the old, so threads can share it.
std/collections/immutable.fb, line 342
-
An empty one.
-
One with the
entries, all read first, a later entry's value for a key taking the place of an earlier one's. -
How many entries it holds.
-
The
key's value, or Null when it isn't there. -
The
key's value, orfallbackwhen it isn't there. -
The key's value. A key that isn't there panics.
-
Whether
keyhas an entry. -
A copy with the
key'svalue, which takes the place of the one it has. -
A copy with each of the
entriesadded in turn, as Add adds one, all read first. -
A copy without the
key's entry, or the same one when it has none. -
The keys, in the order the entries go in.
-
The values, in their keys' order.
-
A new Map with the same entries, in the same order.
-
An empty one.
-
Each key and its value, for 'For key, value In map', by their keys' hashes, and keys of one hash in the order they were added.
ImmutableMapIterator
struct
Public Struct ImmutableMapIterator<K, V> Implements Iterator<(K, V)>
An ImmutableMap's entries: the nodes on the way down to the next one, and the entry it's at.
std/collections/immutable.fb, line 627
-
The next value, or Null when there are no more.
Doc from
std.core.iterator.Iterator.Next.
ImmutableSet
struct
@DebugElements Public Struct ImmutableSet<T> Implements Iterable<T>, Defaultable, Sendable, Hashable
A Set that never changes: each change gives a new one, which shares what it can with the old, so threads can share it.
std/collections/immutable.fb, line 702
-
An empty one.
-
One with the
values, all read first. -
How many values it holds.
-
Whether it holds
value. -
A copy with the
value, or the same one when it has it. -
A copy with each of the
valuesadded, all read first. -
A copy without the
value, or the same one when it hasn't got it. -
The values, in a new array, in the order they go in.
-
An empty one.
-
Two ImmutableSets are equal when they have the same values.
-
Equal ImmutableSets have equal hashes, whatever order their values go in.
-
The values, by their hashes, and values of one hash in the order they were added.
ImmutableSetIterator
struct
Public Struct ImmutableSetIterator<T> Implements Iterator<T>
The values of an ImmutableSet, which For ... In goes over.
std/collections/immutable.fb, line 771
-
The next value, or Null when there are no more.
Doc from
std.core.iterator.Iterator.Next.
Extends
ImmutableArray
extend
Extend ImmutableArray<T> Implements Equatable
No doc comment.
std/collections/immutable.fb, line 268
-
Whether
aandbare equal.Doc from
std.core.interfaces.Equatable.Operator==.
ImmutableArray
extend
Extend ImmutableArray<T> Implements Hashable
No doc comment.
std/collections/immutable.fb, line 282
-
Its hash, the same for values that are equal.
Doc from
std.core.interfaces.Hashable.Hash.
ImmutableArray
extend
Extend ImmutableArray<T> Implements Printable
No doc comment.
std/collections/immutable.fb, line 295
-
Its text, as a string interpolation like "{value}" shows it.
Doc from
std.core.interfaces.Printable.ToString.
ImmutableMap
extend
Extend ImmutableMap<K, V> Implements Equatable
No doc comment.
std/collections/immutable.fb, line 660
-
Whether
aandbare equal.Doc from
std.core.interfaces.Equatable.Operator==.
ImmutableMap
extend
Extend ImmutableMap<K, V> Implements Hashable
No doc comment.
std/collections/immutable.fb, line 674
-
Its hash, the same for values that are equal.
Doc from
std.core.interfaces.Hashable.Hash.
ImmutableMap
extend
Extend ImmutableMap<K, V> Implements Printable
No doc comment.
std/collections/immutable.fb, line 687
-
Its text, as a string interpolation like "{value}" shows it.
Doc from
std.core.interfaces.Printable.ToString.
ImmutableSet
extend
Extend ImmutableSet<T> Implements Printable
No doc comment.
std/collections/immutable.fb, line 785
-
Its text, as a string interpolation like "{value}" shows it.
Doc from
std.core.interfaces.Printable.ToString.
Report an issue with this page or with FutureBlitz on GitHub.