16 lines
524 B
Swift
16 lines
524 B
Swift
import Foundation
|
|
import RemoteCore
|
|
|
|
/// Typed outgoing container seam. Workstream B owns WCSession dictionary parsing,
|
|
/// strict incoming key/type validation, routing and exactly-once replies.
|
|
public struct RelayContainer: Sendable {
|
|
public let schemaVersion = RelayWire.schemaVersion
|
|
public let kind: RelayMessageKind
|
|
public let payload: Data
|
|
|
|
public init<Value: Encodable>(kind: RelayMessageKind, value: Value) throws {
|
|
self.kind = kind
|
|
self.payload = try RelayJSON.encode(value)
|
|
}
|
|
}
|