1 using System.Collections;
2 using System.Collections.Generic;
3 using System.Collections.Immutable;
8 public readonly record
struct NetCollection<T>(ImmutableArray<T> Array) : INetSerializableStruct, IEnumerable<T>
10 public static readonly NetCollection<T>
Empty =
new(ImmutableArray<T>.Empty);
12 public NetCollection(params T[] elements) : this(elements.ToImmutableArray()) { }
14 IEnumerator<T> IEnumerable<T>.GetEnumerator() => ((IEnumerable<T>)Array).GetEnumerator();
15 IEnumerator IEnumerable.GetEnumerator() => ((IEnumerable)Array).GetEnumerator();