feat: Conforming types to Sendable
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
public struct BudgetedPercentEnvelope: Equatable {
|
||||
public struct BudgetedPercentEnvelope: Equatable, Sendable {
|
||||
|
||||
public var coilBudget: Percentage
|
||||
public var filterBudget: Percentage
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Foundation
|
||||
|
||||
public enum EquipmentMeasurement: Equatable {
|
||||
|
||||
public enum EquipmentMeasurement: Equatable, Sendable {
|
||||
|
||||
case airHandler(AirHandler)
|
||||
case furnaceAndCoil(FurnaceAndCoil)
|
||||
|
||||
@@ -32,7 +32,7 @@ public enum EquipmentMeasurement: Equatable {
|
||||
}
|
||||
}
|
||||
|
||||
public struct AirHandler: Equatable {
|
||||
public struct AirHandler: Equatable, Sendable {
|
||||
|
||||
@Positive
|
||||
public var airflow: Double
|
||||
@@ -95,7 +95,7 @@ public enum EquipmentMeasurement: Equatable {
|
||||
}
|
||||
}
|
||||
|
||||
public enum EquipmentType: Equatable, CaseIterable, CustomStringConvertible, Identifiable {
|
||||
public enum EquipmentType: Equatable, CaseIterable, CustomStringConvertible, Identifiable, Sendable {
|
||||
case airHandler
|
||||
case furnaceAndCoil
|
||||
|
||||
@@ -113,7 +113,7 @@ public enum EquipmentMeasurement: Equatable {
|
||||
}
|
||||
|
||||
// TODO: Needs updated for when forms are using `minmal` values.
|
||||
public struct FlaggedMeasurement: Equatable {
|
||||
public struct FlaggedMeasurement: Equatable, Sendable {
|
||||
public var airflow: Flagged
|
||||
public var coilPressureDrop: Flagged
|
||||
public var externalStaticPressure: Flagged
|
||||
@@ -234,7 +234,7 @@ public enum EquipmentMeasurement: Equatable {
|
||||
}
|
||||
|
||||
|
||||
public struct FurnaceAndCoil: Equatable {
|
||||
public struct FurnaceAndCoil: Equatable, Sendable {
|
||||
|
||||
@Positive
|
||||
public var airflow: Double
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
public struct EquipmentMetadata: Equatable {
|
||||
public struct EquipmentMetadata: Equatable, Sendable {
|
||||
public var coolingCapacity: CoolingCapacity
|
||||
public var fanType: FanType
|
||||
public var ratedStaticPressures: RatedStaticPressures
|
||||
@@ -15,7 +15,7 @@ public struct EquipmentMetadata: Equatable {
|
||||
self.ratedStaticPressures = ratedStaticPressures
|
||||
}
|
||||
|
||||
public enum CoolingCapacity: Double, Equatable, CaseIterable, Identifiable, CustomStringConvertible {
|
||||
public enum CoolingCapacity: Double, Equatable, CaseIterable, Identifiable, CustomStringConvertible, Sendable {
|
||||
case half = 0.5
|
||||
case threeQuarter = 0.75
|
||||
case one = 1
|
||||
@@ -57,7 +57,7 @@ public struct EquipmentMetadata: Equatable {
|
||||
}
|
||||
}
|
||||
|
||||
public enum FanType: Hashable, Equatable, CaseIterable, CustomStringConvertible, Identifiable {
|
||||
public enum FanType: Hashable, Equatable, CaseIterable, CustomStringConvertible, Identifiable, Sendable {
|
||||
case constantSpeed
|
||||
case variableSpeed
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import Foundation
|
||||
/// on the current value.
|
||||
///
|
||||
@dynamicMemberLookup
|
||||
public struct Flagged: Equatable {
|
||||
|
||||
public struct Flagged: Equatable, Sendable {
|
||||
|
||||
public var checkValue: CheckHandler
|
||||
public var wrappedValue: Double
|
||||
|
||||
@@ -51,11 +51,11 @@ public struct Flagged: Equatable {
|
||||
}
|
||||
}
|
||||
|
||||
public struct CheckHandler {
|
||||
|
||||
let checkValue: (Double) -> CheckResult
|
||||
|
||||
public init(_ checkValue: @escaping (Double) -> CheckResult) {
|
||||
public struct CheckHandler: Sendable {
|
||||
|
||||
let checkValue: @Sendable (Double) -> CheckResult
|
||||
|
||||
public init(_ checkValue: @escaping @Sendable (Double) -> CheckResult) {
|
||||
self.checkValue = checkValue
|
||||
}
|
||||
|
||||
@@ -64,8 +64,8 @@ public struct Flagged: Equatable {
|
||||
}
|
||||
}
|
||||
|
||||
public enum CheckResult: Equatable {
|
||||
|
||||
public enum CheckResult: Equatable, Sendable {
|
||||
|
||||
case aboveMaximum(Double)
|
||||
case belowMinimum(Double)
|
||||
case betweenRange(minimum: Double, maximum: Double)
|
||||
@@ -113,7 +113,7 @@ public struct Flagged: Equatable {
|
||||
}
|
||||
}
|
||||
|
||||
public enum Status: String, Equatable, CaseIterable {
|
||||
public enum Status: String, Equatable, CaseIterable, Sendable {
|
||||
case good, warning, error
|
||||
|
||||
public var title: String {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
public struct Percentage: Equatable, RawRepresentable {
|
||||
public struct Percentage: Equatable, RawRepresentable, Sendable {
|
||||
|
||||
public var rawValue: Double
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ public struct Positive<Value> where Value: Numeric, Value: Comparable {
|
||||
}
|
||||
|
||||
extension Positive: Equatable where Value: Equatable { }
|
||||
extension Positive: Sendable where Value: Sendable { }
|
||||
|
||||
extension Positive: Comparable where Value: Comparable {
|
||||
public static func < (lhs: Positive<Value>, rhs: Positive<Value>) -> Bool {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
public enum PlenumDimension: Equatable {
|
||||
public enum PlenumDimension: Equatable, Sendable {
|
||||
case rectangular(width: Double, height: Double)
|
||||
case round(Double)
|
||||
|
||||
@@ -15,7 +15,7 @@ public enum PlenumDimension: Equatable {
|
||||
}
|
||||
}
|
||||
|
||||
public enum Key: String, Equatable, CaseIterable, CustomStringConvertible {
|
||||
public enum Key: String, Equatable, CaseIterable, CustomStringConvertible, Sendable {
|
||||
|
||||
case rectangular, round
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
public struct RatedEnvelope<Rating>: Equatable {
|
||||
public struct RatedEnvelope<Rating>: Equatable, Sendable {
|
||||
public var maximum: Double
|
||||
public var minimum: Double
|
||||
public var rated: Double
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Foundation
|
||||
|
||||
public struct Velocity: Equatable {
|
||||
public struct Velocity: Equatable, Sendable {
|
||||
public var airflow: Double
|
||||
public var dimension: PlenumDimension
|
||||
|
||||
|
||||
Reference in New Issue
Block a user