Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Sources/GRPCCore/Call/Server/ServerContext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@

/// Additional information about an RPC handled by a server.
public struct ServerContext: Sendable {

/// Protocol used to help identify transport specific context fields
public protocol TransportSpecific: Sendable {}

/// A description of the method being called.
public var descriptor: MethodDescriptor

Expand Down Expand Up @@ -45,6 +49,15 @@ public struct ServerContext: Sendable {
/// - "in-process:27182".
public var localPeer: String

/// An optional field for transports to store specific data
///
/// Refer to the transport documentation to understand what type of
/// value this field will contain, if any.
///
/// An example of what this field can be used for, would be to store
/// things like a peer certificate from a mTLS connection
public var transportSpecific: (any TransportSpecific)?

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

Expand Down