MCPcopy Create free account
hub / github.com/apache/fory / RpcMethod

Class RpcMethod

compiler/fory_compiler/ir/ast.py:277–298  ·  view source on GitHub ↗

An RPC method inside a service.

Source from the content-addressed store, hash-verified

275
276@dataclass
277class RpcMethod:
278 """An RPC method inside a service."""
279
280 name: str
281 request_type: NamedType
282 response_type: NamedType
283 client_streaming: bool = False
284 server_streaming: bool = False
285 options: dict = field(default_factory=dict)
286 line: int = 0
287 column: int = 0
288 location: Optional[SourceLocation] = None
289
290 def __repr__(self) -> str:
291 opts_str = f" [{self.options}]" if self.options else ""
292 req_stream = "stream " if self.client_streaming else ""
293 res_stream = "stream " if self.server_streaming else ""
294 return (
295 f"RpcMethod({self.name} "
296 f"({req_stream}{self.request_type}) returns ({res_stream}{self.response_type})"
297 f"{opts_str})"
298 )
299
300
301@dataclass

Callers 3

_translate_rpc_methodMethod · 0.90
parse_rpc_methodMethod · 0.90
_translate_rpc_methodMethod · 0.90

Calls 1

fieldFunction · 0.50

Tested by

no test coverage detected