Skip to content

Commit 188a912

Browse files
committed
As per review, add a protocol to define the transport field
1 parent 3ff823e commit 188a912

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Sources/GRPCCore/Call/Server/ServerContext.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616

1717
/// Additional information about an RPC handled by a server.
1818
public struct ServerContext: Sendable {
19+
20+
/// Protocol used to help identify transport specific context fields
21+
public protocol TransportSpecific: Sendable {}
22+
1923
/// A description of the method being called.
2024
public var descriptor: MethodDescriptor
2125

@@ -52,7 +56,7 @@ public struct ServerContext: Sendable {
5256
///
5357
/// An example of what this field can be used for, would be to store
5458
/// things like a peer certificate from a mTLS connection
55-
public var transportSpecific: (any Sendable)?
59+
public var transportSpecific: (any TransportSpecific)?
5660

5761
/// A handle for checking the cancellation status of an RPC.
5862
public var cancellation: RPCCancellationHandle

0 commit comments

Comments
 (0)