Initializergrpc-swift 2.0.0GRPCCore
init
Creates a new router with no methods registered.
init()
Creates a new router with no methods registered.
init()
import GRPCCore
A gRPC library for Swift written natively in Swift.
struct RPCRouter<Transport> where Transport : ServerTransport
Stores and provides handlers for RPCs.
var count: Int { get }
Returns the number of methods registered with the router.
var methods: [MethodDescriptor] { get }
Returns all descriptors known to the router in an undefined order.
func hasHandler(forMethod descriptor: MethodDescriptor) -> Bool
Returns whether a handler exists for a given method.
mutating func registerHandler<Input, Output>(forMethod descriptor: MethodDescriptor, deserializer: some MessageDeserializer<Input>, serializer: some MessageSerializer<Output>, handler: @escaping (_ request: StreamingServerRequest<Input>, _ context: ServerContext) async throws -> StreamingServerResponse<Output>) where Input : Sendable, Output : Sendable
Registers a handler with the router.
mutating func registerInterceptors(pipeline: [ConditionalInterceptor<any ServerInterceptor>])
Registers applicable interceptors to all currently-registered handlers.
@discardableResult mutating func removeHandler(forMethod descriptor: MethodDescriptor) -> Bool
Removes any handler registered for the specified method.