class_docstr: Context manager to set and get gRPC context.
  
  This class implements most of the methods from ServicerContext
  (see: https://grpc.github.io/grpc/python/grpc.html#grpc.ServicerContext). It's
  serializable and can be passed with the request to be used on the deployment.
class_docstr_tok: ["Context","manager","to","set","and","get","gRPC","context",".","This","class","implements","most","of","the","methods","from","ServicerContext","(","see",":","https",":","\/\/grpc.github.io\/grpc\/python\/grpc.html","#","grpc.ServicerContext",")",".","It's","serializable","and","can","be","passed","with","the","request","to","be","used","on","the","deployment","."]
docstr: Sets the trailing metadata for the RPC.
  
  Sets the trailing metadata to be sent upon completion of the RPC.
  
  If this method is invoked multiple times throughout the lifetime of an
  RPC, the value supplied in the final invocation + request id will be the value
  sent over the wire.
  
  This method need not be called by implementations if they have no
  metadata to add to what the gRPC runtime will transmit.
  
  Args:
    trailing_metadata: The trailing :term:`metadata`.
docstr_tok: ["Sets","the","trailing","metadata","for","the","RPC",".","Sets","the","trailing","metadata","to","be","sent","upon","completion","of","the","RPC",".","If","this","method","is","invoked","multiple","times","throughout","the","lifetime","of","an","RPC",",","the","value","supplied","in","the","final","invocation","+","request","id","will","be","the","value","sent","over","the","wire",".","This","method","need","not","be","called","by","implementations","if","they","have","no","metadata","to","add","to","what","the","gRPC","runtime","will","transmit",".","Args",":","trailing_metadata",":","The","trailing",":","term",":","`","metadata","`","."]
code: def set_trailing_metadata(
      self, trailing_metadata: List[Tuple[str, str]]
  ):
      """Sets the trailing metadata for the RPC.
  
      Sets the trailing metadata to be sent upon completion of the RPC.
  
      If this method is invoked multiple times throughout the lifetime of an
      RPC, the value supplied in the final invocation + request id will be the value
      sent over the wire.
  
      This method need not be called by implementations if they have no
      metadata to add to what the gRPC runtime will transmit.
  
      Args:
        trailing_metadata: The trailing :term:`metadata`.
      """
      self._trailing_metadata = (
          self._request_id_metadata() + trailing_metadata
      )
  
file_path: ray/python/ray/serve/grpc_util.py
imports: from typing import Any, Dict, List, Optional, Tuple
  import grpc
  from ray.util.annotations import PublicAPI
label_desc: Use image node_id 14 for calling the RayServegRPCContext obj's underlying member method code with example usage: obj.set_trailing_metadata(trailing_metadata) without return types