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 15 16cdef class Operation: 17 18 cdef void c(self) 19 cdef void un_c(self) 20 21 # TODO(https://github.com/grpc/grpc/issues/7950): Eliminate this! 22 cdef grpc_op c_op 23 24 25cdef class SendInitialMetadataOperation(Operation): 26 27 cdef readonly object _initial_metadata; 28 cdef readonly int _flags 29 cdef grpc_metadata *_c_initial_metadata 30 cdef size_t _c_initial_metadata_count 31 32 cdef void c(self) 33 cdef void un_c(self) 34 35 36cdef class SendMessageOperation(Operation): 37 38 cdef readonly bytes _message 39 cdef readonly int _flags 40 cdef grpc_byte_buffer *_c_message_byte_buffer 41 42 cdef void c(self) 43 cdef void un_c(self) 44 45 46cdef class SendCloseFromClientOperation(Operation): 47 48 cdef readonly int _flags 49 50 cdef void c(self) 51 cdef void un_c(self) 52 53 54cdef class SendStatusFromServerOperation(Operation): 55 56 cdef readonly object _trailing_metadata 57 cdef readonly object _code 58 cdef readonly object _details 59 cdef readonly int _flags 60 cdef grpc_metadata *_c_trailing_metadata 61 cdef size_t _c_trailing_metadata_count 62 cdef grpc_slice _c_details 63 64 cdef void c(self) 65 cdef void un_c(self) 66 67 68cdef class ReceiveInitialMetadataOperation(Operation): 69 70 cdef readonly int _flags 71 cdef tuple _initial_metadata 72 cdef grpc_metadata_array _c_initial_metadata 73 74 cdef void c(self) 75 cdef void un_c(self) 76 77 78cdef class ReceiveMessageOperation(Operation): 79 80 cdef readonly int _flags 81 cdef grpc_byte_buffer *_c_message_byte_buffer 82 cdef bytes _message 83 84 cdef void c(self) 85 cdef void un_c(self) 86 87 88cdef class ReceiveStatusOnClientOperation(Operation): 89 90 cdef readonly int _flags 91 cdef grpc_metadata_array _c_trailing_metadata 92 cdef grpc_status_code _c_code 93 cdef grpc_slice _c_details 94 cdef const char* _c_error_string 95 cdef tuple _trailing_metadata 96 cdef object _code 97 cdef str _details 98 cdef str _error_string 99 100 cdef void c(self) 101 cdef void un_c(self) 102 103 104cdef class ReceiveCloseOnServerOperation(Operation): 105 106 cdef readonly int _flags 107 cdef object _cancelled 108 cdef int _c_cancelled 109 110 cdef void c(self) 111 cdef void un_c(self) 112