1 pub const GRPC_ARES: u32 = 1; 2 pub const GRPC_IF_NAMETOINDEX: u32 = 1; 3 pub const GRPC_ALLOW_EXCEPTIONS: u32 = 1; 4 pub const GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY: &[u8; 31] = 5 b"grpc-internal-encoding-request\0"; 6 pub const GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM: &[u8; 35] = 7 b"grpc.default_compression_algorithm\0"; 8 pub const GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL: &[u8; 31] = b"grpc.default_compression_level\0"; 9 pub const GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET: &[u8; 43] = 10 b"grpc.compression_enabled_algorithms_bitset\0"; 11 pub const GRPC_SLICE_BUFFER_INLINE_ELEMENTS: u32 = 8; 12 pub const GRPC_ARG_ENABLE_CENSUS: &[u8; 12] = b"grpc.census\0"; 13 pub const GRPC_ARG_ENABLE_LOAD_REPORTING: &[u8; 19] = b"grpc.loadreporting\0"; 14 pub const GRPC_ARG_SERVER_CALL_METRIC_RECORDING: &[u8; 34] = b"grpc.server_call_metric_recording\0"; 15 pub const GRPC_ARG_MINIMAL_STACK: &[u8; 19] = b"grpc.minimal_stack\0"; 16 pub const GRPC_ARG_MAX_CONCURRENT_STREAMS: &[u8; 28] = b"grpc.max_concurrent_streams\0"; 17 pub const GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH: &[u8; 32] = b"grpc.max_receive_message_length\0"; 18 pub const GRPC_ARG_MAX_MESSAGE_LENGTH: &[u8; 32] = b"grpc.max_receive_message_length\0"; 19 pub const GRPC_ARG_MAX_SEND_MESSAGE_LENGTH: &[u8; 29] = b"grpc.max_send_message_length\0"; 20 pub const GRPC_ARG_MAX_CONNECTION_IDLE_MS: &[u8; 28] = b"grpc.max_connection_idle_ms\0"; 21 pub const GRPC_ARG_MAX_CONNECTION_AGE_MS: &[u8; 27] = b"grpc.max_connection_age_ms\0"; 22 pub const GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS: &[u8; 33] = b"grpc.max_connection_age_grace_ms\0"; 23 pub const GRPC_ARG_CLIENT_IDLE_TIMEOUT_MS: &[u8; 28] = b"grpc.client_idle_timeout_ms\0"; 24 pub const GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION: &[u8; 29] = b"grpc.per_message_compression\0"; 25 pub const GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION: &[u8; 31] = 26 b"grpc.per_message_decompression\0"; 27 pub const GRPC_ARG_ENABLE_DEADLINE_CHECKS: &[u8; 30] = b"grpc.enable_deadline_checking\0"; 28 pub const GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER: &[u8; 35] = 29 b"grpc.http2.initial_sequence_number\0"; 30 pub const GRPC_ARG_HTTP2_STREAM_LOOKAHEAD_BYTES: &[u8; 27] = b"grpc.http2.lookahead_bytes\0"; 31 pub const GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_DECODER: &[u8; 36] = 32 b"grpc.http2.hpack_table_size.decoder\0"; 33 pub const GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_ENCODER: &[u8; 36] = 34 b"grpc.http2.hpack_table_size.encoder\0"; 35 pub const GRPC_ARG_HTTP2_MAX_FRAME_SIZE: &[u8; 26] = b"grpc.http2.max_frame_size\0"; 36 pub const GRPC_ARG_HTTP2_BDP_PROBE: &[u8; 21] = b"grpc.http2.bdp_probe\0"; 37 pub const GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS: &[u8; 37] = 38 b"grpc.http2.min_time_between_pings_ms\0"; 39 pub const GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS: &[u8; 45] = 40 b"grpc.http2.min_ping_interval_without_data_ms\0"; 41 pub const GRPC_ARG_HTTP2_SCHEME: &[u8; 18] = b"grpc.http2_scheme\0"; 42 pub const GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA: &[u8; 34] = b"grpc.http2.max_pings_without_data\0"; 43 pub const GRPC_ARG_HTTP2_MAX_PING_STRIKES: &[u8; 28] = b"grpc.http2.max_ping_strikes\0"; 44 pub const GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE: &[u8; 29] = b"grpc.http2.write_buffer_size\0"; 45 pub const GRPC_ARG_HTTP2_ENABLE_TRUE_BINARY: &[u8; 23] = b"grpc.http2.true_binary\0"; 46 pub const GRPC_ARG_EXPERIMENTAL_HTTP2_PREFERRED_CRYPTO_FRAME_SIZE: &[u8; 52] = 47 b"grpc.experimental.http2.enable_preferred_frame_size\0"; 48 pub const GRPC_ARG_KEEPALIVE_TIME_MS: &[u8; 23] = b"grpc.keepalive_time_ms\0"; 49 pub const GRPC_ARG_KEEPALIVE_TIMEOUT_MS: &[u8; 26] = b"grpc.keepalive_timeout_ms\0"; 50 pub const GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS: &[u8; 36] = 51 b"grpc.keepalive_permit_without_calls\0"; 52 pub const GRPC_ARG_DEFAULT_AUTHORITY: &[u8; 23] = b"grpc.default_authority\0"; 53 pub const GRPC_ARG_PRIMARY_USER_AGENT_STRING: &[u8; 24] = b"grpc.primary_user_agent\0"; 54 pub const GRPC_ARG_SECONDARY_USER_AGENT_STRING: &[u8; 26] = b"grpc.secondary_user_agent\0"; 55 pub const GRPC_ARG_MIN_RECONNECT_BACKOFF_MS: &[u8; 30] = b"grpc.min_reconnect_backoff_ms\0"; 56 pub const GRPC_ARG_MAX_RECONNECT_BACKOFF_MS: &[u8; 30] = b"grpc.max_reconnect_backoff_ms\0"; 57 pub const GRPC_ARG_INITIAL_RECONNECT_BACKOFF_MS: &[u8; 34] = b"grpc.initial_reconnect_backoff_ms\0"; 58 pub const GRPC_ARG_DNS_MIN_TIME_BETWEEN_RESOLUTIONS_MS: &[u8; 41] = 59 b"grpc.dns_min_time_between_resolutions_ms\0"; 60 pub const GRPC_ARG_SERVER_HANDSHAKE_TIMEOUT_MS: &[u8; 33] = b"grpc.server_handshake_timeout_ms\0"; 61 pub const GRPC_SSL_TARGET_NAME_OVERRIDE_ARG: &[u8; 30] = b"grpc.ssl_target_name_override\0"; 62 pub const GRPC_SSL_SESSION_CACHE_ARG: &[u8; 23] = b"grpc.ssl_session_cache\0"; 63 pub const GRPC_ARG_TSI_MAX_FRAME_SIZE: &[u8; 24] = b"grpc.tsi.max_frame_size\0"; 64 pub const GRPC_ARG_MAX_METADATA_SIZE: &[u8; 23] = b"grpc.max_metadata_size\0"; 65 pub const GRPC_ARG_ABSOLUTE_MAX_METADATA_SIZE: &[u8; 32] = b"grpc.absolute_max_metadata_size\0"; 66 pub const GRPC_ARG_ALLOW_REUSEPORT: &[u8; 18] = b"grpc.so_reuseport\0"; 67 pub const GRPC_ARG_RESOURCE_QUOTA: &[u8; 20] = b"grpc.resource_quota\0"; 68 pub const GRPC_ARG_EXPAND_WILDCARD_ADDRS: &[u8; 27] = b"grpc.expand_wildcard_addrs\0"; 69 pub const GRPC_ARG_SERVICE_CONFIG: &[u8; 20] = b"grpc.service_config\0"; 70 pub const GRPC_ARG_SERVICE_CONFIG_DISABLE_RESOLUTION: &[u8; 39] = 71 b"grpc.service_config_disable_resolution\0"; 72 pub const GRPC_ARG_LB_POLICY_NAME: &[u8; 20] = b"grpc.lb_policy_name\0"; 73 pub const GRPC_ARG_RING_HASH_LB_RING_SIZE_CAP: &[u8; 32] = b"grpc.lb.ring_hash.ring_size_cap\0"; 74 pub const GRPC_ARG_SOCKET_MUTATOR: &[u8; 20] = b"grpc.socket_mutator\0"; 75 pub const GRPC_ARG_SOCKET_FACTORY: &[u8; 20] = b"grpc.socket_factory\0"; 76 pub const GRPC_ARG_GZIP_COMPRESSION_LEVEL: &[u8; 28] = b"grpc.gzip_compression_level\0"; 77 pub const GRPC_ARG_MIN_MESSAGE_SIZE_TO_COMPRESS: &[u8; 39] = 78 b"grpc.gprc_min_message_size_to_compress\0"; 79 pub const GRPC_ARG_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE: &[u8; 45] = 80 b"grpc.max_channel_trace_event_memory_per_node\0"; 81 pub const GRPC_ARG_ENABLE_CHANNELZ: &[u8; 21] = b"grpc.enable_channelz\0"; 82 pub const GRPC_ARG_USE_CRONET_PACKET_COALESCING: &[u8; 34] = b"grpc.use_cronet_packet_coalescing\0"; 83 pub const GRPC_ARG_TCP_READ_CHUNK_SIZE: &[u8; 38] = b"grpc.experimental.tcp_read_chunk_size\0"; 84 pub const GRPC_TCP_DEFAULT_READ_SLICE_SIZE: u32 = 8192; 85 pub const GRPC_ARG_TCP_MIN_READ_CHUNK_SIZE: &[u8; 42] = 86 b"grpc.experimental.tcp_min_read_chunk_size\0"; 87 pub const GRPC_ARG_TCP_MAX_READ_CHUNK_SIZE: &[u8; 42] = 88 b"grpc.experimental.tcp_max_read_chunk_size\0"; 89 pub const GRPC_ARG_TCP_TX_ZEROCOPY_ENABLED: &[u8; 42] = 90 b"grpc.experimental.tcp_tx_zerocopy_enabled\0"; 91 pub const GRPC_ARG_TCP_TX_ZEROCOPY_SEND_BYTES_THRESHOLD: &[u8; 55] = 92 b"grpc.experimental.tcp_tx_zerocopy_send_bytes_threshold\0"; 93 pub const GRPC_ARG_TCP_TX_ZEROCOPY_MAX_SIMULT_SENDS: &[u8; 57] = 94 b"grpc.experimental.tcp_tx_zerocopy_max_simultaneous_sends\0"; 95 pub const GRPC_ARG_TCP_RECEIVE_BUFFER_SIZE: &[u8; 29] = b"grpc.tcp_receive_buffer_size\0"; 96 pub const GRPC_ARG_GRPCLB_CALL_TIMEOUT_MS: &[u8; 28] = b"grpc.grpclb_call_timeout_ms\0"; 97 pub const GRPC_ARG_TEST_ONLY_DO_NOT_USE_IN_PROD_XDS_BOOTSTRAP_CONFIG: &[u8; 55] = 98 b"grpc.TEST_ONLY_DO_NOT_USE_IN_PROD.xds_bootstrap_config\0"; 99 pub const GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS: &[u8; 32] = b"grpc.grpclb_fallback_timeout_ms\0"; 100 pub const GRPC_ARG_EXPERIMENTAL_GRPCLB_CHANNEL_ARGS: &[u8; 38] = 101 b"grpc.experimental.grpclb_channel_args\0"; 102 pub const GRPC_ARG_PRIORITY_FAILOVER_TIMEOUT_MS: &[u8; 34] = b"grpc.priority_failover_timeout_ms\0"; 103 pub const GRPC_ARG_WORKAROUND_CRONET_COMPRESSION: &[u8; 35] = 104 b"grpc.workaround.cronet_compression\0"; 105 pub const GRPC_ARG_OPTIMIZATION_TARGET: &[u8; 25] = b"grpc.optimization_target\0"; 106 pub const GRPC_ARG_ENABLE_RETRIES: &[u8; 20] = b"grpc.enable_retries\0"; 107 pub const GRPC_ARG_EXPERIMENTAL_ENABLE_HEDGING: &[u8; 33] = b"grpc.experimental.enable_hedging\0"; 108 pub const GRPC_ARG_PER_RPC_RETRY_BUFFER_SIZE: &[u8; 31] = b"grpc.per_rpc_retry_buffer_size\0"; 109 pub const GRPC_ARG_MOBILE_LOG_CONTEXT: &[u8; 24] = b"grpc.mobile_log_context\0"; 110 pub const GRPC_ARG_DISABLE_CLIENT_AUTHORITY_FILTER: &[u8; 37] = 111 b"grpc.disable_client_authority_filter\0"; 112 pub const GRPC_ARG_ENABLE_HTTP_PROXY: &[u8; 23] = b"grpc.enable_http_proxy\0"; 113 pub const GRPC_ARG_HTTP_PROXY: &[u8; 16] = b"grpc.http_proxy\0"; 114 pub const GRPC_ARG_SURFACE_USER_AGENT: &[u8; 24] = b"grpc.surface_user_agent\0"; 115 pub const GRPC_ARG_INHIBIT_HEALTH_CHECKING: &[u8; 29] = b"grpc.inhibit_health_checking\0"; 116 pub const GRPC_ARG_DNS_ENABLE_SRV_QUERIES: &[u8; 28] = b"grpc.dns_enable_srv_queries\0"; 117 pub const GRPC_ARG_DNS_ARES_QUERY_TIMEOUT_MS: &[u8; 28] = b"grpc.dns_ares_query_timeout\0"; 118 pub const GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL: &[u8; 31] = b"grpc.use_local_subchannel_pool\0"; 119 pub const GRPC_ARG_CHANNEL_POOL_DOMAIN: &[u8; 28] = b"grpc.channel_pooling_domain\0"; 120 pub const GRPC_ARG_CHANNEL_ID: &[u8; 16] = b"grpc.channel_id\0"; 121 pub const GRPC_ARG_AUTHORIZATION_POLICY_PROVIDER: &[u8; 35] = 122 b"grpc.authorization_policy_provider\0"; 123 pub const GRPC_ARG_SERVER_CONFIG_CHANGE_DRAIN_GRACE_TIME_MS: &[u8; 59] = 124 b"grpc.experimental.server_config_change_drain_grace_time_ms\0"; 125 pub const GRPC_DEFAULT_MAX_SEND_MESSAGE_LENGTH: i32 = -1; 126 pub const GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH: u32 = 4194304; 127 pub const GRPC_WRITE_BUFFER_HINT: u32 = 1; 128 pub const GRPC_WRITE_NO_COMPRESS: u32 = 2; 129 pub const GRPC_WRITE_THROUGH: u32 = 4; 130 pub const GRPC_WRITE_USED_MASK: u32 = 7; 131 pub const GRPC_INITIAL_METADATA_WAIT_FOR_READY: u32 = 32; 132 pub const GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET: u32 = 128; 133 pub const GRPC_INITIAL_METADATA_USED_MASK: u32 = 164; 134 pub const GRPC_CQ_CURRENT_VERSION: u32 = 2; 135 pub const GRPC_CQ_VERSION_MINIMUM_FOR_CALLBACKABLE: u32 = 2; 136 pub const GRPC_MAX_COMPLETION_QUEUE_PLUCKERS: u32 = 6; 137 pub const GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME: &[u8; 24] = b"transport_security_type\0"; 138 pub const GRPC_SSL_TRANSPORT_SECURITY_TYPE: &[u8; 4] = b"ssl\0"; 139 pub const GRPC_TLS_TRANSPORT_SECURITY_TYPE: &[u8; 4] = b"tls\0"; 140 pub const GRPC_X509_CN_PROPERTY_NAME: &[u8; 17] = b"x509_common_name\0"; 141 pub const GRPC_X509_SUBJECT_PROPERTY_NAME: &[u8; 13] = b"x509_subject\0"; 142 pub const GRPC_X509_SAN_PROPERTY_NAME: &[u8; 30] = b"x509_subject_alternative_name\0"; 143 pub const GRPC_X509_PEM_CERT_PROPERTY_NAME: &[u8; 14] = b"x509_pem_cert\0"; 144 pub const GRPC_X509_PEM_CERT_CHAIN_PROPERTY_NAME: &[u8; 20] = b"x509_pem_cert_chain\0"; 145 pub const GRPC_SSL_SESSION_REUSED_PROPERTY: &[u8; 19] = b"ssl_session_reused\0"; 146 pub const GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME: &[u8; 15] = b"security_level\0"; 147 pub const GRPC_PEER_DNS_PROPERTY_NAME: &[u8; 9] = b"peer_dns\0"; 148 pub const GRPC_PEER_SPIFFE_ID_PROPERTY_NAME: &[u8; 15] = b"peer_spiffe_id\0"; 149 pub const GRPC_PEER_URI_PROPERTY_NAME: &[u8; 9] = b"peer_uri\0"; 150 pub const GRPC_PEER_EMAIL_PROPERTY_NAME: &[u8; 11] = b"peer_email\0"; 151 pub const GRPC_PEER_IP_PROPERTY_NAME: &[u8; 8] = b"peer_ip\0"; 152 pub const GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR: &[u8; 33] = 153 b"GRPC_DEFAULT_SSL_ROOTS_FILE_PATH\0"; 154 pub const GRPC_GOOGLE_CREDENTIALS_ENV_VAR: &[u8; 31] = b"GOOGLE_APPLICATION_CREDENTIALS\0"; 155 pub const GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX: u32 = 4; 156 extern "C" { gpr_unreachable_code( reason: *const ::std::os::raw::c_char, file: *const ::std::os::raw::c_char, line: ::std::os::raw::c_int, ) -> !157 pub fn gpr_unreachable_code( 158 reason: *const ::std::os::raw::c_char, 159 file: *const ::std::os::raw::c_char, 160 line: ::std::os::raw::c_int, 161 ) -> !; 162 } 163 #[repr(i32)] 164 #[doc = " The various compression algorithms supported by gRPC (not sorted by\n compression level)"] 165 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 166 pub enum grpc_compression_algorithm { 167 GRPC_COMPRESS_NONE = 0, 168 GRPC_COMPRESS_DEFLATE = 1, 169 GRPC_COMPRESS_GZIP = 2, 170 GRPC_COMPRESS_ALGORITHMS_COUNT = 3, 171 } 172 #[repr(i32)] 173 #[doc = " Compression levels allow a party with knowledge of its peer's accepted\n encodings to request compression in an abstract way. The level-algorithm\n mapping is performed internally and depends on the peer's supported\n compression algorithms."] 174 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 175 pub enum grpc_compression_level { 176 GRPC_COMPRESS_LEVEL_NONE = 0, 177 GRPC_COMPRESS_LEVEL_LOW = 1, 178 GRPC_COMPRESS_LEVEL_MED = 2, 179 GRPC_COMPRESS_LEVEL_HIGH = 3, 180 GRPC_COMPRESS_LEVEL_COUNT = 4, 181 } 182 #[repr(C)] 183 #[derive(Debug, Copy, Clone)] 184 pub struct grpc_compression_options { 185 #[doc = " All algs are enabled by default. This option corresponds to the channel\n argument key behind \\a GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET"] 186 pub enabled_algorithms_bitset: u32, 187 pub default_level: grpc_compression_options_grpc_compression_options_default_level, 188 pub default_algorithm: grpc_compression_options_grpc_compression_options_default_algorithm, 189 } 190 #[doc = " The default compression level. It'll be used in the absence of call\n specific settings. This option corresponds to the channel\n argument key behind \\a GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL. If present,\n takes precedence over \\a default_algorithm.\n TODO(dgq): currently only available for server channels."] 191 #[repr(C)] 192 #[derive(Debug, Copy, Clone)] 193 pub struct grpc_compression_options_grpc_compression_options_default_level { 194 pub is_set: ::std::os::raw::c_int, 195 pub level: grpc_compression_level, 196 } 197 #[doc = " The default message compression algorithm. It'll be used in the absence of\n call specific settings. This option corresponds to the channel argument key\n behind \\a GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM."] 198 #[repr(C)] 199 #[derive(Debug, Copy, Clone)] 200 pub struct grpc_compression_options_grpc_compression_options_default_algorithm { 201 pub is_set: ::std::os::raw::c_int, 202 pub algorithm: grpc_compression_algorithm, 203 } 204 #[repr(C)] 205 #[derive(Debug, Copy, Clone)] 206 pub struct grpc_slice_refcount { 207 _unused: [u8; 0], 208 } 209 #[doc = " A grpc_slice s, if initialized, represents the byte range\ns.bytes[0..s.length-1].\n\nIt can have an associated ref count which has a destruction routine to be run\nwhen the ref count reaches zero (see grpc_slice_new() and grp_slice_unref()).\nMultiple grpc_slice values may share a ref count.\n\nIf the slice does not have a refcount, it represents an inlined small piece\nof data that is copied by value.\n\nAs a special case, a slice can be given refcount == uintptr_t(1), meaning\nthat the slice represents external data that is not refcounted."] 210 #[repr(C)] 211 #[derive(Copy, Clone)] 212 pub struct grpc_slice { 213 pub refcount: *mut grpc_slice_refcount, 214 pub data: grpc_slice_grpc_slice_data, 215 } 216 #[repr(C)] 217 #[derive(Copy, Clone)] 218 pub union grpc_slice_grpc_slice_data { 219 pub refcounted: grpc_slice_grpc_slice_data_grpc_slice_refcounted, 220 pub inlined: grpc_slice_grpc_slice_data_grpc_slice_inlined, 221 } 222 #[repr(C)] 223 #[derive(Debug, Copy, Clone)] 224 pub struct grpc_slice_grpc_slice_data_grpc_slice_refcounted { 225 pub length: usize, 226 pub bytes: *mut u8, 227 } 228 #[repr(C)] 229 #[derive(Debug, Copy, Clone)] 230 pub struct grpc_slice_grpc_slice_data_grpc_slice_inlined { 231 pub length: u8, 232 pub bytes: [u8; 23usize], 233 } 234 impl ::std::fmt::Debug for grpc_slice_grpc_slice_data { fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result235 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 236 write!(f, "grpc_slice_grpc_slice_data {{ union }}") 237 } 238 } 239 impl ::std::fmt::Debug for grpc_slice { fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result240 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 241 write!( 242 f, 243 "grpc_slice {{ refcount: {:?}, data: {:?} }}", 244 self.refcount, self.data 245 ) 246 } 247 } 248 #[doc = " Represents an expandable array of slices, to be interpreted as a\nsingle item."] 249 #[repr(C)] 250 #[derive(Copy, Clone)] 251 pub struct grpc_slice_buffer { 252 #[doc = " This is for internal use only. External users (i.e any code outside grpc\n core) MUST NOT use this field"] 253 pub base_slices: *mut grpc_slice, 254 #[doc = " slices in the array (Points to the first valid grpc_slice in the array)"] 255 pub slices: *mut grpc_slice, 256 #[doc = " the number of slices in the array"] 257 pub count: usize, 258 #[doc = " the number of slices allocated in the array. External users (i.e any code\n outside grpc core) MUST NOT use this field"] 259 pub capacity: usize, 260 #[doc = " the combined length of all slices in the array"] 261 pub length: usize, 262 #[doc = " inlined elements to avoid allocations"] 263 pub inlined: [grpc_slice; 8usize], 264 } 265 impl ::std::fmt::Debug for grpc_slice_buffer { fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result266 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 267 write!( 268 f, 269 "grpc_slice_buffer {{ base_slices: {:?}, slices: {:?}, inlined: {:?} }}", 270 self.base_slices, self.slices, self.inlined 271 ) 272 } 273 } 274 #[repr(i32)] 275 #[doc = " The clocks we support."] 276 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 277 pub enum gpr_clock_type { 278 #[doc = " Monotonic clock. Epoch undefined. Always moves forwards."] 279 GPR_CLOCK_MONOTONIC = 0, 280 #[doc = " Realtime clock. May jump forwards or backwards. Settable by\nthe system administrator. Has its epoch at 0:00:00 UTC 1 Jan 1970."] 281 GPR_CLOCK_REALTIME = 1, 282 #[doc = " CPU cycle time obtained by rdtsc instruction on x86 platforms. Epoch\nundefined. Degrades to GPR_CLOCK_REALTIME on other platforms."] 283 GPR_CLOCK_PRECISE = 2, 284 #[doc = " Unmeasurable clock type: no base, created by taking the difference\nbetween two times"] 285 GPR_TIMESPAN = 3, 286 } 287 #[doc = " Analogous to struct timespec. On some machines, absolute times may be in\n local time."] 288 #[repr(C)] 289 #[derive(Debug, Copy, Clone)] 290 pub struct gpr_timespec { 291 pub tv_sec: i64, 292 pub tv_nsec: i32, 293 #[doc = " Against which clock was this time measured? (or GPR_TIMESPAN if\nthis is a relative time measure)"] 294 pub clock_type: gpr_clock_type, 295 } 296 extern "C" { 297 #[doc = " Time constants. */\n/** The zero time interval."] gpr_time_0(type_: gpr_clock_type) -> gpr_timespec298 pub fn gpr_time_0(type_: gpr_clock_type) -> gpr_timespec; 299 } 300 extern "C" { 301 #[doc = " The far future"] gpr_inf_future(type_: gpr_clock_type) -> gpr_timespec302 pub fn gpr_inf_future(type_: gpr_clock_type) -> gpr_timespec; 303 } 304 extern "C" { 305 #[doc = " The far past."] gpr_inf_past(type_: gpr_clock_type) -> gpr_timespec306 pub fn gpr_inf_past(type_: gpr_clock_type) -> gpr_timespec; 307 } 308 extern "C" { 309 #[doc = " initialize time subsystem"] gpr_time_init()310 pub fn gpr_time_init(); 311 } 312 extern "C" { 313 #[doc = " Return the current time measured from the given clocks epoch."] gpr_now(clock: gpr_clock_type) -> gpr_timespec314 pub fn gpr_now(clock: gpr_clock_type) -> gpr_timespec; 315 } 316 extern "C" { 317 #[doc = " Convert a timespec from one clock to another"] gpr_convert_clock_type(t: gpr_timespec, clock_type: gpr_clock_type) -> gpr_timespec318 pub fn gpr_convert_clock_type(t: gpr_timespec, clock_type: gpr_clock_type) -> gpr_timespec; 319 } 320 extern "C" { 321 #[doc = " Return -ve, 0, or +ve according to whether a < b, a == b, or a > b\nrespectively."] gpr_time_cmp(a: gpr_timespec, b: gpr_timespec) -> ::std::os::raw::c_int322 pub fn gpr_time_cmp(a: gpr_timespec, b: gpr_timespec) -> ::std::os::raw::c_int; 323 } 324 extern "C" { gpr_time_max(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec325 pub fn gpr_time_max(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec; 326 } 327 extern "C" { gpr_time_min(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec328 pub fn gpr_time_min(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec; 329 } 330 extern "C" { 331 #[doc = " Add and subtract times. Calculations saturate at infinities."] gpr_time_add(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec332 pub fn gpr_time_add(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec; 333 } 334 extern "C" { gpr_time_sub(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec335 pub fn gpr_time_sub(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec; 336 } 337 extern "C" { 338 #[doc = " Return a timespec representing a given number of time units. INT64_MIN is\ninterpreted as gpr_inf_past, and INT64_MAX as gpr_inf_future."] gpr_time_from_micros(us: i64, clock_type: gpr_clock_type) -> gpr_timespec339 pub fn gpr_time_from_micros(us: i64, clock_type: gpr_clock_type) -> gpr_timespec; 340 } 341 extern "C" { gpr_time_from_nanos(ns: i64, clock_type: gpr_clock_type) -> gpr_timespec342 pub fn gpr_time_from_nanos(ns: i64, clock_type: gpr_clock_type) -> gpr_timespec; 343 } 344 extern "C" { gpr_time_from_millis(ms: i64, clock_type: gpr_clock_type) -> gpr_timespec345 pub fn gpr_time_from_millis(ms: i64, clock_type: gpr_clock_type) -> gpr_timespec; 346 } 347 extern "C" { gpr_time_from_seconds(s: i64, clock_type: gpr_clock_type) -> gpr_timespec348 pub fn gpr_time_from_seconds(s: i64, clock_type: gpr_clock_type) -> gpr_timespec; 349 } 350 extern "C" { gpr_time_from_minutes(m: i64, clock_type: gpr_clock_type) -> gpr_timespec351 pub fn gpr_time_from_minutes(m: i64, clock_type: gpr_clock_type) -> gpr_timespec; 352 } 353 extern "C" { gpr_time_from_hours(h: i64, clock_type: gpr_clock_type) -> gpr_timespec354 pub fn gpr_time_from_hours(h: i64, clock_type: gpr_clock_type) -> gpr_timespec; 355 } 356 extern "C" { gpr_time_to_millis(timespec: gpr_timespec) -> i32357 pub fn gpr_time_to_millis(timespec: gpr_timespec) -> i32; 358 } 359 extern "C" { 360 #[doc = " Return 1 if two times are equal or within threshold of each other,\n0 otherwise"] gpr_time_similar( a: gpr_timespec, b: gpr_timespec, threshold: gpr_timespec, ) -> ::std::os::raw::c_int361 pub fn gpr_time_similar( 362 a: gpr_timespec, 363 b: gpr_timespec, 364 threshold: gpr_timespec, 365 ) -> ::std::os::raw::c_int; 366 } 367 extern "C" { 368 #[doc = " Sleep until at least 'until' - an absolute timeout"] gpr_sleep_until(until: gpr_timespec)369 pub fn gpr_sleep_until(until: gpr_timespec); 370 } 371 extern "C" { gpr_timespec_to_micros(t: gpr_timespec) -> f64372 pub fn gpr_timespec_to_micros(t: gpr_timespec) -> f64; 373 } 374 pub type gpr_atm = isize; 375 extern "C" { 376 #[doc = " Adds \\a delta to \\a *value, clamping the result to the range specified\nby \\a min and \\a max. Returns the new value."] gpr_atm_no_barrier_clamped_add( value: *mut gpr_atm, delta: gpr_atm, min: gpr_atm, max: gpr_atm, ) -> gpr_atm377 pub fn gpr_atm_no_barrier_clamped_add( 378 value: *mut gpr_atm, 379 delta: gpr_atm, 380 min: gpr_atm, 381 max: gpr_atm, 382 ) -> gpr_atm; 383 } 384 #[repr(C)] 385 #[derive(Debug, Copy, Clone)] 386 pub struct gpr_event { 387 pub state: gpr_atm, 388 } 389 #[repr(C)] 390 #[derive(Debug, Copy, Clone)] 391 pub struct gpr_refcount { 392 pub count: gpr_atm, 393 } 394 #[repr(C)] 395 #[derive(Debug, Copy, Clone)] 396 pub struct gpr_stats_counter { 397 pub value: gpr_atm, 398 } 399 extern "C" { 400 #[doc = " Initialize *ev."] gpr_event_init(ev: *mut gpr_event)401 pub fn gpr_event_init(ev: *mut gpr_event); 402 } 403 extern "C" { 404 #[doc = " Set *ev so that gpr_event_get() and gpr_event_wait() will return value.\nRequires: *ev initialized; value != NULL; no prior or concurrent calls to\ngpr_event_set(ev, ...) since initialization."] gpr_event_set(ev: *mut gpr_event, value: *mut ::std::os::raw::c_void)405 pub fn gpr_event_set(ev: *mut gpr_event, value: *mut ::std::os::raw::c_void); 406 } 407 extern "C" { 408 #[doc = " Return the value set by gpr_event_set(ev, ...), or NULL if no such call has\ncompleted. If the result is non-NULL, all operations that occurred prior to\nthe gpr_event_set(ev, ...) set will be visible after this call returns.\nRequires: *ev initialized. This operation is faster than acquiring a mutex\non most platforms."] gpr_event_get(ev: *mut gpr_event) -> *mut ::std::os::raw::c_void409 pub fn gpr_event_get(ev: *mut gpr_event) -> *mut ::std::os::raw::c_void; 410 } 411 extern "C" { 412 #[doc = " Wait until *ev is set by gpr_event_set(ev, ...), or abs_deadline is\nexceeded, then return gpr_event_get(ev). Requires: *ev initialized. Use\nabs_deadline==gpr_inf_future for no deadline. When the event has been\nsignalled before the call, this operation is faster than acquiring a mutex\non most platforms."] gpr_event_wait( ev: *mut gpr_event, abs_deadline: gpr_timespec, ) -> *mut ::std::os::raw::c_void413 pub fn gpr_event_wait( 414 ev: *mut gpr_event, 415 abs_deadline: gpr_timespec, 416 ) -> *mut ::std::os::raw::c_void; 417 } 418 extern "C" { 419 #[doc = " Initialize *r to value n."] gpr_ref_init(r: *mut gpr_refcount, n: ::std::os::raw::c_int)420 pub fn gpr_ref_init(r: *mut gpr_refcount, n: ::std::os::raw::c_int); 421 } 422 extern "C" { 423 #[doc = " Increment the reference count *r. Requires *r initialized."] gpr_ref(r: *mut gpr_refcount)424 pub fn gpr_ref(r: *mut gpr_refcount); 425 } 426 extern "C" { 427 #[doc = " Increment the reference count *r. Requires *r initialized.\nCrashes if refcount is zero"] gpr_ref_non_zero(r: *mut gpr_refcount)428 pub fn gpr_ref_non_zero(r: *mut gpr_refcount); 429 } 430 extern "C" { 431 #[doc = " Increment the reference count *r by n. Requires *r initialized, n > 0."] gpr_refn(r: *mut gpr_refcount, n: ::std::os::raw::c_int)432 pub fn gpr_refn(r: *mut gpr_refcount, n: ::std::os::raw::c_int); 433 } 434 extern "C" { 435 #[doc = " Decrement the reference count *r and return non-zero iff it has reached\nzero. . Requires *r initialized."] gpr_unref(r: *mut gpr_refcount) -> ::std::os::raw::c_int436 pub fn gpr_unref(r: *mut gpr_refcount) -> ::std::os::raw::c_int; 437 } 438 extern "C" { 439 #[doc = " Return non-zero iff the reference count of *r is one, and thus is owned\nby exactly one object."] gpr_ref_is_unique(r: *mut gpr_refcount) -> ::std::os::raw::c_int440 pub fn gpr_ref_is_unique(r: *mut gpr_refcount) -> ::std::os::raw::c_int; 441 } 442 extern "C" { 443 #[doc = " Initialize *c to the value n."] gpr_stats_init(c: *mut gpr_stats_counter, n: isize)444 pub fn gpr_stats_init(c: *mut gpr_stats_counter, n: isize); 445 } 446 extern "C" { 447 #[doc = " *c += inc. Requires: *c initialized."] gpr_stats_inc(c: *mut gpr_stats_counter, inc: isize)448 pub fn gpr_stats_inc(c: *mut gpr_stats_counter, inc: isize); 449 } 450 extern "C" { 451 #[doc = " Return *c. Requires: *c initialized."] gpr_stats_read(c: *const gpr_stats_counter) -> isize452 pub fn gpr_stats_read(c: *const gpr_stats_counter) -> isize; 453 } 454 extern "C" { 455 #[doc = " Increment the refcount of s. Requires slice is initialized.\nReturns s."] grpc_slice_ref(s: grpc_slice) -> grpc_slice456 pub fn grpc_slice_ref(s: grpc_slice) -> grpc_slice; 457 } 458 extern "C" { 459 #[doc = " Decrement the ref count of s. If the ref count of s reaches zero, all\nslices sharing the ref count are destroyed, and considered no longer\ninitialized. If s is ultimately derived from a call to grpc_slice_new(start,\nlen, dest) where dest!=NULL , then (*dest)(start) is called, else if s is\nultimately derived from a call to grpc_slice_new_with_len(start, len, dest)\nwhere dest!=NULL , then (*dest)(start, len). Requires s initialized."] grpc_slice_unref(s: grpc_slice)460 pub fn grpc_slice_unref(s: grpc_slice); 461 } 462 extern "C" { 463 #[doc = " Copy slice - create a new slice that contains the same data as s"] grpc_slice_copy(s: grpc_slice) -> grpc_slice464 pub fn grpc_slice_copy(s: grpc_slice) -> grpc_slice; 465 } 466 extern "C" { 467 #[doc = " Create a slice pointing at some data. Calls malloc to allocate a refcount\nfor the object, and arranges that destroy will be called with the pointer\npassed in at destruction."] grpc_slice_new( p: *mut ::std::os::raw::c_void, len: usize, destroy: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>, ) -> grpc_slice468 pub fn grpc_slice_new( 469 p: *mut ::std::os::raw::c_void, 470 len: usize, 471 destroy: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>, 472 ) -> grpc_slice; 473 } 474 extern "C" { 475 #[doc = " Equivalent to grpc_slice_new, but with a separate pointer that is\npassed to the destroy function. This function can be useful when\nthe data is part of a larger structure that must be destroyed when\nthe data is no longer needed."] grpc_slice_new_with_user_data( p: *mut ::std::os::raw::c_void, len: usize, destroy: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>, user_data: *mut ::std::os::raw::c_void, ) -> grpc_slice476 pub fn grpc_slice_new_with_user_data( 477 p: *mut ::std::os::raw::c_void, 478 len: usize, 479 destroy: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>, 480 user_data: *mut ::std::os::raw::c_void, 481 ) -> grpc_slice; 482 } 483 extern "C" { 484 #[doc = " Equivalent to grpc_slice_new, but with a two argument destroy function that\nalso takes the slice length."] grpc_slice_new_with_len( p: *mut ::std::os::raw::c_void, len: usize, destroy: ::std::option::Option< unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void, arg2: usize), >, ) -> grpc_slice485 pub fn grpc_slice_new_with_len( 486 p: *mut ::std::os::raw::c_void, 487 len: usize, 488 destroy: ::std::option::Option< 489 unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void, arg2: usize), 490 >, 491 ) -> grpc_slice; 492 } 493 extern "C" { 494 #[doc = " Equivalent to grpc_slice_new(malloc(len), len, free), but saves one malloc()\ncall.\nAborts if malloc() fails."] grpc_slice_malloc(length: usize) -> grpc_slice495 pub fn grpc_slice_malloc(length: usize) -> grpc_slice; 496 } 497 extern "C" { grpc_slice_malloc_large(length: usize) -> grpc_slice498 pub fn grpc_slice_malloc_large(length: usize) -> grpc_slice; 499 } 500 extern "C" { 501 #[doc = " Create a slice by copying a string.\nDoes not preserve null terminators.\nEquivalent to:\nsize_t len = strlen(source);\ngrpc_slice slice = grpc_slice_malloc(len);\nmemcpy(slice->data, source, len);"] grpc_slice_from_copied_string(source: *const ::std::os::raw::c_char) -> grpc_slice502 pub fn grpc_slice_from_copied_string(source: *const ::std::os::raw::c_char) -> grpc_slice; 503 } 504 extern "C" { 505 #[doc = " Create a slice by copying a buffer.\nEquivalent to:\ngrpc_slice slice = grpc_slice_malloc(len);\nmemcpy(slice->data, source, len);"] grpc_slice_from_copied_buffer( source: *const ::std::os::raw::c_char, len: usize, ) -> grpc_slice506 pub fn grpc_slice_from_copied_buffer( 507 source: *const ::std::os::raw::c_char, 508 len: usize, 509 ) -> grpc_slice; 510 } 511 extern "C" { 512 #[doc = " Create a slice pointing to constant memory"] grpc_slice_from_static_string(source: *const ::std::os::raw::c_char) -> grpc_slice513 pub fn grpc_slice_from_static_string(source: *const ::std::os::raw::c_char) -> grpc_slice; 514 } 515 extern "C" { 516 #[doc = " Create a slice pointing to constant memory"] grpc_slice_from_static_buffer( source: *const ::std::os::raw::c_void, len: usize, ) -> grpc_slice517 pub fn grpc_slice_from_static_buffer( 518 source: *const ::std::os::raw::c_void, 519 len: usize, 520 ) -> grpc_slice; 521 } 522 extern "C" { 523 #[doc = " Return a result slice derived from s, which shares a ref count with \\a s,\nwhere result.data==s.data+begin, and result.length==end-begin. The ref count\nof \\a s is increased by one. Do not assign result back to \\a s.\nRequires s initialized, begin <= end, begin <= s.length, and\nend <= source->length."] grpc_slice_sub(s: grpc_slice, begin: usize, end: usize) -> grpc_slice524 pub fn grpc_slice_sub(s: grpc_slice, begin: usize, end: usize) -> grpc_slice; 525 } 526 extern "C" { 527 #[doc = " The same as grpc_slice_sub, but without altering the ref count"] grpc_slice_sub_no_ref(s: grpc_slice, begin: usize, end: usize) -> grpc_slice528 pub fn grpc_slice_sub_no_ref(s: grpc_slice, begin: usize, end: usize) -> grpc_slice; 529 } 530 extern "C" { 531 #[doc = " Splits s into two: modifies s to be s[0:split], and returns a new slice,\nsharing a refcount with s, that contains s[split:s.length].\nRequires s initialized, split <= s.length"] grpc_slice_split_tail(s: *mut grpc_slice, split: usize) -> grpc_slice532 pub fn grpc_slice_split_tail(s: *mut grpc_slice, split: usize) -> grpc_slice; 533 } 534 #[repr(i32)] 535 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 536 pub enum grpc_slice_ref_whom { 537 GRPC_SLICE_REF_TAIL = 1, 538 GRPC_SLICE_REF_HEAD = 2, 539 GRPC_SLICE_REF_BOTH = 3, 540 } 541 extern "C" { 542 #[doc = " The same as grpc_slice_split_tail, but with an option to skip altering\n refcounts (grpc_slice_split_tail_maybe_ref(..., true) is equivalent to\n grpc_slice_split_tail(...))"] grpc_slice_split_tail_maybe_ref( s: *mut grpc_slice, split: usize, ref_whom: grpc_slice_ref_whom, ) -> grpc_slice543 pub fn grpc_slice_split_tail_maybe_ref( 544 s: *mut grpc_slice, 545 split: usize, 546 ref_whom: grpc_slice_ref_whom, 547 ) -> grpc_slice; 548 } 549 extern "C" { 550 #[doc = " Splits s into two: modifies s to be s[split:s.length], and returns a new\nslice, sharing a refcount with s, that contains s[0:split].\nRequires s initialized, split <= s.length"] grpc_slice_split_head(s: *mut grpc_slice, split: usize) -> grpc_slice551 pub fn grpc_slice_split_head(s: *mut grpc_slice, split: usize) -> grpc_slice; 552 } 553 extern "C" { grpc_empty_slice() -> grpc_slice554 pub fn grpc_empty_slice() -> grpc_slice; 555 } 556 extern "C" { grpc_slice_eq(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int557 pub fn grpc_slice_eq(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int; 558 } 559 extern "C" { 560 #[doc = " Returns <0 if a < b, ==0 if a == b, >0 if a > b\nThe order is arbitrary, and is not guaranteed to be stable across different\nversions of the API."] grpc_slice_cmp(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int561 pub fn grpc_slice_cmp(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int; 562 } 563 extern "C" { grpc_slice_str_cmp( a: grpc_slice, b: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int564 pub fn grpc_slice_str_cmp( 565 a: grpc_slice, 566 b: *const ::std::os::raw::c_char, 567 ) -> ::std::os::raw::c_int; 568 } 569 extern "C" { 570 #[doc = " return non-zero if the first blen bytes of a are equal to b"] grpc_slice_buf_start_eq( a: grpc_slice, b: *const ::std::os::raw::c_void, blen: usize, ) -> ::std::os::raw::c_int571 pub fn grpc_slice_buf_start_eq( 572 a: grpc_slice, 573 b: *const ::std::os::raw::c_void, 574 blen: usize, 575 ) -> ::std::os::raw::c_int; 576 } 577 extern "C" { 578 #[doc = " return the index of the last instance of \\a c in \\a s, or -1 if not found"] grpc_slice_rchr(s: grpc_slice, c: ::std::os::raw::c_char) -> ::std::os::raw::c_int579 pub fn grpc_slice_rchr(s: grpc_slice, c: ::std::os::raw::c_char) -> ::std::os::raw::c_int; 580 } 581 extern "C" { grpc_slice_chr(s: grpc_slice, c: ::std::os::raw::c_char) -> ::std::os::raw::c_int582 pub fn grpc_slice_chr(s: grpc_slice, c: ::std::os::raw::c_char) -> ::std::os::raw::c_int; 583 } 584 extern "C" { 585 #[doc = " return the index of the first occurrence of \\a needle in \\a haystack, or -1\nif it's not found"] grpc_slice_slice(haystack: grpc_slice, needle: grpc_slice) -> ::std::os::raw::c_int586 pub fn grpc_slice_slice(haystack: grpc_slice, needle: grpc_slice) -> ::std::os::raw::c_int; 587 } 588 extern "C" { 589 #[doc = " Do two slices point at the same memory, with the same length\nIf a or b is inlined, actually compares data"] grpc_slice_is_equivalent(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int590 pub fn grpc_slice_is_equivalent(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int; 591 } 592 extern "C" { 593 #[doc = " Return a slice pointing to newly allocated memory that has the same contents\n as \\a s"] grpc_slice_dup(a: grpc_slice) -> grpc_slice594 pub fn grpc_slice_dup(a: grpc_slice) -> grpc_slice; 595 } 596 extern "C" { 597 #[doc = " Return a copy of slice as a C string. Offers no protection against embedded\nNULL's. Returned string must be freed with gpr_free."] grpc_slice_to_c_string(s: grpc_slice) -> *mut ::std::os::raw::c_char598 pub fn grpc_slice_to_c_string(s: grpc_slice) -> *mut ::std::os::raw::c_char; 599 } 600 pub mod grpc_status_code { 601 pub type Type = ::std::os::raw::c_int; 602 #[doc = " Not an error; returned on success"] 603 pub const GRPC_STATUS_OK: Type = 0; 604 #[doc = " The operation was cancelled (typically by the caller)."] 605 pub const GRPC_STATUS_CANCELLED: Type = 1; 606 #[doc = " Unknown error. An example of where this error may be returned is\nif a Status value received from another address space belongs to\nan error-space that is not known in this address space. Also\nerrors raised by APIs that do not return enough error information\nmay be converted to this error."] 607 pub const GRPC_STATUS_UNKNOWN: Type = 2; 608 #[doc = " Client specified an invalid argument. Note that this differs\nfrom FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments\nthat are problematic regardless of the state of the system\n(e.g., a malformed file name)."] 609 pub const GRPC_STATUS_INVALID_ARGUMENT: Type = 3; 610 #[doc = " Deadline expired before operation could complete. For operations\nthat change the state of the system, this error may be returned\neven if the operation has completed successfully. For example, a\nsuccessful response from a server could have been delayed long\nenough for the deadline to expire."] 611 pub const GRPC_STATUS_DEADLINE_EXCEEDED: Type = 4; 612 #[doc = " Some requested entity (e.g., file or directory) was not found."] 613 pub const GRPC_STATUS_NOT_FOUND: Type = 5; 614 #[doc = " Some entity that we attempted to create (e.g., file or directory)\nalready exists."] 615 pub const GRPC_STATUS_ALREADY_EXISTS: Type = 6; 616 #[doc = " The caller does not have permission to execute the specified\noperation. PERMISSION_DENIED must not be used for rejections\ncaused by exhausting some resource (use RESOURCE_EXHAUSTED\ninstead for those errors). PERMISSION_DENIED must not be\nused if the caller can not be identified (use UNAUTHENTICATED\ninstead for those errors)."] 617 pub const GRPC_STATUS_PERMISSION_DENIED: Type = 7; 618 #[doc = " The request does not have valid authentication credentials for the\noperation."] 619 pub const GRPC_STATUS_UNAUTHENTICATED: Type = 16; 620 #[doc = " Some resource has been exhausted, perhaps a per-user quota, or\nperhaps the entire file system is out of space."] 621 pub const GRPC_STATUS_RESOURCE_EXHAUSTED: Type = 8; 622 #[doc = " Operation was rejected because the system is not in a state\nrequired for the operation's execution. For example, directory\nto be deleted may be non-empty, an rmdir operation is applied to\na non-directory, etc.\n\nA litmus test that may help a service implementor in deciding\nbetween FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:\n(a) Use UNAVAILABLE if the client can retry just the failing call.\n(b) Use ABORTED if the client should retry at a higher-level\n(e.g., restarting a read-modify-write sequence).\n(c) Use FAILED_PRECONDITION if the client should not retry until\nthe system state has been explicitly fixed. E.g., if an \"rmdir\"\nfails because the directory is non-empty, FAILED_PRECONDITION\nshould be returned since the client should not retry unless\nthey have first fixed up the directory by deleting files from it.\n(d) Use FAILED_PRECONDITION if the client performs conditional\nREST Get/Update/Delete on a resource and the resource on the\nserver does not match the condition. E.g., conflicting\nread-modify-write on the same resource."] 623 pub const GRPC_STATUS_FAILED_PRECONDITION: Type = 9; 624 #[doc = " The operation was aborted, typically due to a concurrency issue\nlike sequencer check failures, transaction aborts, etc.\n\nSee litmus test above for deciding between FAILED_PRECONDITION,\nABORTED, and UNAVAILABLE."] 625 pub const GRPC_STATUS_ABORTED: Type = 10; 626 #[doc = " Operation was attempted past the valid range. E.g., seeking or\nreading past end of file.\n\nUnlike INVALID_ARGUMENT, this error indicates a problem that may\nbe fixed if the system state changes. For example, a 32-bit file\nsystem will generate INVALID_ARGUMENT if asked to read at an\noffset that is not in the range [0,2^32-1], but it will generate\nOUT_OF_RANGE if asked to read from an offset past the current\nfile size.\n\nThere is a fair bit of overlap between FAILED_PRECONDITION and\nOUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific\nerror) when it applies so that callers who are iterating through\na space can easily look for an OUT_OF_RANGE error to detect when\nthey are done."] 627 pub const GRPC_STATUS_OUT_OF_RANGE: Type = 11; 628 #[doc = " Operation is not implemented or not supported/enabled in this service."] 629 pub const GRPC_STATUS_UNIMPLEMENTED: Type = 12; 630 #[doc = " Internal errors. Means some invariants expected by underlying\nsystem has been broken. If you see one of these errors,\nsomething is very broken."] 631 pub const GRPC_STATUS_INTERNAL: Type = 13; 632 #[doc = " The service is currently unavailable. This is a most likely a\ntransient condition and may be corrected by retrying with\na backoff. Note that it is not always safe to retry non-idempotent\noperations.\n\nWARNING: Although data MIGHT not have been transmitted when this\nstatus occurs, there is NOT A GUARANTEE that the server has not seen\nanything. So in general it is unsafe to retry on this status code\nif the call is non-idempotent.\n\nSee litmus test above for deciding between FAILED_PRECONDITION,\nABORTED, and UNAVAILABLE."] 633 pub const GRPC_STATUS_UNAVAILABLE: Type = 14; 634 #[doc = " Unrecoverable data loss or corruption."] 635 pub const GRPC_STATUS_DATA_LOSS: Type = 15; 636 #[doc = " Force users to include a default branch:"] 637 pub const GRPC_STATUS__DO_NOT_USE: Type = -1; 638 } 639 #[repr(i32)] 640 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 641 pub enum grpc_byte_buffer_type { 642 GRPC_BB_RAW = 0, 643 } 644 #[repr(C)] 645 #[derive(Copy, Clone)] 646 pub struct grpc_byte_buffer { 647 pub reserved: *mut ::std::os::raw::c_void, 648 pub type_: grpc_byte_buffer_type, 649 pub data: grpc_byte_buffer_grpc_byte_buffer_data, 650 } 651 #[repr(C)] 652 #[derive(Copy, Clone)] 653 pub union grpc_byte_buffer_grpc_byte_buffer_data { 654 pub reserved: grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1, 655 pub raw: grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer, 656 } 657 #[repr(C)] 658 #[derive(Debug, Copy, Clone)] 659 pub struct grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1 { 660 pub reserved: [*mut ::std::os::raw::c_void; 8usize], 661 } 662 #[repr(C)] 663 #[derive(Copy, Clone)] 664 pub struct grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer { 665 pub compression: grpc_compression_algorithm, 666 pub slice_buffer: grpc_slice_buffer, 667 } 668 impl ::std::fmt::Debug for grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer { fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result669 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 670 write ! (f , "grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer {{ compression: {:?}, slice_buffer: {:?} }}" , self . compression , self . slice_buffer) 671 } 672 } 673 impl ::std::fmt::Debug for grpc_byte_buffer_grpc_byte_buffer_data { fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result674 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 675 write!(f, "grpc_byte_buffer_grpc_byte_buffer_data {{ union }}") 676 } 677 } 678 impl ::std::fmt::Debug for grpc_byte_buffer { fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result679 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 680 write!( 681 f, 682 "grpc_byte_buffer {{ reserved: {:?}, type: {:?}, data: {:?} }}", 683 self.reserved, self.type_, self.data 684 ) 685 } 686 } 687 #[repr(C)] 688 #[derive(Debug, Copy, Clone)] 689 pub struct grpc_completion_queue { 690 _unused: [u8; 0], 691 } 692 #[repr(C)] 693 #[derive(Debug, Copy, Clone)] 694 pub struct grpc_channel { 695 _unused: [u8; 0], 696 } 697 #[repr(C)] 698 #[derive(Debug, Copy, Clone)] 699 pub struct grpc_server { 700 _unused: [u8; 0], 701 } 702 #[repr(C)] 703 #[derive(Debug, Copy, Clone)] 704 pub struct grpc_call { 705 _unused: [u8; 0], 706 } 707 #[repr(C)] 708 #[derive(Debug, Copy, Clone)] 709 pub struct grpc_socket_mutator { 710 _unused: [u8; 0], 711 } 712 #[repr(C)] 713 #[derive(Debug, Copy, Clone)] 714 pub struct grpc_socket_factory { 715 _unused: [u8; 0], 716 } 717 #[repr(i32)] 718 #[doc = " Type specifier for grpc_arg"] 719 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 720 pub enum grpc_arg_type { 721 GRPC_ARG_STRING = 0, 722 GRPC_ARG_INTEGER = 1, 723 GRPC_ARG_POINTER = 2, 724 } 725 #[repr(C)] 726 #[derive(Debug, Copy, Clone)] 727 pub struct grpc_arg_pointer_vtable { 728 pub copy: ::std::option::Option< 729 unsafe extern "C" fn(p: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void, 730 >, 731 pub destroy: ::std::option::Option<unsafe extern "C" fn(p: *mut ::std::os::raw::c_void)>, 732 pub cmp: ::std::option::Option< 733 unsafe extern "C" fn( 734 p: *mut ::std::os::raw::c_void, 735 q: *mut ::std::os::raw::c_void, 736 ) -> ::std::os::raw::c_int, 737 >, 738 } 739 #[doc = " A single argument... each argument has a key and a value\n\nA note on naming keys:\nKeys are namespaced into groups, usually grouped by library, and are\nkeys for module XYZ are named XYZ.key1, XYZ.key2, etc. Module names must\nbe restricted to the regex [A-Za-z][_A-Za-z0-9]{,15}.\nKey names must be restricted to the regex [A-Za-z][_A-Za-z0-9]{,47}.\n\nGRPC core library keys are prefixed by grpc.\n\nLibrary authors are strongly encouraged to \\#define symbolic constants for\ntheir keys so that it's possible to change them in the future."] 740 #[repr(C)] 741 #[derive(Copy, Clone)] 742 pub struct grpc_arg { 743 pub type_: grpc_arg_type, 744 pub key: *mut ::std::os::raw::c_char, 745 pub value: grpc_arg_grpc_arg_value, 746 } 747 #[repr(C)] 748 #[derive(Copy, Clone)] 749 pub union grpc_arg_grpc_arg_value { 750 pub string: *mut ::std::os::raw::c_char, 751 pub integer: ::std::os::raw::c_int, 752 pub pointer: grpc_arg_grpc_arg_value_grpc_arg_pointer, 753 } 754 #[repr(C)] 755 #[derive(Debug, Copy, Clone)] 756 pub struct grpc_arg_grpc_arg_value_grpc_arg_pointer { 757 pub p: *mut ::std::os::raw::c_void, 758 pub vtable: *const grpc_arg_pointer_vtable, 759 } 760 impl ::std::fmt::Debug for grpc_arg_grpc_arg_value { fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result761 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 762 write!(f, "grpc_arg_grpc_arg_value {{ union }}") 763 } 764 } 765 impl ::std::fmt::Debug for grpc_arg { fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result766 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 767 write!( 768 f, 769 "grpc_arg {{ type: {:?}, key: {:?}, value: {:?} }}", 770 self.type_, self.key, self.value 771 ) 772 } 773 } 774 #[doc = " An array of arguments that can be passed around.\n\nUsed to set optional channel-level configuration.\nThese configuration options are modelled as key-value pairs as defined\nby grpc_arg; keys are strings to allow easy backwards-compatible extension\nby arbitrary parties. All evaluation is performed at channel creation\ntime (i.e. the keys and values in this structure need only live through the\ncreation invocation).\n\nHowever, if one of the args has grpc_arg_type==GRPC_ARG_POINTER, then the\ngrpc_arg_pointer_vtable must live until the channel args are done being\nused by core (i.e. when the object for use with which they were passed\nis destroyed).\n\nSee the description of the \\ref grpc_arg_keys \"available args\" for more\ndetails."] 775 #[repr(C)] 776 #[derive(Debug, Copy, Clone)] 777 pub struct grpc_channel_args { 778 pub num_args: usize, 779 pub args: *mut grpc_arg, 780 } 781 #[repr(i32)] 782 #[doc = " Result of a grpc call. If the caller satisfies the prerequisites of a\nparticular operation, the grpc_call_error returned will be GRPC_CALL_OK.\nReceiving any other value listed here is an indication of a bug in the\ncaller."] 783 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 784 pub enum grpc_call_error { 785 #[doc = " everything went ok"] 786 GRPC_CALL_OK = 0, 787 #[doc = " something failed, we don't know what"] 788 GRPC_CALL_ERROR = 1, 789 #[doc = " this method is not available on the server"] 790 GRPC_CALL_ERROR_NOT_ON_SERVER = 2, 791 #[doc = " this method is not available on the client"] 792 GRPC_CALL_ERROR_NOT_ON_CLIENT = 3, 793 #[doc = " this method must be called before server_accept"] 794 GRPC_CALL_ERROR_ALREADY_ACCEPTED = 4, 795 #[doc = " this method must be called before invoke"] 796 GRPC_CALL_ERROR_ALREADY_INVOKED = 5, 797 #[doc = " this method must be called after invoke"] 798 GRPC_CALL_ERROR_NOT_INVOKED = 6, 799 #[doc = " this call is already finished\n(writes_done or write_status has already been called)"] 800 GRPC_CALL_ERROR_ALREADY_FINISHED = 7, 801 #[doc = " there is already an outstanding read/write operation on the call"] 802 GRPC_CALL_ERROR_TOO_MANY_OPERATIONS = 8, 803 #[doc = " the flags value was illegal for this call"] 804 GRPC_CALL_ERROR_INVALID_FLAGS = 9, 805 #[doc = " invalid metadata was passed to this call"] 806 GRPC_CALL_ERROR_INVALID_METADATA = 10, 807 #[doc = " invalid message was passed to this call"] 808 GRPC_CALL_ERROR_INVALID_MESSAGE = 11, 809 #[doc = " completion queue for notification has not been registered\n with the server"] 810 GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE = 12, 811 #[doc = " this batch of operations leads to more operations than allowed"] 812 GRPC_CALL_ERROR_BATCH_TOO_BIG = 13, 813 #[doc = " payload type requested is not the type registered"] 814 GRPC_CALL_ERROR_PAYLOAD_TYPE_MISMATCH = 14, 815 #[doc = " completion queue has been shutdown"] 816 GRPC_CALL_ERROR_COMPLETION_QUEUE_SHUTDOWN = 15, 817 } 818 #[doc = " A single metadata element"] 819 #[repr(C)] 820 #[derive(Copy, Clone)] 821 pub struct grpc_metadata { 822 #[doc = " the key, value values are expected to line up with grpc_mdelem: if\nchanging them, update metadata.h at the same time."] 823 pub key: grpc_slice, 824 pub value: grpc_slice, 825 pub internal_data: grpc_metadata__bindgen_ty_1, 826 } 827 #[doc = " The following fields are reserved for grpc internal use.\nThere is no need to initialize them, and they will be set to garbage\nduring calls to grpc."] 828 #[repr(C)] 829 #[derive(Debug, Copy, Clone)] 830 pub struct grpc_metadata__bindgen_ty_1 { 831 pub obfuscated: [*mut ::std::os::raw::c_void; 4usize], 832 } 833 impl ::std::fmt::Debug for grpc_metadata { fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result834 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 835 write!( 836 f, 837 "grpc_metadata {{ key: {:?}, value: {:?}, internal_data: {:?} }}", 838 self.key, self.value, self.internal_data 839 ) 840 } 841 } 842 #[repr(i32)] 843 #[doc = " The type of completion (for grpc_event)"] 844 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 845 pub enum grpc_completion_type { 846 #[doc = " Shutting down"] 847 GRPC_QUEUE_SHUTDOWN = 0, 848 #[doc = " No event before timeout"] 849 GRPC_QUEUE_TIMEOUT = 1, 850 #[doc = " Operation completion"] 851 GRPC_OP_COMPLETE = 2, 852 } 853 #[doc = " The result of an operation.\n\nReturned by a completion queue when the operation started with tag."] 854 #[repr(C)] 855 #[derive(Debug, Copy, Clone)] 856 pub struct grpc_event { 857 #[doc = " The type of the completion."] 858 pub type_: grpc_completion_type, 859 #[doc = " If the grpc_completion_type is GRPC_OP_COMPLETE, this field indicates\nwhether the operation was successful or not; 0 in case of failure and\nnon-zero in case of success.\nIf grpc_completion_type is GRPC_QUEUE_SHUTDOWN or GRPC_QUEUE_TIMEOUT, this\nfield is guaranteed to be 0"] 860 pub success: ::std::os::raw::c_int, 861 #[doc = " The tag passed to grpc_call_start_batch etc to start this operation.\nOnly* GRPC_OP_COMPLETE has a tag. For all other grpc_completion_type\nvalues, tag is uninitialized."] 862 pub tag: *mut ::std::os::raw::c_void, 863 } 864 #[repr(C)] 865 #[derive(Debug, Copy, Clone)] 866 pub struct grpc_metadata_array { 867 pub count: usize, 868 pub capacity: usize, 869 pub metadata: *mut grpc_metadata, 870 } 871 #[repr(C)] 872 #[derive(Copy, Clone)] 873 pub struct grpc_call_details { 874 pub method: grpc_slice, 875 pub host: grpc_slice, 876 pub deadline: gpr_timespec, 877 } 878 impl ::std::fmt::Debug for grpc_call_details { fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result879 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 880 write!( 881 f, 882 "grpc_call_details {{ method: {:?}, host: {:?}, deadline: {:?} }}", 883 self.method, self.host, self.deadline 884 ) 885 } 886 } 887 #[repr(i32)] 888 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 889 pub enum grpc_op_type { 890 #[doc = " Send initial metadata: one and only one instance MUST be sent for each\ncall, unless the call was cancelled - in which case this can be skipped.\nThis op completes after all bytes of metadata have been accepted by\noutgoing flow control."] 891 GRPC_OP_SEND_INITIAL_METADATA = 0, 892 #[doc = " Send a message: 0 or more of these operations can occur for each call.\nThis op completes after all bytes for the message have been accepted by\noutgoing flow control."] 893 GRPC_OP_SEND_MESSAGE = 1, 894 #[doc = " Send a close from the client: one and only one instance MUST be sent from\nthe client, unless the call was cancelled - in which case this can be\nskipped. This op completes after all bytes for the call\n(including the close) have passed outgoing flow control."] 895 GRPC_OP_SEND_CLOSE_FROM_CLIENT = 2, 896 #[doc = " Send status from the server: one and only one instance MUST be sent from\nthe server unless the call was cancelled - in which case this can be\nskipped. This op completes after all bytes for the call\n(including the status) have passed outgoing flow control."] 897 GRPC_OP_SEND_STATUS_FROM_SERVER = 3, 898 #[doc = " Receive initial metadata: one and only one MUST be made on the client,\nmust not be made on the server.\nThis op completes after all initial metadata has been read from the\npeer."] 899 GRPC_OP_RECV_INITIAL_METADATA = 4, 900 #[doc = " Receive a message: 0 or more of these operations can occur for each call.\nThis op completes after all bytes of the received message have been\nread, or after a half-close has been received on this call."] 901 GRPC_OP_RECV_MESSAGE = 5, 902 #[doc = " Receive status on the client: one and only one must be made on the client.\nThis operation always succeeds, meaning ops paired with this operation\nwill also appear to succeed, even though they may not have. In that case\nthe status will indicate some failure.\nThis op completes after all activity on the call has completed."] 903 GRPC_OP_RECV_STATUS_ON_CLIENT = 6, 904 #[doc = " Receive close on the server: one and only one must be made on the\nserver. This op completes after the close has been received by the\nserver. This operation always succeeds, meaning ops paired with\nthis operation will also appear to succeed, even though they may not\nhave."] 905 GRPC_OP_RECV_CLOSE_ON_SERVER = 7, 906 } 907 #[doc = " Operation data: one field for each op type (except SEND_CLOSE_FROM_CLIENT\nwhich has no arguments)"] 908 #[repr(C)] 909 #[derive(Copy, Clone)] 910 pub struct grpc_op { 911 #[doc = " Operation type, as defined by grpc_op_type"] 912 pub op: grpc_op_type, 913 #[doc = " Write flags bitset for grpc_begin_messages"] 914 pub flags: u32, 915 #[doc = " Reserved for future usage"] 916 pub reserved: *mut ::std::os::raw::c_void, 917 pub data: grpc_op_grpc_op_data, 918 } 919 #[repr(C)] 920 #[derive(Copy, Clone)] 921 pub union grpc_op_grpc_op_data { 922 pub reserved: grpc_op_grpc_op_data__bindgen_ty_1, 923 pub send_initial_metadata: grpc_op_grpc_op_data_grpc_op_send_initial_metadata, 924 pub send_message: grpc_op_grpc_op_data_grpc_op_send_message, 925 pub send_status_from_server: grpc_op_grpc_op_data_grpc_op_send_status_from_server, 926 pub recv_initial_metadata: grpc_op_grpc_op_data_grpc_op_recv_initial_metadata, 927 pub recv_message: grpc_op_grpc_op_data_grpc_op_recv_message, 928 pub recv_status_on_client: grpc_op_grpc_op_data_grpc_op_recv_status_on_client, 929 pub recv_close_on_server: grpc_op_grpc_op_data_grpc_op_recv_close_on_server, 930 } 931 #[doc = " Reserved for future usage"] 932 #[repr(C)] 933 #[derive(Debug, Copy, Clone)] 934 pub struct grpc_op_grpc_op_data__bindgen_ty_1 { 935 pub reserved: [*mut ::std::os::raw::c_void; 8usize], 936 } 937 #[repr(C)] 938 #[derive(Debug, Copy, Clone)] 939 pub struct grpc_op_grpc_op_data_grpc_op_send_initial_metadata { pub count : usize , pub metadata : * mut grpc_metadata , pub maybe_compression_level : grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level , } 940 #[doc = " If \\a is_set, \\a compression_level will be used for the call.\n Otherwise, \\a compression_level won't be considered"] 941 #[repr(C)] 942 #[derive(Debug, Copy, Clone)] 943 pub struct grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level 944 { 945 pub is_set: u8, 946 pub level: grpc_compression_level, 947 } 948 #[repr(C)] 949 #[derive(Debug, Copy, Clone)] 950 pub struct grpc_op_grpc_op_data_grpc_op_send_message { 951 #[doc = " This op takes ownership of the slices in send_message. After\n a call completes, the contents of send_message are not guaranteed\n and likely empty. The original owner should still call\n grpc_byte_buffer_destroy() on this object however."] 952 pub send_message: *mut grpc_byte_buffer, 953 } 954 #[repr(C)] 955 #[derive(Debug, Copy, Clone)] 956 pub struct grpc_op_grpc_op_data_grpc_op_send_status_from_server { 957 pub trailing_metadata_count: usize, 958 pub trailing_metadata: *mut grpc_metadata, 959 pub status: grpc_status_code::Type, 960 #[doc = " optional: set to NULL if no details need sending, non-NULL if they do\n pointer will not be retained past the start_batch call"] 961 pub status_details: *mut grpc_slice, 962 } 963 #[doc = " ownership of the array is with the caller, but ownership of the elements\nstays with the call object (ie key, value members are owned by the call\nobject, recv_initial_metadata->array is owned by the caller).\nAfter the operation completes, call grpc_metadata_array_destroy on this\nvalue, or reuse it in a future op."] 964 #[repr(C)] 965 #[derive(Debug, Copy, Clone)] 966 pub struct grpc_op_grpc_op_data_grpc_op_recv_initial_metadata { 967 pub recv_initial_metadata: *mut grpc_metadata_array, 968 } 969 #[doc = " ownership of the byte buffer is moved to the caller; the caller must\ncall grpc_byte_buffer_destroy on this value, or reuse it in a future op.\nThe returned byte buffer will be NULL if trailing metadata was\nreceived instead of a message."] 970 #[repr(C)] 971 #[derive(Debug, Copy, Clone)] 972 pub struct grpc_op_grpc_op_data_grpc_op_recv_message { 973 pub recv_message: *mut *mut grpc_byte_buffer, 974 } 975 #[repr(C)] 976 #[derive(Debug, Copy, Clone)] 977 pub struct grpc_op_grpc_op_data_grpc_op_recv_status_on_client { 978 #[doc = " ownership of the array is with the caller, but ownership of the\nelements stays with the call object (ie key, value members are owned\nby the call object, trailing_metadata->array is owned by the caller).\nAfter the operation completes, call grpc_metadata_array_destroy on\nthis value, or reuse it in a future op."] 979 pub trailing_metadata: *mut grpc_metadata_array, 980 pub status: *mut grpc_status_code::Type, 981 pub status_details: *mut grpc_slice, 982 #[doc = " If this is not nullptr, it will be populated with the full fidelity\n error string for debugging purposes. The application is responsible\n for freeing the data by using gpr_free()."] 983 pub error_string: *mut *const ::std::os::raw::c_char, 984 } 985 #[repr(C)] 986 #[derive(Debug, Copy, Clone)] 987 pub struct grpc_op_grpc_op_data_grpc_op_recv_close_on_server { 988 #[doc = " out argument, set to 1 if the call failed at the server for\na reason other than a non-OK status (cancel, deadline\nexceeded, network failure, etc.), 0 otherwise (RPC processing ran to\ncompletion and was able to provide any status from the server)"] 989 pub cancelled: *mut ::std::os::raw::c_int, 990 } 991 impl ::std::fmt::Debug for grpc_op_grpc_op_data { fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result992 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 993 write!(f, "grpc_op_grpc_op_data {{ union }}") 994 } 995 } 996 impl ::std::fmt::Debug for grpc_op { fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result997 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 998 write!( 999 f, 1000 "grpc_op {{ op: {:?}, reserved: {:?}, data: {:?} }}", 1001 self.op, self.reserved, self.data 1002 ) 1003 } 1004 } 1005 #[doc = " Information requested from the channel."] 1006 #[repr(C)] 1007 #[derive(Debug, Copy, Clone)] 1008 pub struct grpc_channel_info { 1009 #[doc = " If non-NULL, will be set to point to a string indicating the LB\n policy name. Caller takes ownership."] 1010 pub lb_policy_name: *mut *mut ::std::os::raw::c_char, 1011 #[doc = " If non-NULL, will be set to point to a string containing the\n service config used by the channel in JSON form."] 1012 pub service_config_json: *mut *mut ::std::os::raw::c_char, 1013 } 1014 #[repr(C)] 1015 #[derive(Debug, Copy, Clone)] 1016 pub struct grpc_resource_quota { 1017 _unused: [u8; 0], 1018 } 1019 #[repr(i32)] 1020 #[doc = " Completion queues internally MAY maintain a set of file descriptors in a\nstructure called 'pollset'. This enum specifies if a completion queue has an\nassociated pollset and any restrictions on the type of file descriptors that\ncan be present in the pollset.\n\nI/O progress can only be made when grpc_completion_queue_next() or\ngrpc_completion_queue_pluck() are called on the completion queue (unless the\ngrpc_cq_polling_type is GRPC_CQ_NON_POLLING) and hence it is very important\nto actively call these APIs"] 1021 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 1022 pub enum grpc_cq_polling_type { 1023 #[doc = " The completion queue will have an associated pollset and there is no\nrestriction on the type of file descriptors the pollset may contain"] 1024 GRPC_CQ_DEFAULT_POLLING = 0, 1025 #[doc = " Similar to GRPC_CQ_DEFAULT_POLLING except that the completion queues will\nnot contain any 'listening file descriptors' (i.e file descriptors used to\nlisten to incoming channels)"] 1026 GRPC_CQ_NON_LISTENING = 1, 1027 #[doc = " The completion queue will not have an associated pollset. Note that\ngrpc_completion_queue_next() or grpc_completion_queue_pluck() MUST still\nbe called to pop events from the completion queue; it is not required to\ncall them actively to make I/O progress"] 1028 GRPC_CQ_NON_POLLING = 2, 1029 } 1030 #[repr(i32)] 1031 #[doc = " Specifies the type of APIs to use to pop events from the completion queue"] 1032 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 1033 pub enum grpc_cq_completion_type { 1034 #[doc = " Events are popped out by calling grpc_completion_queue_next() API ONLY"] 1035 GRPC_CQ_NEXT = 0, 1036 #[doc = " Events are popped out by calling grpc_completion_queue_pluck() API ONLY"] 1037 GRPC_CQ_PLUCK = 1, 1038 #[doc = " Events trigger a callback specified as the tag"] 1039 GRPC_CQ_CALLBACK = 2, 1040 } 1041 #[doc = " Specifies an interface class to be used as a tag for callback-based\n completion queues. This can be used directly, as the first element of a\n struct in C, or as a base class in C++. Its \"run\" value should be assigned to\n some non-member function, such as a static method."] 1042 #[repr(C)] 1043 #[derive(Debug, Copy, Clone)] 1044 pub struct grpc_completion_queue_functor { 1045 #[doc = " The run member specifies a function that will be called when this\ntag is extracted from the completion queue. Its arguments will be a\npointer to this functor and a boolean that indicates whether the\noperation succeeded (non-zero) or failed (zero)"] 1046 pub functor_run: ::std::option::Option< 1047 unsafe extern "C" fn(arg1: *mut grpc_completion_queue_functor, arg2: ::std::os::raw::c_int), 1048 >, 1049 #[doc = " The inlineable member specifies whether this functor can be run inline.\nThis should only be used for trivial internally-defined functors."] 1050 pub inlineable: ::std::os::raw::c_int, 1051 #[doc = " The following fields are not API. They are meant for internal use."] 1052 pub internal_success: ::std::os::raw::c_int, 1053 pub internal_next: *mut grpc_completion_queue_functor, 1054 } 1055 #[repr(C)] 1056 #[derive(Debug, Copy, Clone)] 1057 pub struct grpc_completion_queue_attributes { 1058 #[doc = " The version number of this structure. More fields might be added to this\nstructure in future."] 1059 pub version: ::std::os::raw::c_int, 1060 #[doc = " Set to GRPC_CQ_CURRENT_VERSION"] 1061 pub cq_completion_type: grpc_cq_completion_type, 1062 pub cq_polling_type: grpc_cq_polling_type, 1063 #[doc = " When creating a callbackable CQ, pass in a functor to get invoked when\n shutdown is complete"] 1064 pub cq_shutdown_cb: *mut grpc_completion_queue_functor, 1065 } 1066 #[repr(C)] 1067 #[derive(Debug, Copy, Clone)] 1068 pub struct grpc_completion_queue_factory { 1069 _unused: [u8; 0], 1070 } 1071 extern "C" { 1072 #[doc = " initialize a slice buffer"] grpc_slice_buffer_init(sb: *mut grpc_slice_buffer)1073 pub fn grpc_slice_buffer_init(sb: *mut grpc_slice_buffer); 1074 } 1075 extern "C" { 1076 #[doc = " destroy a slice buffer - unrefs any held elements"] grpc_slice_buffer_destroy(sb: *mut grpc_slice_buffer)1077 pub fn grpc_slice_buffer_destroy(sb: *mut grpc_slice_buffer); 1078 } 1079 extern "C" { 1080 #[doc = " Add an element to a slice buffer - takes ownership of the slice.\nThis function is allowed to concatenate the passed in slice to the end of\nsome other slice if desired by the slice buffer."] grpc_slice_buffer_add(sb: *mut grpc_slice_buffer, slice: grpc_slice)1081 pub fn grpc_slice_buffer_add(sb: *mut grpc_slice_buffer, slice: grpc_slice); 1082 } 1083 extern "C" { 1084 #[doc = " add an element to a slice buffer - takes ownership of the slice and returns\nthe index of the slice.\nGuarantees that the slice will not be concatenated at the end of another\nslice (i.e. the data for this slice will begin at the first byte of the\nslice at the returned index in sb->slices)\nThe implementation MAY decide to concatenate data at the end of a small\nslice added in this fashion."] grpc_slice_buffer_add_indexed(sb: *mut grpc_slice_buffer, slice: grpc_slice) -> usize1085 pub fn grpc_slice_buffer_add_indexed(sb: *mut grpc_slice_buffer, slice: grpc_slice) -> usize; 1086 } 1087 extern "C" { grpc_slice_buffer_addn(sb: *mut grpc_slice_buffer, slices: *mut grpc_slice, n: usize)1088 pub fn grpc_slice_buffer_addn(sb: *mut grpc_slice_buffer, slices: *mut grpc_slice, n: usize); 1089 } 1090 extern "C" { 1091 #[doc = " add a very small (less than 8 bytes) amount of data to the end of a slice\nbuffer: returns a pointer into which to add the data"] grpc_slice_buffer_tiny_add(sb: *mut grpc_slice_buffer, len: usize) -> *mut u81092 pub fn grpc_slice_buffer_tiny_add(sb: *mut grpc_slice_buffer, len: usize) -> *mut u8; 1093 } 1094 extern "C" { 1095 #[doc = " pop the last buffer, but don't unref it"] grpc_slice_buffer_pop(sb: *mut grpc_slice_buffer)1096 pub fn grpc_slice_buffer_pop(sb: *mut grpc_slice_buffer); 1097 } 1098 extern "C" { 1099 #[doc = " clear a slice buffer, unref all elements"] grpc_slice_buffer_reset_and_unref(sb: *mut grpc_slice_buffer)1100 pub fn grpc_slice_buffer_reset_and_unref(sb: *mut grpc_slice_buffer); 1101 } 1102 extern "C" { 1103 #[doc = " swap the contents of two slice buffers"] grpc_slice_buffer_swap(a: *mut grpc_slice_buffer, b: *mut grpc_slice_buffer)1104 pub fn grpc_slice_buffer_swap(a: *mut grpc_slice_buffer, b: *mut grpc_slice_buffer); 1105 } 1106 extern "C" { 1107 #[doc = " move all of the elements of src into dst"] grpc_slice_buffer_move_into(src: *mut grpc_slice_buffer, dst: *mut grpc_slice_buffer)1108 pub fn grpc_slice_buffer_move_into(src: *mut grpc_slice_buffer, dst: *mut grpc_slice_buffer); 1109 } 1110 extern "C" { 1111 #[doc = " remove n bytes from the end of a slice buffer"] grpc_slice_buffer_trim_end( sb: *mut grpc_slice_buffer, n: usize, garbage: *mut grpc_slice_buffer, )1112 pub fn grpc_slice_buffer_trim_end( 1113 sb: *mut grpc_slice_buffer, 1114 n: usize, 1115 garbage: *mut grpc_slice_buffer, 1116 ); 1117 } 1118 extern "C" { 1119 #[doc = " move the first n bytes of src into dst"] grpc_slice_buffer_move_first( src: *mut grpc_slice_buffer, n: usize, dst: *mut grpc_slice_buffer, )1120 pub fn grpc_slice_buffer_move_first( 1121 src: *mut grpc_slice_buffer, 1122 n: usize, 1123 dst: *mut grpc_slice_buffer, 1124 ); 1125 } 1126 extern "C" { 1127 #[doc = " move the first n bytes of src into dst without adding references"] grpc_slice_buffer_move_first_no_ref( src: *mut grpc_slice_buffer, n: usize, dst: *mut grpc_slice_buffer, )1128 pub fn grpc_slice_buffer_move_first_no_ref( 1129 src: *mut grpc_slice_buffer, 1130 n: usize, 1131 dst: *mut grpc_slice_buffer, 1132 ); 1133 } 1134 extern "C" { 1135 #[doc = " move the first n bytes of src into dst (copying them)"] grpc_slice_buffer_move_first_into_buffer( src: *mut grpc_slice_buffer, n: usize, dst: *mut ::std::os::raw::c_void, )1136 pub fn grpc_slice_buffer_move_first_into_buffer( 1137 src: *mut grpc_slice_buffer, 1138 n: usize, 1139 dst: *mut ::std::os::raw::c_void, 1140 ); 1141 } 1142 extern "C" { 1143 #[doc = " take the first slice in the slice buffer"] grpc_slice_buffer_take_first(sb: *mut grpc_slice_buffer) -> grpc_slice1144 pub fn grpc_slice_buffer_take_first(sb: *mut grpc_slice_buffer) -> grpc_slice; 1145 } 1146 extern "C" { 1147 #[doc = " undo the above with (a possibly different) \\a slice"] grpc_slice_buffer_undo_take_first(sb: *mut grpc_slice_buffer, slice: grpc_slice)1148 pub fn grpc_slice_buffer_undo_take_first(sb: *mut grpc_slice_buffer, slice: grpc_slice); 1149 } 1150 extern "C" { 1151 #[doc = " Returns a RAW byte buffer instance over the given slices (up to \\a nslices).\n\n Increases the reference count for all \\a slices processed. The user is\n responsible for invoking grpc_byte_buffer_destroy on the returned instance."] grpc_raw_byte_buffer_create( slices: *mut grpc_slice, nslices: usize, ) -> *mut grpc_byte_buffer1152 pub fn grpc_raw_byte_buffer_create( 1153 slices: *mut grpc_slice, 1154 nslices: usize, 1155 ) -> *mut grpc_byte_buffer; 1156 } 1157 extern "C" { 1158 #[doc = " Returns a *compressed* RAW byte buffer instance over the given slices (up to\n \\a nslices). The \\a compression argument defines the compression algorithm\n used to generate the data in \\a slices.\n\n Increases the reference count for all \\a slices processed. The user is\n responsible for invoking grpc_byte_buffer_destroy on the returned instance."] grpc_raw_compressed_byte_buffer_create( slices: *mut grpc_slice, nslices: usize, compression: grpc_compression_algorithm, ) -> *mut grpc_byte_buffer1159 pub fn grpc_raw_compressed_byte_buffer_create( 1160 slices: *mut grpc_slice, 1161 nslices: usize, 1162 compression: grpc_compression_algorithm, 1163 ) -> *mut grpc_byte_buffer; 1164 } 1165 extern "C" { 1166 #[doc = " Copies input byte buffer \\a bb.\n\n Increases the reference count of all the source slices. The user is\n responsible for calling grpc_byte_buffer_destroy over the returned copy."] grpc_byte_buffer_copy(bb: *mut grpc_byte_buffer) -> *mut grpc_byte_buffer1167 pub fn grpc_byte_buffer_copy(bb: *mut grpc_byte_buffer) -> *mut grpc_byte_buffer; 1168 } 1169 extern "C" { 1170 #[doc = " Returns the size of the given byte buffer, in bytes."] grpc_byte_buffer_length(bb: *mut grpc_byte_buffer) -> usize1171 pub fn grpc_byte_buffer_length(bb: *mut grpc_byte_buffer) -> usize; 1172 } 1173 extern "C" { 1174 #[doc = " Destroys \\a byte_buffer deallocating all its memory."] grpc_byte_buffer_destroy(bb: *mut grpc_byte_buffer)1175 pub fn grpc_byte_buffer_destroy(bb: *mut grpc_byte_buffer); 1176 } 1177 extern "C" { 1178 #[doc = " Initialize \\a reader to read over \\a buffer.\n Returns 1 upon success, 0 otherwise."] grpc_byte_buffer_reader_init( reader: *mut grpc_byte_buffer_reader, buffer: *mut grpc_byte_buffer, ) -> ::std::os::raw::c_int1179 pub fn grpc_byte_buffer_reader_init( 1180 reader: *mut grpc_byte_buffer_reader, 1181 buffer: *mut grpc_byte_buffer, 1182 ) -> ::std::os::raw::c_int; 1183 } 1184 extern "C" { 1185 #[doc = " Cleanup and destroy \\a reader"] grpc_byte_buffer_reader_destroy(reader: *mut grpc_byte_buffer_reader)1186 pub fn grpc_byte_buffer_reader_destroy(reader: *mut grpc_byte_buffer_reader); 1187 } 1188 extern "C" { 1189 #[doc = " Updates \\a slice with the next piece of data from from \\a reader and returns\n 1. Returns 0 at the end of the stream. Caller is responsible for calling\n grpc_slice_unref on the result."] grpc_byte_buffer_reader_next( reader: *mut grpc_byte_buffer_reader, slice: *mut grpc_slice, ) -> ::std::os::raw::c_int1190 pub fn grpc_byte_buffer_reader_next( 1191 reader: *mut grpc_byte_buffer_reader, 1192 slice: *mut grpc_slice, 1193 ) -> ::std::os::raw::c_int; 1194 } 1195 extern "C" { 1196 #[doc = " EXPERIMENTAL API - This function may be removed and changed, in the future.\n\n Updates \\a slice with the next piece of data from from \\a reader and returns\n 1. Returns 0 at the end of the stream. Caller is responsible for making sure\n the slice pointer remains valid when accessed.\n\n NOTE: Do not use this function unless the caller can guarantee that the\n underlying grpc_byte_buffer outlasts the use of the slice. This is only\n safe when the underlying grpc_byte_buffer remains immutable while slice\n is being accessed."] grpc_byte_buffer_reader_peek( reader: *mut grpc_byte_buffer_reader, slice: *mut *mut grpc_slice, ) -> ::std::os::raw::c_int1197 pub fn grpc_byte_buffer_reader_peek( 1198 reader: *mut grpc_byte_buffer_reader, 1199 slice: *mut *mut grpc_slice, 1200 ) -> ::std::os::raw::c_int; 1201 } 1202 extern "C" { 1203 #[doc = " Merge all data from \\a reader into single slice"] grpc_byte_buffer_reader_readall(reader: *mut grpc_byte_buffer_reader) -> grpc_slice1204 pub fn grpc_byte_buffer_reader_readall(reader: *mut grpc_byte_buffer_reader) -> grpc_slice; 1205 } 1206 extern "C" { 1207 #[doc = " Returns a RAW byte buffer instance from the output of \\a reader."] grpc_raw_byte_buffer_from_reader( reader: *mut grpc_byte_buffer_reader, ) -> *mut grpc_byte_buffer1208 pub fn grpc_raw_byte_buffer_from_reader( 1209 reader: *mut grpc_byte_buffer_reader, 1210 ) -> *mut grpc_byte_buffer; 1211 } 1212 extern "C" { 1213 #[doc = " Return if an algorithm is message compression algorithm."] grpc_compression_algorithm_is_message( algorithm: grpc_compression_algorithm, ) -> ::std::os::raw::c_int1214 pub fn grpc_compression_algorithm_is_message( 1215 algorithm: grpc_compression_algorithm, 1216 ) -> ::std::os::raw::c_int; 1217 } 1218 extern "C" { 1219 #[doc = " Return if an algorithm is stream compression algorithm."] grpc_compression_algorithm_is_stream( algorithm: grpc_compression_algorithm, ) -> ::std::os::raw::c_int1220 pub fn grpc_compression_algorithm_is_stream( 1221 algorithm: grpc_compression_algorithm, 1222 ) -> ::std::os::raw::c_int; 1223 } 1224 extern "C" { 1225 #[doc = " Parses the \\a slice as a grpc_compression_algorithm instance and updating \\a\n algorithm. Returns 1 upon success, 0 otherwise."] grpc_compression_algorithm_parse( name: grpc_slice, algorithm: *mut grpc_compression_algorithm, ) -> ::std::os::raw::c_int1226 pub fn grpc_compression_algorithm_parse( 1227 name: grpc_slice, 1228 algorithm: *mut grpc_compression_algorithm, 1229 ) -> ::std::os::raw::c_int; 1230 } 1231 extern "C" { 1232 #[doc = " Updates \\a name with the encoding name corresponding to a valid \\a\n algorithm. Note that \\a name is statically allocated and must *not* be freed.\n Returns 1 upon success, 0 otherwise."] grpc_compression_algorithm_name( algorithm: grpc_compression_algorithm, name: *mut *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int1233 pub fn grpc_compression_algorithm_name( 1234 algorithm: grpc_compression_algorithm, 1235 name: *mut *const ::std::os::raw::c_char, 1236 ) -> ::std::os::raw::c_int; 1237 } 1238 extern "C" { 1239 #[doc = " Returns the compression algorithm corresponding to \\a level for the\n compression algorithms encoded in the \\a accepted_encodings bitset."] grpc_compression_algorithm_for_level( level: grpc_compression_level, accepted_encodings: u32, ) -> grpc_compression_algorithm1240 pub fn grpc_compression_algorithm_for_level( 1241 level: grpc_compression_level, 1242 accepted_encodings: u32, 1243 ) -> grpc_compression_algorithm; 1244 } 1245 extern "C" { grpc_compression_options_init(opts: *mut grpc_compression_options)1246 pub fn grpc_compression_options_init(opts: *mut grpc_compression_options); 1247 } 1248 extern "C" { 1249 #[doc = " Mark \\a algorithm as enabled in \\a opts."] grpc_compression_options_enable_algorithm( opts: *mut grpc_compression_options, algorithm: grpc_compression_algorithm, )1250 pub fn grpc_compression_options_enable_algorithm( 1251 opts: *mut grpc_compression_options, 1252 algorithm: grpc_compression_algorithm, 1253 ); 1254 } 1255 extern "C" { 1256 #[doc = " Mark \\a algorithm as disabled in \\a opts."] grpc_compression_options_disable_algorithm( opts: *mut grpc_compression_options, algorithm: grpc_compression_algorithm, )1257 pub fn grpc_compression_options_disable_algorithm( 1258 opts: *mut grpc_compression_options, 1259 algorithm: grpc_compression_algorithm, 1260 ); 1261 } 1262 extern "C" { 1263 #[doc = " Returns true if \\a algorithm is marked as enabled in \\a opts."] grpc_compression_options_is_algorithm_enabled( opts: *const grpc_compression_options, algorithm: grpc_compression_algorithm, ) -> ::std::os::raw::c_int1264 pub fn grpc_compression_options_is_algorithm_enabled( 1265 opts: *const grpc_compression_options, 1266 algorithm: grpc_compression_algorithm, 1267 ) -> ::std::os::raw::c_int; 1268 } 1269 #[repr(i32)] 1270 #[doc = " Connectivity state of a channel."] 1271 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 1272 pub enum grpc_connectivity_state { 1273 #[doc = " channel is idle"] 1274 GRPC_CHANNEL_IDLE = 0, 1275 #[doc = " channel is connecting"] 1276 GRPC_CHANNEL_CONNECTING = 1, 1277 #[doc = " channel is ready for work"] 1278 GRPC_CHANNEL_READY = 2, 1279 #[doc = " channel has seen a failure but expects to recover"] 1280 GRPC_CHANNEL_TRANSIENT_FAILURE = 3, 1281 #[doc = " channel has seen a failure that it cannot recover from"] 1282 GRPC_CHANNEL_SHUTDOWN = 4, 1283 } 1284 extern "C" { 1285 #[doc = " \\mainpage GRPC Core\n\n The GRPC Core library is a low-level library designed to be wrapped by higher\n level libraries. The top-level API is provided in grpc.h. Security related\n functionality lives in grpc_security.h."] grpc_metadata_array_init(array: *mut grpc_metadata_array)1286 pub fn grpc_metadata_array_init(array: *mut grpc_metadata_array); 1287 } 1288 extern "C" { grpc_metadata_array_destroy(array: *mut grpc_metadata_array)1289 pub fn grpc_metadata_array_destroy(array: *mut grpc_metadata_array); 1290 } 1291 extern "C" { grpc_call_details_init(details: *mut grpc_call_details)1292 pub fn grpc_call_details_init(details: *mut grpc_call_details); 1293 } 1294 extern "C" { grpc_call_details_destroy(details: *mut grpc_call_details)1295 pub fn grpc_call_details_destroy(details: *mut grpc_call_details); 1296 } 1297 extern "C" { 1298 #[doc = " Initialize the grpc library.\n\nAfter it's called, a matching invocation to grpc_shutdown() is expected.\n\nIt is not safe to call any other grpc functions before calling this.\n(To avoid overhead, little checking is done, and some things may work. We\ndo not warrant that they will continue to do so in future revisions of this\nlibrary)."] grpc_init()1299 pub fn grpc_init(); 1300 } 1301 extern "C" { 1302 #[doc = " Shut down the grpc library.\n\nBefore it's called, there should haven been a matching invocation to\ngrpc_init().\n\nThe last call to grpc_shutdown will initiate cleaning up of grpc library\ninternals, which can happen in another thread. Once the clean-up is done,\nno memory is used by grpc, nor are any instructions executing within the\ngrpc library. Prior to calling, all application owned grpc objects must\nhave been destroyed."] grpc_shutdown()1303 pub fn grpc_shutdown(); 1304 } 1305 extern "C" { 1306 #[doc = " EXPERIMENTAL. Returns 1 if the grpc library has been initialized.\nTODO(ericgribkoff) Decide if this should be promoted to non-experimental as\npart of stabilizing the fork support API, as tracked in\nhttps://github.com/grpc/grpc/issues/15334"] grpc_is_initialized() -> ::std::os::raw::c_int1307 pub fn grpc_is_initialized() -> ::std::os::raw::c_int; 1308 } 1309 extern "C" { 1310 #[doc = " DEPRECATED. Recommend to use grpc_shutdown only"] grpc_shutdown_blocking()1311 pub fn grpc_shutdown_blocking(); 1312 } 1313 extern "C" { 1314 #[doc = " Return a string representing the current version of grpc"] grpc_version_string() -> *const ::std::os::raw::c_char1315 pub fn grpc_version_string() -> *const ::std::os::raw::c_char; 1316 } 1317 extern "C" { 1318 #[doc = " Return a string specifying what the 'g' in gRPC stands for"] grpc_g_stands_for() -> *const ::std::os::raw::c_char1319 pub fn grpc_g_stands_for() -> *const ::std::os::raw::c_char; 1320 } 1321 extern "C" { 1322 #[doc = " Returns the completion queue factory based on the attributes. MAY return a\nNULL if no factory can be found"] grpc_completion_queue_factory_lookup( attributes: *const grpc_completion_queue_attributes, ) -> *const grpc_completion_queue_factory1323 pub fn grpc_completion_queue_factory_lookup( 1324 attributes: *const grpc_completion_queue_attributes, 1325 ) -> *const grpc_completion_queue_factory; 1326 } 1327 extern "C" { 1328 #[doc = " Helper function to create a completion queue with grpc_cq_completion_type\nof GRPC_CQ_NEXT and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING"] grpc_completion_queue_create_for_next( reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_completion_queue1329 pub fn grpc_completion_queue_create_for_next( 1330 reserved: *mut ::std::os::raw::c_void, 1331 ) -> *mut grpc_completion_queue; 1332 } 1333 extern "C" { 1334 #[doc = " Helper function to create a completion queue with grpc_cq_completion_type\nof GRPC_CQ_PLUCK and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING"] grpc_completion_queue_create_for_pluck( reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_completion_queue1335 pub fn grpc_completion_queue_create_for_pluck( 1336 reserved: *mut ::std::os::raw::c_void, 1337 ) -> *mut grpc_completion_queue; 1338 } 1339 extern "C" { 1340 #[doc = " Helper function to create a completion queue with grpc_cq_completion_type\nof GRPC_CQ_CALLBACK and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING.\nThis function is experimental."] grpc_completion_queue_create_for_callback( shutdown_callback: *mut grpc_completion_queue_functor, reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_completion_queue1341 pub fn grpc_completion_queue_create_for_callback( 1342 shutdown_callback: *mut grpc_completion_queue_functor, 1343 reserved: *mut ::std::os::raw::c_void, 1344 ) -> *mut grpc_completion_queue; 1345 } 1346 extern "C" { 1347 #[doc = " Create a completion queue"] grpc_completion_queue_create( factory: *const grpc_completion_queue_factory, attributes: *const grpc_completion_queue_attributes, reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_completion_queue1348 pub fn grpc_completion_queue_create( 1349 factory: *const grpc_completion_queue_factory, 1350 attributes: *const grpc_completion_queue_attributes, 1351 reserved: *mut ::std::os::raw::c_void, 1352 ) -> *mut grpc_completion_queue; 1353 } 1354 extern "C" { 1355 #[doc = " Blocks until an event is available, the completion queue is being shut down,\nor deadline is reached.\n\nReturns a grpc_event with type GRPC_QUEUE_TIMEOUT on timeout,\notherwise a grpc_event describing the event that occurred.\n\nCallers must not call grpc_completion_queue_next and\ngrpc_completion_queue_pluck simultaneously on the same completion queue."] grpc_completion_queue_next( cq: *mut grpc_completion_queue, deadline: gpr_timespec, reserved: *mut ::std::os::raw::c_void, ) -> grpc_event1356 pub fn grpc_completion_queue_next( 1357 cq: *mut grpc_completion_queue, 1358 deadline: gpr_timespec, 1359 reserved: *mut ::std::os::raw::c_void, 1360 ) -> grpc_event; 1361 } 1362 extern "C" { 1363 #[doc = " Blocks until an event with tag 'tag' is available, the completion queue is\nbeing shutdown or deadline is reached.\n\nReturns a grpc_event with type GRPC_QUEUE_TIMEOUT on timeout,\notherwise a grpc_event describing the event that occurred.\n\nCallers must not call grpc_completion_queue_next and\ngrpc_completion_queue_pluck simultaneously on the same completion queue.\n\nCompletion queues support a maximum of GRPC_MAX_COMPLETION_QUEUE_PLUCKERS\nconcurrently executing plucks at any time."] grpc_completion_queue_pluck( cq: *mut grpc_completion_queue, tag: *mut ::std::os::raw::c_void, deadline: gpr_timespec, reserved: *mut ::std::os::raw::c_void, ) -> grpc_event1364 pub fn grpc_completion_queue_pluck( 1365 cq: *mut grpc_completion_queue, 1366 tag: *mut ::std::os::raw::c_void, 1367 deadline: gpr_timespec, 1368 reserved: *mut ::std::os::raw::c_void, 1369 ) -> grpc_event; 1370 } 1371 extern "C" { 1372 #[doc = " Begin destruction of a completion queue. Once all possible events are\ndrained then grpc_completion_queue_next will start to produce\nGRPC_QUEUE_SHUTDOWN events only. At that point it's safe to call\ngrpc_completion_queue_destroy.\n\nAfter calling this function applications should ensure that no\nNEW work is added to be published on this completion queue."] grpc_completion_queue_shutdown(cq: *mut grpc_completion_queue)1373 pub fn grpc_completion_queue_shutdown(cq: *mut grpc_completion_queue); 1374 } 1375 extern "C" { 1376 #[doc = " Destroy a completion queue. The caller must ensure that the queue is\ndrained and no threads are executing grpc_completion_queue_next"] grpc_completion_queue_destroy(cq: *mut grpc_completion_queue)1377 pub fn grpc_completion_queue_destroy(cq: *mut grpc_completion_queue); 1378 } 1379 extern "C" { 1380 #[doc = " EXPERIMENTAL API ************/\n/** Initializes a thread local cache for \\a cq.\n grpc_flush_cq_tls_cache() MUST be called on the same thread,\n with the same cq."] grpc_completion_queue_thread_local_cache_init(cq: *mut grpc_completion_queue)1381 pub fn grpc_completion_queue_thread_local_cache_init(cq: *mut grpc_completion_queue); 1382 } 1383 extern "C" { 1384 #[doc = " EXPERIMENTAL API ************/\n/** Flushes the thread local cache for \\a cq.\n Returns 1 if there was contents in the cache. If there was an event\n in \\a cq tls cache, its tag is placed in tag, and ok is set to the\n event success."] grpc_completion_queue_thread_local_cache_flush( cq: *mut grpc_completion_queue, tag: *mut *mut ::std::os::raw::c_void, ok: *mut ::std::os::raw::c_int, ) -> ::std::os::raw::c_int1385 pub fn grpc_completion_queue_thread_local_cache_flush( 1386 cq: *mut grpc_completion_queue, 1387 tag: *mut *mut ::std::os::raw::c_void, 1388 ok: *mut ::std::os::raw::c_int, 1389 ) -> ::std::os::raw::c_int; 1390 } 1391 extern "C" { 1392 #[doc = " Check the connectivity state of a channel."] grpc_channel_check_connectivity_state( channel: *mut grpc_channel, try_to_connect: ::std::os::raw::c_int, ) -> grpc_connectivity_state1393 pub fn grpc_channel_check_connectivity_state( 1394 channel: *mut grpc_channel, 1395 try_to_connect: ::std::os::raw::c_int, 1396 ) -> grpc_connectivity_state; 1397 } 1398 extern "C" { 1399 #[doc = " Number of active \"external connectivity state watchers\" attached to a\n channel.\n Useful for testing."] grpc_channel_num_external_connectivity_watchers( channel: *mut grpc_channel, ) -> ::std::os::raw::c_int1400 pub fn grpc_channel_num_external_connectivity_watchers( 1401 channel: *mut grpc_channel, 1402 ) -> ::std::os::raw::c_int; 1403 } 1404 extern "C" { 1405 #[doc = " Watch for a change in connectivity state.\nOnce the channel connectivity state is different from last_observed_state,\ntag will be enqueued on cq with success=1.\nIf deadline expires BEFORE the state is changed, tag will be enqueued on cq\nwith success=0."] grpc_channel_watch_connectivity_state( channel: *mut grpc_channel, last_observed_state: grpc_connectivity_state, deadline: gpr_timespec, cq: *mut grpc_completion_queue, tag: *mut ::std::os::raw::c_void, )1406 pub fn grpc_channel_watch_connectivity_state( 1407 channel: *mut grpc_channel, 1408 last_observed_state: grpc_connectivity_state, 1409 deadline: gpr_timespec, 1410 cq: *mut grpc_completion_queue, 1411 tag: *mut ::std::os::raw::c_void, 1412 ); 1413 } 1414 extern "C" { 1415 #[doc = " Check whether a grpc channel supports connectivity watcher"] grpc_channel_support_connectivity_watcher( channel: *mut grpc_channel, ) -> ::std::os::raw::c_int1416 pub fn grpc_channel_support_connectivity_watcher( 1417 channel: *mut grpc_channel, 1418 ) -> ::std::os::raw::c_int; 1419 } 1420 extern "C" { 1421 #[doc = " Create a call given a grpc_channel, in order to call 'method'. All\ncompletions are sent to 'completion_queue'. 'method' and 'host' need only\nlive through the invocation of this function.\nIf parent_call is non-NULL, it must be a server-side call. It will be used\nto propagate properties from the server call to this new client call,\ndepending on the value of \\a propagation_mask (see propagation_bits.h for\npossible values)."] grpc_channel_create_call( channel: *mut grpc_channel, parent_call: *mut grpc_call, propagation_mask: u32, completion_queue: *mut grpc_completion_queue, method: grpc_slice, host: *const grpc_slice, deadline: gpr_timespec, reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_call1422 pub fn grpc_channel_create_call( 1423 channel: *mut grpc_channel, 1424 parent_call: *mut grpc_call, 1425 propagation_mask: u32, 1426 completion_queue: *mut grpc_completion_queue, 1427 method: grpc_slice, 1428 host: *const grpc_slice, 1429 deadline: gpr_timespec, 1430 reserved: *mut ::std::os::raw::c_void, 1431 ) -> *mut grpc_call; 1432 } 1433 extern "C" { 1434 #[doc = " Pre-register a method/host pair on a channel.\nmethod and host are not owned and must remain alive while the channel is\nalive."] grpc_channel_register_call( channel: *mut grpc_channel, method: *const ::std::os::raw::c_char, host: *const ::std::os::raw::c_char, reserved: *mut ::std::os::raw::c_void, ) -> *mut ::std::os::raw::c_void1435 pub fn grpc_channel_register_call( 1436 channel: *mut grpc_channel, 1437 method: *const ::std::os::raw::c_char, 1438 host: *const ::std::os::raw::c_char, 1439 reserved: *mut ::std::os::raw::c_void, 1440 ) -> *mut ::std::os::raw::c_void; 1441 } 1442 extern "C" { 1443 #[doc = " Create a call given a handle returned from grpc_channel_register_call.\n\\sa grpc_channel_create_call."] grpc_channel_create_registered_call( channel: *mut grpc_channel, parent_call: *mut grpc_call, propagation_mask: u32, completion_queue: *mut grpc_completion_queue, registered_call_handle: *mut ::std::os::raw::c_void, deadline: gpr_timespec, reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_call1444 pub fn grpc_channel_create_registered_call( 1445 channel: *mut grpc_channel, 1446 parent_call: *mut grpc_call, 1447 propagation_mask: u32, 1448 completion_queue: *mut grpc_completion_queue, 1449 registered_call_handle: *mut ::std::os::raw::c_void, 1450 deadline: gpr_timespec, 1451 reserved: *mut ::std::os::raw::c_void, 1452 ) -> *mut grpc_call; 1453 } 1454 extern "C" { 1455 #[doc = " Allocate memory in the grpc_call arena: this memory is automatically\ndiscarded at call completion"] grpc_call_arena_alloc(call: *mut grpc_call, size: usize) -> *mut ::std::os::raw::c_void1456 pub fn grpc_call_arena_alloc(call: *mut grpc_call, size: usize) -> *mut ::std::os::raw::c_void; 1457 } 1458 extern "C" { 1459 #[doc = " Start a batch of operations defined in the array ops; when complete, post a\ncompletion of type 'tag' to the completion queue bound to the call.\nThe order of ops specified in the batch has no significance.\nOnly one operation of each type can be active at once in any given\nbatch.\nIf a call to grpc_call_start_batch returns GRPC_CALL_OK you must call\ngrpc_completion_queue_next or grpc_completion_queue_pluck on the completion\nqueue associated with 'call' for work to be performed. If a call to\ngrpc_call_start_batch returns any value other than GRPC_CALL_OK it is\nguaranteed that no state associated with 'call' is changed and it is not\nappropriate to call grpc_completion_queue_next or\ngrpc_completion_queue_pluck consequent to the failed grpc_call_start_batch\ncall.\nIf a call to grpc_call_start_batch with an empty batch returns\nGRPC_CALL_OK, the tag is put in the completion queue immediately.\nTHREAD SAFETY: access to grpc_call_start_batch in multi-threaded environment\nneeds to be synchronized. As an optimization, you may synchronize batches\ncontaining just send operations independently from batches containing just\nreceive operations. Access to grpc_call_start_batch with an empty batch is\nthread-compatible."] grpc_call_start_batch( call: *mut grpc_call, ops: *const grpc_op, nops: usize, tag: *mut ::std::os::raw::c_void, reserved: *mut ::std::os::raw::c_void, ) -> grpc_call_error1460 pub fn grpc_call_start_batch( 1461 call: *mut grpc_call, 1462 ops: *const grpc_op, 1463 nops: usize, 1464 tag: *mut ::std::os::raw::c_void, 1465 reserved: *mut ::std::os::raw::c_void, 1466 ) -> grpc_call_error; 1467 } 1468 extern "C" { 1469 #[doc = " Returns a newly allocated string representing the endpoint to which this\ncall is communicating with. The string is in the uri format accepted by\ngrpc_channel_create.\nThe returned string should be disposed of with gpr_free().\n\nWARNING: this value is never authenticated or subject to any security\nrelated code. It must not be used for any authentication related\nfunctionality. Instead, use grpc_auth_context."] grpc_call_get_peer(call: *mut grpc_call) -> *mut ::std::os::raw::c_char1470 pub fn grpc_call_get_peer(call: *mut grpc_call) -> *mut ::std::os::raw::c_char; 1471 } 1472 #[repr(C)] 1473 #[derive(Debug, Copy, Clone)] 1474 pub struct census_context { 1475 _unused: [u8; 0], 1476 } 1477 extern "C" { 1478 #[doc = " Set census context for a call; Must be called before first call to\ngrpc_call_start_batch()."] grpc_census_call_set_context(call: *mut grpc_call, context: *mut census_context)1479 pub fn grpc_census_call_set_context(call: *mut grpc_call, context: *mut census_context); 1480 } 1481 extern "C" { 1482 #[doc = " Retrieve the calls current census context."] grpc_census_call_get_context(call: *mut grpc_call) -> *mut census_context1483 pub fn grpc_census_call_get_context(call: *mut grpc_call) -> *mut census_context; 1484 } 1485 extern "C" { 1486 #[doc = " Return a newly allocated string representing the target a channel was\ncreated for."] grpc_channel_get_target(channel: *mut grpc_channel) -> *mut ::std::os::raw::c_char1487 pub fn grpc_channel_get_target(channel: *mut grpc_channel) -> *mut ::std::os::raw::c_char; 1488 } 1489 extern "C" { 1490 #[doc = " Request info about the channel.\n\\a channel_info indicates what information is being requested and\nhow that information will be returned.\n\\a channel_info is owned by the caller."] grpc_channel_get_info( channel: *mut grpc_channel, channel_info: *const grpc_channel_info, )1491 pub fn grpc_channel_get_info( 1492 channel: *mut grpc_channel, 1493 channel_info: *const grpc_channel_info, 1494 ); 1495 } 1496 extern "C" { 1497 #[doc = " EXPERIMENTAL. Resets the channel's connect backoff.\nTODO(roth): When we see whether this proves useful, either promote\nto non-experimental or remove it."] grpc_channel_reset_connect_backoff(channel: *mut grpc_channel)1498 pub fn grpc_channel_reset_connect_backoff(channel: *mut grpc_channel); 1499 } 1500 #[repr(C)] 1501 #[derive(Debug, Copy, Clone)] 1502 pub struct grpc_channel_credentials { 1503 _unused: [u8; 0], 1504 } 1505 extern "C" { 1506 #[doc = " Releases a channel credentials object.\nThe creator of the credentials object is responsible for its release."] grpc_channel_credentials_release(creds: *mut grpc_channel_credentials)1507 pub fn grpc_channel_credentials_release(creds: *mut grpc_channel_credentials); 1508 } 1509 #[repr(C)] 1510 #[derive(Debug, Copy, Clone)] 1511 pub struct grpc_server_credentials { 1512 _unused: [u8; 0], 1513 } 1514 extern "C" { 1515 #[doc = " Releases a server_credentials object.\nThe creator of the server_credentials object is responsible for its release."] grpc_server_credentials_release(creds: *mut grpc_server_credentials)1516 pub fn grpc_server_credentials_release(creds: *mut grpc_server_credentials); 1517 } 1518 extern "C" { 1519 #[doc = " Creates a secure channel using the passed-in credentials. Additional\nchannel level configuration MAY be provided by grpc_channel_args, though\nthe expectation is that most clients will want to simply pass NULL. The\nuser data in 'args' need only live through the invocation of this function.\nHowever, if any args of the 'pointer' type are passed, then the referenced\nvtable must be maintained by the caller until grpc_channel_destroy\nterminates. See grpc_channel_args definition for more on this."] grpc_channel_create( target: *const ::std::os::raw::c_char, creds: *mut grpc_channel_credentials, args: *const grpc_channel_args, ) -> *mut grpc_channel1520 pub fn grpc_channel_create( 1521 target: *const ::std::os::raw::c_char, 1522 creds: *mut grpc_channel_credentials, 1523 args: *const grpc_channel_args, 1524 ) -> *mut grpc_channel; 1525 } 1526 extern "C" { 1527 #[doc = " Create a lame client: this client fails every operation attempted on it."] grpc_lame_client_channel_create( target: *const ::std::os::raw::c_char, error_code: grpc_status_code::Type, error_message: *const ::std::os::raw::c_char, ) -> *mut grpc_channel1528 pub fn grpc_lame_client_channel_create( 1529 target: *const ::std::os::raw::c_char, 1530 error_code: grpc_status_code::Type, 1531 error_message: *const ::std::os::raw::c_char, 1532 ) -> *mut grpc_channel; 1533 } 1534 extern "C" { 1535 #[doc = " Close and destroy a grpc channel"] grpc_channel_destroy(channel: *mut grpc_channel)1536 pub fn grpc_channel_destroy(channel: *mut grpc_channel); 1537 } 1538 extern "C" { 1539 #[doc = " Cancel an RPC.\nCan be called multiple times, from any thread.\nTHREAD-SAFETY grpc_call_cancel and grpc_call_cancel_with_status\nare thread-safe, and can be called at any point before grpc_call_unref\nis called."] grpc_call_cancel( call: *mut grpc_call, reserved: *mut ::std::os::raw::c_void, ) -> grpc_call_error1540 pub fn grpc_call_cancel( 1541 call: *mut grpc_call, 1542 reserved: *mut ::std::os::raw::c_void, 1543 ) -> grpc_call_error; 1544 } 1545 extern "C" { 1546 #[doc = " Cancel an RPC.\nCan be called multiple times, from any thread.\nIf a status has not been received for the call, set it to the status code\nand description passed in.\nImportantly, this function does not send status nor description to the\nremote endpoint.\nNote that \\a description doesn't need be a static string.\nIt doesn't need to be alive after the call to\ngrpc_call_cancel_with_status completes."] grpc_call_cancel_with_status( call: *mut grpc_call, status: grpc_status_code::Type, description: *const ::std::os::raw::c_char, reserved: *mut ::std::os::raw::c_void, ) -> grpc_call_error1547 pub fn grpc_call_cancel_with_status( 1548 call: *mut grpc_call, 1549 status: grpc_status_code::Type, 1550 description: *const ::std::os::raw::c_char, 1551 reserved: *mut ::std::os::raw::c_void, 1552 ) -> grpc_call_error; 1553 } 1554 extern "C" { grpc_call_failed_before_recv_message(c: *const grpc_call) -> ::std::os::raw::c_int1555 pub fn grpc_call_failed_before_recv_message(c: *const grpc_call) -> ::std::os::raw::c_int; 1556 } 1557 extern "C" { 1558 #[doc = " Ref a call.\nTHREAD SAFETY: grpc_call_ref is thread-compatible"] grpc_call_ref(call: *mut grpc_call)1559 pub fn grpc_call_ref(call: *mut grpc_call); 1560 } 1561 extern "C" { 1562 #[doc = " Unref a call.\nTHREAD SAFETY: grpc_call_unref is thread-compatible"] grpc_call_unref(call: *mut grpc_call)1563 pub fn grpc_call_unref(call: *mut grpc_call); 1564 } 1565 extern "C" { 1566 #[doc = " Request notification of a new call.\nOnce a call is received, a notification tagged with \\a tag_new is added to\n\\a cq_for_notification. \\a call, \\a details and \\a request_metadata are\nupdated with the appropriate call information. \\a cq_bound_to_call is bound\nto \\a call, and batch operation notifications for that call will be posted\nto \\a cq_bound_to_call.\nNote that \\a cq_for_notification must have been registered to the server via\n\\a grpc_server_register_completion_queue."] grpc_server_request_call( server: *mut grpc_server, call: *mut *mut grpc_call, details: *mut grpc_call_details, request_metadata: *mut grpc_metadata_array, cq_bound_to_call: *mut grpc_completion_queue, cq_for_notification: *mut grpc_completion_queue, tag_new: *mut ::std::os::raw::c_void, ) -> grpc_call_error1567 pub fn grpc_server_request_call( 1568 server: *mut grpc_server, 1569 call: *mut *mut grpc_call, 1570 details: *mut grpc_call_details, 1571 request_metadata: *mut grpc_metadata_array, 1572 cq_bound_to_call: *mut grpc_completion_queue, 1573 cq_for_notification: *mut grpc_completion_queue, 1574 tag_new: *mut ::std::os::raw::c_void, 1575 ) -> grpc_call_error; 1576 } 1577 #[repr(i32)] 1578 #[doc = " How to handle payloads for a registered method"] 1579 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 1580 pub enum grpc_server_register_method_payload_handling { 1581 #[doc = " Don't try to read the payload"] 1582 GRPC_SRM_PAYLOAD_NONE = 0, 1583 #[doc = " Read the initial payload as a byte buffer"] 1584 GRPC_SRM_PAYLOAD_READ_INITIAL_BYTE_BUFFER = 1, 1585 } 1586 extern "C" { 1587 #[doc = " Registers a method in the server.\nMethods to this (host, method) pair will not be reported by\ngrpc_server_request_call, but instead be reported by\ngrpc_server_request_registered_call when passed the appropriate\nregistered_method (as returned by this function).\nMust be called before grpc_server_start.\nReturns NULL on failure."] grpc_server_register_method( server: *mut grpc_server, method: *const ::std::os::raw::c_char, host: *const ::std::os::raw::c_char, payload_handling: grpc_server_register_method_payload_handling, flags: u32, ) -> *mut ::std::os::raw::c_void1588 pub fn grpc_server_register_method( 1589 server: *mut grpc_server, 1590 method: *const ::std::os::raw::c_char, 1591 host: *const ::std::os::raw::c_char, 1592 payload_handling: grpc_server_register_method_payload_handling, 1593 flags: u32, 1594 ) -> *mut ::std::os::raw::c_void; 1595 } 1596 extern "C" { 1597 #[doc = " Request notification of a new pre-registered call. 'cq_for_notification'\nmust have been registered to the server via\ngrpc_server_register_completion_queue."] grpc_server_request_registered_call( server: *mut grpc_server, registered_method: *mut ::std::os::raw::c_void, call: *mut *mut grpc_call, deadline: *mut gpr_timespec, request_metadata: *mut grpc_metadata_array, optional_payload: *mut *mut grpc_byte_buffer, cq_bound_to_call: *mut grpc_completion_queue, cq_for_notification: *mut grpc_completion_queue, tag_new: *mut ::std::os::raw::c_void, ) -> grpc_call_error1598 pub fn grpc_server_request_registered_call( 1599 server: *mut grpc_server, 1600 registered_method: *mut ::std::os::raw::c_void, 1601 call: *mut *mut grpc_call, 1602 deadline: *mut gpr_timespec, 1603 request_metadata: *mut grpc_metadata_array, 1604 optional_payload: *mut *mut grpc_byte_buffer, 1605 cq_bound_to_call: *mut grpc_completion_queue, 1606 cq_for_notification: *mut grpc_completion_queue, 1607 tag_new: *mut ::std::os::raw::c_void, 1608 ) -> grpc_call_error; 1609 } 1610 extern "C" { 1611 #[doc = " Create a server. Additional configuration for each incoming channel can\nbe specified with args. If no additional configuration is needed, args can\nbe NULL. The user data in 'args' need only live through the invocation of\nthis function. However, if any args of the 'pointer' type are passed, then\nthe referenced vtable must be maintained by the caller until\ngrpc_server_destroy terminates. See grpc_channel_args definition for more\non this."] grpc_server_create( args: *const grpc_channel_args, reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_server1612 pub fn grpc_server_create( 1613 args: *const grpc_channel_args, 1614 reserved: *mut ::std::os::raw::c_void, 1615 ) -> *mut grpc_server; 1616 } 1617 extern "C" { 1618 #[doc = " Register a completion queue with the server. Must be done for any\nnotification completion queue that is passed to grpc_server_request_*_call\nand to grpc_server_shutdown_and_notify. Must be performed prior to\ngrpc_server_start."] grpc_server_register_completion_queue( server: *mut grpc_server, cq: *mut grpc_completion_queue, reserved: *mut ::std::os::raw::c_void, )1619 pub fn grpc_server_register_completion_queue( 1620 server: *mut grpc_server, 1621 cq: *mut grpc_completion_queue, 1622 reserved: *mut ::std::os::raw::c_void, 1623 ); 1624 } 1625 #[repr(C)] 1626 #[derive(Debug, Copy, Clone)] 1627 pub struct grpc_serving_status_update { 1628 pub code: grpc_status_code::Type, 1629 pub error_message: *const ::std::os::raw::c_char, 1630 } 1631 #[repr(C)] 1632 #[derive(Debug, Copy, Clone)] 1633 pub struct grpc_server_xds_status_notifier { 1634 pub on_serving_status_update: ::std::option::Option< 1635 unsafe extern "C" fn( 1636 user_data: *mut ::std::os::raw::c_void, 1637 uri: *const ::std::os::raw::c_char, 1638 update: grpc_serving_status_update, 1639 ), 1640 >, 1641 pub user_data: *mut ::std::os::raw::c_void, 1642 } 1643 #[repr(C)] 1644 #[derive(Debug, Copy, Clone)] 1645 pub struct grpc_server_config_fetcher { 1646 _unused: [u8; 0], 1647 } 1648 extern "C" { 1649 #[doc = " EXPERIMENTAL. Creates an xDS config fetcher."] grpc_server_config_fetcher_xds_create( notifier: grpc_server_xds_status_notifier, args: *const grpc_channel_args, ) -> *mut grpc_server_config_fetcher1650 pub fn grpc_server_config_fetcher_xds_create( 1651 notifier: grpc_server_xds_status_notifier, 1652 args: *const grpc_channel_args, 1653 ) -> *mut grpc_server_config_fetcher; 1654 } 1655 extern "C" { 1656 #[doc = " EXPERIMENTAL. Destroys a config fetcher."] grpc_server_config_fetcher_destroy(config_fetcher: *mut grpc_server_config_fetcher)1657 pub fn grpc_server_config_fetcher_destroy(config_fetcher: *mut grpc_server_config_fetcher); 1658 } 1659 extern "C" { 1660 #[doc = " EXPERIMENTAL. Sets the server's config fetcher. Takes ownership.\nMust be called before adding ports"] grpc_server_set_config_fetcher( server: *mut grpc_server, config_fetcher: *mut grpc_server_config_fetcher, )1661 pub fn grpc_server_set_config_fetcher( 1662 server: *mut grpc_server, 1663 config_fetcher: *mut grpc_server_config_fetcher, 1664 ); 1665 } 1666 extern "C" { 1667 #[doc = " Add a HTTP2 over an encrypted link over tcp listener.\nReturns bound port number on success, 0 on failure.\nREQUIRES: server not started"] grpc_server_add_http2_port( server: *mut grpc_server, addr: *const ::std::os::raw::c_char, creds: *mut grpc_server_credentials, ) -> ::std::os::raw::c_int1668 pub fn grpc_server_add_http2_port( 1669 server: *mut grpc_server, 1670 addr: *const ::std::os::raw::c_char, 1671 creds: *mut grpc_server_credentials, 1672 ) -> ::std::os::raw::c_int; 1673 } 1674 extern "C" { 1675 #[doc = " Start a server - tells all listeners to start listening"] grpc_server_start(server: *mut grpc_server)1676 pub fn grpc_server_start(server: *mut grpc_server); 1677 } 1678 extern "C" { 1679 #[doc = " Begin shutting down a server.\nAfter completion, no new calls or connections will be admitted.\nExisting calls will be allowed to complete.\nSend a GRPC_OP_COMPLETE event when there are no more calls being serviced.\nShutdown is idempotent, and all tags will be notified at once if multiple\ngrpc_server_shutdown_and_notify calls are made. 'cq' must have been\nregistered to this server via grpc_server_register_completion_queue."] grpc_server_shutdown_and_notify( server: *mut grpc_server, cq: *mut grpc_completion_queue, tag: *mut ::std::os::raw::c_void, )1680 pub fn grpc_server_shutdown_and_notify( 1681 server: *mut grpc_server, 1682 cq: *mut grpc_completion_queue, 1683 tag: *mut ::std::os::raw::c_void, 1684 ); 1685 } 1686 extern "C" { 1687 #[doc = " Cancel all in-progress calls.\nOnly usable after shutdown."] grpc_server_cancel_all_calls(server: *mut grpc_server)1688 pub fn grpc_server_cancel_all_calls(server: *mut grpc_server); 1689 } 1690 extern "C" { 1691 #[doc = " Destroy a server.\nShutdown must have completed beforehand (i.e. all tags generated by\ngrpc_server_shutdown_and_notify must have been received, and at least\none call to grpc_server_shutdown_and_notify must have been made)."] grpc_server_destroy(server: *mut grpc_server)1692 pub fn grpc_server_destroy(server: *mut grpc_server); 1693 } 1694 extern "C" { 1695 #[doc = " Enable or disable a tracer.\n\nTracers (usually controlled by the environment variable GRPC_TRACE)\nallow printf-style debugging on GRPC internals, and are useful for\ntracking down problems in the field.\n\nUse of this function is not strictly thread-safe, but the\nthread-safety issues raised by it should not be of concern."] grpc_tracer_set_enabled( name: *const ::std::os::raw::c_char, enabled: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int1696 pub fn grpc_tracer_set_enabled( 1697 name: *const ::std::os::raw::c_char, 1698 enabled: ::std::os::raw::c_int, 1699 ) -> ::std::os::raw::c_int; 1700 } 1701 extern "C" { 1702 #[doc = " Check whether a metadata key is legal (will be accepted by core)"] grpc_header_key_is_legal(slice: grpc_slice) -> ::std::os::raw::c_int1703 pub fn grpc_header_key_is_legal(slice: grpc_slice) -> ::std::os::raw::c_int; 1704 } 1705 extern "C" { 1706 #[doc = " Check whether a non-binary metadata value is legal (will be accepted by\ncore)"] grpc_header_nonbin_value_is_legal(slice: grpc_slice) -> ::std::os::raw::c_int1707 pub fn grpc_header_nonbin_value_is_legal(slice: grpc_slice) -> ::std::os::raw::c_int; 1708 } 1709 extern "C" { 1710 #[doc = " Check whether a metadata key corresponds to a binary value"] grpc_is_binary_header(slice: grpc_slice) -> ::std::os::raw::c_int1711 pub fn grpc_is_binary_header(slice: grpc_slice) -> ::std::os::raw::c_int; 1712 } 1713 extern "C" { 1714 #[doc = " Convert grpc_call_error values to a string"] grpc_call_error_to_string(error: grpc_call_error) -> *const ::std::os::raw::c_char1715 pub fn grpc_call_error_to_string(error: grpc_call_error) -> *const ::std::os::raw::c_char; 1716 } 1717 extern "C" { 1718 #[doc = " Create a buffer pool"] grpc_resource_quota_create( trace_name: *const ::std::os::raw::c_char, ) -> *mut grpc_resource_quota1719 pub fn grpc_resource_quota_create( 1720 trace_name: *const ::std::os::raw::c_char, 1721 ) -> *mut grpc_resource_quota; 1722 } 1723 extern "C" { 1724 #[doc = " Add a reference to a buffer pool"] grpc_resource_quota_ref(resource_quota: *mut grpc_resource_quota)1725 pub fn grpc_resource_quota_ref(resource_quota: *mut grpc_resource_quota); 1726 } 1727 extern "C" { 1728 #[doc = " Drop a reference to a buffer pool"] grpc_resource_quota_unref(resource_quota: *mut grpc_resource_quota)1729 pub fn grpc_resource_quota_unref(resource_quota: *mut grpc_resource_quota); 1730 } 1731 extern "C" { 1732 #[doc = " Update the size of a buffer pool"] grpc_resource_quota_resize(resource_quota: *mut grpc_resource_quota, new_size: usize)1733 pub fn grpc_resource_quota_resize(resource_quota: *mut grpc_resource_quota, new_size: usize); 1734 } 1735 extern "C" { 1736 #[doc = " Update the size of the maximum number of threads allowed"] grpc_resource_quota_set_max_threads( resource_quota: *mut grpc_resource_quota, new_max_threads: ::std::os::raw::c_int, )1737 pub fn grpc_resource_quota_set_max_threads( 1738 resource_quota: *mut grpc_resource_quota, 1739 new_max_threads: ::std::os::raw::c_int, 1740 ); 1741 } 1742 extern "C" { 1743 #[doc = " EXPERIMENTAL. Dumps xDS configs as a serialized ClientConfig proto.\nThe full name of the proto is envoy.service.status.v3.ClientConfig."] grpc_dump_xds_configs() -> grpc_slice1744 pub fn grpc_dump_xds_configs() -> grpc_slice; 1745 } 1746 extern "C" { 1747 #[doc = " Fetch a vtable for a grpc_channel_arg that points to a grpc_resource_quota"] grpc_resource_quota_arg_vtable() -> *const grpc_arg_pointer_vtable1748 pub fn grpc_resource_quota_arg_vtable() -> *const grpc_arg_pointer_vtable; 1749 } 1750 extern "C" { 1751 #[doc = " CHANNELZ API *************/\n/** Channelz is under active development. The following APIs will see some\nchurn as the feature is implemented. This comment will be removed once\nchannelz is officially supported, and these APIs become stable. For now\nyou may track the progress by following this github issue:\nhttps://github.com/grpc/grpc/issues/15340\n\nthe following APIs return allocated JSON strings that match the response\nobjects from the channelz proto, found here:\nhttps://github.com/grpc/grpc/blob/master/src/proto/grpc/channelz/channelz.proto.\n\nFor easy conversion to protobuf, The JSON is formatted according to:\nhttps://developers.google.com/protocol-buffers/docs/proto3#json."] grpc_channelz_get_top_channels(start_channel_id: isize) -> *mut ::std::os::raw::c_char1752 pub fn grpc_channelz_get_top_channels(start_channel_id: isize) -> *mut ::std::os::raw::c_char; 1753 } 1754 extern "C" { grpc_channelz_get_servers(start_server_id: isize) -> *mut ::std::os::raw::c_char1755 pub fn grpc_channelz_get_servers(start_server_id: isize) -> *mut ::std::os::raw::c_char; 1756 } 1757 extern "C" { grpc_channelz_get_server(server_id: isize) -> *mut ::std::os::raw::c_char1758 pub fn grpc_channelz_get_server(server_id: isize) -> *mut ::std::os::raw::c_char; 1759 } 1760 extern "C" { grpc_channelz_get_server_sockets( server_id: isize, start_socket_id: isize, max_results: isize, ) -> *mut ::std::os::raw::c_char1761 pub fn grpc_channelz_get_server_sockets( 1762 server_id: isize, 1763 start_socket_id: isize, 1764 max_results: isize, 1765 ) -> *mut ::std::os::raw::c_char; 1766 } 1767 extern "C" { grpc_channelz_get_channel(channel_id: isize) -> *mut ::std::os::raw::c_char1768 pub fn grpc_channelz_get_channel(channel_id: isize) -> *mut ::std::os::raw::c_char; 1769 } 1770 extern "C" { grpc_channelz_get_subchannel(subchannel_id: isize) -> *mut ::std::os::raw::c_char1771 pub fn grpc_channelz_get_subchannel(subchannel_id: isize) -> *mut ::std::os::raw::c_char; 1772 } 1773 extern "C" { grpc_channelz_get_socket(socket_id: isize) -> *mut ::std::os::raw::c_char1774 pub fn grpc_channelz_get_socket(socket_id: isize) -> *mut ::std::os::raw::c_char; 1775 } 1776 extern "C" { 1777 #[doc = " EXPERIMENTAL - Subject to change.\n Fetch a vtable for grpc_channel_arg that points to\n grpc_authorization_policy_provider."] grpc_authorization_policy_provider_arg_vtable() -> *const grpc_arg_pointer_vtable1778 pub fn grpc_authorization_policy_provider_arg_vtable() -> *const grpc_arg_pointer_vtable; 1779 } 1780 extern "C" { grpc_cronet_secure_channel_create( engine: *mut ::std::os::raw::c_void, target: *const ::std::os::raw::c_char, args: *const grpc_channel_args, reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_channel1781 pub fn grpc_cronet_secure_channel_create( 1782 engine: *mut ::std::os::raw::c_void, 1783 target: *const ::std::os::raw::c_char, 1784 args: *const grpc_channel_args, 1785 reserved: *mut ::std::os::raw::c_void, 1786 ) -> *mut grpc_channel; 1787 } 1788 extern "C" { 1789 #[doc = " Create a secure channel to 'target' using file descriptor 'fd' and passed-in\ncredentials. The 'target' argument will be used to indicate the name for\nthis channel. Note that this API currently only supports insecure channel\ncredentials. Using other types of credentials will result in a failure."] grpc_channel_create_from_fd( target: *const ::std::os::raw::c_char, fd: ::std::os::raw::c_int, creds: *mut grpc_channel_credentials, args: *const grpc_channel_args, ) -> *mut grpc_channel1790 pub fn grpc_channel_create_from_fd( 1791 target: *const ::std::os::raw::c_char, 1792 fd: ::std::os::raw::c_int, 1793 creds: *mut grpc_channel_credentials, 1794 args: *const grpc_channel_args, 1795 ) -> *mut grpc_channel; 1796 } 1797 extern "C" { 1798 #[doc = " Add the connected secure communication channel based on file descriptor 'fd'\nto the 'server' and server credentials 'creds'. The 'fd' must be an open file\ndescriptor corresponding to a connected socket. Events from the file\ndescriptor may come on any of the server completion queues (i.e completion\nqueues registered via the grpc_server_register_completion_queue API).\nNote that this API currently only supports inseure server credentials\nUsing other types of credentials will result in a failure.\nTODO(hork): add channel_args to this API to allow endpoints and transports\ncreated in this function to participate in the resource quota feature."] grpc_server_add_channel_from_fd( server: *mut grpc_server, fd: ::std::os::raw::c_int, creds: *mut grpc_server_credentials, )1799 pub fn grpc_server_add_channel_from_fd( 1800 server: *mut grpc_server, 1801 fd: ::std::os::raw::c_int, 1802 creds: *mut grpc_server_credentials, 1803 ); 1804 } 1805 #[repr(i32)] 1806 #[doc = " Results for the SSL roots override callback."] 1807 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 1808 pub enum grpc_ssl_roots_override_result { 1809 GRPC_SSL_ROOTS_OVERRIDE_OK = 0, 1810 GRPC_SSL_ROOTS_OVERRIDE_FAIL_PERMANENTLY = 1, 1811 #[doc = " Do not try fallback options."] 1812 GRPC_SSL_ROOTS_OVERRIDE_FAIL = 2, 1813 } 1814 #[repr(i32)] 1815 #[doc = " Callback results for dynamically loading a SSL certificate config."] 1816 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 1817 pub enum grpc_ssl_certificate_config_reload_status { 1818 GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED = 0, 1819 GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW = 1, 1820 GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL = 2, 1821 } 1822 #[repr(i32)] 1823 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 1824 pub enum grpc_ssl_client_certificate_request_type { 1825 #[doc = " Server does not request client certificate.\nThe certificate presented by the client is not checked by the server at\nall. (A client may present a self signed or signed certificate or not\npresent a certificate at all and any of those option would be accepted)"] 1826 GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE = 0, 1827 #[doc = " Server requests client certificate but does not enforce that the client\npresents a certificate.\n\nIf the client presents a certificate, the client authentication is left to\nthe application (the necessary metadata will be available to the\napplication via authentication context properties, see grpc_auth_context).\n\nThe client's key certificate pair must be valid for the SSL connection to\nbe established."] 1828 GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY = 1, 1829 #[doc = " Server requests client certificate but does not enforce that the client\npresents a certificate.\n\nIf the client presents a certificate, the client authentication is done by\nthe gRPC framework. (For a successful connection the client needs to either\npresent a certificate that can be verified against the root certificate\nconfigured by the server or not present a certificate at all)\n\nThe client's key certificate pair must be valid for the SSL connection to\nbe established."] 1830 GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY = 2, 1831 #[doc = " Server requests client certificate and enforces that the client presents a\ncertificate.\n\nIf the client presents a certificate, the client authentication is left to\nthe application (the necessary metadata will be available to the\napplication via authentication context properties, see grpc_auth_context).\n\nThe client's key certificate pair must be valid for the SSL connection to\nbe established."] 1832 GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY = 3, 1833 #[doc = " Server requests client certificate and enforces that the client presents a\ncertificate.\n\nThe certificate presented by the client is verified by the gRPC framework.\n(For a successful connection the client needs to present a certificate that\ncan be verified against the root certificate configured by the server)\n\nThe client's key certificate pair must be valid for the SSL connection to\nbe established."] 1834 GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY = 4, 1835 } 1836 impl grpc_security_level { 1837 pub const GRPC_SECURITY_NONE: grpc_security_level = grpc_security_level::GRPC_SECURITY_MIN; 1838 } 1839 impl grpc_security_level { 1840 pub const GRPC_SECURITY_MAX: grpc_security_level = 1841 grpc_security_level::GRPC_PRIVACY_AND_INTEGRITY; 1842 } 1843 #[repr(i32)] 1844 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 1845 pub enum grpc_security_level { 1846 GRPC_SECURITY_MIN = 0, 1847 GRPC_INTEGRITY_ONLY = 1, 1848 GRPC_PRIVACY_AND_INTEGRITY = 2, 1849 } 1850 #[repr(i32)] 1851 #[doc = " Type of local connections for which local channel/server credentials will be\n applied. It supports UDS and local TCP connections."] 1852 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 1853 pub enum grpc_local_connect_type { 1854 UDS = 0, 1855 LOCAL_TCP = 1, 1856 } 1857 #[repr(i32)] 1858 #[doc = " The TLS versions that are supported by the SSL stack."] 1859 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 1860 pub enum grpc_tls_version { 1861 TLS1_2 = 0, 1862 TLS1_3 = 1, 1863 } 1864 #[repr(C)] 1865 #[derive(Debug, Copy, Clone)] 1866 pub struct grpc_auth_context { 1867 _unused: [u8; 0], 1868 } 1869 #[repr(C)] 1870 #[derive(Debug, Copy, Clone)] 1871 pub struct grpc_auth_property_iterator { 1872 pub ctx: *const grpc_auth_context, 1873 pub index: usize, 1874 pub name: *const ::std::os::raw::c_char, 1875 } 1876 #[doc = " value, if not NULL, is guaranteed to be NULL terminated."] 1877 #[repr(C)] 1878 #[derive(Debug, Copy, Clone)] 1879 pub struct grpc_auth_property { 1880 pub name: *mut ::std::os::raw::c_char, 1881 pub value: *mut ::std::os::raw::c_char, 1882 pub value_length: usize, 1883 } 1884 extern "C" { 1885 #[doc = " Returns NULL when the iterator is at the end."] grpc_auth_property_iterator_next( it: *mut grpc_auth_property_iterator, ) -> *const grpc_auth_property1886 pub fn grpc_auth_property_iterator_next( 1887 it: *mut grpc_auth_property_iterator, 1888 ) -> *const grpc_auth_property; 1889 } 1890 extern "C" { 1891 #[doc = " Iterates over the auth context."] grpc_auth_context_property_iterator( ctx: *const grpc_auth_context, ) -> grpc_auth_property_iterator1892 pub fn grpc_auth_context_property_iterator( 1893 ctx: *const grpc_auth_context, 1894 ) -> grpc_auth_property_iterator; 1895 } 1896 extern "C" { 1897 #[doc = " Gets the peer identity. Returns an empty iterator (first _next will return\nNULL) if the peer is not authenticated."] grpc_auth_context_peer_identity( ctx: *const grpc_auth_context, ) -> grpc_auth_property_iterator1898 pub fn grpc_auth_context_peer_identity( 1899 ctx: *const grpc_auth_context, 1900 ) -> grpc_auth_property_iterator; 1901 } 1902 extern "C" { 1903 #[doc = " Finds a property in the context. May return an empty iterator (first _next\nwill return NULL) if no property with this name was found in the context."] grpc_auth_context_find_properties_by_name( ctx: *const grpc_auth_context, name: *const ::std::os::raw::c_char, ) -> grpc_auth_property_iterator1904 pub fn grpc_auth_context_find_properties_by_name( 1905 ctx: *const grpc_auth_context, 1906 name: *const ::std::os::raw::c_char, 1907 ) -> grpc_auth_property_iterator; 1908 } 1909 extern "C" { 1910 #[doc = " Gets the name of the property that indicates the peer identity. Will return\nNULL if the peer is not authenticated."] grpc_auth_context_peer_identity_property_name( ctx: *const grpc_auth_context, ) -> *const ::std::os::raw::c_char1911 pub fn grpc_auth_context_peer_identity_property_name( 1912 ctx: *const grpc_auth_context, 1913 ) -> *const ::std::os::raw::c_char; 1914 } 1915 extern "C" { 1916 #[doc = " Returns 1 if the peer is authenticated, 0 otherwise."] grpc_auth_context_peer_is_authenticated( ctx: *const grpc_auth_context, ) -> ::std::os::raw::c_int1917 pub fn grpc_auth_context_peer_is_authenticated( 1918 ctx: *const grpc_auth_context, 1919 ) -> ::std::os::raw::c_int; 1920 } 1921 extern "C" { 1922 #[doc = " Gets the auth context from the call. Caller needs to call\ngrpc_auth_context_release on the returned context."] grpc_call_auth_context(call: *mut grpc_call) -> *mut grpc_auth_context1923 pub fn grpc_call_auth_context(call: *mut grpc_call) -> *mut grpc_auth_context; 1924 } 1925 extern "C" { 1926 #[doc = " Releases the auth context returned from grpc_call_auth_context."] grpc_auth_context_release(context: *mut grpc_auth_context)1927 pub fn grpc_auth_context_release(context: *mut grpc_auth_context); 1928 } 1929 extern "C" { 1930 #[doc = " Add a property."] grpc_auth_context_add_property( ctx: *mut grpc_auth_context, name: *const ::std::os::raw::c_char, value: *const ::std::os::raw::c_char, value_length: usize, )1931 pub fn grpc_auth_context_add_property( 1932 ctx: *mut grpc_auth_context, 1933 name: *const ::std::os::raw::c_char, 1934 value: *const ::std::os::raw::c_char, 1935 value_length: usize, 1936 ); 1937 } 1938 extern "C" { 1939 #[doc = " Add a C string property."] grpc_auth_context_add_cstring_property( ctx: *mut grpc_auth_context, name: *const ::std::os::raw::c_char, value: *const ::std::os::raw::c_char, )1940 pub fn grpc_auth_context_add_cstring_property( 1941 ctx: *mut grpc_auth_context, 1942 name: *const ::std::os::raw::c_char, 1943 value: *const ::std::os::raw::c_char, 1944 ); 1945 } 1946 extern "C" { 1947 #[doc = " Sets the property name. Returns 1 if successful or 0 in case of failure\n(which means that no property with this name exists)."] grpc_auth_context_set_peer_identity_property_name( ctx: *mut grpc_auth_context, name: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int1948 pub fn grpc_auth_context_set_peer_identity_property_name( 1949 ctx: *mut grpc_auth_context, 1950 name: *const ::std::os::raw::c_char, 1951 ) -> ::std::os::raw::c_int; 1952 } 1953 #[repr(C)] 1954 #[derive(Debug, Copy, Clone)] 1955 pub struct grpc_ssl_session_cache { 1956 _unused: [u8; 0], 1957 } 1958 extern "C" { 1959 #[doc = " Create LRU cache for client-side SSL sessions with the given capacity.\nIf capacity is < 1, a default capacity is used instead."] grpc_ssl_session_cache_create_lru(capacity: usize) -> *mut grpc_ssl_session_cache1960 pub fn grpc_ssl_session_cache_create_lru(capacity: usize) -> *mut grpc_ssl_session_cache; 1961 } 1962 extern "C" { 1963 #[doc = " Destroy SSL session cache."] grpc_ssl_session_cache_destroy(cache: *mut grpc_ssl_session_cache)1964 pub fn grpc_ssl_session_cache_destroy(cache: *mut grpc_ssl_session_cache); 1965 } 1966 extern "C" { 1967 #[doc = " Create a channel arg with the given cache object."] grpc_ssl_session_cache_create_channel_arg( cache: *mut grpc_ssl_session_cache, ) -> grpc_arg1968 pub fn grpc_ssl_session_cache_create_channel_arg( 1969 cache: *mut grpc_ssl_session_cache, 1970 ) -> grpc_arg; 1971 } 1972 #[repr(C)] 1973 #[derive(Debug, Copy, Clone)] 1974 pub struct grpc_call_credentials { 1975 _unused: [u8; 0], 1976 } 1977 extern "C" { 1978 #[doc = " Releases a call credentials object.\nThe creator of the credentials object is responsible for its release."] grpc_call_credentials_release(creds: *mut grpc_call_credentials)1979 pub fn grpc_call_credentials_release(creds: *mut grpc_call_credentials); 1980 } 1981 extern "C" { 1982 #[doc = " Creates default credentials to connect to a google gRPC service.\nWARNING: Do NOT use this credentials to connect to a non-google service as\nthis could result in an oauth2 token leak. The security level of the\nresulting connection is GRPC_PRIVACY_AND_INTEGRITY.\n\nIf specified, the supplied call credentials object will be attached to the\nreturned channel credentials object. The call_credentials object must remain\nvalid throughout the lifetime of the returned grpc_channel_credentials\nobject. It is expected that the call credentials object was generated\naccording to the Application Default Credentials mechanism and asserts the\nidentity of the default service account of the machine. Supplying any other\nsort of call credential will result in undefined behavior, up to and\nincluding the sudden and unexpected failure of RPCs.\n\nIf nullptr is supplied, the returned channel credentials object will use a\ncall credentials object based on the Application Default Credentials\nmechanism."] grpc_google_default_credentials_create( call_credentials: *mut grpc_call_credentials, ) -> *mut grpc_channel_credentials1983 pub fn grpc_google_default_credentials_create( 1984 call_credentials: *mut grpc_call_credentials, 1985 ) -> *mut grpc_channel_credentials; 1986 } 1987 #[doc = " Callback for getting the SSL roots override from the application.\nIn case of success, *pem_roots_certs must be set to a NULL terminated string\ncontaining the list of PEM encoded root certificates. The ownership is passed\nto the core and freed (laster by the core) with gpr_free.\nIf this function fails and GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment is\nset to a valid path, it will override the roots specified this func"] 1988 pub type grpc_ssl_roots_override_callback = ::std::option::Option< 1989 unsafe extern "C" fn( 1990 pem_root_certs: *mut *mut ::std::os::raw::c_char, 1991 ) -> grpc_ssl_roots_override_result, 1992 >; 1993 extern "C" { 1994 #[doc = " Setup a callback to override the default TLS/SSL roots.\nThis function is not thread-safe and must be called at initialization time\nbefore any ssl credentials are created to have the desired side effect.\nIf GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment is set to a valid path, the\ncallback will not be called."] grpc_set_ssl_roots_override_callback(cb: grpc_ssl_roots_override_callback)1995 pub fn grpc_set_ssl_roots_override_callback(cb: grpc_ssl_roots_override_callback); 1996 } 1997 #[doc = " Object that holds a private key / certificate chain pair in PEM format."] 1998 #[repr(C)] 1999 #[derive(Debug, Copy, Clone)] 2000 pub struct grpc_ssl_pem_key_cert_pair { 2001 #[doc = " private_key is the NULL-terminated string containing the PEM encoding of\nthe client's private key."] 2002 pub private_key: *const ::std::os::raw::c_char, 2003 #[doc = " cert_chain is the NULL-terminated string containing the PEM encoding of\nthe client's certificate chain."] 2004 pub cert_chain: *const ::std::os::raw::c_char, 2005 } 2006 #[doc = " Deprecated in favor of grpc_ssl_verify_peer_options. It will be removed\nafter all of its call sites are migrated to grpc_ssl_verify_peer_options.\nObject that holds additional peer-verification options on a secure\nchannel."] 2007 #[repr(C)] 2008 #[derive(Debug, Copy, Clone)] 2009 pub struct verify_peer_options { 2010 #[doc = " If non-NULL this callback will be invoked with the expected\ntarget_name, the peer's certificate (in PEM format), and whatever\nuserdata pointer is set below. If a non-zero value is returned by this\ncallback then it is treated as a verification failure. Invocation of\nthe callback is blocking, so any implementation should be light-weight."] 2011 pub verify_peer_callback: ::std::option::Option< 2012 unsafe extern "C" fn( 2013 target_name: *const ::std::os::raw::c_char, 2014 peer_pem: *const ::std::os::raw::c_char, 2015 userdata: *mut ::std::os::raw::c_void, 2016 ) -> ::std::os::raw::c_int, 2017 >, 2018 #[doc = " Arbitrary userdata that will be passed as the last argument to\nverify_peer_callback."] 2019 pub verify_peer_callback_userdata: *mut ::std::os::raw::c_void, 2020 #[doc = " A destruct callback that will be invoked when the channel is being\ncleaned up. The userdata argument will be passed to it. The intent is\nto perform any cleanup associated with that userdata."] 2021 pub verify_peer_destruct: 2022 ::std::option::Option<unsafe extern "C" fn(userdata: *mut ::std::os::raw::c_void)>, 2023 } 2024 #[doc = " Object that holds additional peer-verification options on a secure\nchannel."] 2025 #[repr(C)] 2026 #[derive(Debug, Copy, Clone)] 2027 pub struct grpc_ssl_verify_peer_options { 2028 #[doc = " If non-NULL this callback will be invoked with the expected\ntarget_name, the peer's certificate (in PEM format), and whatever\nuserdata pointer is set below. If a non-zero value is returned by this\ncallback then it is treated as a verification failure. Invocation of\nthe callback is blocking, so any implementation should be light-weight."] 2029 pub verify_peer_callback: ::std::option::Option< 2030 unsafe extern "C" fn( 2031 target_name: *const ::std::os::raw::c_char, 2032 peer_pem: *const ::std::os::raw::c_char, 2033 userdata: *mut ::std::os::raw::c_void, 2034 ) -> ::std::os::raw::c_int, 2035 >, 2036 #[doc = " Arbitrary userdata that will be passed as the last argument to\nverify_peer_callback."] 2037 pub verify_peer_callback_userdata: *mut ::std::os::raw::c_void, 2038 #[doc = " A destruct callback that will be invoked when the channel is being\ncleaned up. The userdata argument will be passed to it. The intent is\nto perform any cleanup associated with that userdata."] 2039 pub verify_peer_destruct: 2040 ::std::option::Option<unsafe extern "C" fn(userdata: *mut ::std::os::raw::c_void)>, 2041 } 2042 extern "C" { 2043 #[doc = " Deprecated in favor of grpc_ssl_server_credentials_create_ex. It will be\nremoved after all of its call sites are migrated to\ngrpc_ssl_server_credentials_create_ex. Creates an SSL credentials object.\nThe security level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY.\n- pem_root_certs is the NULL-terminated string containing the PEM encoding\nof the server root certificates. If this parameter is NULL, the\nimplementation will first try to dereference the file pointed by the\nGRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment variable, and if that fails,\ntry to get the roots set by grpc_override_ssl_default_roots. Eventually,\nif all these fail, it will try to get the roots from a well-known place on\ndisk (in the grpc install directory).\n\ngRPC has implemented root cache if the underlying OpenSSL library supports\nit. The gRPC root certificates cache is only applicable on the default\nroot certificates, which is used when this parameter is nullptr. If user\nprovides their own pem_root_certs, when creating an SSL credential object,\ngRPC would not be able to cache it, and each subchannel will generate a\ncopy of the root store. So it is recommended to avoid providing large room\npem with pem_root_certs parameter to avoid excessive memory consumption,\nparticularly on mobile platforms such as iOS.\n- pem_key_cert_pair is a pointer on the object containing client's private\nkey and certificate chain. This parameter can be NULL if the client does\nnot have such a key/cert pair.\n- verify_options is an optional verify_peer_options object which holds\nadditional options controlling how peer certificates are verified. For\nexample, you can supply a callback which receives the peer's certificate\nwith which you can do additional verification. Can be NULL, in which\ncase verification will retain default behavior. Any settings in\nverify_options are copied during this call, so the verify_options\nobject can be released afterwards."] grpc_ssl_credentials_create( pem_root_certs: *const ::std::os::raw::c_char, pem_key_cert_pair: *mut grpc_ssl_pem_key_cert_pair, verify_options: *const verify_peer_options, reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_channel_credentials2044 pub fn grpc_ssl_credentials_create( 2045 pem_root_certs: *const ::std::os::raw::c_char, 2046 pem_key_cert_pair: *mut grpc_ssl_pem_key_cert_pair, 2047 verify_options: *const verify_peer_options, 2048 reserved: *mut ::std::os::raw::c_void, 2049 ) -> *mut grpc_channel_credentials; 2050 } 2051 extern "C" { grpc_ssl_credentials_create_ex( pem_root_certs: *const ::std::os::raw::c_char, pem_key_cert_pair: *mut grpc_ssl_pem_key_cert_pair, verify_options: *const grpc_ssl_verify_peer_options, reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_channel_credentials2052 pub fn grpc_ssl_credentials_create_ex( 2053 pem_root_certs: *const ::std::os::raw::c_char, 2054 pem_key_cert_pair: *mut grpc_ssl_pem_key_cert_pair, 2055 verify_options: *const grpc_ssl_verify_peer_options, 2056 reserved: *mut ::std::os::raw::c_void, 2057 ) -> *mut grpc_channel_credentials; 2058 } 2059 extern "C" { 2060 #[doc = " Creates a composite channel credentials object. The security level of\n resulting connection is determined by channel_creds."] grpc_composite_channel_credentials_create( channel_creds: *mut grpc_channel_credentials, call_creds: *mut grpc_call_credentials, reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_channel_credentials2061 pub fn grpc_composite_channel_credentials_create( 2062 channel_creds: *mut grpc_channel_credentials, 2063 call_creds: *mut grpc_call_credentials, 2064 reserved: *mut ::std::os::raw::c_void, 2065 ) -> *mut grpc_channel_credentials; 2066 } 2067 extern "C" { 2068 #[doc = " Creates a composite call credentials object."] grpc_composite_call_credentials_create( creds1: *mut grpc_call_credentials, creds2: *mut grpc_call_credentials, reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_call_credentials2069 pub fn grpc_composite_call_credentials_create( 2070 creds1: *mut grpc_call_credentials, 2071 creds2: *mut grpc_call_credentials, 2072 reserved: *mut ::std::os::raw::c_void, 2073 ) -> *mut grpc_call_credentials; 2074 } 2075 extern "C" { 2076 #[doc = " Creates a compute engine credentials object for connecting to Google.\nWARNING: Do NOT use this credentials to connect to a non-google service as\nthis could result in an oauth2 token leak."] grpc_google_compute_engine_credentials_create( reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_call_credentials2077 pub fn grpc_google_compute_engine_credentials_create( 2078 reserved: *mut ::std::os::raw::c_void, 2079 ) -> *mut grpc_call_credentials; 2080 } 2081 extern "C" { grpc_max_auth_token_lifetime() -> gpr_timespec2082 pub fn grpc_max_auth_token_lifetime() -> gpr_timespec; 2083 } 2084 extern "C" { 2085 #[doc = " Creates a JWT credentials object. May return NULL if the input is invalid.\n- json_key is the JSON key string containing the client's private key.\n- token_lifetime is the lifetime of each Json Web Token (JWT) created with\nthis credentials. It should not exceed grpc_max_auth_token_lifetime or\nwill be cropped to this value."] grpc_service_account_jwt_access_credentials_create( json_key: *const ::std::os::raw::c_char, token_lifetime: gpr_timespec, reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_call_credentials2086 pub fn grpc_service_account_jwt_access_credentials_create( 2087 json_key: *const ::std::os::raw::c_char, 2088 token_lifetime: gpr_timespec, 2089 reserved: *mut ::std::os::raw::c_void, 2090 ) -> *mut grpc_call_credentials; 2091 } 2092 extern "C" { 2093 #[doc = " Builds External Account credentials.\n- json_string is the JSON string containing the credentials options.\n- scopes_string contains the scopes to be binded with the credentials.\nThis API is used for experimental purposes for now and may change in the\nfuture."] grpc_external_account_credentials_create( json_string: *const ::std::os::raw::c_char, scopes_string: *const ::std::os::raw::c_char, ) -> *mut grpc_call_credentials2094 pub fn grpc_external_account_credentials_create( 2095 json_string: *const ::std::os::raw::c_char, 2096 scopes_string: *const ::std::os::raw::c_char, 2097 ) -> *mut grpc_call_credentials; 2098 } 2099 extern "C" { 2100 #[doc = " Creates an Oauth2 Refresh Token credentials object for connecting to Google.\nMay return NULL if the input is invalid.\nWARNING: Do NOT use this credentials to connect to a non-google service as\nthis could result in an oauth2 token leak.\n- json_refresh_token is the JSON string containing the refresh token itself\nalong with a client_id and client_secret."] grpc_google_refresh_token_credentials_create( json_refresh_token: *const ::std::os::raw::c_char, reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_call_credentials2101 pub fn grpc_google_refresh_token_credentials_create( 2102 json_refresh_token: *const ::std::os::raw::c_char, 2103 reserved: *mut ::std::os::raw::c_void, 2104 ) -> *mut grpc_call_credentials; 2105 } 2106 extern "C" { 2107 #[doc = " Creates an Oauth2 Access Token credentials with an access token that was\nacquired by an out of band mechanism."] grpc_access_token_credentials_create( access_token: *const ::std::os::raw::c_char, reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_call_credentials2108 pub fn grpc_access_token_credentials_create( 2109 access_token: *const ::std::os::raw::c_char, 2110 reserved: *mut ::std::os::raw::c_void, 2111 ) -> *mut grpc_call_credentials; 2112 } 2113 extern "C" { 2114 #[doc = " Creates an IAM credentials object for connecting to Google."] grpc_google_iam_credentials_create( authorization_token: *const ::std::os::raw::c_char, authority_selector: *const ::std::os::raw::c_char, reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_call_credentials2115 pub fn grpc_google_iam_credentials_create( 2116 authorization_token: *const ::std::os::raw::c_char, 2117 authority_selector: *const ::std::os::raw::c_char, 2118 reserved: *mut ::std::os::raw::c_void, 2119 ) -> *mut grpc_call_credentials; 2120 } 2121 #[doc = " Options for creating STS Oauth Token Exchange credentials following the IETF\ndraft https://tools.ietf.org/html/draft-ietf-oauth-token-exchange-16.\nOptional fields may be set to NULL or empty string. It is the responsibility\nof the caller to ensure that the subject and actor tokens are refreshed on\ndisk at the specified paths. This API is used for experimental purposes for\nnow and may change in the future."] 2122 #[repr(C)] 2123 #[derive(Debug, Copy, Clone)] 2124 pub struct grpc_sts_credentials_options { 2125 pub token_exchange_service_uri: *const ::std::os::raw::c_char, 2126 pub resource: *const ::std::os::raw::c_char, 2127 pub audience: *const ::std::os::raw::c_char, 2128 pub scope: *const ::std::os::raw::c_char, 2129 pub requested_token_type: *const ::std::os::raw::c_char, 2130 pub subject_token_path: *const ::std::os::raw::c_char, 2131 pub subject_token_type: *const ::std::os::raw::c_char, 2132 pub actor_token_path: *const ::std::os::raw::c_char, 2133 pub actor_token_type: *const ::std::os::raw::c_char, 2134 } 2135 extern "C" { 2136 #[doc = " Creates an STS credentials following the STS Token Exchanged specifed in the\nIETF draft https://tools.ietf.org/html/draft-ietf-oauth-token-exchange-16.\nThis API is used for experimental purposes for now and may change in the\nfuture."] grpc_sts_credentials_create( options: *const grpc_sts_credentials_options, reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_call_credentials2137 pub fn grpc_sts_credentials_create( 2138 options: *const grpc_sts_credentials_options, 2139 reserved: *mut ::std::os::raw::c_void, 2140 ) -> *mut grpc_call_credentials; 2141 } 2142 #[doc = " Callback function to be called by the metadata credentials plugin\nimplementation when the metadata is ready.\n- user_data is the opaque pointer that was passed in the get_metadata method\nof the grpc_metadata_credentials_plugin (see below).\n- creds_md is an array of credentials metadata produced by the plugin. It\nmay be set to NULL in case of an error.\n- num_creds_md is the number of items in the creds_md array.\n- status must be GRPC_STATUS_OK in case of success or another specific error\ncode otherwise.\n- error_details contains details about the error if any. In case of success\nit should be NULL and will be otherwise ignored."] 2143 pub type grpc_credentials_plugin_metadata_cb = ::std::option::Option< 2144 unsafe extern "C" fn( 2145 user_data: *mut ::std::os::raw::c_void, 2146 creds_md: *const grpc_metadata, 2147 num_creds_md: usize, 2148 status: grpc_status_code::Type, 2149 error_details: *const ::std::os::raw::c_char, 2150 ), 2151 >; 2152 #[doc = " Context that can be used by metadata credentials plugin in order to create\nauth related metadata."] 2153 #[repr(C)] 2154 #[derive(Debug, Copy, Clone)] 2155 pub struct grpc_auth_metadata_context { 2156 #[doc = " The fully qualifed service url."] 2157 pub service_url: *const ::std::os::raw::c_char, 2158 #[doc = " The method name of the RPC being called (not fully qualified).\nThe fully qualified method name can be built from the service_url:\nfull_qualified_method_name = ctx->service_url + '/' + ctx->method_name."] 2159 pub method_name: *const ::std::os::raw::c_char, 2160 #[doc = " The auth_context of the channel which gives the server's identity."] 2161 pub channel_auth_context: *const grpc_auth_context, 2162 #[doc = " Reserved for future use."] 2163 pub reserved: *mut ::std::os::raw::c_void, 2164 } 2165 extern "C" { 2166 #[doc = " Performs a deep copy from \\a from to \\a to."] grpc_auth_metadata_context_copy( from: *mut grpc_auth_metadata_context, to: *mut grpc_auth_metadata_context, )2167 pub fn grpc_auth_metadata_context_copy( 2168 from: *mut grpc_auth_metadata_context, 2169 to: *mut grpc_auth_metadata_context, 2170 ); 2171 } 2172 extern "C" { 2173 #[doc = " Releases internal resources held by \\a context."] grpc_auth_metadata_context_reset(context: *mut grpc_auth_metadata_context)2174 pub fn grpc_auth_metadata_context_reset(context: *mut grpc_auth_metadata_context); 2175 } 2176 #[doc = " grpc_metadata_credentials plugin is an API user provided structure used to\ncreate grpc_credentials objects that can be set on a channel (composed) or\na call. See grpc_credentials_metadata_create_from_plugin below.\nThe grpc client stack will call the get_metadata method of the plugin for\nevery call in scope for the credentials created from it."] 2177 #[repr(C)] 2178 #[derive(Debug, Copy, Clone)] 2179 pub struct grpc_metadata_credentials_plugin { 2180 #[doc = " The implementation of this method has to be non-blocking, but can\nbe performed synchronously or asynchronously.\n\nIf processing occurs synchronously, returns non-zero and populates\ncreds_md, num_creds_md, status, and error_details. In this case,\nthe caller takes ownership of the entries in creds_md and of\nerror_details. Note that if the plugin needs to return more than\nGRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX entries in creds_md, it must\nreturn asynchronously.\n\nIf processing occurs asynchronously, returns zero and invokes \\a cb\nwhen processing is completed. \\a user_data will be passed as the\nfirst parameter of the callback. NOTE: \\a cb MUST be invoked in a\ndifferent thread, not from the thread in which \\a get_metadata() is\ninvoked.\n\n\\a context is the information that can be used by the plugin to create\nauth metadata."] 2181 pub get_metadata: ::std::option::Option< 2182 unsafe extern "C" fn( 2183 state: *mut ::std::os::raw::c_void, 2184 context: grpc_auth_metadata_context, 2185 cb: grpc_credentials_plugin_metadata_cb, 2186 user_data: *mut ::std::os::raw::c_void, 2187 creds_md: *mut grpc_metadata, 2188 num_creds_md: *mut usize, 2189 status: *mut grpc_status_code::Type, 2190 error_details: *mut *const ::std::os::raw::c_char, 2191 ) -> ::std::os::raw::c_int, 2192 >, 2193 #[doc = " Implements debug string of the given plugin. This method returns an\n allocated string that the caller needs to free using gpr_free()"] 2194 pub debug_string: ::std::option::Option< 2195 unsafe extern "C" fn(state: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_char, 2196 >, 2197 #[doc = " Destroys the plugin state."] 2198 pub destroy: ::std::option::Option<unsafe extern "C" fn(state: *mut ::std::os::raw::c_void)>, 2199 #[doc = " State that will be set as the first parameter of the methods above."] 2200 pub state: *mut ::std::os::raw::c_void, 2201 #[doc = " Type of credentials that this plugin is implementing."] 2202 pub type_: *const ::std::os::raw::c_char, 2203 } 2204 extern "C" { 2205 #[doc = " Creates a credentials object from a plugin with a specified minimum security\n level."] grpc_metadata_credentials_create_from_plugin( plugin: grpc_metadata_credentials_plugin, min_security_level: grpc_security_level, reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_call_credentials2206 pub fn grpc_metadata_credentials_create_from_plugin( 2207 plugin: grpc_metadata_credentials_plugin, 2208 min_security_level: grpc_security_level, 2209 reserved: *mut ::std::os::raw::c_void, 2210 ) -> *mut grpc_call_credentials; 2211 } 2212 #[repr(C)] 2213 #[derive(Debug, Copy, Clone)] 2214 pub struct grpc_ssl_server_certificate_config { 2215 _unused: [u8; 0], 2216 } 2217 extern "C" { 2218 #[doc = " Creates a grpc_ssl_server_certificate_config object.\n- pem_roots_cert is the NULL-terminated string containing the PEM encoding of\nthe client root certificates. This parameter may be NULL if the server does\nnot want the client to be authenticated with SSL.\n- pem_key_cert_pairs is an array private key / certificate chains of the\nserver. This parameter cannot be NULL.\n- num_key_cert_pairs indicates the number of items in the private_key_files\nand cert_chain_files parameters. It must be at least 1.\n- It is the caller's responsibility to free this object via\ngrpc_ssl_server_certificate_config_destroy()."] grpc_ssl_server_certificate_config_create( pem_root_certs: *const ::std::os::raw::c_char, pem_key_cert_pairs: *const grpc_ssl_pem_key_cert_pair, num_key_cert_pairs: usize, ) -> *mut grpc_ssl_server_certificate_config2219 pub fn grpc_ssl_server_certificate_config_create( 2220 pem_root_certs: *const ::std::os::raw::c_char, 2221 pem_key_cert_pairs: *const grpc_ssl_pem_key_cert_pair, 2222 num_key_cert_pairs: usize, 2223 ) -> *mut grpc_ssl_server_certificate_config; 2224 } 2225 extern "C" { 2226 #[doc = " Destroys a grpc_ssl_server_certificate_config object."] grpc_ssl_server_certificate_config_destroy( config: *mut grpc_ssl_server_certificate_config, )2227 pub fn grpc_ssl_server_certificate_config_destroy( 2228 config: *mut grpc_ssl_server_certificate_config, 2229 ); 2230 } 2231 #[doc = " Callback to retrieve updated SSL server certificates, private keys, and\ntrusted CAs (for client authentication).\n- user_data parameter, if not NULL, contains opaque data to be used by the\ncallback.\n- Use grpc_ssl_server_certificate_config_create to create the config.\n- The caller assumes ownership of the config."] 2232 pub type grpc_ssl_server_certificate_config_callback = ::std::option::Option< 2233 unsafe extern "C" fn( 2234 user_data: *mut ::std::os::raw::c_void, 2235 config: *mut *mut grpc_ssl_server_certificate_config, 2236 ) -> grpc_ssl_certificate_config_reload_status, 2237 >; 2238 extern "C" { 2239 #[doc = " Deprecated in favor of grpc_ssl_server_credentials_create_ex.\nCreates an SSL server_credentials object.\n- pem_roots_cert is the NULL-terminated string containing the PEM encoding of\nthe client root certificates. This parameter may be NULL if the server does\nnot want the client to be authenticated with SSL.\n- pem_key_cert_pairs is an array private key / certificate chains of the\nserver. This parameter cannot be NULL.\n- num_key_cert_pairs indicates the number of items in the private_key_files\nand cert_chain_files parameters. It should be at least 1.\n- force_client_auth, if set to non-zero will force the client to authenticate\nwith an SSL cert. Note that this option is ignored if pem_root_certs is\nNULL."] grpc_ssl_server_credentials_create( pem_root_certs: *const ::std::os::raw::c_char, pem_key_cert_pairs: *mut grpc_ssl_pem_key_cert_pair, num_key_cert_pairs: usize, force_client_auth: ::std::os::raw::c_int, reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_server_credentials2240 pub fn grpc_ssl_server_credentials_create( 2241 pem_root_certs: *const ::std::os::raw::c_char, 2242 pem_key_cert_pairs: *mut grpc_ssl_pem_key_cert_pair, 2243 num_key_cert_pairs: usize, 2244 force_client_auth: ::std::os::raw::c_int, 2245 reserved: *mut ::std::os::raw::c_void, 2246 ) -> *mut grpc_server_credentials; 2247 } 2248 extern "C" { 2249 #[doc = " Deprecated in favor of grpc_ssl_server_credentials_create_with_options.\nSame as grpc_ssl_server_credentials_create method except uses\ngrpc_ssl_client_certificate_request_type enum to support more ways to\nauthenticate client certificates."] grpc_ssl_server_credentials_create_ex( pem_root_certs: *const ::std::os::raw::c_char, pem_key_cert_pairs: *mut grpc_ssl_pem_key_cert_pair, num_key_cert_pairs: usize, client_certificate_request: grpc_ssl_client_certificate_request_type, reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_server_credentials2250 pub fn grpc_ssl_server_credentials_create_ex( 2251 pem_root_certs: *const ::std::os::raw::c_char, 2252 pem_key_cert_pairs: *mut grpc_ssl_pem_key_cert_pair, 2253 num_key_cert_pairs: usize, 2254 client_certificate_request: grpc_ssl_client_certificate_request_type, 2255 reserved: *mut ::std::os::raw::c_void, 2256 ) -> *mut grpc_server_credentials; 2257 } 2258 #[repr(C)] 2259 #[derive(Debug, Copy, Clone)] 2260 pub struct grpc_ssl_server_credentials_options { 2261 _unused: [u8; 0], 2262 } 2263 extern "C" { 2264 #[doc = " Creates an options object using a certificate config. Use this method when\nthe certificates and keys of the SSL server will not change during the\nserver's lifetime.\n- Takes ownership of the certificate_config parameter."] grpc_ssl_server_credentials_create_options_using_config( client_certificate_request: grpc_ssl_client_certificate_request_type, certificate_config: *mut grpc_ssl_server_certificate_config, ) -> *mut grpc_ssl_server_credentials_options2265 pub fn grpc_ssl_server_credentials_create_options_using_config( 2266 client_certificate_request: grpc_ssl_client_certificate_request_type, 2267 certificate_config: *mut grpc_ssl_server_certificate_config, 2268 ) -> *mut grpc_ssl_server_credentials_options; 2269 } 2270 extern "C" { 2271 #[doc = " Creates an options object using a certificate config fetcher. Use this\nmethod to reload the certificates and keys of the SSL server without\ninterrupting the operation of the server. Initial certificate config will be\nfetched during server initialization.\n- user_data parameter, if not NULL, contains opaque data which will be passed\nto the fetcher (see definition of\ngrpc_ssl_server_certificate_config_callback)."] grpc_ssl_server_credentials_create_options_using_config_fetcher( client_certificate_request: grpc_ssl_client_certificate_request_type, cb: grpc_ssl_server_certificate_config_callback, user_data: *mut ::std::os::raw::c_void, ) -> *mut grpc_ssl_server_credentials_options2272 pub fn grpc_ssl_server_credentials_create_options_using_config_fetcher( 2273 client_certificate_request: grpc_ssl_client_certificate_request_type, 2274 cb: grpc_ssl_server_certificate_config_callback, 2275 user_data: *mut ::std::os::raw::c_void, 2276 ) -> *mut grpc_ssl_server_credentials_options; 2277 } 2278 extern "C" { 2279 #[doc = " Destroys a grpc_ssl_server_credentials_options object."] grpc_ssl_server_credentials_options_destroy( options: *mut grpc_ssl_server_credentials_options, )2280 pub fn grpc_ssl_server_credentials_options_destroy( 2281 options: *mut grpc_ssl_server_credentials_options, 2282 ); 2283 } 2284 extern "C" { 2285 #[doc = " Creates an SSL server_credentials object using the provided options struct.\n- Takes ownership of the options parameter."] grpc_ssl_server_credentials_create_with_options( options: *mut grpc_ssl_server_credentials_options, ) -> *mut grpc_server_credentials2286 pub fn grpc_ssl_server_credentials_create_with_options( 2287 options: *mut grpc_ssl_server_credentials_options, 2288 ) -> *mut grpc_server_credentials; 2289 } 2290 extern "C" { 2291 #[doc = " Sets a credentials to a call. Can only be called on the client side before\ngrpc_call_start_batch."] grpc_call_set_credentials( call: *mut grpc_call, creds: *mut grpc_call_credentials, ) -> grpc_call_error2292 pub fn grpc_call_set_credentials( 2293 call: *mut grpc_call, 2294 creds: *mut grpc_call_credentials, 2295 ) -> grpc_call_error; 2296 } 2297 #[doc = " Callback function that is called when the metadata processing is done.\n- Consumed metadata will be removed from the set of metadata available on the\ncall. consumed_md may be NULL if no metadata has been consumed.\n- Response metadata will be set on the response. response_md may be NULL.\n- status is GRPC_STATUS_OK for success or a specific status for an error.\nCommon error status for auth metadata processing is either\nGRPC_STATUS_UNAUTHENTICATED in case of an authentication failure or\nGRPC_STATUS PERMISSION_DENIED in case of an authorization failure.\n- error_details gives details about the error. May be NULL."] 2298 pub type grpc_process_auth_metadata_done_cb = ::std::option::Option< 2299 unsafe extern "C" fn( 2300 user_data: *mut ::std::os::raw::c_void, 2301 consumed_md: *const grpc_metadata, 2302 num_consumed_md: usize, 2303 response_md: *const grpc_metadata, 2304 num_response_md: usize, 2305 status: grpc_status_code::Type, 2306 error_details: *const ::std::os::raw::c_char, 2307 ), 2308 >; 2309 #[doc = " Pluggable server-side metadata processor object."] 2310 #[repr(C)] 2311 #[derive(Debug, Copy, Clone)] 2312 pub struct grpc_auth_metadata_processor { 2313 #[doc = " The context object is read/write: it contains the properties of the\nchannel peer and it is the job of the process function to augment it with\nproperties derived from the passed-in metadata.\nThe lifetime of these objects is guaranteed until cb is invoked."] 2314 pub process: ::std::option::Option< 2315 unsafe extern "C" fn( 2316 state: *mut ::std::os::raw::c_void, 2317 context: *mut grpc_auth_context, 2318 md: *const grpc_metadata, 2319 num_md: usize, 2320 cb: grpc_process_auth_metadata_done_cb, 2321 user_data: *mut ::std::os::raw::c_void, 2322 ), 2323 >, 2324 pub destroy: ::std::option::Option<unsafe extern "C" fn(state: *mut ::std::os::raw::c_void)>, 2325 pub state: *mut ::std::os::raw::c_void, 2326 } 2327 extern "C" { grpc_server_credentials_set_auth_metadata_processor( creds: *mut grpc_server_credentials, processor: grpc_auth_metadata_processor, )2328 pub fn grpc_server_credentials_set_auth_metadata_processor( 2329 creds: *mut grpc_server_credentials, 2330 processor: grpc_auth_metadata_processor, 2331 ); 2332 } 2333 #[repr(C)] 2334 #[derive(Debug, Copy, Clone)] 2335 pub struct grpc_alts_credentials_options { 2336 _unused: [u8; 0], 2337 } 2338 extern "C" { 2339 #[doc = " This method creates a grpc ALTS credentials client options instance.\n It is used for experimental purpose for now and subject to change."] grpc_alts_credentials_client_options_create() -> *mut grpc_alts_credentials_options2340 pub fn grpc_alts_credentials_client_options_create() -> *mut grpc_alts_credentials_options; 2341 } 2342 extern "C" { 2343 #[doc = " This method creates a grpc ALTS credentials server options instance.\n It is used for experimental purpose for now and subject to change."] grpc_alts_credentials_server_options_create() -> *mut grpc_alts_credentials_options2344 pub fn grpc_alts_credentials_server_options_create() -> *mut grpc_alts_credentials_options; 2345 } 2346 extern "C" { 2347 #[doc = " This method adds a target service account to grpc client's ALTS credentials\n options instance. It is used for experimental purpose for now and subject\n to change.\n\n - options: grpc ALTS credentials options instance.\n - service_account: service account of target endpoint."] grpc_alts_credentials_client_options_add_target_service_account( options: *mut grpc_alts_credentials_options, service_account: *const ::std::os::raw::c_char, )2348 pub fn grpc_alts_credentials_client_options_add_target_service_account( 2349 options: *mut grpc_alts_credentials_options, 2350 service_account: *const ::std::os::raw::c_char, 2351 ); 2352 } 2353 extern "C" { 2354 #[doc = " This method destroys a grpc_alts_credentials_options instance by\n de-allocating all of its occupied memory. It is used for experimental purpose\n for now and subject to change.\n\n - options: a grpc_alts_credentials_options instance that needs to be\n destroyed."] grpc_alts_credentials_options_destroy(options: *mut grpc_alts_credentials_options)2355 pub fn grpc_alts_credentials_options_destroy(options: *mut grpc_alts_credentials_options); 2356 } 2357 extern "C" { 2358 #[doc = " This method creates an ALTS channel credential object. The security\n level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY.\n It is used for experimental purpose for now and subject to change.\n\n - options: grpc ALTS credentials options instance for client.\n\n It returns the created ALTS channel credential object."] grpc_alts_credentials_create( options: *const grpc_alts_credentials_options, ) -> *mut grpc_channel_credentials2359 pub fn grpc_alts_credentials_create( 2360 options: *const grpc_alts_credentials_options, 2361 ) -> *mut grpc_channel_credentials; 2362 } 2363 extern "C" { 2364 #[doc = " This method creates an ALTS server credential object. It is used for\n experimental purpose for now and subject to change.\n\n - options: grpc ALTS credentials options instance for server.\n\n It returns the created ALTS server credential object."] grpc_alts_server_credentials_create( options: *const grpc_alts_credentials_options, ) -> *mut grpc_server_credentials2365 pub fn grpc_alts_server_credentials_create( 2366 options: *const grpc_alts_credentials_options, 2367 ) -> *mut grpc_server_credentials; 2368 } 2369 extern "C" { 2370 #[doc = " This method creates a local channel credential object. The security level\n of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY for UDS and\n GRPC_SECURITY_NONE for LOCAL_TCP. It is used for experimental purpose\n for now and subject to change.\n\n - type: local connection type\n\n It returns the created local channel credential object."] grpc_local_credentials_create( type_: grpc_local_connect_type, ) -> *mut grpc_channel_credentials2371 pub fn grpc_local_credentials_create( 2372 type_: grpc_local_connect_type, 2373 ) -> *mut grpc_channel_credentials; 2374 } 2375 extern "C" { 2376 #[doc = " This method creates a local server credential object. It is used for\n experimental purpose for now and subject to change.\n\n - type: local connection type\n\n It returns the created local server credential object."] grpc_local_server_credentials_create( type_: grpc_local_connect_type, ) -> *mut grpc_server_credentials2377 pub fn grpc_local_server_credentials_create( 2378 type_: grpc_local_connect_type, 2379 ) -> *mut grpc_server_credentials; 2380 } 2381 #[repr(C)] 2382 #[derive(Debug, Copy, Clone)] 2383 pub struct grpc_tls_credentials_options { 2384 _unused: [u8; 0], 2385 } 2386 #[repr(C)] 2387 #[derive(Debug, Copy, Clone)] 2388 pub struct grpc_tls_certificate_provider { 2389 _unused: [u8; 0], 2390 } 2391 #[repr(C)] 2392 #[derive(Debug, Copy, Clone)] 2393 pub struct grpc_tls_identity_pairs { 2394 _unused: [u8; 0], 2395 } 2396 extern "C" { 2397 #[doc = " EXPERIMENTAL API - Subject to change\n\n Creates a grpc_tls_identity_pairs that stores a list of identity credential\n data, including identity private key and identity certificate chain."] grpc_tls_identity_pairs_create() -> *mut grpc_tls_identity_pairs2398 pub fn grpc_tls_identity_pairs_create() -> *mut grpc_tls_identity_pairs; 2399 } 2400 extern "C" { 2401 #[doc = " EXPERIMENTAL API - Subject to change\n\n Adds a identity private key and a identity certificate chain to\n grpc_tls_identity_pairs. This function will make an internal copy of\n |private_key| and |cert_chain|."] grpc_tls_identity_pairs_add_pair( pairs: *mut grpc_tls_identity_pairs, private_key: *const ::std::os::raw::c_char, cert_chain: *const ::std::os::raw::c_char, )2402 pub fn grpc_tls_identity_pairs_add_pair( 2403 pairs: *mut grpc_tls_identity_pairs, 2404 private_key: *const ::std::os::raw::c_char, 2405 cert_chain: *const ::std::os::raw::c_char, 2406 ); 2407 } 2408 extern "C" { 2409 #[doc = " EXPERIMENTAL API - Subject to change\n\n Destroys a grpc_tls_identity_pairs object. If this object is passed to a\n provider initiation function, the ownership is transferred so this function\n doesn't need to be called. Otherwise the creator of the\n grpc_tls_identity_pairs object is responsible for its destruction."] grpc_tls_identity_pairs_destroy(pairs: *mut grpc_tls_identity_pairs)2410 pub fn grpc_tls_identity_pairs_destroy(pairs: *mut grpc_tls_identity_pairs); 2411 } 2412 extern "C" { 2413 #[doc = " EXPERIMENTAL API - Subject to change\n\n Creates a grpc_tls_certificate_provider that will load credential data from\n static string during initialization. This provider will always return the\n same cert data for all cert names.\n root_certificate and pem_key_cert_pairs can be nullptr, indicating the\n corresponding credential data is not needed.\n This function will make a copy of |root_certificate|.\n The ownership of |pem_key_cert_pairs| is transferred."] grpc_tls_certificate_provider_static_data_create( root_certificate: *const ::std::os::raw::c_char, pem_key_cert_pairs: *mut grpc_tls_identity_pairs, ) -> *mut grpc_tls_certificate_provider2414 pub fn grpc_tls_certificate_provider_static_data_create( 2415 root_certificate: *const ::std::os::raw::c_char, 2416 pem_key_cert_pairs: *mut grpc_tls_identity_pairs, 2417 ) -> *mut grpc_tls_certificate_provider; 2418 } 2419 extern "C" { 2420 #[doc = " EXPERIMENTAL API - Subject to change\n\n Creates a grpc_tls_certificate_provider that will watch the credential\n changes on the file system. This provider will always return the up-to-date\n cert data for all the cert names callers set through\n |grpc_tls_credentials_options|. Note that this API only supports one key-cert\n file and hence one set of identity key-cert pair, so SNI(Server Name\n Indication) is not supported.\n - private_key_path is the file path of the private key. This must be set if\n |identity_certificate_path| is set. Otherwise, it could be null if no\n identity credentials are needed.\n - identity_certificate_path is the file path of the identity certificate\n chain. This must be set if |private_key_path| is set. Otherwise, it could\n be null if no identity credentials are needed.\n - root_cert_path is the file path to the root certificate bundle. This\n may be null if no root certs are needed.\n - refresh_interval_sec is the refreshing interval that we will check the\n files for updates.\n It does not take ownership of parameters."] grpc_tls_certificate_provider_file_watcher_create( private_key_path: *const ::std::os::raw::c_char, identity_certificate_path: *const ::std::os::raw::c_char, root_cert_path: *const ::std::os::raw::c_char, refresh_interval_sec: ::std::os::raw::c_uint, ) -> *mut grpc_tls_certificate_provider2421 pub fn grpc_tls_certificate_provider_file_watcher_create( 2422 private_key_path: *const ::std::os::raw::c_char, 2423 identity_certificate_path: *const ::std::os::raw::c_char, 2424 root_cert_path: *const ::std::os::raw::c_char, 2425 refresh_interval_sec: ::std::os::raw::c_uint, 2426 ) -> *mut grpc_tls_certificate_provider; 2427 } 2428 extern "C" { 2429 #[doc = " EXPERIMENTAL API - Subject to change\n\n Releases a grpc_tls_certificate_provider object. The creator of the\n grpc_tls_certificate_provider object is responsible for its release."] grpc_tls_certificate_provider_release(provider: *mut grpc_tls_certificate_provider)2430 pub fn grpc_tls_certificate_provider_release(provider: *mut grpc_tls_certificate_provider); 2431 } 2432 extern "C" { 2433 #[doc = " EXPERIMENTAL API - Subject to change\n\n Creates an grpc_tls_credentials_options."] grpc_tls_credentials_options_create() -> *mut grpc_tls_credentials_options2434 pub fn grpc_tls_credentials_options_create() -> *mut grpc_tls_credentials_options; 2435 } 2436 extern "C" { 2437 #[doc = " EXPERIMENTAL API - Subject to change\n\n Sets the credential provider in the options.\n The |options| will implicitly take a new ref to the |provider|."] grpc_tls_credentials_options_set_certificate_provider( options: *mut grpc_tls_credentials_options, provider: *mut grpc_tls_certificate_provider, )2438 pub fn grpc_tls_credentials_options_set_certificate_provider( 2439 options: *mut grpc_tls_credentials_options, 2440 provider: *mut grpc_tls_certificate_provider, 2441 ); 2442 } 2443 extern "C" { 2444 #[doc = " EXPERIMENTAL API - Subject to change\n\n If set, gRPC stack will keep watching the root certificates with\n name |root_cert_name|.\n If this is not set on the client side, we will use the root certificates\n stored in the default system location, since client side must provide root\n certificates in TLS.\n If this is not set on the server side, we will not watch any root certificate\n updates, and assume no root certificates needed for the server(single-side\n TLS). Default root certs on the server side is not supported."] grpc_tls_credentials_options_watch_root_certs( options: *mut grpc_tls_credentials_options, )2445 pub fn grpc_tls_credentials_options_watch_root_certs( 2446 options: *mut grpc_tls_credentials_options, 2447 ); 2448 } 2449 extern "C" { 2450 #[doc = " EXPERIMENTAL API - Subject to change\n\n Sets the name of the root certificates being watched.\n If not set, We will use a default empty string as the root certificate name."] grpc_tls_credentials_options_set_root_cert_name( options: *mut grpc_tls_credentials_options, root_cert_name: *const ::std::os::raw::c_char, )2451 pub fn grpc_tls_credentials_options_set_root_cert_name( 2452 options: *mut grpc_tls_credentials_options, 2453 root_cert_name: *const ::std::os::raw::c_char, 2454 ); 2455 } 2456 extern "C" { 2457 #[doc = " EXPERIMENTAL API - Subject to change\n\n If set, gRPC stack will keep watching the identity key-cert pairs\n with name |identity_cert_name|.\n This is required on the server side, and optional on the client side."] grpc_tls_credentials_options_watch_identity_key_cert_pairs( options: *mut grpc_tls_credentials_options, )2458 pub fn grpc_tls_credentials_options_watch_identity_key_cert_pairs( 2459 options: *mut grpc_tls_credentials_options, 2460 ); 2461 } 2462 extern "C" { 2463 #[doc = " EXPERIMENTAL API - Subject to change\n\n Sets the name of the identity certificates being watched.\n If not set, We will use a default empty string as the identity certificate\n name."] grpc_tls_credentials_options_set_identity_cert_name( options: *mut grpc_tls_credentials_options, identity_cert_name: *const ::std::os::raw::c_char, )2464 pub fn grpc_tls_credentials_options_set_identity_cert_name( 2465 options: *mut grpc_tls_credentials_options, 2466 identity_cert_name: *const ::std::os::raw::c_char, 2467 ); 2468 } 2469 extern "C" { 2470 #[doc = " EXPERIMENTAL API - Subject to change\n\n Sets the options of whether to request and/or verify client certs. This shall\n only be called on the server side."] grpc_tls_credentials_options_set_cert_request_type( options: *mut grpc_tls_credentials_options, type_: grpc_ssl_client_certificate_request_type, )2471 pub fn grpc_tls_credentials_options_set_cert_request_type( 2472 options: *mut grpc_tls_credentials_options, 2473 type_: grpc_ssl_client_certificate_request_type, 2474 ); 2475 } 2476 extern "C" { 2477 #[doc = " EXPERIMENTAL API - Subject to change\n\n If set, gRPC will read all hashed x.509 CRL files in the directory and\n enforce the CRL files on all TLS handshakes. Only supported for OpenSSL\n version > 1.1.\n It is used for experimental purpose for now and subject to change."] grpc_tls_credentials_options_set_crl_directory( options: *mut grpc_tls_credentials_options, crl_directory: *const ::std::os::raw::c_char, )2478 pub fn grpc_tls_credentials_options_set_crl_directory( 2479 options: *mut grpc_tls_credentials_options, 2480 crl_directory: *const ::std::os::raw::c_char, 2481 ); 2482 } 2483 extern "C" { 2484 #[doc = " EXPERIMENTAL API - Subject to change\n\n Sets the options of whether to verify server certs on the client side.\n Passing in a non-zero value indicates verifying the certs."] grpc_tls_credentials_options_set_verify_server_cert( options: *mut grpc_tls_credentials_options, verify_server_cert: ::std::os::raw::c_int, )2485 pub fn grpc_tls_credentials_options_set_verify_server_cert( 2486 options: *mut grpc_tls_credentials_options, 2487 verify_server_cert: ::std::os::raw::c_int, 2488 ); 2489 } 2490 extern "C" { 2491 #[doc = " EXPERIMENTAL API - Subject to change\n\n Sets whether or not a TLS server should send a list of CA names in the\n ServerHello. This list of CA names is read from the server's trust bundle, so\n that the client can use this list as a hint to know which certificate it\n should send to the server.\n\n WARNING: This API is extremely dangerous and should not be used. If the\n server's trust bundle is too large, then the TLS server will be unable to\n form a ServerHello, and hence will be unusable. The definition of \"too large\"\n depends on the underlying SSL library being used and on the size of the CN\n fields of the certificates in the trust bundle."] grpc_tls_credentials_options_set_send_client_ca_list( options: *mut grpc_tls_credentials_options, send_client_ca_list: bool, )2492 pub fn grpc_tls_credentials_options_set_send_client_ca_list( 2493 options: *mut grpc_tls_credentials_options, 2494 send_client_ca_list: bool, 2495 ); 2496 } 2497 #[doc = " EXPERIMENTAL API - Subject to change\n\n The read-only request information exposed in a verification call.\n Callers should not directly manage the ownership of it. We will make sure it\n is always available inside verify() or cancel() call, and will destroy the\n object at the end of custom verification."] 2498 #[repr(C)] 2499 #[derive(Debug, Copy, Clone)] 2500 pub struct grpc_tls_custom_verification_check_request { 2501 pub target_name: *const ::std::os::raw::c_char, 2502 pub peer_info: grpc_tls_custom_verification_check_request_peer_info, 2503 } 2504 #[repr(C)] 2505 #[derive(Debug, Copy, Clone)] 2506 pub struct grpc_tls_custom_verification_check_request_peer_info { 2507 pub common_name: *const ::std::os::raw::c_char, 2508 pub san_names: grpc_tls_custom_verification_check_request_peer_info_san_names, 2509 pub peer_cert: *const ::std::os::raw::c_char, 2510 pub peer_cert_full_chain: *const ::std::os::raw::c_char, 2511 pub verified_root_cert_subject: *const ::std::os::raw::c_char, 2512 } 2513 #[repr(C)] 2514 #[derive(Debug, Copy, Clone)] 2515 pub struct grpc_tls_custom_verification_check_request_peer_info_san_names { 2516 pub uri_names: *mut *mut ::std::os::raw::c_char, 2517 pub uri_names_size: usize, 2518 pub dns_names: *mut *mut ::std::os::raw::c_char, 2519 pub dns_names_size: usize, 2520 pub email_names: *mut *mut ::std::os::raw::c_char, 2521 pub email_names_size: usize, 2522 pub ip_names: *mut *mut ::std::os::raw::c_char, 2523 pub ip_names_size: usize, 2524 } 2525 #[doc = " EXPERIMENTAL API - Subject to change\n\n A callback function provided by gRPC as a parameter of the |verify| function\n in grpc_tls_certificate_verifier_external. If |verify| is expected to be run\n asynchronously, the implementer of |verify| will need to invoke this callback\n with |callback_arg| and proper verification status at the end to bring the\n control back to gRPC C core."] 2526 pub type grpc_tls_on_custom_verification_check_done_cb = ::std::option::Option< 2527 unsafe extern "C" fn( 2528 request: *mut grpc_tls_custom_verification_check_request, 2529 callback_arg: *mut ::std::os::raw::c_void, 2530 status: grpc_status_code::Type, 2531 error_details: *const ::std::os::raw::c_char, 2532 ), 2533 >; 2534 #[repr(C)] 2535 #[derive(Debug, Copy, Clone)] 2536 pub struct grpc_tls_certificate_verifier { 2537 _unused: [u8; 0], 2538 } 2539 #[doc = " EXPERIMENTAL API - Subject to change\n\n A struct containing all the necessary functions a custom external verifier\n needs to implement to be able to be converted to an internal verifier."] 2540 #[repr(C)] 2541 #[derive(Debug, Copy, Clone)] 2542 pub struct grpc_tls_certificate_verifier_external { 2543 pub user_data: *mut ::std::os::raw::c_void, 2544 #[doc = " A function pointer containing the verification logic that will be\n performed after the TLS handshake is done. It could be processed\n synchronously or asynchronously.\n - If expected to be processed synchronously, the implementer should\n populate the verification result through |sync_status| and\n |sync_error_details|, and then return true.\n - If expected to be processed asynchronously, the implementer should return\n false immediately, and then in the asynchronous thread invoke |callback|\n with the verification result. The implementer MUST NOT invoke the async\n |callback| in the same thread before |verify| returns, otherwise it can\n lead to deadlocks.\n\n user_data: any argument that is passed in the user_data of\n grpc_tls_certificate_verifier_external during construction time\n can be retrieved later here.\n request: request information exposed to the function implementer.\n callback: the callback that the function implementer needs to invoke, if\n return a non-zero value. It is usually invoked when the\n asynchronous verification is done, and serves to bring the\n control back to gRPC.\n callback_arg: A pointer to the internal ExternalVerifier instance. This is\n mainly used as an argument in |callback|, if want to invoke\n |callback| in async mode.\n sync_status: indicates if a connection should be allowed. This should only\n be used if the verification check is done synchronously.\n sync_error_details: the error generated while verifying a connection. This\n should only be used if the verification check is done\n synchronously. the implementation must allocate the\n error string via gpr_malloc() or gpr_strdup().\n return: return 0 if |verify| is expected to be executed asynchronously,\n otherwise return a non-zero value."] 2545 pub verify: ::std::option::Option< 2546 unsafe extern "C" fn( 2547 user_data: *mut ::std::os::raw::c_void, 2548 request: *mut grpc_tls_custom_verification_check_request, 2549 callback: grpc_tls_on_custom_verification_check_done_cb, 2550 callback_arg: *mut ::std::os::raw::c_void, 2551 sync_status: *mut grpc_status_code::Type, 2552 sync_error_details: *mut *mut ::std::os::raw::c_char, 2553 ) -> ::std::os::raw::c_int, 2554 >, 2555 #[doc = " A function pointer that cleans up the caller-specified resources when the\n verifier is still running but the whole connection got cancelled. This\n could happen when the verifier is doing some async operations, and the\n whole handshaker object got destroyed because of connection time limit is\n reached, or any other reasons. In such cases, function implementers might\n want to be notified, and properly clean up some resources.\n\n user_data: any argument that is passed in the user_data of\n grpc_tls_certificate_verifier_external during construction time\n can be retrieved later here.\n request: request information exposed to the function implementer. It will\n be the same request object that was passed to verify(), and it\n tells the cancel() which request to cancel."] 2556 pub cancel: ::std::option::Option< 2557 unsafe extern "C" fn( 2558 user_data: *mut ::std::os::raw::c_void, 2559 request: *mut grpc_tls_custom_verification_check_request, 2560 ), 2561 >, 2562 #[doc = " A function pointer that does some additional destruction work when the\n verifier is destroyed. This is used when the caller wants to associate some\n objects to the lifetime of external_verifier, and destroy them when\n external_verifier got destructed. For example, in C++, the class containing\n user-specified callback functions should not be destroyed before\n external_verifier, since external_verifier will invoke them while being\n used.\n Note that the caller MUST delete the grpc_tls_certificate_verifier_external\n object itself in this function, otherwise it will cause memory leaks. That\n also means the user_data has to carries at least a self pointer, for the\n callers to later delete it in destruct().\n\n user_data: any argument that is passed in the user_data of\n grpc_tls_certificate_verifier_external during construction time\n can be retrieved later here."] 2563 pub destruct: 2564 ::std::option::Option<unsafe extern "C" fn(user_data: *mut ::std::os::raw::c_void)>, 2565 } 2566 extern "C" { 2567 #[doc = " EXPERIMENTAL API - Subject to change\n\n Converts an external verifier to an internal verifier.\n Note that we will not take the ownership of the external_verifier. Callers\n will need to delete external_verifier in its own destruct function."] grpc_tls_certificate_verifier_external_create( external_verifier: *mut grpc_tls_certificate_verifier_external, ) -> *mut grpc_tls_certificate_verifier2568 pub fn grpc_tls_certificate_verifier_external_create( 2569 external_verifier: *mut grpc_tls_certificate_verifier_external, 2570 ) -> *mut grpc_tls_certificate_verifier; 2571 } 2572 extern "C" { 2573 #[doc = " EXPERIMENTAL API - Subject to change\n\n Factory function for an internal verifier that won't perform any\n post-handshake verification. Note: using this solely without any other\n authentication mechanisms on the peer identity will leave your applications\n to the MITM(Man-In-The-Middle) attacks. Users should avoid doing so in\n production environments."] grpc_tls_certificate_verifier_no_op_create() -> *mut grpc_tls_certificate_verifier2574 pub fn grpc_tls_certificate_verifier_no_op_create() -> *mut grpc_tls_certificate_verifier; 2575 } 2576 extern "C" { 2577 #[doc = " EXPERIMENTAL API - Subject to change\n\n Factory function for an internal verifier that will do the default hostname\n check."] grpc_tls_certificate_verifier_host_name_create() -> *mut grpc_tls_certificate_verifier2578 pub fn grpc_tls_certificate_verifier_host_name_create() -> *mut grpc_tls_certificate_verifier; 2579 } 2580 extern "C" { 2581 #[doc = " EXPERIMENTAL API - Subject to change\n\n Releases a grpc_tls_certificate_verifier object. The creator of the\n grpc_tls_certificate_verifier object is responsible for its release."] grpc_tls_certificate_verifier_release(verifier: *mut grpc_tls_certificate_verifier)2582 pub fn grpc_tls_certificate_verifier_release(verifier: *mut grpc_tls_certificate_verifier); 2583 } 2584 extern "C" { 2585 #[doc = " EXPERIMENTAL API - Subject to change\n\n Sets the verifier in options. The |options| will implicitly take a new ref to\n the |verifier|. If not set on the client side, we will verify server's\n certificates, and check the default hostname. If not set on the server side,\n we will verify client's certificates."] grpc_tls_credentials_options_set_certificate_verifier( options: *mut grpc_tls_credentials_options, verifier: *mut grpc_tls_certificate_verifier, )2586 pub fn grpc_tls_credentials_options_set_certificate_verifier( 2587 options: *mut grpc_tls_credentials_options, 2588 verifier: *mut grpc_tls_certificate_verifier, 2589 ); 2590 } 2591 extern "C" { 2592 #[doc = " EXPERIMENTAL API - Subject to change\n\n Sets the options of whether to check the hostname of the peer on a per-call\n basis. This is usually used in a combination with virtual hosting at the\n client side, where each individual call on a channel can have a different\n host associated with it.\n This check is intended to verify that the host specified for the individual\n call is covered by the cert that the peer presented.\n The default is a non-zero value, which indicates performing such checks."] grpc_tls_credentials_options_set_check_call_host( options: *mut grpc_tls_credentials_options, check_call_host: ::std::os::raw::c_int, )2593 pub fn grpc_tls_credentials_options_set_check_call_host( 2594 options: *mut grpc_tls_credentials_options, 2595 check_call_host: ::std::os::raw::c_int, 2596 ); 2597 } 2598 extern "C" { 2599 #[doc = " EXPERIMENTAL API - Subject to change\n\n Performs the verification logic of an internal verifier.\n This is typically used when composing the internal verifiers as part of the\n custom verification.\n If |grpc_tls_certificate_verifier_verify| returns true, inspect the\n verification result through request->status and request->error_details.\n Otherwise, inspect through the parameter of |callback|."] grpc_tls_certificate_verifier_verify( verifier: *mut grpc_tls_certificate_verifier, request: *mut grpc_tls_custom_verification_check_request, callback: grpc_tls_on_custom_verification_check_done_cb, callback_arg: *mut ::std::os::raw::c_void, sync_status: *mut grpc_status_code::Type, sync_error_details: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int2600 pub fn grpc_tls_certificate_verifier_verify( 2601 verifier: *mut grpc_tls_certificate_verifier, 2602 request: *mut grpc_tls_custom_verification_check_request, 2603 callback: grpc_tls_on_custom_verification_check_done_cb, 2604 callback_arg: *mut ::std::os::raw::c_void, 2605 sync_status: *mut grpc_status_code::Type, 2606 sync_error_details: *mut *mut ::std::os::raw::c_char, 2607 ) -> ::std::os::raw::c_int; 2608 } 2609 extern "C" { 2610 #[doc = " EXPERIMENTAL API - Subject to change\n\n Performs the cancellation logic of an internal verifier.\n This is typically used when composing the internal verifiers as part of the\n custom verification."] grpc_tls_certificate_verifier_cancel( verifier: *mut grpc_tls_certificate_verifier, request: *mut grpc_tls_custom_verification_check_request, )2611 pub fn grpc_tls_certificate_verifier_cancel( 2612 verifier: *mut grpc_tls_certificate_verifier, 2613 request: *mut grpc_tls_custom_verification_check_request, 2614 ); 2615 } 2616 extern "C" { 2617 #[doc = " EXPERIMENTAL API - Subject to change\n\n Creates a TLS channel credential object based on the\n grpc_tls_credentials_options specified by callers. The\n grpc_channel_credentials will take the ownership of the |options|. The\n security level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY."] grpc_tls_credentials_create( options: *mut grpc_tls_credentials_options, ) -> *mut grpc_channel_credentials2618 pub fn grpc_tls_credentials_create( 2619 options: *mut grpc_tls_credentials_options, 2620 ) -> *mut grpc_channel_credentials; 2621 } 2622 extern "C" { 2623 #[doc = " EXPERIMENTAL API - Subject to change\n\n Creates a TLS server credential object based on the\n grpc_tls_credentials_options specified by callers. The\n grpc_server_credentials will take the ownership of the |options|."] grpc_tls_server_credentials_create( options: *mut grpc_tls_credentials_options, ) -> *mut grpc_server_credentials2624 pub fn grpc_tls_server_credentials_create( 2625 options: *mut grpc_tls_credentials_options, 2626 ) -> *mut grpc_server_credentials; 2627 } 2628 extern "C" { 2629 #[doc = " EXPERIMENTAL API - Subject to change\n\n This method creates an insecure channel credentials object."] grpc_insecure_credentials_create() -> *mut grpc_channel_credentials2630 pub fn grpc_insecure_credentials_create() -> *mut grpc_channel_credentials; 2631 } 2632 extern "C" { 2633 #[doc = " EXPERIMENTAL API - Subject to change\n\n This method creates an insecure server credentials object."] grpc_insecure_server_credentials_create() -> *mut grpc_server_credentials2634 pub fn grpc_insecure_server_credentials_create() -> *mut grpc_server_credentials; 2635 } 2636 extern "C" { 2637 #[doc = " EXPERIMENTAL API - Subject to change\n\n This method creates an xDS channel credentials object.\n\n Creating a channel with credentials of this type indicates that the channel\n should get credentials configuration from the xDS control plane.\n\n \\a fallback_credentials are used if the channel target does not have the\n 'xds:///' scheme or if the xDS control plane does not provide information on\n how to fetch credentials dynamically. Does NOT take ownership of the \\a\n fallback_credentials. (Internally takes a ref to the object.)"] grpc_xds_credentials_create( fallback_credentials: *mut grpc_channel_credentials, ) -> *mut grpc_channel_credentials2638 pub fn grpc_xds_credentials_create( 2639 fallback_credentials: *mut grpc_channel_credentials, 2640 ) -> *mut grpc_channel_credentials; 2641 } 2642 extern "C" { 2643 #[doc = " EXPERIMENTAL API - Subject to change\n\n This method creates an xDS server credentials object.\n\n \\a fallback_credentials are used if the xDS control plane does not provide\n information on how to fetch credentials dynamically.\n\n Does NOT take ownership of the \\a fallback_credentials. (Internally takes\n a ref to the object.)"] grpc_xds_server_credentials_create( fallback_credentials: *mut grpc_server_credentials, ) -> *mut grpc_server_credentials2644 pub fn grpc_xds_server_credentials_create( 2645 fallback_credentials: *mut grpc_server_credentials, 2646 ) -> *mut grpc_server_credentials; 2647 } 2648 #[repr(C)] 2649 #[derive(Debug, Copy, Clone)] 2650 pub struct grpc_authorization_policy_provider { 2651 _unused: [u8; 0], 2652 } 2653 extern "C" { 2654 #[doc = " EXPERIMENTAL - Subject to change.\n Creates a grpc_authorization_policy_provider using gRPC authorization policy\n from static string.\n - authz_policy is the input gRPC authorization policy.\n - code is the error status code on failure. On success, it equals\n GRPC_STATUS_OK.\n - error_details contains details about the error if any. If the\n initialization is successful, it will be null. Caller must use gpr_free to\n destroy this string."] grpc_authorization_policy_provider_static_data_create( authz_policy: *const ::std::os::raw::c_char, code: *mut grpc_status_code::Type, error_details: *mut *const ::std::os::raw::c_char, ) -> *mut grpc_authorization_policy_provider2655 pub fn grpc_authorization_policy_provider_static_data_create( 2656 authz_policy: *const ::std::os::raw::c_char, 2657 code: *mut grpc_status_code::Type, 2658 error_details: *mut *const ::std::os::raw::c_char, 2659 ) -> *mut grpc_authorization_policy_provider; 2660 } 2661 extern "C" { 2662 #[doc = " EXPERIMENTAL - Subject to change.\n Creates a grpc_authorization_policy_provider by watching for gRPC\n authorization policy changes in filesystem.\n - authz_policy is the file path of gRPC authorization policy.\n - refresh_interval_sec is the amount of time the internal thread would wait\n before checking for file updates.\n - code is the error status code on failure. On success, it equals\n GRPC_STATUS_OK.\n - error_details contains details about the error if any. If the\n initialization is successful, it will be null. Caller must use gpr_free to\n destroy this string."] grpc_authorization_policy_provider_file_watcher_create( authz_policy_path: *const ::std::os::raw::c_char, refresh_interval_sec: ::std::os::raw::c_uint, code: *mut grpc_status_code::Type, error_details: *mut *const ::std::os::raw::c_char, ) -> *mut grpc_authorization_policy_provider2663 pub fn grpc_authorization_policy_provider_file_watcher_create( 2664 authz_policy_path: *const ::std::os::raw::c_char, 2665 refresh_interval_sec: ::std::os::raw::c_uint, 2666 code: *mut grpc_status_code::Type, 2667 error_details: *mut *const ::std::os::raw::c_char, 2668 ) -> *mut grpc_authorization_policy_provider; 2669 } 2670 extern "C" { 2671 #[doc = " EXPERIMENTAL - Subject to change.\n Releases grpc_authorization_policy_provider object. The creator of\n grpc_authorization_policy_provider is responsible for its release."] grpc_authorization_policy_provider_release( provider: *mut grpc_authorization_policy_provider, )2672 pub fn grpc_authorization_policy_provider_release( 2673 provider: *mut grpc_authorization_policy_provider, 2674 ); 2675 } 2676 extern "C" { 2677 #[doc = " EXPERIMENTAL API - Subject to change.\n Configures a grpc_tls_credentials_options object with tls session key\n logging capability. TLS channels using these credentials have tls session\n key logging enabled.\n - options is the grpc_tls_credentials_options object\n - path is a string pointing to the location where TLS session keys would be\n stored."] grpc_tls_credentials_options_set_tls_session_key_log_file_path( options: *mut grpc_tls_credentials_options, path: *const ::std::os::raw::c_char, )2678 pub fn grpc_tls_credentials_options_set_tls_session_key_log_file_path( 2679 options: *mut grpc_tls_credentials_options, 2680 path: *const ::std::os::raw::c_char, 2681 ); 2682 } 2683 extern "C" { 2684 #[doc = " malloc.\n If size==0, always returns NULL. Otherwise this function never returns NULL.\n The pointer returned is suitably aligned for any kind of variable it could\n contain."] gpr_malloc(size: usize) -> *mut ::std::os::raw::c_void2685 pub fn gpr_malloc(size: usize) -> *mut ::std::os::raw::c_void; 2686 } 2687 extern "C" { 2688 #[doc = " like malloc, but zero all bytes before returning them"] gpr_zalloc(size: usize) -> *mut ::std::os::raw::c_void2689 pub fn gpr_zalloc(size: usize) -> *mut ::std::os::raw::c_void; 2690 } 2691 extern "C" { 2692 #[doc = " free"] gpr_free(ptr: *mut ::std::os::raw::c_void)2693 pub fn gpr_free(ptr: *mut ::std::os::raw::c_void); 2694 } 2695 extern "C" { 2696 #[doc = " realloc, never returns NULL"] gpr_realloc(p: *mut ::std::os::raw::c_void, size: usize) -> *mut ::std::os::raw::c_void2697 pub fn gpr_realloc(p: *mut ::std::os::raw::c_void, size: usize) -> *mut ::std::os::raw::c_void; 2698 } 2699 extern "C" { 2700 #[doc = " aligned malloc, never returns NULL, will align to alignment, which\n must be a power of 2."] gpr_malloc_aligned(size: usize, alignment: usize) -> *mut ::std::os::raw::c_void2701 pub fn gpr_malloc_aligned(size: usize, alignment: usize) -> *mut ::std::os::raw::c_void; 2702 } 2703 extern "C" { 2704 #[doc = " free memory allocated by gpr_malloc_aligned"] gpr_free_aligned(ptr: *mut ::std::os::raw::c_void)2705 pub fn gpr_free_aligned(ptr: *mut ::std::os::raw::c_void); 2706 } 2707 extern "C" { 2708 #[doc = " Return the number of CPU cores on the current system. Will return 0 if\nthe information is not available."] gpr_cpu_num_cores() -> ::std::os::raw::c_uint2709 pub fn gpr_cpu_num_cores() -> ::std::os::raw::c_uint; 2710 } 2711 extern "C" { 2712 #[doc = " Return the CPU on which the current thread is executing; N.B. This should\nbe considered advisory only - it is possible that the thread is switched\nto a different CPU at any time. Returns a value in range\n[0, gpr_cpu_num_cores() - 1]"] gpr_cpu_current_cpu() -> ::std::os::raw::c_uint2713 pub fn gpr_cpu_current_cpu() -> ::std::os::raw::c_uint; 2714 } 2715 #[repr(i32)] 2716 #[doc = " The severity of a log message - use the #defines below when calling into\ngpr_log to additionally supply file and line data"] 2717 #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] 2718 pub enum gpr_log_severity { 2719 GPR_LOG_SEVERITY_DEBUG = 0, 2720 GPR_LOG_SEVERITY_INFO = 1, 2721 GPR_LOG_SEVERITY_ERROR = 2, 2722 } 2723 extern "C" { 2724 #[doc = " Returns a string representation of the log severity"] gpr_log_severity_string(severity: gpr_log_severity) -> *const ::std::os::raw::c_char2725 pub fn gpr_log_severity_string(severity: gpr_log_severity) -> *const ::std::os::raw::c_char; 2726 } 2727 extern "C" { 2728 #[doc = " Log a message. It's advised to use GPR_xxx above to generate the context\n for each message"] gpr_log( file: *const ::std::os::raw::c_char, line: ::std::os::raw::c_int, severity: gpr_log_severity, format: *const ::std::os::raw::c_char, ... )2729 pub fn gpr_log( 2730 file: *const ::std::os::raw::c_char, 2731 line: ::std::os::raw::c_int, 2732 severity: gpr_log_severity, 2733 format: *const ::std::os::raw::c_char, 2734 ... 2735 ); 2736 } 2737 extern "C" { gpr_should_log(severity: gpr_log_severity) -> ::std::os::raw::c_int2738 pub fn gpr_should_log(severity: gpr_log_severity) -> ::std::os::raw::c_int; 2739 } 2740 extern "C" { gpr_log_message( file: *const ::std::os::raw::c_char, line: ::std::os::raw::c_int, severity: gpr_log_severity, message: *const ::std::os::raw::c_char, )2741 pub fn gpr_log_message( 2742 file: *const ::std::os::raw::c_char, 2743 line: ::std::os::raw::c_int, 2744 severity: gpr_log_severity, 2745 message: *const ::std::os::raw::c_char, 2746 ); 2747 } 2748 extern "C" { 2749 #[doc = " Set global log verbosity"] gpr_set_log_verbosity(min_severity_to_print: gpr_log_severity)2750 pub fn gpr_set_log_verbosity(min_severity_to_print: gpr_log_severity); 2751 } 2752 extern "C" { gpr_log_verbosity_init()2753 pub fn gpr_log_verbosity_init(); 2754 } 2755 #[doc = " Log overrides: applications can use this API to intercept logging calls\nand use their own implementations"] 2756 #[repr(C)] 2757 #[derive(Debug, Copy, Clone)] 2758 pub struct gpr_log_func_args { 2759 pub file: *const ::std::os::raw::c_char, 2760 pub line: ::std::os::raw::c_int, 2761 pub severity: gpr_log_severity, 2762 pub message: *const ::std::os::raw::c_char, 2763 } 2764 pub type gpr_log_func = ::std::option::Option<unsafe extern "C" fn(args: *mut gpr_log_func_args)>; 2765 extern "C" { gpr_set_log_function(func: gpr_log_func)2766 pub fn gpr_set_log_function(func: gpr_log_func); 2767 } 2768 extern "C" { gpr_assertion_failed( filename: *const ::std::os::raw::c_char, line: ::std::os::raw::c_int, message: *const ::std::os::raw::c_char, ) -> !2769 pub fn gpr_assertion_failed( 2770 filename: *const ::std::os::raw::c_char, 2771 line: ::std::os::raw::c_int, 2772 message: *const ::std::os::raw::c_char, 2773 ) -> !; 2774 } 2775 extern "C" { 2776 #[doc = " Returns a string allocated with gpr_malloc that contains a UTF-8\n formatted error message, corresponding to the error messageid.\n Use in conjunction with GetLastError() et al."] gpr_format_message(messageid: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char2777 pub fn gpr_format_message(messageid: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; 2778 } 2779 extern "C" { 2780 #[doc = " Returns a copy of src that can be passed to gpr_free().\nIf allocation fails or if src is NULL, returns NULL."] gpr_strdup(src: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char2781 pub fn gpr_strdup(src: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; 2782 } 2783 extern "C" { 2784 #[doc = " printf to a newly-allocated string. The set of supported formats may vary\nbetween platforms.\n\nOn success, returns the number of bytes printed (excluding the final '\\0'),\nand *strp points to a string which must later be destroyed with gpr_free().\n\nOn error, returns -1 and sets *strp to NULL. If the format string is bad,\nthe result is undefined."] gpr_asprintf( strp: *mut *mut ::std::os::raw::c_char, format: *const ::std::os::raw::c_char, ... ) -> ::std::os::raw::c_int2785 pub fn gpr_asprintf( 2786 strp: *mut *mut ::std::os::raw::c_char, 2787 format: *const ::std::os::raw::c_char, 2788 ... 2789 ) -> ::std::os::raw::c_int; 2790 } 2791 pub type gpr_thd_id = usize; 2792 extern "C" { 2793 #[doc = " Returns the identifier of the current thread."] gpr_thd_currentid() -> gpr_thd_id2794 pub fn gpr_thd_currentid() -> gpr_thd_id; 2795 } 2796 #[doc = " Reader for byte buffers. Iterates over slices in the byte buffer"] 2797 #[repr(C)] 2798 #[derive(Copy, Clone)] 2799 pub struct grpc_byte_buffer_reader { 2800 pub buffer_in: *mut grpc_byte_buffer, 2801 pub buffer_out: *mut grpc_byte_buffer, 2802 pub current: grpc_byte_buffer_reader_grpc_byte_buffer_reader_current, 2803 } 2804 #[doc = " Different current objects correspond to different types of byte buffers"] 2805 #[repr(C)] 2806 #[derive(Copy, Clone)] 2807 pub union grpc_byte_buffer_reader_grpc_byte_buffer_reader_current { 2808 #[doc = " Index into a slice buffer's array of slices"] 2809 pub index: ::std::os::raw::c_uint, 2810 } 2811 impl ::std::fmt::Debug for grpc_byte_buffer_reader_grpc_byte_buffer_reader_current { fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result2812 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 2813 write!( 2814 f, 2815 "grpc_byte_buffer_reader_grpc_byte_buffer_reader_current {{ union }}" 2816 ) 2817 } 2818 } 2819 impl ::std::fmt::Debug for grpc_byte_buffer_reader { fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result2820 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 2821 write!( 2822 f, 2823 "grpc_byte_buffer_reader {{ buffer_in: {:?}, buffer_out: {:?}, current: {:?} }}", 2824 self.buffer_in, self.buffer_out, self.current 2825 ) 2826 } 2827 } 2828 #[repr(C)] 2829 #[derive(Copy, Clone)] 2830 pub struct grpcwrap_batch_context { 2831 pub send_initial_metadata: grpc_metadata_array, 2832 pub send_message: *mut grpc_byte_buffer, 2833 pub send_status_from_server: grpcwrap_batch_context__bindgen_ty_1, 2834 pub recv_initial_metadata: grpc_metadata_array, 2835 pub recv_message: *mut grpc_byte_buffer, 2836 pub recv_status_on_client: grpcwrap_batch_context__bindgen_ty_2, 2837 pub recv_close_on_server_cancelled: ::std::os::raw::c_int, 2838 } 2839 #[repr(C)] 2840 #[derive(Debug, Copy, Clone)] 2841 pub struct grpcwrap_batch_context__bindgen_ty_1 { 2842 pub trailing_metadata: grpc_metadata_array, 2843 } 2844 #[repr(C)] 2845 #[derive(Copy, Clone)] 2846 pub struct grpcwrap_batch_context__bindgen_ty_2 { 2847 pub trailing_metadata: grpc_metadata_array, 2848 pub status: grpc_status_code::Type, 2849 pub status_details: grpc_slice, 2850 pub error_string: *const ::std::os::raw::c_char, 2851 } 2852 impl ::std::fmt::Debug for grpcwrap_batch_context__bindgen_ty_2 { fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result2853 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 2854 write ! (f , "grpcwrap_batch_context__bindgen_ty_2 {{ trailing_metadata: {:?}, status: {:?}, status_details: {:?}, error_string: {:?} }}" , self . trailing_metadata , self . status , self . status_details , self . error_string) 2855 } 2856 } 2857 impl ::std::fmt::Debug for grpcwrap_batch_context { fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result2858 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 2859 write ! (f , "grpcwrap_batch_context {{ send_initial_metadata: {:?}, send_message: {:?}, send_status_from_server: {:?}, recv_initial_metadata: {:?}, recv_message: {:?}, recv_status_on_client: {:?}, recv_close_on_server_cancelled: {:?} }}" , self . send_initial_metadata , self . send_message , self . send_status_from_server , self . recv_initial_metadata , self . recv_message , self . recv_status_on_client , self . recv_close_on_server_cancelled) 2860 } 2861 } 2862 extern "C" { grpcwrap_batch_context_create() -> *mut grpcwrap_batch_context2863 pub fn grpcwrap_batch_context_create() -> *mut grpcwrap_batch_context; 2864 } 2865 #[repr(C)] 2866 #[derive(Copy, Clone)] 2867 pub struct grpcwrap_request_call_context { 2868 pub call: *mut grpc_call, 2869 pub call_details: grpc_call_details, 2870 pub request_metadata: grpc_metadata_array, 2871 } 2872 impl ::std::fmt::Debug for grpcwrap_request_call_context { fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result2873 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { 2874 write ! (f , "grpcwrap_request_call_context {{ call: {:?}, call_details: {:?}, request_metadata: {:?} }}" , self . call , self . call_details , self . request_metadata) 2875 } 2876 } 2877 extern "C" { grpcwrap_request_call_context_create() -> *mut grpcwrap_request_call_context2878 pub fn grpcwrap_request_call_context_create() -> *mut grpcwrap_request_call_context; 2879 } 2880 extern "C" { grpcwrap_metadata_array_destroy_metadata_only(array: *mut grpc_metadata_array)2881 pub fn grpcwrap_metadata_array_destroy_metadata_only(array: *mut grpc_metadata_array); 2882 } 2883 extern "C" { grpcwrap_metadata_array_destroy_metadata_including_entries( array: *mut grpc_metadata_array, )2884 pub fn grpcwrap_metadata_array_destroy_metadata_including_entries( 2885 array: *mut grpc_metadata_array, 2886 ); 2887 } 2888 extern "C" { grpcwrap_metadata_array_destroy_full(array: *mut grpc_metadata_array)2889 pub fn grpcwrap_metadata_array_destroy_full(array: *mut grpc_metadata_array); 2890 } 2891 extern "C" { grpcwrap_metadata_array_init(array: *mut grpc_metadata_array, capacity: usize)2892 pub fn grpcwrap_metadata_array_init(array: *mut grpc_metadata_array, capacity: usize); 2893 } 2894 extern "C" { grpcwrap_metadata_array_add( array: *mut grpc_metadata_array, key: *const ::std::os::raw::c_char, key_length: usize, value: *const ::std::os::raw::c_char, value_length: usize, )2895 pub fn grpcwrap_metadata_array_add( 2896 array: *mut grpc_metadata_array, 2897 key: *const ::std::os::raw::c_char, 2898 key_length: usize, 2899 value: *const ::std::os::raw::c_char, 2900 value_length: usize, 2901 ); 2902 } 2903 extern "C" { grpcwrap_metadata_array_get_key( array: *const grpc_metadata_array, index: usize, key_length: *mut usize, ) -> *const ::std::os::raw::c_char2904 pub fn grpcwrap_metadata_array_get_key( 2905 array: *const grpc_metadata_array, 2906 index: usize, 2907 key_length: *mut usize, 2908 ) -> *const ::std::os::raw::c_char; 2909 } 2910 extern "C" { grpcwrap_metadata_array_get_value( array: *const grpc_metadata_array, index: usize, value_length: *mut usize, ) -> *const ::std::os::raw::c_char2911 pub fn grpcwrap_metadata_array_get_value( 2912 array: *const grpc_metadata_array, 2913 index: usize, 2914 value_length: *mut usize, 2915 ) -> *const ::std::os::raw::c_char; 2916 } 2917 extern "C" { grpcwrap_metadata_array_cleanup(array: *mut grpc_metadata_array)2918 pub fn grpcwrap_metadata_array_cleanup(array: *mut grpc_metadata_array); 2919 } 2920 extern "C" { grpcwrap_metadata_array_shrink_to_fit(array: *mut grpc_metadata_array)2921 pub fn grpcwrap_metadata_array_shrink_to_fit(array: *mut grpc_metadata_array); 2922 } 2923 extern "C" { grpcwrap_metadata_array_move( dest: *mut grpc_metadata_array, src: *mut grpc_metadata_array, )2924 pub fn grpcwrap_metadata_array_move( 2925 dest: *mut grpc_metadata_array, 2926 src: *mut grpc_metadata_array, 2927 ); 2928 } 2929 extern "C" { grpcwrap_batch_context_destroy(ctx: *mut grpcwrap_batch_context)2930 pub fn grpcwrap_batch_context_destroy(ctx: *mut grpcwrap_batch_context); 2931 } 2932 extern "C" { grpcwrap_request_call_context_destroy(ctx: *mut grpcwrap_request_call_context)2933 pub fn grpcwrap_request_call_context_destroy(ctx: *mut grpcwrap_request_call_context); 2934 } 2935 extern "C" { grpcwrap_batch_context_take_recv_initial_metadata( ctx: *mut grpcwrap_batch_context, res: *mut grpc_metadata_array, )2936 pub fn grpcwrap_batch_context_take_recv_initial_metadata( 2937 ctx: *mut grpcwrap_batch_context, 2938 res: *mut grpc_metadata_array, 2939 ); 2940 } 2941 extern "C" { grpcwrap_batch_context_take_recv_status_on_client_trailing_metadata( ctx: *mut grpcwrap_batch_context, res: *mut grpc_metadata_array, )2942 pub fn grpcwrap_batch_context_take_recv_status_on_client_trailing_metadata( 2943 ctx: *mut grpcwrap_batch_context, 2944 res: *mut grpc_metadata_array, 2945 ); 2946 } 2947 extern "C" { grpcwrap_slice_raw_offset( slice: *const grpc_slice, offset: usize, len: *mut usize, ) -> *const ::std::os::raw::c_char2948 pub fn grpcwrap_slice_raw_offset( 2949 slice: *const grpc_slice, 2950 offset: usize, 2951 len: *mut usize, 2952 ) -> *const ::std::os::raw::c_char; 2953 } 2954 extern "C" { grpcwrap_slice_copy(slice: *const grpc_slice) -> grpc_slice2955 pub fn grpcwrap_slice_copy(slice: *const grpc_slice) -> grpc_slice; 2956 } 2957 extern "C" { grpcwrap_slice_unref(slice: *const grpc_slice)2958 pub fn grpcwrap_slice_unref(slice: *const grpc_slice); 2959 } 2960 extern "C" { grpcwrap_slice_ref(slice: *const grpc_slice) -> grpc_slice2961 pub fn grpcwrap_slice_ref(slice: *const grpc_slice) -> grpc_slice; 2962 } 2963 extern "C" { grpcwrap_slice_length(slice: *const grpc_slice) -> usize2964 pub fn grpcwrap_slice_length(slice: *const grpc_slice) -> usize; 2965 } 2966 extern "C" { grpcwrap_batch_context_take_recv_message( ctx: *mut grpcwrap_batch_context, ) -> *mut grpc_byte_buffer2967 pub fn grpcwrap_batch_context_take_recv_message( 2968 ctx: *mut grpcwrap_batch_context, 2969 ) -> *mut grpc_byte_buffer; 2970 } 2971 extern "C" { grpcwrap_batch_context_recv_status_on_client_status( ctx: *const grpcwrap_batch_context, ) -> grpc_status_code::Type2972 pub fn grpcwrap_batch_context_recv_status_on_client_status( 2973 ctx: *const grpcwrap_batch_context, 2974 ) -> grpc_status_code::Type; 2975 } 2976 extern "C" { grpcwrap_batch_context_recv_status_on_client_details( ctx: *const grpcwrap_batch_context, details_length: *mut usize, ) -> *const ::std::os::raw::c_char2977 pub fn grpcwrap_batch_context_recv_status_on_client_details( 2978 ctx: *const grpcwrap_batch_context, 2979 details_length: *mut usize, 2980 ) -> *const ::std::os::raw::c_char; 2981 } 2982 extern "C" { grpcwrap_batch_context_recv_status_on_client_trailing_metadata( ctx: *const grpcwrap_batch_context, ) -> *const grpc_metadata_array2983 pub fn grpcwrap_batch_context_recv_status_on_client_trailing_metadata( 2984 ctx: *const grpcwrap_batch_context, 2985 ) -> *const grpc_metadata_array; 2986 } 2987 extern "C" { grpcwrap_batch_context_recv_status_on_client_error_string( ctx: *const grpcwrap_batch_context, ) -> *const ::std::os::raw::c_char2988 pub fn grpcwrap_batch_context_recv_status_on_client_error_string( 2989 ctx: *const grpcwrap_batch_context, 2990 ) -> *const ::std::os::raw::c_char; 2991 } 2992 extern "C" { grpcwrap_request_call_context_ref_call( ctx: *mut grpcwrap_request_call_context, ) -> *mut grpc_call2993 pub fn grpcwrap_request_call_context_ref_call( 2994 ctx: *mut grpcwrap_request_call_context, 2995 ) -> *mut grpc_call; 2996 } 2997 extern "C" { grpcwrap_request_call_context_get_call( ctx: *mut grpcwrap_request_call_context, ) -> *mut grpc_call2998 pub fn grpcwrap_request_call_context_get_call( 2999 ctx: *mut grpcwrap_request_call_context, 3000 ) -> *mut grpc_call; 3001 } 3002 extern "C" { grpcwrap_request_call_context_method( ctx: *const grpcwrap_request_call_context, method_length: *mut usize, ) -> *const ::std::os::raw::c_char3003 pub fn grpcwrap_request_call_context_method( 3004 ctx: *const grpcwrap_request_call_context, 3005 method_length: *mut usize, 3006 ) -> *const ::std::os::raw::c_char; 3007 } 3008 extern "C" { grpcwrap_request_call_context_host( ctx: *const grpcwrap_request_call_context, host_length: *mut usize, ) -> *const ::std::os::raw::c_char3009 pub fn grpcwrap_request_call_context_host( 3010 ctx: *const grpcwrap_request_call_context, 3011 host_length: *mut usize, 3012 ) -> *const ::std::os::raw::c_char; 3013 } 3014 extern "C" { grpcwrap_request_call_context_deadline( ctx: *const grpcwrap_request_call_context, ) -> gpr_timespec3015 pub fn grpcwrap_request_call_context_deadline( 3016 ctx: *const grpcwrap_request_call_context, 3017 ) -> gpr_timespec; 3018 } 3019 extern "C" { grpcwrap_request_call_context_metadata_array( ctx: *const grpcwrap_request_call_context, ) -> *const grpc_metadata_array3020 pub fn grpcwrap_request_call_context_metadata_array( 3021 ctx: *const grpcwrap_request_call_context, 3022 ) -> *const grpc_metadata_array; 3023 } 3024 extern "C" { grpcwrap_batch_context_recv_close_on_server_cancelled( ctx: *const grpcwrap_batch_context, ) -> i323025 pub fn grpcwrap_batch_context_recv_close_on_server_cancelled( 3026 ctx: *const grpcwrap_batch_context, 3027 ) -> i32; 3028 } 3029 extern "C" { grpcwrap_channel_create_call( channel: *mut grpc_channel, parent_call: *mut grpc_call, propagation_mask: u32, cq: *mut grpc_completion_queue, method: *const ::std::os::raw::c_char, method_len: usize, host: *const ::std::os::raw::c_char, host_len: usize, deadline: gpr_timespec, ) -> *mut grpc_call3030 pub fn grpcwrap_channel_create_call( 3031 channel: *mut grpc_channel, 3032 parent_call: *mut grpc_call, 3033 propagation_mask: u32, 3034 cq: *mut grpc_completion_queue, 3035 method: *const ::std::os::raw::c_char, 3036 method_len: usize, 3037 host: *const ::std::os::raw::c_char, 3038 host_len: usize, 3039 deadline: gpr_timespec, 3040 ) -> *mut grpc_call; 3041 } 3042 extern "C" { grpcwrap_channel_args_create(num_args: usize) -> *mut grpc_channel_args3043 pub fn grpcwrap_channel_args_create(num_args: usize) -> *mut grpc_channel_args; 3044 } 3045 extern "C" { grpcwrap_channel_args_set_string( args: *mut grpc_channel_args, index: usize, key: *const ::std::os::raw::c_char, value: *const ::std::os::raw::c_char, )3046 pub fn grpcwrap_channel_args_set_string( 3047 args: *mut grpc_channel_args, 3048 index: usize, 3049 key: *const ::std::os::raw::c_char, 3050 value: *const ::std::os::raw::c_char, 3051 ); 3052 } 3053 extern "C" { grpcwrap_channel_args_set_integer( args: *mut grpc_channel_args, index: usize, key: *const ::std::os::raw::c_char, value: ::std::os::raw::c_int, )3054 pub fn grpcwrap_channel_args_set_integer( 3055 args: *mut grpc_channel_args, 3056 index: usize, 3057 key: *const ::std::os::raw::c_char, 3058 value: ::std::os::raw::c_int, 3059 ); 3060 } 3061 extern "C" { grpcwrap_channel_args_set_pointer_vtable( args: *mut grpc_channel_args, index: usize, key: *const ::std::os::raw::c_char, value: *mut ::std::os::raw::c_void, vtable: *const grpc_arg_pointer_vtable, )3062 pub fn grpcwrap_channel_args_set_pointer_vtable( 3063 args: *mut grpc_channel_args, 3064 index: usize, 3065 key: *const ::std::os::raw::c_char, 3066 value: *mut ::std::os::raw::c_void, 3067 vtable: *const grpc_arg_pointer_vtable, 3068 ); 3069 } 3070 extern "C" { grpcwrap_channel_args_destroy(args: *mut grpc_channel_args)3071 pub fn grpcwrap_channel_args_destroy(args: *mut grpc_channel_args); 3072 } 3073 extern "C" { grpcwrap_call_start_unary( call: *mut grpc_call, ctx: *mut grpcwrap_batch_context, send_buffer: *mut grpc_slice, write_flags: u32, initial_metadata: *mut grpc_metadata_array, initial_metadata_flags: u32, tag: *mut ::std::os::raw::c_void, ) -> grpc_call_error3074 pub fn grpcwrap_call_start_unary( 3075 call: *mut grpc_call, 3076 ctx: *mut grpcwrap_batch_context, 3077 send_buffer: *mut grpc_slice, 3078 write_flags: u32, 3079 initial_metadata: *mut grpc_metadata_array, 3080 initial_metadata_flags: u32, 3081 tag: *mut ::std::os::raw::c_void, 3082 ) -> grpc_call_error; 3083 } 3084 extern "C" { grpcwrap_call_start_client_streaming( call: *mut grpc_call, ctx: *mut grpcwrap_batch_context, initial_metadata: *mut grpc_metadata_array, initial_metadata_flags: u32, tag: *mut ::std::os::raw::c_void, ) -> grpc_call_error3085 pub fn grpcwrap_call_start_client_streaming( 3086 call: *mut grpc_call, 3087 ctx: *mut grpcwrap_batch_context, 3088 initial_metadata: *mut grpc_metadata_array, 3089 initial_metadata_flags: u32, 3090 tag: *mut ::std::os::raw::c_void, 3091 ) -> grpc_call_error; 3092 } 3093 extern "C" { grpcwrap_call_start_server_streaming( call: *mut grpc_call, ctx: *mut grpcwrap_batch_context, send_buffer: *mut grpc_slice, write_flags: u32, initial_metadata: *mut grpc_metadata_array, initial_metadata_flags: u32, tag: *mut ::std::os::raw::c_void, ) -> grpc_call_error3094 pub fn grpcwrap_call_start_server_streaming( 3095 call: *mut grpc_call, 3096 ctx: *mut grpcwrap_batch_context, 3097 send_buffer: *mut grpc_slice, 3098 write_flags: u32, 3099 initial_metadata: *mut grpc_metadata_array, 3100 initial_metadata_flags: u32, 3101 tag: *mut ::std::os::raw::c_void, 3102 ) -> grpc_call_error; 3103 } 3104 extern "C" { grpcwrap_call_start_duplex_streaming( call: *mut grpc_call, ctx: *mut grpcwrap_batch_context, initial_metadata: *mut grpc_metadata_array, initial_metadata_flags: u32, tag: *mut ::std::os::raw::c_void, ) -> grpc_call_error3105 pub fn grpcwrap_call_start_duplex_streaming( 3106 call: *mut grpc_call, 3107 ctx: *mut grpcwrap_batch_context, 3108 initial_metadata: *mut grpc_metadata_array, 3109 initial_metadata_flags: u32, 3110 tag: *mut ::std::os::raw::c_void, 3111 ) -> grpc_call_error; 3112 } 3113 extern "C" { grpcwrap_call_recv_initial_metadata( call: *mut grpc_call, ctx: *mut grpcwrap_batch_context, tag: *mut ::std::os::raw::c_void, ) -> grpc_call_error3114 pub fn grpcwrap_call_recv_initial_metadata( 3115 call: *mut grpc_call, 3116 ctx: *mut grpcwrap_batch_context, 3117 tag: *mut ::std::os::raw::c_void, 3118 ) -> grpc_call_error; 3119 } 3120 extern "C" { grpcwrap_call_send_message( call: *mut grpc_call, ctx: *mut grpcwrap_batch_context, send_buffer: *mut grpc_slice, write_flags: u32, initial_metadata: *mut grpc_metadata_array, initial_metadata_flags: u32, tag: *mut ::std::os::raw::c_void, ) -> grpc_call_error3121 pub fn grpcwrap_call_send_message( 3122 call: *mut grpc_call, 3123 ctx: *mut grpcwrap_batch_context, 3124 send_buffer: *mut grpc_slice, 3125 write_flags: u32, 3126 initial_metadata: *mut grpc_metadata_array, 3127 initial_metadata_flags: u32, 3128 tag: *mut ::std::os::raw::c_void, 3129 ) -> grpc_call_error; 3130 } 3131 extern "C" { grpcwrap_call_send_close_from_client( call: *mut grpc_call, tag: *mut ::std::os::raw::c_void, ) -> grpc_call_error3132 pub fn grpcwrap_call_send_close_from_client( 3133 call: *mut grpc_call, 3134 tag: *mut ::std::os::raw::c_void, 3135 ) -> grpc_call_error; 3136 } 3137 extern "C" { grpcwrap_call_send_status_from_server( call: *mut grpc_call, ctx: *mut grpcwrap_batch_context, status_code: grpc_status_code::Type, status_details: *const ::std::os::raw::c_char, status_details_len: usize, initial_metadata: *mut grpc_metadata_array, initial_metadata_flags: u32, trailing_metadata: *mut grpc_metadata_array, optional_send_buffer: *mut grpc_slice, write_flags: u32, tag: *mut ::std::os::raw::c_void, ) -> grpc_call_error3138 pub fn grpcwrap_call_send_status_from_server( 3139 call: *mut grpc_call, 3140 ctx: *mut grpcwrap_batch_context, 3141 status_code: grpc_status_code::Type, 3142 status_details: *const ::std::os::raw::c_char, 3143 status_details_len: usize, 3144 initial_metadata: *mut grpc_metadata_array, 3145 initial_metadata_flags: u32, 3146 trailing_metadata: *mut grpc_metadata_array, 3147 optional_send_buffer: *mut grpc_slice, 3148 write_flags: u32, 3149 tag: *mut ::std::os::raw::c_void, 3150 ) -> grpc_call_error; 3151 } 3152 extern "C" { grpcwrap_call_recv_message( call: *mut grpc_call, ctx: *mut grpcwrap_batch_context, tag: *mut ::std::os::raw::c_void, ) -> grpc_call_error3153 pub fn grpcwrap_call_recv_message( 3154 call: *mut grpc_call, 3155 ctx: *mut grpcwrap_batch_context, 3156 tag: *mut ::std::os::raw::c_void, 3157 ) -> grpc_call_error; 3158 } 3159 extern "C" { grpcwrap_call_start_serverside( call: *mut grpc_call, ctx: *mut grpcwrap_batch_context, tag: *mut ::std::os::raw::c_void, ) -> grpc_call_error3160 pub fn grpcwrap_call_start_serverside( 3161 call: *mut grpc_call, 3162 ctx: *mut grpcwrap_batch_context, 3163 tag: *mut ::std::os::raw::c_void, 3164 ) -> grpc_call_error; 3165 } 3166 extern "C" { grpcwrap_call_send_initial_metadata( call: *mut grpc_call, ctx: *mut grpcwrap_batch_context, initial_metadata: *mut grpc_metadata_array, tag: *mut ::std::os::raw::c_void, ) -> grpc_call_error3167 pub fn grpcwrap_call_send_initial_metadata( 3168 call: *mut grpc_call, 3169 ctx: *mut grpcwrap_batch_context, 3170 initial_metadata: *mut grpc_metadata_array, 3171 tag: *mut ::std::os::raw::c_void, 3172 ) -> grpc_call_error; 3173 } 3174 extern "C" { 3175 #[doc = " Kick call's completion queue, it should be called after there is an event\nready to poll.\nTHREAD SAFETY: grpcwrap_call_kick_completion_queue is thread-safe\nbecause it does not change the call's state."] grpcwrap_call_kick_completion_queue( call: *mut grpc_call, tag: *mut ::std::os::raw::c_void, ) -> grpc_call_error3176 pub fn grpcwrap_call_kick_completion_queue( 3177 call: *mut grpc_call, 3178 tag: *mut ::std::os::raw::c_void, 3179 ) -> grpc_call_error; 3180 } 3181 extern "C" { grpcwrap_server_request_call( server: *mut grpc_server, cq: *mut grpc_completion_queue, ctx: *mut grpcwrap_request_call_context, tag: *mut ::std::os::raw::c_void, ) -> grpc_call_error3182 pub fn grpcwrap_server_request_call( 3183 server: *mut grpc_server, 3184 cq: *mut grpc_completion_queue, 3185 ctx: *mut grpcwrap_request_call_context, 3186 tag: *mut ::std::os::raw::c_void, 3187 ) -> grpc_call_error; 3188 } 3189