o
    áË·e7  ã                	   @   s    d Z ddlZddlmZ ddlmZ ddlmZ ddlmZ G dd„ dej	e 
dg d	¢¡ƒZd
d„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ ZdS )z-Utilities for RPC Framework's Face interface.é    N)Úcardinality)Ústyle)Ústream)Úfacec                   @   s   e Zd ZdS )Ú_MethodImplementationN)Ú__name__Ú
__module__Ú__qualname__© r
   r
   ú_/var/www/ideatree/venv/lib/python3.10/site-packages/grpc/framework/interfaces/face/utilities.pyr      s    r   )
r   r   Úunary_unary_inlineÚunary_stream_inlineÚstream_unary_inlineÚstream_stream_inlineÚunary_unary_eventÚunary_stream_eventÚstream_unary_eventÚstream_stream_eventc                 C   s"   t tjjtjj| dddddddƒ
S )aO  Creates an face.MethodImplementation for the given behavior.

  Args:
    behavior: The implementation of a unary-unary RPC method as a callable value
      that takes a request value and an face.ServicerContext object and
      returns a response value.

  Returns:
    An face.MethodImplementation derived from the given behavior.
  N)r   r   ÚCardinalityÚUNARY_UNARYr   ÚServiceÚINLINE©Úbehaviorr
   r
   r   r   )   ó   
þr   c                 C   s"   t tjjtjjd| ddddddƒ
S )a^  Creates an face.MethodImplementation for the given behavior.

  Args:
    behavior: The implementation of a unary-stream RPC method as a callable
      value that takes a request value and an face.ServicerContext object and
      returns an iterator of response values.

  Returns:
    An face.MethodImplementation derived from the given behavior.
  N)r   r   r   ÚUNARY_STREAMr   r   r   r   r
   r
   r   r   9   r   r   c                 C   s"   t tjjtjjdd| dddddƒ
S )a^  Creates an face.MethodImplementation for the given behavior.

  Args:
    behavior: The implementation of a stream-unary RPC method as a callable
      value that takes an iterator of request values and an
      face.ServicerContext object and returns a response value.

  Returns:
    An face.MethodImplementation derived from the given behavior.
  N)r   r   r   ÚSTREAM_UNARYr   r   r   r   r
   r
   r   r   I   r   r   c                 C   s"   t tjjtjjddd| ddddƒ
S )am  Creates an face.MethodImplementation for the given behavior.

  Args:
    behavior: The implementation of a stream-stream RPC method as a callable
      value that takes an iterator of request values and an
      face.ServicerContext object and returns an iterator of response values.

  Returns:
    An face.MethodImplementation derived from the given behavior.
  N)r   r   r   ÚSTREAM_STREAMr   r   r   r   r
   r
   r   r   Y   r   r   c                 C   s"   t tjjtjjdddd| dddƒ
S )ap  Creates an face.MethodImplementation for the given behavior.

  Args:
    behavior: The implementation of a unary-unary RPC method as a callable
      value that takes a request value, a response callback to which to pass
      the response value of the RPC, and an face.ServicerContext.

  Returns:
    An face.MethodImplementation derived from the given behavior.
  N)r   r   r   r   r   r   ÚEVENTr   r
   r
   r   r   i   ó   þr   c                 C   s"   t tjjtjjddddd| ddƒ
S )at  Creates an face.MethodImplementation for the given behavior.

  Args:
    behavior: The implementation of a unary-stream RPC method as a callable
      value that takes a request value, a stream.Consumer to which to pass the
      the response values of the RPC, and an face.ServicerContext.

  Returns:
    An face.MethodImplementation derived from the given behavior.
  N)r   r   r   r   r   r   r   r   r
   r
   r   r   y   r   r   c                 C   s"   t tjjtjjdddddd| dƒ
S )a»  Creates an face.MethodImplementation for the given behavior.

  Args:
    behavior: The implementation of a stream-unary RPC method as a callable
      value that takes a response callback to which to pass the response value
      of the RPC and an face.ServicerContext and returns a stream.Consumer to
      which the request values of the RPC should be passed.

  Returns:
    An face.MethodImplementation derived from the given behavior.
  N)r   r   r   r   r   r   r   r   r
   r
   r   r   ‰   ó   þr   c                 C   s"   t tjjtjjddddddd| ƒ
S )a»  Creates an face.MethodImplementation for the given behavior.

  Args:
    behavior: The implementation of a stream-stream RPC method as a callable
      value that takes a stream.Consumer to which to pass the response values
      of the RPC and an face.ServicerContext and returns a stream.Consumer to
      which the request values of the RPC should be passed.

  Returns:
    An face.MethodImplementation derived from the given behavior.
  N)r   r   r   r   r   r   r   r   r
   r
   r   r   š   r    r   )Ú__doc__ÚcollectionsÚgrpc.framework.commonr   r   Úgrpc.framework.foundationr   Úgrpc.framework.interfaces.facer   ÚMethodImplementationÚ
namedtupler   r   r   r   r   r   r   r   r   r
   r
   r
   r   Ú<module>   s"   ÿ