operation.pxd.pxi 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. # Copyright 2017 gRPC authors.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. cdef class Operation:
  15. cdef void c(self) except *
  16. cdef void un_c(self) except *
  17. # TODO(https://github.com/grpc/grpc/issues/7950): Eliminate this!
  18. cdef grpc_op c_op
  19. cdef class SendInitialMetadataOperation(Operation):
  20. cdef readonly object _initial_metadata;
  21. cdef readonly int _flags
  22. cdef grpc_metadata *_c_initial_metadata
  23. cdef size_t _c_initial_metadata_count
  24. cdef void c(self) except *
  25. cdef void un_c(self) except *
  26. cdef class SendMessageOperation(Operation):
  27. cdef readonly bytes _message
  28. cdef readonly int _flags
  29. cdef grpc_byte_buffer *_c_message_byte_buffer
  30. cdef void c(self) except *
  31. cdef void un_c(self) except *
  32. cdef class SendCloseFromClientOperation(Operation):
  33. cdef readonly int _flags
  34. cdef void c(self) except *
  35. cdef void un_c(self) except *
  36. cdef class SendStatusFromServerOperation(Operation):
  37. cdef readonly object _trailing_metadata
  38. cdef readonly object _code
  39. cdef readonly object _details
  40. cdef readonly int _flags
  41. cdef grpc_metadata *_c_trailing_metadata
  42. cdef size_t _c_trailing_metadata_count
  43. cdef grpc_slice _c_details
  44. cdef void c(self) except *
  45. cdef void un_c(self) except *
  46. cdef class ReceiveInitialMetadataOperation(Operation):
  47. cdef readonly int _flags
  48. cdef tuple _initial_metadata
  49. cdef grpc_metadata_array _c_initial_metadata
  50. cdef void c(self) except *
  51. cdef void un_c(self) except *
  52. cdef class ReceiveMessageOperation(Operation):
  53. cdef readonly int _flags
  54. cdef grpc_byte_buffer *_c_message_byte_buffer
  55. cdef bytes _message
  56. cdef void c(self) except *
  57. cdef void un_c(self) except *
  58. cdef class ReceiveStatusOnClientOperation(Operation):
  59. cdef readonly int _flags
  60. cdef grpc_metadata_array _c_trailing_metadata
  61. cdef grpc_status_code _c_code
  62. cdef grpc_slice _c_details
  63. cdef const char* _c_error_string
  64. cdef tuple _trailing_metadata
  65. cdef object _code
  66. cdef str _details
  67. cdef str _error_string
  68. cdef void c(self) except *
  69. cdef void un_c(self) except *
  70. cdef class ReceiveCloseOnServerOperation(Operation):
  71. cdef readonly int _flags
  72. cdef object _cancelled
  73. cdef int _c_cancelled
  74. cdef void c(self) except *
  75. cdef void un_c(self) except *