@@ -261,21 +261,18 @@ public protocol DistributedActorSystem<SerializationRequirement>: Sendable {
261
261
262
262
/// Type of ``DistributedTargetInvocationEncoder`` that should be used when the Swift runtime needs to encode
263
263
/// a distributed target call into an encoder, before passing it off to `remoteCall(...)`.
264
- associatedtype InvocationEncoder : DistributedTargetInvocationEncoder
264
+ associatedtype InvocationEncoder : DistributedTargetInvocationEncoder < SerializationRequirement >
265
265
/// Type of ``DistributedTargetInvocationDecoder`` that should be used when decoding invocations during
266
266
/// ``executeDistributedTarget(on:target:invocationDecoder:handler:)`` calls.
267
- associatedtype InvocationDecoder : DistributedTargetInvocationDecoder
267
+ associatedtype InvocationDecoder : DistributedTargetInvocationDecoder < SerializationRequirement >
268
268
269
269
/// The type of the result handler which will be offered the results
270
270
/// returned by a distributed function invocation called via
271
271
/// ``executeDistributedTarget(on:target:invocationDecoder:handler:)``.
272
- associatedtype ResultHandler : DistributedTargetInvocationResultHandler
272
+ associatedtype ResultHandler : DistributedTargetInvocationResultHandler < SerializationRequirement >
273
273
274
274
/// The serialization requirement that will be applied to all distributed targets used with this system.
275
275
associatedtype SerializationRequirement // TODO: constrain SerializationRequirement in type-system to only be ok with protocol or class here
276
- where SerializationRequirement == InvocationEncoder . SerializationRequirement ,
277
- SerializationRequirement == InvocationDecoder . SerializationRequirement ,
278
- SerializationRequirement == ResultHandler . SerializationRequirement
279
276
280
277
// ==== ---------------------------------------------------------------------
281
278
// - MARK: Resolving actors by identity
@@ -724,7 +721,7 @@ func _executeDistributedTarget<D: DistributedTargetInvocationDecoder, DA: Distri
724
721
/// so decoding can rely on simply invoking e.g. `Codable` (if that is the `SerializationRequirement`) decoding
725
722
/// entry points on the provided types.
726
723
@available( SwiftStdlib 5.7 , * )
727
- public protocol DistributedTargetInvocationEncoder {
724
+ public protocol DistributedTargetInvocationEncoder< SerializationRequirement > {
728
725
/// The serialization requirement that the types passed to `recordArgument` and `recordReturnType` are required to conform to.
729
726
associatedtype SerializationRequirement
730
727
@@ -861,7 +858,7 @@ public struct RemoteCallArgument<Value> {
861
858
/// }
862
859
/// ```
863
860
@available ( SwiftStdlib 5 . 7 , * )
864
- public protocol DistributedTargetInvocationDecoder {
861
+ public protocol DistributedTargetInvocationDecoder < SerializationRequirement > {
865
862
/// The serialization requirement that the types passed to `decodeNextArgument` are required to conform to.
866
863
/// The type returned by `decodeReturnType` is also expected to conform to this associated type requirement.
867
864
associatedtype SerializationRequirement
@@ -928,7 +925,7 @@ public protocol DistributedTargetInvocationDecoder {
928
925
/// func onReturn<Success: SerializationRequirement>(value: Success) async throws
929
926
/// ```
930
927
@available ( SwiftStdlib 5 . 7 , * )
931
- public protocol DistributedTargetInvocationResultHandler {
928
+ public protocol DistributedTargetInvocationResultHandler < SerializationRequirement > {
932
929
/// The serialization requirement that the value passed to `onReturn` is required to conform to.
933
930
associatedtype SerializationRequirement
934
931
0 commit comments