methodKindFromFlags function
Maps a (clientStreaming, serverStreaming) flag pair to a MethodKind.
This is the typed counterpart of the boolean flags carried by
MethodDescriptorProto (and by extractServiceMethods() in
grpc_frame.dart).
Implementation
MethodKind methodKindFromFlags({
required bool clientStreaming,
required bool serverStreaming,
}) {
if (clientStreaming && serverStreaming) return MethodKind.bidiStreaming;
if (clientStreaming) return MethodKind.clientStreaming;
if (serverStreaming) return MethodKind.serverStreaming;
return MethodKind.unary;
}