< Summary

Information
Class: SwiftCollections.SwiftArrayState<T>
Assembly: SwiftCollections
File(s): /home/runner/work/SwiftCollections/SwiftCollections/src/SwiftCollections/Serialization/State/SwiftArrayState.cs
Line coverage
100%
Covered lines: 2
Uncovered lines: 0
Coverable lines: 2
Total lines: 36
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%

File(s)

/home/runner/work/SwiftCollections/SwiftCollections/src/SwiftCollections/Serialization/State/SwiftArrayState.cs

#LineLine coverage
 1using MemoryPack;
 2using System;
 3using System.Text.Json.Serialization;
 4
 5namespace SwiftCollections;
 6
 7/// <summary>
 8/// Represents an immutable snapshot of an array of items of the specified type.
 9/// </summary>
 10/// <remarks>
 11/// This struct is intended for scenarios where a value-type representation of an array is needed, such as serialization
 12/// The array referenced by the Items field should not be modified after construction to preserve immutability.
 13/// </remarks>
 14/// <typeparam name="T">The type of elements contained in the array.</typeparam>
 15[Serializable]
 16[MemoryPackable]
 17public readonly partial struct SwiftArrayState<T>
 18{
 19    /// <summary>
 20    /// Gets the array of items contained in the collection.
 21    /// </summary>
 22    [JsonInclude]
 23    [MemoryPackInclude]
 24    public readonly T[] Items;
 25
 26    /// <summary>
 27    /// Initializes a new instance of the SwiftArrayState class with the specified items.
 28    /// </summary>
 29    /// <param name="items">The array of items to initialize the state with. Cannot be null.</param>
 30    [JsonConstructor]
 31    [MemoryPackConstructor]
 32    public SwiftArrayState(T[] items)
 33    {
 7634        Items = items;
 7635    }
 36}

Methods/Properties

.ctor(T[])