blob: 0bc0117b0e160b5cfcfc1203909f45e18f3f3f9d [file] [log] [blame]
Jeff Vander Stoep3adfea82020-10-14 15:35:59 +02001/* automatically generated by rust-bindgen */
2
3pub const GRPC_USE_ABSL: u32 = 1;
4pub const GRPC_ARES: u32 = 1;
5pub const GRPC_IF_NAMETOINDEX: u32 = 1;
6pub const GRPC_ALLOW_EXCEPTIONS: u32 = 1;
7pub const GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY: &'static [u8; 31usize] =
8 b"grpc-internal-encoding-request\0";
9pub const GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM: &'static [u8; 35usize] =
10 b"grpc.default_compression_algorithm\0";
11pub const GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL: &'static [u8; 31usize] =
12 b"grpc.default_compression_level\0";
13pub const GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET: &'static [u8; 43usize] =
14 b"grpc.compression_enabled_algorithms_bitset\0";
15pub const GRPC_ALLOW_GPR_SLICE_FUNCTIONS: u32 = 1;
16pub const GRPC_SLICE_BUFFER_INLINE_ELEMENTS: u32 = 8;
17pub const GRPC_ARG_ENABLE_CENSUS: &'static [u8; 12usize] = b"grpc.census\0";
18pub const GRPC_ARG_ENABLE_LOAD_REPORTING: &'static [u8; 19usize] = b"grpc.loadreporting\0";
19pub const GRPC_ARG_MINIMAL_STACK: &'static [u8; 19usize] = b"grpc.minimal_stack\0";
20pub const GRPC_ARG_MAX_CONCURRENT_STREAMS: &'static [u8; 28usize] =
21 b"grpc.max_concurrent_streams\0";
22pub const GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH: &'static [u8; 32usize] =
23 b"grpc.max_receive_message_length\0";
24pub const GRPC_ARG_MAX_MESSAGE_LENGTH: &'static [u8; 32usize] =
25 b"grpc.max_receive_message_length\0";
26pub const GRPC_ARG_MAX_SEND_MESSAGE_LENGTH: &'static [u8; 29usize] =
27 b"grpc.max_send_message_length\0";
28pub const GRPC_ARG_MAX_CONNECTION_IDLE_MS: &'static [u8; 28usize] =
29 b"grpc.max_connection_idle_ms\0";
30pub const GRPC_ARG_MAX_CONNECTION_AGE_MS: &'static [u8; 27usize] = b"grpc.max_connection_age_ms\0";
31pub const GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS: &'static [u8; 33usize] =
32 b"grpc.max_connection_age_grace_ms\0";
33pub const GRPC_ARG_CLIENT_IDLE_TIMEOUT_MS: &'static [u8; 28usize] =
34 b"grpc.client_idle_timeout_ms\0";
35pub const GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION: &'static [u8; 29usize] =
36 b"grpc.per_message_compression\0";
37pub const GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION: &'static [u8; 31usize] =
38 b"grpc.per_message_decompression\0";
39pub const GRPC_ARG_ENABLE_DEADLINE_CHECKS: &'static [u8; 30usize] =
40 b"grpc.enable_deadline_checking\0";
41pub const GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER: &'static [u8; 35usize] =
42 b"grpc.http2.initial_sequence_number\0";
43pub const GRPC_ARG_HTTP2_STREAM_LOOKAHEAD_BYTES: &'static [u8; 27usize] =
44 b"grpc.http2.lookahead_bytes\0";
45pub const GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_DECODER: &'static [u8; 36usize] =
46 b"grpc.http2.hpack_table_size.decoder\0";
47pub const GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_ENCODER: &'static [u8; 36usize] =
48 b"grpc.http2.hpack_table_size.encoder\0";
49pub const GRPC_ARG_HTTP2_MAX_FRAME_SIZE: &'static [u8; 26usize] = b"grpc.http2.max_frame_size\0";
50pub const GRPC_ARG_HTTP2_BDP_PROBE: &'static [u8; 21usize] = b"grpc.http2.bdp_probe\0";
51pub const GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS: &'static [u8; 37usize] =
52 b"grpc.http2.min_time_between_pings_ms\0";
53pub const GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS: &'static [u8; 45usize] =
54 b"grpc.http2.min_ping_interval_without_data_ms\0";
55pub const GRPC_ARG_HTTP2_SCHEME: &'static [u8; 18usize] = b"grpc.http2_scheme\0";
56pub const GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA: &'static [u8; 34usize] =
57 b"grpc.http2.max_pings_without_data\0";
58pub const GRPC_ARG_HTTP2_MAX_PING_STRIKES: &'static [u8; 28usize] =
59 b"grpc.http2.max_ping_strikes\0";
60pub const GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE: &'static [u8; 29usize] =
61 b"grpc.http2.write_buffer_size\0";
62pub const GRPC_ARG_HTTP2_ENABLE_TRUE_BINARY: &'static [u8; 23usize] = b"grpc.http2.true_binary\0";
63pub const GRPC_ARG_KEEPALIVE_TIME_MS: &'static [u8; 23usize] = b"grpc.keepalive_time_ms\0";
64pub const GRPC_ARG_KEEPALIVE_TIMEOUT_MS: &'static [u8; 26usize] = b"grpc.keepalive_timeout_ms\0";
65pub const GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS: &'static [u8; 36usize] =
66 b"grpc.keepalive_permit_without_calls\0";
67pub const GRPC_ARG_DEFAULT_AUTHORITY: &'static [u8; 23usize] = b"grpc.default_authority\0";
68pub const GRPC_ARG_PRIMARY_USER_AGENT_STRING: &'static [u8; 24usize] = b"grpc.primary_user_agent\0";
69pub const GRPC_ARG_SECONDARY_USER_AGENT_STRING: &'static [u8; 26usize] =
70 b"grpc.secondary_user_agent\0";
71pub const GRPC_ARG_MIN_RECONNECT_BACKOFF_MS: &'static [u8; 30usize] =
72 b"grpc.min_reconnect_backoff_ms\0";
73pub const GRPC_ARG_MAX_RECONNECT_BACKOFF_MS: &'static [u8; 30usize] =
74 b"grpc.max_reconnect_backoff_ms\0";
75pub const GRPC_ARG_INITIAL_RECONNECT_BACKOFF_MS: &'static [u8; 34usize] =
76 b"grpc.initial_reconnect_backoff_ms\0";
77pub const GRPC_ARG_DNS_MIN_TIME_BETWEEN_RESOLUTIONS_MS: &'static [u8; 41usize] =
78 b"grpc.dns_min_time_between_resolutions_ms\0";
79pub const GRPC_ARG_SERVER_HANDSHAKE_TIMEOUT_MS: &'static [u8; 33usize] =
80 b"grpc.server_handshake_timeout_ms\0";
81pub const GRPC_SSL_TARGET_NAME_OVERRIDE_ARG: &'static [u8; 30usize] =
82 b"grpc.ssl_target_name_override\0";
83pub const GRPC_SSL_SESSION_CACHE_ARG: &'static [u8; 23usize] = b"grpc.ssl_session_cache\0";
84pub const GRPC_ARG_TSI_MAX_FRAME_SIZE: &'static [u8; 24usize] = b"grpc.tsi.max_frame_size\0";
85pub const GRPC_ARG_MAX_METADATA_SIZE: &'static [u8; 23usize] = b"grpc.max_metadata_size\0";
86pub const GRPC_ARG_ALLOW_REUSEPORT: &'static [u8; 18usize] = b"grpc.so_reuseport\0";
87pub const GRPC_ARG_RESOURCE_QUOTA: &'static [u8; 20usize] = b"grpc.resource_quota\0";
88pub const GRPC_ARG_EXPAND_WILDCARD_ADDRS: &'static [u8; 27usize] = b"grpc.expand_wildcard_addrs\0";
89pub const GRPC_ARG_SERVICE_CONFIG: &'static [u8; 20usize] = b"grpc.service_config\0";
90pub const GRPC_ARG_SERVICE_CONFIG_DISABLE_RESOLUTION: &'static [u8; 39usize] =
91 b"grpc.service_config_disable_resolution\0";
92pub const GRPC_ARG_LB_POLICY_NAME: &'static [u8; 20usize] = b"grpc.lb_policy_name\0";
93pub const GRPC_ARG_SOCKET_MUTATOR: &'static [u8; 20usize] = b"grpc.socket_mutator\0";
94pub const GRPC_ARG_SOCKET_FACTORY: &'static [u8; 20usize] = b"grpc.socket_factory\0";
95pub const GRPC_ARG_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE: &'static [u8; 45usize] =
96 b"grpc.max_channel_trace_event_memory_per_node\0";
97pub const GRPC_ARG_ENABLE_CHANNELZ: &'static [u8; 21usize] = b"grpc.enable_channelz\0";
98pub const GRPC_ARG_USE_CRONET_PACKET_COALESCING: &'static [u8; 34usize] =
99 b"grpc.use_cronet_packet_coalescing\0";
100pub const GRPC_ARG_TCP_READ_CHUNK_SIZE: &'static [u8; 38usize] =
101 b"grpc.experimental.tcp_read_chunk_size\0";
102pub const GRPC_TCP_DEFAULT_READ_SLICE_SIZE: u32 = 8192;
103pub const GRPC_ARG_TCP_MIN_READ_CHUNK_SIZE: &'static [u8; 42usize] =
104 b"grpc.experimental.tcp_min_read_chunk_size\0";
105pub const GRPC_ARG_TCP_MAX_READ_CHUNK_SIZE: &'static [u8; 42usize] =
106 b"grpc.experimental.tcp_max_read_chunk_size\0";
107pub const GRPC_ARG_TCP_TX_ZEROCOPY_ENABLED: &'static [u8; 42usize] =
108 b"grpc.experimental.tcp_tx_zerocopy_enabled\0";
109pub const GRPC_ARG_TCP_TX_ZEROCOPY_SEND_BYTES_THRESHOLD: &'static [u8; 55usize] =
110 b"grpc.experimental.tcp_tx_zerocopy_send_bytes_threshold\0";
111pub const GRPC_ARG_TCP_TX_ZEROCOPY_MAX_SIMULT_SENDS: &'static [u8; 57usize] =
112 b"grpc.experimental.tcp_tx_zerocopy_max_simultaneous_sends\0";
113pub const GRPC_ARG_GRPCLB_CALL_TIMEOUT_MS: &'static [u8; 28usize] =
114 b"grpc.grpclb_call_timeout_ms\0";
115pub const GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS: &'static [u8; 32usize] =
116 b"grpc.grpclb_fallback_timeout_ms\0";
117pub const GRPC_ARG_PRIORITY_FAILOVER_TIMEOUT_MS: &'static [u8; 34usize] =
118 b"grpc.priority_failover_timeout_ms\0";
119pub const GRPC_ARG_XDS_RESOURCE_DOES_NOT_EXIST_TIMEOUT_MS: &'static [u8; 44usize] =
120 b"grpc.xds_resource_does_not_exist_timeout_ms\0";
121pub const GRPC_ARG_XDS_ROUTING_ENABLED: &'static [u8; 25usize] = b"grpc.xds_routing_enabled\0";
122pub const GRPC_ARG_WORKAROUND_CRONET_COMPRESSION: &'static [u8; 35usize] =
123 b"grpc.workaround.cronet_compression\0";
124pub const GRPC_ARG_OPTIMIZATION_TARGET: &'static [u8; 25usize] = b"grpc.optimization_target\0";
125pub const GRPC_ARG_ENABLE_RETRIES: &'static [u8; 20usize] = b"grpc.enable_retries\0";
126pub const GRPC_ARG_PER_RPC_RETRY_BUFFER_SIZE: &'static [u8; 31usize] =
127 b"grpc.per_rpc_retry_buffer_size\0";
128pub const GRPC_ARG_MOBILE_LOG_CONTEXT: &'static [u8; 24usize] = b"grpc.mobile_log_context\0";
129pub const GRPC_ARG_DISABLE_CLIENT_AUTHORITY_FILTER: &'static [u8; 37usize] =
130 b"grpc.disable_client_authority_filter\0";
131pub const GRPC_ARG_ENABLE_HTTP_PROXY: &'static [u8; 23usize] = b"grpc.enable_http_proxy\0";
132pub const GRPC_ARG_SURFACE_USER_AGENT: &'static [u8; 24usize] = b"grpc.surface_user_agent\0";
133pub const GRPC_ARG_INHIBIT_HEALTH_CHECKING: &'static [u8; 29usize] =
134 b"grpc.inhibit_health_checking\0";
135pub const GRPC_ARG_DNS_ENABLE_SRV_QUERIES: &'static [u8; 28usize] =
136 b"grpc.dns_enable_srv_queries\0";
137pub const GRPC_ARG_DNS_ARES_QUERY_TIMEOUT_MS: &'static [u8; 28usize] =
138 b"grpc.dns_ares_query_timeout\0";
139pub const GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL: &'static [u8; 31usize] =
140 b"grpc.use_local_subchannel_pool\0";
141pub const GRPC_ARG_CHANNEL_POOL_DOMAIN: &'static [u8; 28usize] = b"grpc.channel_pooling_domain\0";
142pub const GRPC_ARG_CHANNEL_ID: &'static [u8; 16usize] = b"grpc.channel_id\0";
143pub const GRPC_DEFAULT_MAX_SEND_MESSAGE_LENGTH: i32 = -1;
144pub const GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH: u32 = 4194304;
145pub const GRPC_WRITE_BUFFER_HINT: u32 = 1;
146pub const GRPC_WRITE_NO_COMPRESS: u32 = 2;
147pub const GRPC_WRITE_THROUGH: u32 = 4;
148pub const GRPC_WRITE_USED_MASK: u32 = 7;
149pub const GRPC_INITIAL_METADATA_IDEMPOTENT_REQUEST: u32 = 16;
150pub const GRPC_INITIAL_METADATA_WAIT_FOR_READY: u32 = 32;
151pub const GRPC_INITIAL_METADATA_CACHEABLE_REQUEST: u32 = 64;
152pub const GRPC_INITIAL_METADATA_WAIT_FOR_READY_EXPLICITLY_SET: u32 = 128;
153pub const GRPC_INITIAL_METADATA_CORKED: u32 = 256;
154pub const GRPC_INITIAL_METADATA_USED_MASK: u32 = 500;
155pub const GRPC_CQ_CURRENT_VERSION: u32 = 2;
156pub const GRPC_CQ_VERSION_MINIMUM_FOR_CALLBACKABLE: u32 = 2;
157pub const GRPC_MAX_COMPLETION_QUEUE_PLUCKERS: u32 = 6;
158pub const GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME: &'static [u8; 24usize] =
159 b"transport_security_type\0";
160pub const GRPC_SSL_TRANSPORT_SECURITY_TYPE: &'static [u8; 4usize] = b"ssl\0";
161pub const GRPC_X509_CN_PROPERTY_NAME: &'static [u8; 17usize] = b"x509_common_name\0";
162pub const GRPC_X509_SAN_PROPERTY_NAME: &'static [u8; 30usize] = b"x509_subject_alternative_name\0";
163pub const GRPC_X509_PEM_CERT_PROPERTY_NAME: &'static [u8; 14usize] = b"x509_pem_cert\0";
164pub const GRPC_X509_PEM_CERT_CHAIN_PROPERTY_NAME: &'static [u8; 20usize] = b"x509_pem_cert_chain\0";
165pub const GRPC_SSL_SESSION_REUSED_PROPERTY: &'static [u8; 19usize] = b"ssl_session_reused\0";
166pub const GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME: &'static [u8; 15usize] = b"security_level\0";
167pub const GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR: &'static [u8; 33usize] =
168 b"GRPC_DEFAULT_SSL_ROOTS_FILE_PATH\0";
169pub const GRPC_GOOGLE_CREDENTIALS_ENV_VAR: &'static [u8; 31usize] =
170 b"GOOGLE_APPLICATION_CREDENTIALS\0";
171pub const GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX: u32 = 4;
172#[repr(u32)]
173#[doc = " The various compression algorithms supported by gRPC (not sorted by"]
174#[doc = " compression level)"]
175#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
176pub enum grpc_compression_algorithm {
177 GRPC_COMPRESS_NONE = 0,
178 GRPC_COMPRESS_DEFLATE = 1,
179 GRPC_COMPRESS_GZIP = 2,
180 GRPC_COMPRESS_STREAM_GZIP = 3,
181 GRPC_COMPRESS_ALGORITHMS_COUNT = 4,
182}
183#[repr(u32)]
184#[doc = " Compression levels allow a party with knowledge of its peer's accepted"]
185#[doc = " encodings to request compression in an abstract way. The level-algorithm"]
186#[doc = " mapping is performed internally and depends on the peer's supported"]
187#[doc = " compression algorithms."]
188#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
189pub enum grpc_compression_level {
190 GRPC_COMPRESS_LEVEL_NONE = 0,
191 GRPC_COMPRESS_LEVEL_LOW = 1,
192 GRPC_COMPRESS_LEVEL_MED = 2,
193 GRPC_COMPRESS_LEVEL_HIGH = 3,
194 GRPC_COMPRESS_LEVEL_COUNT = 4,
195}
196#[repr(C)]
197#[derive(Debug, Copy, Clone)]
198pub struct grpc_compression_options {
199 #[doc = " All algs are enabled by default. This option corresponds to the channel"]
200 #[doc = " argument key behind \\a GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET"]
201 pub enabled_algorithms_bitset: u32,
202 pub default_level: grpc_compression_options_grpc_compression_options_default_level,
203 pub default_algorithm: grpc_compression_options_grpc_compression_options_default_algorithm,
204}
205#[doc = " The default compression level. It'll be used in the absence of call"]
206#[doc = " specific settings. This option corresponds to the channel"]
207#[doc = " argument key behind \\a GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL. If present,"]
208#[doc = " takes precedence over \\a default_algorithm."]
209#[doc = " TODO(dgq): currently only available for server channels."]
210#[repr(C)]
211#[derive(Debug, Copy, Clone)]
212pub struct grpc_compression_options_grpc_compression_options_default_level {
213 pub is_set: ::std::os::raw::c_int,
214 pub level: grpc_compression_level,
215}
216#[test]
217fn bindgen_test_layout_grpc_compression_options_grpc_compression_options_default_level() {
218 assert_eq!(
219 ::std::mem::size_of::<grpc_compression_options_grpc_compression_options_default_level>(),
220 8usize,
221 concat!(
222 "Size of: ",
223 stringify!(grpc_compression_options_grpc_compression_options_default_level)
224 )
225 );
226 assert_eq!(
227 ::std::mem::align_of::<grpc_compression_options_grpc_compression_options_default_level>(),
228 4usize,
229 concat!(
230 "Alignment of ",
231 stringify!(grpc_compression_options_grpc_compression_options_default_level)
232 )
233 );
234 assert_eq!(
235 unsafe {
236 &(*(::std::ptr::null::<grpc_compression_options_grpc_compression_options_default_level>(
237 )))
238 .is_set as *const _ as usize
239 },
240 0usize,
241 concat!(
242 "Offset of field: ",
243 stringify!(grpc_compression_options_grpc_compression_options_default_level),
244 "::",
245 stringify!(is_set)
246 )
247 );
248 assert_eq!(
249 unsafe {
250 &(*(::std::ptr::null::<grpc_compression_options_grpc_compression_options_default_level>(
251 )))
252 .level as *const _ as usize
253 },
254 4usize,
255 concat!(
256 "Offset of field: ",
257 stringify!(grpc_compression_options_grpc_compression_options_default_level),
258 "::",
259 stringify!(level)
260 )
261 );
262}
263#[doc = " The default message compression algorithm. It'll be used in the absence of"]
264#[doc = " call specific settings. This option corresponds to the channel argument key"]
265#[doc = " behind \\a GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM."]
266#[repr(C)]
267#[derive(Debug, Copy, Clone)]
268pub struct grpc_compression_options_grpc_compression_options_default_algorithm {
269 pub is_set: ::std::os::raw::c_int,
270 pub algorithm: grpc_compression_algorithm,
271}
272#[test]
273fn bindgen_test_layout_grpc_compression_options_grpc_compression_options_default_algorithm() {
274 assert_eq!(
275 ::std::mem::size_of::<grpc_compression_options_grpc_compression_options_default_algorithm>(
276 ),
277 8usize,
278 concat!(
279 "Size of: ",
280 stringify!(grpc_compression_options_grpc_compression_options_default_algorithm)
281 )
282 );
283 assert_eq!(
284 ::std::mem::align_of::<grpc_compression_options_grpc_compression_options_default_algorithm>(
285 ),
286 4usize,
287 concat!(
288 "Alignment of ",
289 stringify!(grpc_compression_options_grpc_compression_options_default_algorithm)
290 )
291 );
292 assert_eq!(
293 unsafe {
294 &(*(::std::ptr::null::<
295 grpc_compression_options_grpc_compression_options_default_algorithm,
296 >()))
297 .is_set as *const _ as usize
298 },
299 0usize,
300 concat!(
301 "Offset of field: ",
302 stringify!(grpc_compression_options_grpc_compression_options_default_algorithm),
303 "::",
304 stringify!(is_set)
305 )
306 );
307 assert_eq!(
308 unsafe {
309 &(*(::std::ptr::null::<
310 grpc_compression_options_grpc_compression_options_default_algorithm,
311 >()))
312 .algorithm as *const _ as usize
313 },
314 4usize,
315 concat!(
316 "Offset of field: ",
317 stringify!(grpc_compression_options_grpc_compression_options_default_algorithm),
318 "::",
319 stringify!(algorithm)
320 )
321 );
322}
323#[test]
324fn bindgen_test_layout_grpc_compression_options() {
325 assert_eq!(
326 ::std::mem::size_of::<grpc_compression_options>(),
327 20usize,
328 concat!("Size of: ", stringify!(grpc_compression_options))
329 );
330 assert_eq!(
331 ::std::mem::align_of::<grpc_compression_options>(),
332 4usize,
333 concat!("Alignment of ", stringify!(grpc_compression_options))
334 );
335 assert_eq!(
336 unsafe {
337 &(*(::std::ptr::null::<grpc_compression_options>())).enabled_algorithms_bitset
338 as *const _ as usize
339 },
340 0usize,
341 concat!(
342 "Offset of field: ",
343 stringify!(grpc_compression_options),
344 "::",
345 stringify!(enabled_algorithms_bitset)
346 )
347 );
348 assert_eq!(
349 unsafe {
350 &(*(::std::ptr::null::<grpc_compression_options>())).default_level as *const _ as usize
351 },
352 4usize,
353 concat!(
354 "Offset of field: ",
355 stringify!(grpc_compression_options),
356 "::",
357 stringify!(default_level)
358 )
359 );
360 assert_eq!(
361 unsafe {
362 &(*(::std::ptr::null::<grpc_compression_options>())).default_algorithm as *const _
363 as usize
364 },
365 12usize,
366 concat!(
367 "Offset of field: ",
368 stringify!(grpc_compression_options),
369 "::",
370 stringify!(default_algorithm)
371 )
372 );
373}
374#[repr(C)]
375#[derive(Debug, Copy, Clone)]
376pub struct grpc_slice_refcount {
377 _unused: [u8; 0],
378}
379#[doc = " A grpc_slice s, if initialized, represents the byte range"]
380#[doc = "s.bytes[0..s.length-1]."]
381#[doc = ""]
382#[doc = "It can have an associated ref count which has a destruction routine to be run"]
383#[doc = "when the ref count reaches zero (see grpc_slice_new() and grp_slice_unref())."]
384#[doc = "Multiple grpc_slice values may share a ref count."]
385#[doc = ""]
386#[doc = "If the slice does not have a refcount, it represents an inlined small piece"]
387#[doc = "of data that is copied by value."]
388#[repr(C)]
389#[derive(Copy, Clone)]
390pub struct grpc_slice {
391 pub refcount: *mut grpc_slice_refcount,
392 pub data: grpc_slice_grpc_slice_data,
393}
394#[repr(C)]
395#[derive(Copy, Clone)]
396pub union grpc_slice_grpc_slice_data {
397 pub refcounted: grpc_slice_grpc_slice_data_grpc_slice_refcounted,
398 pub inlined: grpc_slice_grpc_slice_data_grpc_slice_inlined,
399 _bindgen_union_align: [u64; 3usize],
400}
401#[repr(C)]
402#[derive(Debug, Copy, Clone)]
403pub struct grpc_slice_grpc_slice_data_grpc_slice_refcounted {
404 pub length: usize,
405 pub bytes: *mut u8,
406}
407#[test]
408fn bindgen_test_layout_grpc_slice_grpc_slice_data_grpc_slice_refcounted() {
409 assert_eq!(
410 ::std::mem::size_of::<grpc_slice_grpc_slice_data_grpc_slice_refcounted>(),
411 16usize,
412 concat!(
413 "Size of: ",
414 stringify!(grpc_slice_grpc_slice_data_grpc_slice_refcounted)
415 )
416 );
417 assert_eq!(
418 ::std::mem::align_of::<grpc_slice_grpc_slice_data_grpc_slice_refcounted>(),
419 8usize,
420 concat!(
421 "Alignment of ",
422 stringify!(grpc_slice_grpc_slice_data_grpc_slice_refcounted)
423 )
424 );
425 assert_eq!(
426 unsafe {
427 &(*(::std::ptr::null::<grpc_slice_grpc_slice_data_grpc_slice_refcounted>())).length
428 as *const _ as usize
429 },
430 0usize,
431 concat!(
432 "Offset of field: ",
433 stringify!(grpc_slice_grpc_slice_data_grpc_slice_refcounted),
434 "::",
435 stringify!(length)
436 )
437 );
438 assert_eq!(
439 unsafe {
440 &(*(::std::ptr::null::<grpc_slice_grpc_slice_data_grpc_slice_refcounted>())).bytes
441 as *const _ as usize
442 },
443 8usize,
444 concat!(
445 "Offset of field: ",
446 stringify!(grpc_slice_grpc_slice_data_grpc_slice_refcounted),
447 "::",
448 stringify!(bytes)
449 )
450 );
451}
452#[repr(C)]
453#[derive(Debug, Copy, Clone)]
454pub struct grpc_slice_grpc_slice_data_grpc_slice_inlined {
455 pub length: u8,
456 pub bytes: [u8; 23usize],
457}
458#[test]
459fn bindgen_test_layout_grpc_slice_grpc_slice_data_grpc_slice_inlined() {
460 assert_eq!(
461 ::std::mem::size_of::<grpc_slice_grpc_slice_data_grpc_slice_inlined>(),
462 24usize,
463 concat!(
464 "Size of: ",
465 stringify!(grpc_slice_grpc_slice_data_grpc_slice_inlined)
466 )
467 );
468 assert_eq!(
469 ::std::mem::align_of::<grpc_slice_grpc_slice_data_grpc_slice_inlined>(),
470 1usize,
471 concat!(
472 "Alignment of ",
473 stringify!(grpc_slice_grpc_slice_data_grpc_slice_inlined)
474 )
475 );
476 assert_eq!(
477 unsafe {
478 &(*(::std::ptr::null::<grpc_slice_grpc_slice_data_grpc_slice_inlined>())).length
479 as *const _ as usize
480 },
481 0usize,
482 concat!(
483 "Offset of field: ",
484 stringify!(grpc_slice_grpc_slice_data_grpc_slice_inlined),
485 "::",
486 stringify!(length)
487 )
488 );
489 assert_eq!(
490 unsafe {
491 &(*(::std::ptr::null::<grpc_slice_grpc_slice_data_grpc_slice_inlined>())).bytes
492 as *const _ as usize
493 },
494 1usize,
495 concat!(
496 "Offset of field: ",
497 stringify!(grpc_slice_grpc_slice_data_grpc_slice_inlined),
498 "::",
499 stringify!(bytes)
500 )
501 );
502}
503#[test]
504fn bindgen_test_layout_grpc_slice_grpc_slice_data() {
505 assert_eq!(
506 ::std::mem::size_of::<grpc_slice_grpc_slice_data>(),
507 24usize,
508 concat!("Size of: ", stringify!(grpc_slice_grpc_slice_data))
509 );
510 assert_eq!(
511 ::std::mem::align_of::<grpc_slice_grpc_slice_data>(),
512 8usize,
513 concat!("Alignment of ", stringify!(grpc_slice_grpc_slice_data))
514 );
515 assert_eq!(
516 unsafe {
517 &(*(::std::ptr::null::<grpc_slice_grpc_slice_data>())).refcounted as *const _ as usize
518 },
519 0usize,
520 concat!(
521 "Offset of field: ",
522 stringify!(grpc_slice_grpc_slice_data),
523 "::",
524 stringify!(refcounted)
525 )
526 );
527 assert_eq!(
528 unsafe {
529 &(*(::std::ptr::null::<grpc_slice_grpc_slice_data>())).inlined as *const _ as usize
530 },
531 0usize,
532 concat!(
533 "Offset of field: ",
534 stringify!(grpc_slice_grpc_slice_data),
535 "::",
536 stringify!(inlined)
537 )
538 );
539}
540impl ::std::fmt::Debug for grpc_slice_grpc_slice_data {
541 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
542 write!(f, "grpc_slice_grpc_slice_data {{ union }}")
543 }
544}
545#[test]
546fn bindgen_test_layout_grpc_slice() {
547 assert_eq!(
548 ::std::mem::size_of::<grpc_slice>(),
549 32usize,
550 concat!("Size of: ", stringify!(grpc_slice))
551 );
552 assert_eq!(
553 ::std::mem::align_of::<grpc_slice>(),
554 8usize,
555 concat!("Alignment of ", stringify!(grpc_slice))
556 );
557 assert_eq!(
558 unsafe { &(*(::std::ptr::null::<grpc_slice>())).refcount as *const _ as usize },
559 0usize,
560 concat!(
561 "Offset of field: ",
562 stringify!(grpc_slice),
563 "::",
564 stringify!(refcount)
565 )
566 );
567 assert_eq!(
568 unsafe { &(*(::std::ptr::null::<grpc_slice>())).data as *const _ as usize },
569 8usize,
570 concat!(
571 "Offset of field: ",
572 stringify!(grpc_slice),
573 "::",
574 stringify!(data)
575 )
576 );
577}
578impl ::std::fmt::Debug for grpc_slice {
579 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
580 write!(
581 f,
582 "grpc_slice {{ refcount: {:?}, data: {:?} }}",
583 self.refcount, self.data
584 )
585 }
586}
587#[doc = " Represents an expandable array of slices, to be interpreted as a"]
588#[doc = "single item."]
589#[repr(C)]
590#[derive(Copy, Clone)]
591pub struct grpc_slice_buffer {
592 #[doc = " This is for internal use only. External users (i.e any code outside grpc"]
593 #[doc = " core) MUST NOT use this field"]
594 pub base_slices: *mut grpc_slice,
595 #[doc = " slices in the array (Points to the first valid grpc_slice in the array)"]
596 pub slices: *mut grpc_slice,
597 #[doc = " the number of slices in the array"]
598 pub count: usize,
599 #[doc = " the number of slices allocated in the array. External users (i.e any code"]
600 #[doc = " outside grpc core) MUST NOT use this field"]
601 pub capacity: usize,
602 #[doc = " the combined length of all slices in the array"]
603 pub length: usize,
604 #[doc = " inlined elements to avoid allocations"]
605 pub inlined: [grpc_slice; 8usize],
606}
607#[test]
608fn bindgen_test_layout_grpc_slice_buffer() {
609 assert_eq!(
610 ::std::mem::size_of::<grpc_slice_buffer>(),
611 296usize,
612 concat!("Size of: ", stringify!(grpc_slice_buffer))
613 );
614 assert_eq!(
615 ::std::mem::align_of::<grpc_slice_buffer>(),
616 8usize,
617 concat!("Alignment of ", stringify!(grpc_slice_buffer))
618 );
619 assert_eq!(
620 unsafe { &(*(::std::ptr::null::<grpc_slice_buffer>())).base_slices as *const _ as usize },
621 0usize,
622 concat!(
623 "Offset of field: ",
624 stringify!(grpc_slice_buffer),
625 "::",
626 stringify!(base_slices)
627 )
628 );
629 assert_eq!(
630 unsafe { &(*(::std::ptr::null::<grpc_slice_buffer>())).slices as *const _ as usize },
631 8usize,
632 concat!(
633 "Offset of field: ",
634 stringify!(grpc_slice_buffer),
635 "::",
636 stringify!(slices)
637 )
638 );
639 assert_eq!(
640 unsafe { &(*(::std::ptr::null::<grpc_slice_buffer>())).count as *const _ as usize },
641 16usize,
642 concat!(
643 "Offset of field: ",
644 stringify!(grpc_slice_buffer),
645 "::",
646 stringify!(count)
647 )
648 );
649 assert_eq!(
650 unsafe { &(*(::std::ptr::null::<grpc_slice_buffer>())).capacity as *const _ as usize },
651 24usize,
652 concat!(
653 "Offset of field: ",
654 stringify!(grpc_slice_buffer),
655 "::",
656 stringify!(capacity)
657 )
658 );
659 assert_eq!(
660 unsafe { &(*(::std::ptr::null::<grpc_slice_buffer>())).length as *const _ as usize },
661 32usize,
662 concat!(
663 "Offset of field: ",
664 stringify!(grpc_slice_buffer),
665 "::",
666 stringify!(length)
667 )
668 );
669 assert_eq!(
670 unsafe { &(*(::std::ptr::null::<grpc_slice_buffer>())).inlined as *const _ as usize },
671 40usize,
672 concat!(
673 "Offset of field: ",
674 stringify!(grpc_slice_buffer),
675 "::",
676 stringify!(inlined)
677 )
678 );
679}
680impl ::std::fmt::Debug for grpc_slice_buffer {
681 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
682 write ! ( f , "grpc_slice_buffer {{ base_slices: {:?}, slices: {:?}, count: {:?}, capacity: {:?}, length: {:?}, inlined: {:?} }}" , self . base_slices , self . slices , self . count , self . capacity , self . length , self . inlined )
683 }
684}
685#[repr(u32)]
686#[doc = " The clocks we support."]
687#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
688pub enum gpr_clock_type {
689 #[doc = " Monotonic clock. Epoch undefined. Always moves forwards."]
690 GPR_CLOCK_MONOTONIC = 0,
691 #[doc = " Realtime clock. May jump forwards or backwards. Settable by"]
692 #[doc = "the system administrator. Has its epoch at 0:00:00 UTC 1 Jan 1970."]
693 GPR_CLOCK_REALTIME = 1,
694 #[doc = " CPU cycle time obtained by rdtsc instruction on x86 platforms. Epoch"]
695 #[doc = "undefined. Degrades to GPR_CLOCK_REALTIME on other platforms."]
696 GPR_CLOCK_PRECISE = 2,
697 #[doc = " Unmeasurable clock type: no base, created by taking the difference"]
698 #[doc = "between two times"]
699 GPR_TIMESPAN = 3,
700}
701#[doc = " Analogous to struct timespec. On some machines, absolute times may be in"]
702#[doc = " local time."]
703#[repr(C)]
704#[derive(Debug, Copy, Clone)]
705pub struct gpr_timespec {
706 pub tv_sec: i64,
707 pub tv_nsec: i32,
708 #[doc = " Against which clock was this time measured? (or GPR_TIMESPAN if"]
709 #[doc = "this is a relative time measure)"]
710 pub clock_type: gpr_clock_type,
711}
712#[test]
713fn bindgen_test_layout_gpr_timespec() {
714 assert_eq!(
715 ::std::mem::size_of::<gpr_timespec>(),
716 16usize,
717 concat!("Size of: ", stringify!(gpr_timespec))
718 );
719 assert_eq!(
720 ::std::mem::align_of::<gpr_timespec>(),
721 8usize,
722 concat!("Alignment of ", stringify!(gpr_timespec))
723 );
724 assert_eq!(
725 unsafe { &(*(::std::ptr::null::<gpr_timespec>())).tv_sec as *const _ as usize },
726 0usize,
727 concat!(
728 "Offset of field: ",
729 stringify!(gpr_timespec),
730 "::",
731 stringify!(tv_sec)
732 )
733 );
734 assert_eq!(
735 unsafe { &(*(::std::ptr::null::<gpr_timespec>())).tv_nsec as *const _ as usize },
736 8usize,
737 concat!(
738 "Offset of field: ",
739 stringify!(gpr_timespec),
740 "::",
741 stringify!(tv_nsec)
742 )
743 );
744 assert_eq!(
745 unsafe { &(*(::std::ptr::null::<gpr_timespec>())).clock_type as *const _ as usize },
746 12usize,
747 concat!(
748 "Offset of field: ",
749 stringify!(gpr_timespec),
750 "::",
751 stringify!(clock_type)
752 )
753 );
754}
755pub type gpr_atm = isize;
756extern "C" {
757 #[doc = " Adds \\a delta to \\a *value, clamping the result to the range specified"]
758 #[doc = "by \\a min and \\a max. Returns the new value."]
759 pub fn gpr_atm_no_barrier_clamped_add(
760 value: *mut gpr_atm,
761 delta: gpr_atm,
762 min: gpr_atm,
763 max: gpr_atm,
764 ) -> gpr_atm;
765}
766#[repr(C)]
767#[derive(Debug, Copy, Clone)]
768pub struct gpr_event {
769 pub state: gpr_atm,
770}
771#[test]
772fn bindgen_test_layout_gpr_event() {
773 assert_eq!(
774 ::std::mem::size_of::<gpr_event>(),
775 8usize,
776 concat!("Size of: ", stringify!(gpr_event))
777 );
778 assert_eq!(
779 ::std::mem::align_of::<gpr_event>(),
780 8usize,
781 concat!("Alignment of ", stringify!(gpr_event))
782 );
783 assert_eq!(
784 unsafe { &(*(::std::ptr::null::<gpr_event>())).state as *const _ as usize },
785 0usize,
786 concat!(
787 "Offset of field: ",
788 stringify!(gpr_event),
789 "::",
790 stringify!(state)
791 )
792 );
793}
794#[repr(C)]
795#[derive(Debug, Copy, Clone)]
796pub struct gpr_refcount {
797 pub count: gpr_atm,
798}
799#[test]
800fn bindgen_test_layout_gpr_refcount() {
801 assert_eq!(
802 ::std::mem::size_of::<gpr_refcount>(),
803 8usize,
804 concat!("Size of: ", stringify!(gpr_refcount))
805 );
806 assert_eq!(
807 ::std::mem::align_of::<gpr_refcount>(),
808 8usize,
809 concat!("Alignment of ", stringify!(gpr_refcount))
810 );
811 assert_eq!(
812 unsafe { &(*(::std::ptr::null::<gpr_refcount>())).count as *const _ as usize },
813 0usize,
814 concat!(
815 "Offset of field: ",
816 stringify!(gpr_refcount),
817 "::",
818 stringify!(count)
819 )
820 );
821}
822#[repr(C)]
823#[derive(Debug, Copy, Clone)]
824pub struct gpr_stats_counter {
825 pub value: gpr_atm,
826}
827#[test]
828fn bindgen_test_layout_gpr_stats_counter() {
829 assert_eq!(
830 ::std::mem::size_of::<gpr_stats_counter>(),
831 8usize,
832 concat!("Size of: ", stringify!(gpr_stats_counter))
833 );
834 assert_eq!(
835 ::std::mem::align_of::<gpr_stats_counter>(),
836 8usize,
837 concat!("Alignment of ", stringify!(gpr_stats_counter))
838 );
839 assert_eq!(
840 unsafe { &(*(::std::ptr::null::<gpr_stats_counter>())).value as *const _ as usize },
841 0usize,
842 concat!(
843 "Offset of field: ",
844 stringify!(gpr_stats_counter),
845 "::",
846 stringify!(value)
847 )
848 );
849}
850extern "C" {
851 #[doc = " Initialize *ev."]
852 pub fn gpr_event_init(ev: *mut gpr_event);
853}
854extern "C" {
855 #[doc = " Set *ev so that gpr_event_get() and gpr_event_wait() will return value."]
856 #[doc = "Requires: *ev initialized; value != NULL; no prior or concurrent calls to"]
857 #[doc = "gpr_event_set(ev, ...) since initialization."]
858 pub fn gpr_event_set(ev: *mut gpr_event, value: *mut ::std::os::raw::c_void);
859}
860extern "C" {
861 #[doc = " Return the value set by gpr_event_set(ev, ...), or NULL if no such call has"]
862 #[doc = "completed. If the result is non-NULL, all operations that occurred prior to"]
863 #[doc = "the gpr_event_set(ev, ...) set will be visible after this call returns."]
864 #[doc = "Requires: *ev initialized. This operation is faster than acquiring a mutex"]
865 #[doc = "on most platforms."]
866 pub fn gpr_event_get(ev: *mut gpr_event) -> *mut ::std::os::raw::c_void;
867}
868extern "C" {
869 #[doc = " Wait until *ev is set by gpr_event_set(ev, ...), or abs_deadline is"]
870 #[doc = "exceeded, then return gpr_event_get(ev). Requires: *ev initialized. Use"]
871 #[doc = "abs_deadline==gpr_inf_future for no deadline. When the event has been"]
872 #[doc = "signalled before the call, this operation is faster than acquiring a mutex"]
873 #[doc = "on most platforms."]
874 pub fn gpr_event_wait(
875 ev: *mut gpr_event,
876 abs_deadline: gpr_timespec,
877 ) -> *mut ::std::os::raw::c_void;
878}
879extern "C" {
880 #[doc = " Initialize *r to value n."]
881 pub fn gpr_ref_init(r: *mut gpr_refcount, n: ::std::os::raw::c_int);
882}
883extern "C" {
884 #[doc = " Increment the reference count *r. Requires *r initialized."]
885 pub fn gpr_ref(r: *mut gpr_refcount);
886}
887extern "C" {
888 #[doc = " Increment the reference count *r. Requires *r initialized."]
889 #[doc = "Crashes if refcount is zero"]
890 pub fn gpr_ref_non_zero(r: *mut gpr_refcount);
891}
892extern "C" {
893 #[doc = " Increment the reference count *r by n. Requires *r initialized, n > 0."]
894 pub fn gpr_refn(r: *mut gpr_refcount, n: ::std::os::raw::c_int);
895}
896extern "C" {
897 #[doc = " Decrement the reference count *r and return non-zero iff it has reached"]
898 #[doc = "zero. . Requires *r initialized."]
899 pub fn gpr_unref(r: *mut gpr_refcount) -> ::std::os::raw::c_int;
900}
901extern "C" {
902 #[doc = " Return non-zero iff the reference count of *r is one, and thus is owned"]
903 #[doc = "by exactly one object."]
904 pub fn gpr_ref_is_unique(r: *mut gpr_refcount) -> ::std::os::raw::c_int;
905}
906extern "C" {
907 #[doc = " Initialize *c to the value n."]
908 pub fn gpr_stats_init(c: *mut gpr_stats_counter, n: isize);
909}
910extern "C" {
911 #[doc = " *c += inc. Requires: *c initialized."]
912 pub fn gpr_stats_inc(c: *mut gpr_stats_counter, inc: isize);
913}
914extern "C" {
915 #[doc = " Return *c. Requires: *c initialized."]
916 pub fn gpr_stats_read(c: *const gpr_stats_counter) -> isize;
917}
918extern "C" {
919 #[doc = " Increment the refcount of s. Requires slice is initialized."]
920 #[doc = "Returns s."]
921 pub fn grpc_slice_ref(s: grpc_slice) -> grpc_slice;
922}
923extern "C" {
924 #[doc = " Decrement the ref count of s. If the ref count of s reaches zero, all"]
925 #[doc = "slices sharing the ref count are destroyed, and considered no longer"]
926 #[doc = "initialized. If s is ultimately derived from a call to grpc_slice_new(start,"]
927 #[doc = "len, dest) where dest!=NULL , then (*dest)(start) is called, else if s is"]
928 #[doc = "ultimately derived from a call to grpc_slice_new_with_len(start, len, dest)"]
929 #[doc = "where dest!=NULL , then (*dest)(start, len). Requires s initialized."]
930 pub fn grpc_slice_unref(s: grpc_slice);
931}
932extern "C" {
933 #[doc = " Copy slice - create a new slice that contains the same data as s"]
934 pub fn grpc_slice_copy(s: grpc_slice) -> grpc_slice;
935}
936extern "C" {
937 #[doc = " Create a slice pointing at some data. Calls malloc to allocate a refcount"]
938 #[doc = "for the object, and arranges that destroy will be called with the pointer"]
939 #[doc = "passed in at destruction."]
940 pub fn grpc_slice_new(
941 p: *mut ::std::os::raw::c_void,
942 len: usize,
943 destroy: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
944 ) -> grpc_slice;
945}
946extern "C" {
947 #[doc = " Equivalent to grpc_slice_new, but with a separate pointer that is"]
948 #[doc = "passed to the destroy function. This function can be useful when"]
949 #[doc = "the data is part of a larger structure that must be destroyed when"]
950 #[doc = "the data is no longer needed."]
951 pub fn grpc_slice_new_with_user_data(
952 p: *mut ::std::os::raw::c_void,
953 len: usize,
954 destroy: ::std::option::Option<unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void)>,
955 user_data: *mut ::std::os::raw::c_void,
956 ) -> grpc_slice;
957}
958extern "C" {
959 #[doc = " Equivalent to grpc_slice_new, but with a two argument destroy function that"]
960 #[doc = "also takes the slice length."]
961 pub fn grpc_slice_new_with_len(
962 p: *mut ::std::os::raw::c_void,
963 len: usize,
964 destroy: ::std::option::Option<
965 unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void, arg2: usize),
966 >,
967 ) -> grpc_slice;
968}
969extern "C" {
970 #[doc = " Equivalent to grpc_slice_new(malloc(len), len, free), but saves one malloc()"]
971 #[doc = "call."]
972 #[doc = "Aborts if malloc() fails."]
973 pub fn grpc_slice_malloc(length: usize) -> grpc_slice;
974}
975extern "C" {
976 pub fn grpc_slice_malloc_large(length: usize) -> grpc_slice;
977}
978extern "C" {
979 #[doc = " Intern a slice:"]
980 #[doc = ""]
981 #[doc = "The return value for two invocations of this function with the same sequence"]
982 #[doc = "of bytes is a slice which points to the same memory."]
983 pub fn grpc_slice_intern(slice: grpc_slice) -> grpc_slice;
984}
985extern "C" {
986 #[doc = " Create a slice by copying a string."]
987 #[doc = "Does not preserve null terminators."]
988 #[doc = "Equivalent to:"]
989 #[doc = "size_t len = strlen(source);"]
990 #[doc = "grpc_slice slice = grpc_slice_malloc(len);"]
991 #[doc = "memcpy(slice->data, source, len);"]
992 pub fn grpc_slice_from_copied_string(source: *const ::std::os::raw::c_char) -> grpc_slice;
993}
994extern "C" {
995 #[doc = " Create a slice by copying a buffer."]
996 #[doc = "Equivalent to:"]
997 #[doc = "grpc_slice slice = grpc_slice_malloc(len);"]
998 #[doc = "memcpy(slice->data, source, len);"]
999 pub fn grpc_slice_from_copied_buffer(
1000 source: *const ::std::os::raw::c_char,
1001 len: usize,
1002 ) -> grpc_slice;
1003}
1004extern "C" {
1005 #[doc = " Create a slice pointing to constant memory"]
1006 pub fn grpc_slice_from_static_string(source: *const ::std::os::raw::c_char) -> grpc_slice;
1007}
1008extern "C" {
1009 #[doc = " Create a slice pointing to constant memory"]
1010 pub fn grpc_slice_from_static_buffer(
1011 source: *const ::std::os::raw::c_void,
1012 len: usize,
1013 ) -> grpc_slice;
1014}
1015extern "C" {
1016 #[doc = " Return a result slice derived from s, which shares a ref count with \\a s,"]
1017 #[doc = "where result.data==s.data+begin, and result.length==end-begin. The ref count"]
1018 #[doc = "of \\a s is increased by one. Do not assign result back to \\a s."]
1019 #[doc = "Requires s initialized, begin <= end, begin <= s.length, and"]
1020 #[doc = "end <= source->length."]
1021 pub fn grpc_slice_sub(s: grpc_slice, begin: usize, end: usize) -> grpc_slice;
1022}
1023extern "C" {
1024 #[doc = " The same as grpc_slice_sub, but without altering the ref count"]
1025 pub fn grpc_slice_sub_no_ref(s: grpc_slice, begin: usize, end: usize) -> grpc_slice;
1026}
1027extern "C" {
1028 #[doc = " Splits s into two: modifies s to be s[0:split], and returns a new slice,"]
1029 #[doc = "sharing a refcount with s, that contains s[split:s.length]."]
1030 #[doc = "Requires s initialized, split <= s.length"]
1031 pub fn grpc_slice_split_tail(s: *mut grpc_slice, split: usize) -> grpc_slice;
1032}
1033#[repr(u32)]
1034#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
1035pub enum grpc_slice_ref_whom {
1036 GRPC_SLICE_REF_TAIL = 1,
1037 GRPC_SLICE_REF_HEAD = 2,
1038 GRPC_SLICE_REF_BOTH = 3,
1039}
1040extern "C" {
1041 #[doc = " The same as grpc_slice_split_tail, but with an option to skip altering"]
1042 #[doc = " refcounts (grpc_slice_split_tail_maybe_ref(..., true) is equivalent to"]
1043 #[doc = " grpc_slice_split_tail(...))"]
1044 pub fn grpc_slice_split_tail_maybe_ref(
1045 s: *mut grpc_slice,
1046 split: usize,
1047 ref_whom: grpc_slice_ref_whom,
1048 ) -> grpc_slice;
1049}
1050extern "C" {
1051 #[doc = " Splits s into two: modifies s to be s[split:s.length], and returns a new"]
1052 #[doc = "slice, sharing a refcount with s, that contains s[0:split]."]
1053 #[doc = "Requires s initialized, split <= s.length"]
1054 pub fn grpc_slice_split_head(s: *mut grpc_slice, split: usize) -> grpc_slice;
1055}
1056extern "C" {
1057 pub fn grpc_empty_slice() -> grpc_slice;
1058}
1059extern "C" {
1060 pub fn grpc_slice_default_hash_impl(s: grpc_slice) -> u32;
1061}
1062extern "C" {
1063 pub fn grpc_slice_default_eq_impl(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int;
1064}
1065extern "C" {
1066 pub fn grpc_slice_eq(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int;
1067}
1068extern "C" {
1069 #[doc = " Returns <0 if a < b, ==0 if a == b, >0 if a > b"]
1070 #[doc = "The order is arbitrary, and is not guaranteed to be stable across different"]
1071 #[doc = "versions of the API."]
1072 pub fn grpc_slice_cmp(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int;
1073}
1074extern "C" {
1075 pub fn grpc_slice_str_cmp(
1076 a: grpc_slice,
1077 b: *const ::std::os::raw::c_char,
1078 ) -> ::std::os::raw::c_int;
1079}
1080extern "C" {
1081 #[doc = " return non-zero if the first blen bytes of a are equal to b"]
1082 pub fn grpc_slice_buf_start_eq(
1083 a: grpc_slice,
1084 b: *const ::std::os::raw::c_void,
1085 blen: usize,
1086 ) -> ::std::os::raw::c_int;
1087}
1088extern "C" {
1089 #[doc = " return the index of the last instance of \\a c in \\a s, or -1 if not found"]
1090 pub fn grpc_slice_rchr(s: grpc_slice, c: ::std::os::raw::c_char) -> ::std::os::raw::c_int;
1091}
1092extern "C" {
1093 pub fn grpc_slice_chr(s: grpc_slice, c: ::std::os::raw::c_char) -> ::std::os::raw::c_int;
1094}
1095extern "C" {
1096 #[doc = " return the index of the first occurrence of \\a needle in \\a haystack, or -1"]
1097 #[doc = "if it's not found"]
1098 pub fn grpc_slice_slice(haystack: grpc_slice, needle: grpc_slice) -> ::std::os::raw::c_int;
1099}
1100extern "C" {
1101 pub fn grpc_slice_hash(s: grpc_slice) -> u32;
1102}
1103extern "C" {
1104 #[doc = " Do two slices point at the same memory, with the same length"]
1105 #[doc = "If a or b is inlined, actually compares data"]
1106 pub fn grpc_slice_is_equivalent(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int;
1107}
1108extern "C" {
1109 #[doc = " Return a slice pointing to newly allocated memory that has the same contents"]
1110 #[doc = " as \\a s"]
1111 pub fn grpc_slice_dup(a: grpc_slice) -> grpc_slice;
1112}
1113extern "C" {
1114 #[doc = " Return a copy of slice as a C string. Offers no protection against embedded"]
1115 #[doc = "NULL's. Returned string must be freed with gpr_free."]
1116 pub fn grpc_slice_to_c_string(s: grpc_slice) -> *mut ::std::os::raw::c_char;
1117}
1118extern "C" {
1119 #[doc = " Return if an algorithm is message compression algorithm."]
1120 pub fn grpc_compression_algorithm_is_message(
1121 algorithm: grpc_compression_algorithm,
1122 ) -> ::std::os::raw::c_int;
1123}
1124extern "C" {
1125 #[doc = " Return if an algorithm is stream compression algorithm."]
1126 pub fn grpc_compression_algorithm_is_stream(
1127 algorithm: grpc_compression_algorithm,
1128 ) -> ::std::os::raw::c_int;
1129}
1130extern "C" {
1131 #[doc = " Parses the \\a slice as a grpc_compression_algorithm instance and updating \\a"]
1132 #[doc = " algorithm. Returns 1 upon success, 0 otherwise."]
1133 pub fn grpc_compression_algorithm_parse(
1134 value: grpc_slice,
1135 algorithm: *mut grpc_compression_algorithm,
1136 ) -> ::std::os::raw::c_int;
1137}
1138extern "C" {
1139 #[doc = " Updates \\a name with the encoding name corresponding to a valid \\a"]
1140 #[doc = " algorithm. Note that \\a name is statically allocated and must *not* be freed."]
1141 #[doc = " Returns 1 upon success, 0 otherwise."]
1142 pub fn grpc_compression_algorithm_name(
1143 algorithm: grpc_compression_algorithm,
1144 name: *mut *const ::std::os::raw::c_char,
1145 ) -> ::std::os::raw::c_int;
1146}
1147extern "C" {
1148 #[doc = " Returns the compression algorithm corresponding to \\a level for the"]
1149 #[doc = " compression algorithms encoded in the \\a accepted_encodings bitset."]
1150 pub fn grpc_compression_algorithm_for_level(
1151 level: grpc_compression_level,
1152 accepted_encodings: u32,
1153 ) -> grpc_compression_algorithm;
1154}
1155extern "C" {
1156 pub fn grpc_compression_options_init(opts: *mut grpc_compression_options);
1157}
1158extern "C" {
1159 #[doc = " Mark \\a algorithm as enabled in \\a opts."]
1160 pub fn grpc_compression_options_enable_algorithm(
1161 opts: *mut grpc_compression_options,
1162 algorithm: grpc_compression_algorithm,
1163 );
1164}
1165extern "C" {
1166 #[doc = " Mark \\a algorithm as disabled in \\a opts."]
1167 pub fn grpc_compression_options_disable_algorithm(
1168 opts: *mut grpc_compression_options,
1169 algorithm: grpc_compression_algorithm,
1170 );
1171}
1172extern "C" {
1173 #[doc = " Returns true if \\a algorithm is marked as enabled in \\a opts."]
1174 pub fn grpc_compression_options_is_algorithm_enabled(
1175 opts: *const grpc_compression_options,
1176 algorithm: grpc_compression_algorithm,
1177 ) -> ::std::os::raw::c_int;
1178}
1179pub mod grpc_status_code {
1180 pub type Type = i32;
1181 #[doc = " Not an error; returned on success"]
1182 pub const GRPC_STATUS_OK: Type = 0;
1183 #[doc = " The operation was cancelled (typically by the caller)."]
1184 pub const GRPC_STATUS_CANCELLED: Type = 1;
1185 #[doc = " Unknown error. An example of where this error may be returned is"]
1186 #[doc = "if a Status value received from another address space belongs to"]
1187 #[doc = "an error-space that is not known in this address space. Also"]
1188 #[doc = "errors raised by APIs that do not return enough error information"]
1189 #[doc = "may be converted to this error."]
1190 pub const GRPC_STATUS_UNKNOWN: Type = 2;
1191 #[doc = " Client specified an invalid argument. Note that this differs"]
1192 #[doc = "from FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments"]
1193 #[doc = "that are problematic regardless of the state of the system"]
1194 #[doc = "(e.g., a malformed file name)."]
1195 pub const GRPC_STATUS_INVALID_ARGUMENT: Type = 3;
1196 #[doc = " Deadline expired before operation could complete. For operations"]
1197 #[doc = "that change the state of the system, this error may be returned"]
1198 #[doc = "even if the operation has completed successfully. For example, a"]
1199 #[doc = "successful response from a server could have been delayed long"]
1200 #[doc = "enough for the deadline to expire."]
1201 pub const GRPC_STATUS_DEADLINE_EXCEEDED: Type = 4;
1202 #[doc = " Some requested entity (e.g., file or directory) was not found."]
1203 pub const GRPC_STATUS_NOT_FOUND: Type = 5;
1204 #[doc = " Some entity that we attempted to create (e.g., file or directory)"]
1205 #[doc = "already exists."]
1206 pub const GRPC_STATUS_ALREADY_EXISTS: Type = 6;
1207 #[doc = " The caller does not have permission to execute the specified"]
1208 #[doc = "operation. PERMISSION_DENIED must not be used for rejections"]
1209 #[doc = "caused by exhausting some resource (use RESOURCE_EXHAUSTED"]
1210 #[doc = "instead for those errors). PERMISSION_DENIED must not be"]
1211 #[doc = "used if the caller can not be identified (use UNAUTHENTICATED"]
1212 #[doc = "instead for those errors)."]
1213 pub const GRPC_STATUS_PERMISSION_DENIED: Type = 7;
1214 #[doc = " The request does not have valid authentication credentials for the"]
1215 #[doc = "operation."]
1216 pub const GRPC_STATUS_UNAUTHENTICATED: Type = 16;
1217 #[doc = " Some resource has been exhausted, perhaps a per-user quota, or"]
1218 #[doc = "perhaps the entire file system is out of space."]
1219 pub const GRPC_STATUS_RESOURCE_EXHAUSTED: Type = 8;
1220 #[doc = " Operation was rejected because the system is not in a state"]
1221 #[doc = "required for the operation's execution. For example, directory"]
1222 #[doc = "to be deleted may be non-empty, an rmdir operation is applied to"]
1223 #[doc = "a non-directory, etc."]
1224 #[doc = ""]
1225 #[doc = "A litmus test that may help a service implementor in deciding"]
1226 #[doc = "between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:"]
1227 #[doc = "(a) Use UNAVAILABLE if the client can retry just the failing call."]
1228 #[doc = "(b) Use ABORTED if the client should retry at a higher-level"]
1229 #[doc = "(e.g., restarting a read-modify-write sequence)."]
1230 #[doc = "(c) Use FAILED_PRECONDITION if the client should not retry until"]
1231 #[doc = "the system state has been explicitly fixed. E.g., if an \"rmdir\""]
1232 #[doc = "fails because the directory is non-empty, FAILED_PRECONDITION"]
1233 #[doc = "should be returned since the client should not retry unless"]
1234 #[doc = "they have first fixed up the directory by deleting files from it."]
1235 #[doc = "(d) Use FAILED_PRECONDITION if the client performs conditional"]
1236 #[doc = "REST Get/Update/Delete on a resource and the resource on the"]
1237 #[doc = "server does not match the condition. E.g., conflicting"]
1238 #[doc = "read-modify-write on the same resource."]
1239 pub const GRPC_STATUS_FAILED_PRECONDITION: Type = 9;
1240 #[doc = " The operation was aborted, typically due to a concurrency issue"]
1241 #[doc = "like sequencer check failures, transaction aborts, etc."]
1242 #[doc = ""]
1243 #[doc = "See litmus test above for deciding between FAILED_PRECONDITION,"]
1244 #[doc = "ABORTED, and UNAVAILABLE."]
1245 pub const GRPC_STATUS_ABORTED: Type = 10;
1246 #[doc = " Operation was attempted past the valid range. E.g., seeking or"]
1247 #[doc = "reading past end of file."]
1248 #[doc = ""]
1249 #[doc = "Unlike INVALID_ARGUMENT, this error indicates a problem that may"]
1250 #[doc = "be fixed if the system state changes. For example, a 32-bit file"]
1251 #[doc = "system will generate INVALID_ARGUMENT if asked to read at an"]
1252 #[doc = "offset that is not in the range [0,2^32-1], but it will generate"]
1253 #[doc = "OUT_OF_RANGE if asked to read from an offset past the current"]
1254 #[doc = "file size."]
1255 #[doc = ""]
1256 #[doc = "There is a fair bit of overlap between FAILED_PRECONDITION and"]
1257 #[doc = "OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific"]
1258 #[doc = "error) when it applies so that callers who are iterating through"]
1259 #[doc = "a space can easily look for an OUT_OF_RANGE error to detect when"]
1260 #[doc = "they are done."]
1261 pub const GRPC_STATUS_OUT_OF_RANGE: Type = 11;
1262 #[doc = " Operation is not implemented or not supported/enabled in this service."]
1263 pub const GRPC_STATUS_UNIMPLEMENTED: Type = 12;
1264 #[doc = " Internal errors. Means some invariants expected by underlying"]
1265 #[doc = "system has been broken. If you see one of these errors,"]
1266 #[doc = "something is very broken."]
1267 pub const GRPC_STATUS_INTERNAL: Type = 13;
1268 #[doc = " The service is currently unavailable. This is a most likely a"]
1269 #[doc = "transient condition and may be corrected by retrying with"]
1270 #[doc = "a backoff. Note that it is not always safe to retry non-idempotent"]
1271 #[doc = "operations."]
1272 #[doc = ""]
1273 #[doc = "WARNING: Although data MIGHT not have been transmitted when this"]
1274 #[doc = "status occurs, there is NOT A GUARANTEE that the server has not seen"]
1275 #[doc = "anything. So in general it is unsafe to retry on this status code"]
1276 #[doc = "if the call is non-idempotent."]
1277 #[doc = ""]
1278 #[doc = "See litmus test above for deciding between FAILED_PRECONDITION,"]
1279 #[doc = "ABORTED, and UNAVAILABLE."]
1280 pub const GRPC_STATUS_UNAVAILABLE: Type = 14;
1281 #[doc = " Unrecoverable data loss or corruption."]
1282 pub const GRPC_STATUS_DATA_LOSS: Type = 15;
1283 #[doc = " Force users to include a default branch:"]
1284 pub const GRPC_STATUS__DO_NOT_USE: Type = -1;
1285}
1286#[repr(u32)]
1287#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
1288pub enum grpc_byte_buffer_type {
1289 GRPC_BB_RAW = 0,
1290}
1291#[repr(C)]
1292#[derive(Copy, Clone)]
1293pub struct grpc_byte_buffer {
1294 pub reserved: *mut ::std::os::raw::c_void,
1295 pub type_: grpc_byte_buffer_type,
1296 pub data: grpc_byte_buffer_grpc_byte_buffer_data,
1297}
1298#[repr(C)]
1299#[derive(Copy, Clone)]
1300pub union grpc_byte_buffer_grpc_byte_buffer_data {
1301 pub reserved: grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1,
1302 pub raw: grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer,
1303 _bindgen_union_align: [u64; 38usize],
1304}
1305#[repr(C)]
1306#[derive(Debug, Copy, Clone)]
1307pub struct grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1 {
1308 pub reserved: [*mut ::std::os::raw::c_void; 8usize],
1309}
1310#[test]
1311fn bindgen_test_layout_grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1() {
1312 assert_eq!(
1313 ::std::mem::size_of::<grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1>(),
1314 64usize,
1315 concat!(
1316 "Size of: ",
1317 stringify!(grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1)
1318 )
1319 );
1320 assert_eq!(
1321 ::std::mem::align_of::<grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1>(),
1322 8usize,
1323 concat!(
1324 "Alignment of ",
1325 stringify!(grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1)
1326 )
1327 );
1328 assert_eq!(
1329 unsafe {
1330 &(*(::std::ptr::null::<grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1>()))
1331 .reserved as *const _ as usize
1332 },
1333 0usize,
1334 concat!(
1335 "Offset of field: ",
1336 stringify!(grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1),
1337 "::",
1338 stringify!(reserved)
1339 )
1340 );
1341}
1342#[repr(C)]
1343#[derive(Copy, Clone)]
1344pub struct grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer {
1345 pub compression: grpc_compression_algorithm,
1346 pub slice_buffer: grpc_slice_buffer,
1347}
1348#[test]
1349fn bindgen_test_layout_grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer() {
1350 assert_eq!(
1351 ::std::mem::size_of::<grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer>(),
1352 304usize,
1353 concat!(
1354 "Size of: ",
1355 stringify!(grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer)
1356 )
1357 );
1358 assert_eq!(
1359 ::std::mem::align_of::<grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer>(),
1360 8usize,
1361 concat!(
1362 "Alignment of ",
1363 stringify!(grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer)
1364 )
1365 );
1366 assert_eq!(
1367 unsafe {
1368 &(*(::std::ptr::null::<grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer>(
1369 )))
1370 .compression as *const _ as usize
1371 },
1372 0usize,
1373 concat!(
1374 "Offset of field: ",
1375 stringify!(grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer),
1376 "::",
1377 stringify!(compression)
1378 )
1379 );
1380 assert_eq!(
1381 unsafe {
1382 &(*(::std::ptr::null::<grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer>(
1383 )))
1384 .slice_buffer as *const _ as usize
1385 },
1386 8usize,
1387 concat!(
1388 "Offset of field: ",
1389 stringify!(grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer),
1390 "::",
1391 stringify!(slice_buffer)
1392 )
1393 );
1394}
1395impl ::std::fmt::Debug for grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer {
1396 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1397 write ! ( f , "grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer {{ compression: {:?}, slice_buffer: {:?} }}" , self . compression , self . slice_buffer )
1398 }
1399}
1400#[test]
1401fn bindgen_test_layout_grpc_byte_buffer_grpc_byte_buffer_data() {
1402 assert_eq!(
1403 ::std::mem::size_of::<grpc_byte_buffer_grpc_byte_buffer_data>(),
1404 304usize,
1405 concat!(
1406 "Size of: ",
1407 stringify!(grpc_byte_buffer_grpc_byte_buffer_data)
1408 )
1409 );
1410 assert_eq!(
1411 ::std::mem::align_of::<grpc_byte_buffer_grpc_byte_buffer_data>(),
1412 8usize,
1413 concat!(
1414 "Alignment of ",
1415 stringify!(grpc_byte_buffer_grpc_byte_buffer_data)
1416 )
1417 );
1418 assert_eq!(
1419 unsafe {
1420 &(*(::std::ptr::null::<grpc_byte_buffer_grpc_byte_buffer_data>())).reserved as *const _
1421 as usize
1422 },
1423 0usize,
1424 concat!(
1425 "Offset of field: ",
1426 stringify!(grpc_byte_buffer_grpc_byte_buffer_data),
1427 "::",
1428 stringify!(reserved)
1429 )
1430 );
1431 assert_eq!(
1432 unsafe {
1433 &(*(::std::ptr::null::<grpc_byte_buffer_grpc_byte_buffer_data>())).raw as *const _
1434 as usize
1435 },
1436 0usize,
1437 concat!(
1438 "Offset of field: ",
1439 stringify!(grpc_byte_buffer_grpc_byte_buffer_data),
1440 "::",
1441 stringify!(raw)
1442 )
1443 );
1444}
1445impl ::std::fmt::Debug for grpc_byte_buffer_grpc_byte_buffer_data {
1446 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1447 write!(f, "grpc_byte_buffer_grpc_byte_buffer_data {{ union }}")
1448 }
1449}
1450#[test]
1451fn bindgen_test_layout_grpc_byte_buffer() {
1452 assert_eq!(
1453 ::std::mem::size_of::<grpc_byte_buffer>(),
1454 320usize,
1455 concat!("Size of: ", stringify!(grpc_byte_buffer))
1456 );
1457 assert_eq!(
1458 ::std::mem::align_of::<grpc_byte_buffer>(),
1459 8usize,
1460 concat!("Alignment of ", stringify!(grpc_byte_buffer))
1461 );
1462 assert_eq!(
1463 unsafe { &(*(::std::ptr::null::<grpc_byte_buffer>())).reserved as *const _ as usize },
1464 0usize,
1465 concat!(
1466 "Offset of field: ",
1467 stringify!(grpc_byte_buffer),
1468 "::",
1469 stringify!(reserved)
1470 )
1471 );
1472 assert_eq!(
1473 unsafe { &(*(::std::ptr::null::<grpc_byte_buffer>())).type_ as *const _ as usize },
1474 8usize,
1475 concat!(
1476 "Offset of field: ",
1477 stringify!(grpc_byte_buffer),
1478 "::",
1479 stringify!(type_)
1480 )
1481 );
1482 assert_eq!(
1483 unsafe { &(*(::std::ptr::null::<grpc_byte_buffer>())).data as *const _ as usize },
1484 16usize,
1485 concat!(
1486 "Offset of field: ",
1487 stringify!(grpc_byte_buffer),
1488 "::",
1489 stringify!(data)
1490 )
1491 );
1492}
1493impl ::std::fmt::Debug for grpc_byte_buffer {
1494 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1495 write!(
1496 f,
1497 "grpc_byte_buffer {{ reserved: {:?}, type: {:?}, data: {:?} }}",
1498 self.reserved, self.type_, self.data
1499 )
1500 }
1501}
1502#[repr(C)]
1503#[derive(Debug, Copy, Clone)]
1504pub struct grpc_completion_queue {
1505 _unused: [u8; 0],
1506}
1507#[repr(C)]
1508#[derive(Debug, Copy, Clone)]
1509pub struct grpc_alarm {
1510 _unused: [u8; 0],
1511}
1512#[repr(C)]
1513#[derive(Debug, Copy, Clone)]
1514pub struct grpc_channel {
1515 _unused: [u8; 0],
1516}
1517#[repr(C)]
1518#[derive(Debug, Copy, Clone)]
1519pub struct grpc_server {
1520 _unused: [u8; 0],
1521}
1522#[repr(C)]
1523#[derive(Debug, Copy, Clone)]
1524pub struct grpc_call {
1525 _unused: [u8; 0],
1526}
1527#[repr(C)]
1528#[derive(Debug, Copy, Clone)]
1529pub struct grpc_socket_mutator {
1530 _unused: [u8; 0],
1531}
1532#[repr(C)]
1533#[derive(Debug, Copy, Clone)]
1534pub struct grpc_socket_factory {
1535 _unused: [u8; 0],
1536}
1537#[repr(u32)]
1538#[doc = " Type specifier for grpc_arg"]
1539#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
1540pub enum grpc_arg_type {
1541 GRPC_ARG_STRING = 0,
1542 GRPC_ARG_INTEGER = 1,
1543 GRPC_ARG_POINTER = 2,
1544}
1545#[repr(C)]
1546#[derive(Debug, Copy, Clone)]
1547pub struct grpc_arg_pointer_vtable {
1548 pub copy: ::std::option::Option<
1549 unsafe extern "C" fn(p: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_void,
1550 >,
1551 pub destroy: ::std::option::Option<unsafe extern "C" fn(p: *mut ::std::os::raw::c_void)>,
1552 pub cmp: ::std::option::Option<
1553 unsafe extern "C" fn(
1554 p: *mut ::std::os::raw::c_void,
1555 q: *mut ::std::os::raw::c_void,
1556 ) -> ::std::os::raw::c_int,
1557 >,
1558}
1559#[test]
1560fn bindgen_test_layout_grpc_arg_pointer_vtable() {
1561 assert_eq!(
1562 ::std::mem::size_of::<grpc_arg_pointer_vtable>(),
1563 24usize,
1564 concat!("Size of: ", stringify!(grpc_arg_pointer_vtable))
1565 );
1566 assert_eq!(
1567 ::std::mem::align_of::<grpc_arg_pointer_vtable>(),
1568 8usize,
1569 concat!("Alignment of ", stringify!(grpc_arg_pointer_vtable))
1570 );
1571 assert_eq!(
1572 unsafe { &(*(::std::ptr::null::<grpc_arg_pointer_vtable>())).copy as *const _ as usize },
1573 0usize,
1574 concat!(
1575 "Offset of field: ",
1576 stringify!(grpc_arg_pointer_vtable),
1577 "::",
1578 stringify!(copy)
1579 )
1580 );
1581 assert_eq!(
1582 unsafe { &(*(::std::ptr::null::<grpc_arg_pointer_vtable>())).destroy as *const _ as usize },
1583 8usize,
1584 concat!(
1585 "Offset of field: ",
1586 stringify!(grpc_arg_pointer_vtable),
1587 "::",
1588 stringify!(destroy)
1589 )
1590 );
1591 assert_eq!(
1592 unsafe { &(*(::std::ptr::null::<grpc_arg_pointer_vtable>())).cmp as *const _ as usize },
1593 16usize,
1594 concat!(
1595 "Offset of field: ",
1596 stringify!(grpc_arg_pointer_vtable),
1597 "::",
1598 stringify!(cmp)
1599 )
1600 );
1601}
1602#[doc = " A single argument... each argument has a key and a value"]
1603#[doc = ""]
1604#[doc = "A note on naming keys:"]
1605#[doc = "Keys are namespaced into groups, usually grouped by library, and are"]
1606#[doc = "keys for module XYZ are named XYZ.key1, XYZ.key2, etc. Module names must"]
1607#[doc = "be restricted to the regex [A-Za-z][_A-Za-z0-9]{,15}."]
1608#[doc = "Key names must be restricted to the regex [A-Za-z][_A-Za-z0-9]{,47}."]
1609#[doc = ""]
1610#[doc = "GRPC core library keys are prefixed by grpc."]
1611#[doc = ""]
1612#[doc = "Library authors are strongly encouraged to \\#define symbolic constants for"]
1613#[doc = "their keys so that it's possible to change them in the future."]
1614#[repr(C)]
1615#[derive(Copy, Clone)]
1616pub struct grpc_arg {
1617 pub type_: grpc_arg_type,
1618 pub key: *mut ::std::os::raw::c_char,
1619 pub value: grpc_arg_grpc_arg_value,
1620}
1621#[repr(C)]
1622#[derive(Copy, Clone)]
1623pub union grpc_arg_grpc_arg_value {
1624 pub string: *mut ::std::os::raw::c_char,
1625 pub integer: ::std::os::raw::c_int,
1626 pub pointer: grpc_arg_grpc_arg_value_grpc_arg_pointer,
1627 _bindgen_union_align: [u64; 2usize],
1628}
1629#[repr(C)]
1630#[derive(Debug, Copy, Clone)]
1631pub struct grpc_arg_grpc_arg_value_grpc_arg_pointer {
1632 pub p: *mut ::std::os::raw::c_void,
1633 pub vtable: *const grpc_arg_pointer_vtable,
1634}
1635#[test]
1636fn bindgen_test_layout_grpc_arg_grpc_arg_value_grpc_arg_pointer() {
1637 assert_eq!(
1638 ::std::mem::size_of::<grpc_arg_grpc_arg_value_grpc_arg_pointer>(),
1639 16usize,
1640 concat!(
1641 "Size of: ",
1642 stringify!(grpc_arg_grpc_arg_value_grpc_arg_pointer)
1643 )
1644 );
1645 assert_eq!(
1646 ::std::mem::align_of::<grpc_arg_grpc_arg_value_grpc_arg_pointer>(),
1647 8usize,
1648 concat!(
1649 "Alignment of ",
1650 stringify!(grpc_arg_grpc_arg_value_grpc_arg_pointer)
1651 )
1652 );
1653 assert_eq!(
1654 unsafe {
1655 &(*(::std::ptr::null::<grpc_arg_grpc_arg_value_grpc_arg_pointer>())).p as *const _
1656 as usize
1657 },
1658 0usize,
1659 concat!(
1660 "Offset of field: ",
1661 stringify!(grpc_arg_grpc_arg_value_grpc_arg_pointer),
1662 "::",
1663 stringify!(p)
1664 )
1665 );
1666 assert_eq!(
1667 unsafe {
1668 &(*(::std::ptr::null::<grpc_arg_grpc_arg_value_grpc_arg_pointer>())).vtable as *const _
1669 as usize
1670 },
1671 8usize,
1672 concat!(
1673 "Offset of field: ",
1674 stringify!(grpc_arg_grpc_arg_value_grpc_arg_pointer),
1675 "::",
1676 stringify!(vtable)
1677 )
1678 );
1679}
1680#[test]
1681fn bindgen_test_layout_grpc_arg_grpc_arg_value() {
1682 assert_eq!(
1683 ::std::mem::size_of::<grpc_arg_grpc_arg_value>(),
1684 16usize,
1685 concat!("Size of: ", stringify!(grpc_arg_grpc_arg_value))
1686 );
1687 assert_eq!(
1688 ::std::mem::align_of::<grpc_arg_grpc_arg_value>(),
1689 8usize,
1690 concat!("Alignment of ", stringify!(grpc_arg_grpc_arg_value))
1691 );
1692 assert_eq!(
1693 unsafe { &(*(::std::ptr::null::<grpc_arg_grpc_arg_value>())).string as *const _ as usize },
1694 0usize,
1695 concat!(
1696 "Offset of field: ",
1697 stringify!(grpc_arg_grpc_arg_value),
1698 "::",
1699 stringify!(string)
1700 )
1701 );
1702 assert_eq!(
1703 unsafe { &(*(::std::ptr::null::<grpc_arg_grpc_arg_value>())).integer as *const _ as usize },
1704 0usize,
1705 concat!(
1706 "Offset of field: ",
1707 stringify!(grpc_arg_grpc_arg_value),
1708 "::",
1709 stringify!(integer)
1710 )
1711 );
1712 assert_eq!(
1713 unsafe { &(*(::std::ptr::null::<grpc_arg_grpc_arg_value>())).pointer as *const _ as usize },
1714 0usize,
1715 concat!(
1716 "Offset of field: ",
1717 stringify!(grpc_arg_grpc_arg_value),
1718 "::",
1719 stringify!(pointer)
1720 )
1721 );
1722}
1723impl ::std::fmt::Debug for grpc_arg_grpc_arg_value {
1724 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1725 write!(f, "grpc_arg_grpc_arg_value {{ union }}")
1726 }
1727}
1728#[test]
1729fn bindgen_test_layout_grpc_arg() {
1730 assert_eq!(
1731 ::std::mem::size_of::<grpc_arg>(),
1732 32usize,
1733 concat!("Size of: ", stringify!(grpc_arg))
1734 );
1735 assert_eq!(
1736 ::std::mem::align_of::<grpc_arg>(),
1737 8usize,
1738 concat!("Alignment of ", stringify!(grpc_arg))
1739 );
1740 assert_eq!(
1741 unsafe { &(*(::std::ptr::null::<grpc_arg>())).type_ as *const _ as usize },
1742 0usize,
1743 concat!(
1744 "Offset of field: ",
1745 stringify!(grpc_arg),
1746 "::",
1747 stringify!(type_)
1748 )
1749 );
1750 assert_eq!(
1751 unsafe { &(*(::std::ptr::null::<grpc_arg>())).key as *const _ as usize },
1752 8usize,
1753 concat!(
1754 "Offset of field: ",
1755 stringify!(grpc_arg),
1756 "::",
1757 stringify!(key)
1758 )
1759 );
1760 assert_eq!(
1761 unsafe { &(*(::std::ptr::null::<grpc_arg>())).value as *const _ as usize },
1762 16usize,
1763 concat!(
1764 "Offset of field: ",
1765 stringify!(grpc_arg),
1766 "::",
1767 stringify!(value)
1768 )
1769 );
1770}
1771impl ::std::fmt::Debug for grpc_arg {
1772 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1773 write!(
1774 f,
1775 "grpc_arg {{ type: {:?}, key: {:?}, value: {:?} }}",
1776 self.type_, self.key, self.value
1777 )
1778 }
1779}
1780#[doc = " An array of arguments that can be passed around."]
1781#[doc = ""]
1782#[doc = "Used to set optional channel-level configuration."]
1783#[doc = "These configuration options are modelled as key-value pairs as defined"]
1784#[doc = "by grpc_arg; keys are strings to allow easy backwards-compatible extension"]
1785#[doc = "by arbitrary parties. All evaluation is performed at channel creation"]
1786#[doc = "time (i.e. the keys and values in this structure need only live through the"]
1787#[doc = "creation invocation)."]
1788#[doc = ""]
1789#[doc = "However, if one of the args has grpc_arg_type==GRPC_ARG_POINTER, then the"]
1790#[doc = "grpc_arg_pointer_vtable must live until the channel args are done being"]
1791#[doc = "used by core (i.e. when the object for use with which they were passed"]
1792#[doc = "is destroyed)."]
1793#[doc = ""]
1794#[doc = "See the description of the \\ref grpc_arg_keys \"available args\" for more"]
1795#[doc = "details."]
1796#[repr(C)]
1797#[derive(Debug, Copy, Clone)]
1798pub struct grpc_channel_args {
1799 pub num_args: usize,
1800 pub args: *mut grpc_arg,
1801}
1802#[test]
1803fn bindgen_test_layout_grpc_channel_args() {
1804 assert_eq!(
1805 ::std::mem::size_of::<grpc_channel_args>(),
1806 16usize,
1807 concat!("Size of: ", stringify!(grpc_channel_args))
1808 );
1809 assert_eq!(
1810 ::std::mem::align_of::<grpc_channel_args>(),
1811 8usize,
1812 concat!("Alignment of ", stringify!(grpc_channel_args))
1813 );
1814 assert_eq!(
1815 unsafe { &(*(::std::ptr::null::<grpc_channel_args>())).num_args as *const _ as usize },
1816 0usize,
1817 concat!(
1818 "Offset of field: ",
1819 stringify!(grpc_channel_args),
1820 "::",
1821 stringify!(num_args)
1822 )
1823 );
1824 assert_eq!(
1825 unsafe { &(*(::std::ptr::null::<grpc_channel_args>())).args as *const _ as usize },
1826 8usize,
1827 concat!(
1828 "Offset of field: ",
1829 stringify!(grpc_channel_args),
1830 "::",
1831 stringify!(args)
1832 )
1833 );
1834}
1835#[repr(u32)]
1836#[doc = " Result of a grpc call. If the caller satisfies the prerequisites of a"]
1837#[doc = "particular operation, the grpc_call_error returned will be GRPC_CALL_OK."]
1838#[doc = "Receiving any other value listed here is an indication of a bug in the"]
1839#[doc = "caller."]
1840#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
1841pub enum grpc_call_error {
1842 #[doc = " everything went ok"]
1843 GRPC_CALL_OK = 0,
1844 #[doc = " something failed, we don't know what"]
1845 GRPC_CALL_ERROR = 1,
1846 #[doc = " this method is not available on the server"]
1847 GRPC_CALL_ERROR_NOT_ON_SERVER = 2,
1848 #[doc = " this method is not available on the client"]
1849 GRPC_CALL_ERROR_NOT_ON_CLIENT = 3,
1850 #[doc = " this method must be called before server_accept"]
1851 GRPC_CALL_ERROR_ALREADY_ACCEPTED = 4,
1852 #[doc = " this method must be called before invoke"]
1853 GRPC_CALL_ERROR_ALREADY_INVOKED = 5,
1854 #[doc = " this method must be called after invoke"]
1855 GRPC_CALL_ERROR_NOT_INVOKED = 6,
1856 #[doc = " this call is already finished"]
1857 #[doc = "(writes_done or write_status has already been called)"]
1858 GRPC_CALL_ERROR_ALREADY_FINISHED = 7,
1859 #[doc = " there is already an outstanding read/write operation on the call"]
1860 GRPC_CALL_ERROR_TOO_MANY_OPERATIONS = 8,
1861 #[doc = " the flags value was illegal for this call"]
1862 GRPC_CALL_ERROR_INVALID_FLAGS = 9,
1863 #[doc = " invalid metadata was passed to this call"]
1864 GRPC_CALL_ERROR_INVALID_METADATA = 10,
1865 #[doc = " invalid message was passed to this call"]
1866 GRPC_CALL_ERROR_INVALID_MESSAGE = 11,
1867 #[doc = " completion queue for notification has not been registered"]
1868 #[doc = " with the server"]
1869 GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE = 12,
1870 #[doc = " this batch of operations leads to more operations than allowed"]
1871 GRPC_CALL_ERROR_BATCH_TOO_BIG = 13,
1872 #[doc = " payload type requested is not the type registered"]
1873 GRPC_CALL_ERROR_PAYLOAD_TYPE_MISMATCH = 14,
1874 #[doc = " completion queue has been shutdown"]
1875 GRPC_CALL_ERROR_COMPLETION_QUEUE_SHUTDOWN = 15,
1876}
1877#[doc = " A single metadata element"]
1878#[repr(C)]
1879#[derive(Copy, Clone)]
1880pub struct grpc_metadata {
1881 #[doc = " the key, value values are expected to line up with grpc_mdelem: if"]
1882 #[doc = "changing them, update metadata.h at the same time."]
1883 pub key: grpc_slice,
1884 pub value: grpc_slice,
1885 pub flags: u32,
1886 pub internal_data: grpc_metadata__bindgen_ty_1,
1887}
1888#[doc = " The following fields are reserved for grpc internal use."]
1889#[doc = "There is no need to initialize them, and they will be set to garbage"]
1890#[doc = "during calls to grpc."]
1891#[repr(C)]
1892#[derive(Debug, Copy, Clone)]
1893pub struct grpc_metadata__bindgen_ty_1 {
1894 pub obfuscated: [*mut ::std::os::raw::c_void; 4usize],
1895}
1896#[test]
1897fn bindgen_test_layout_grpc_metadata__bindgen_ty_1() {
1898 assert_eq!(
1899 ::std::mem::size_of::<grpc_metadata__bindgen_ty_1>(),
1900 32usize,
1901 concat!("Size of: ", stringify!(grpc_metadata__bindgen_ty_1))
1902 );
1903 assert_eq!(
1904 ::std::mem::align_of::<grpc_metadata__bindgen_ty_1>(),
1905 8usize,
1906 concat!("Alignment of ", stringify!(grpc_metadata__bindgen_ty_1))
1907 );
1908 assert_eq!(
1909 unsafe {
1910 &(*(::std::ptr::null::<grpc_metadata__bindgen_ty_1>())).obfuscated as *const _ as usize
1911 },
1912 0usize,
1913 concat!(
1914 "Offset of field: ",
1915 stringify!(grpc_metadata__bindgen_ty_1),
1916 "::",
1917 stringify!(obfuscated)
1918 )
1919 );
1920}
1921#[test]
1922fn bindgen_test_layout_grpc_metadata() {
1923 assert_eq!(
1924 ::std::mem::size_of::<grpc_metadata>(),
1925 104usize,
1926 concat!("Size of: ", stringify!(grpc_metadata))
1927 );
1928 assert_eq!(
1929 ::std::mem::align_of::<grpc_metadata>(),
1930 8usize,
1931 concat!("Alignment of ", stringify!(grpc_metadata))
1932 );
1933 assert_eq!(
1934 unsafe { &(*(::std::ptr::null::<grpc_metadata>())).key as *const _ as usize },
1935 0usize,
1936 concat!(
1937 "Offset of field: ",
1938 stringify!(grpc_metadata),
1939 "::",
1940 stringify!(key)
1941 )
1942 );
1943 assert_eq!(
1944 unsafe { &(*(::std::ptr::null::<grpc_metadata>())).value as *const _ as usize },
1945 32usize,
1946 concat!(
1947 "Offset of field: ",
1948 stringify!(grpc_metadata),
1949 "::",
1950 stringify!(value)
1951 )
1952 );
1953 assert_eq!(
1954 unsafe { &(*(::std::ptr::null::<grpc_metadata>())).flags as *const _ as usize },
1955 64usize,
1956 concat!(
1957 "Offset of field: ",
1958 stringify!(grpc_metadata),
1959 "::",
1960 stringify!(flags)
1961 )
1962 );
1963 assert_eq!(
1964 unsafe { &(*(::std::ptr::null::<grpc_metadata>())).internal_data as *const _ as usize },
1965 72usize,
1966 concat!(
1967 "Offset of field: ",
1968 stringify!(grpc_metadata),
1969 "::",
1970 stringify!(internal_data)
1971 )
1972 );
1973}
1974impl ::std::fmt::Debug for grpc_metadata {
1975 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1976 write!(
1977 f,
1978 "grpc_metadata {{ key: {:?}, value: {:?}, flags: {:?}, internal_data: {:?} }}",
1979 self.key, self.value, self.flags, self.internal_data
1980 )
1981 }
1982}
1983#[repr(u32)]
1984#[doc = " The type of completion (for grpc_event)"]
1985#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
1986pub enum grpc_completion_type {
1987 #[doc = " Shutting down"]
1988 GRPC_QUEUE_SHUTDOWN = 0,
1989 #[doc = " No event before timeout"]
1990 GRPC_QUEUE_TIMEOUT = 1,
1991 #[doc = " Operation completion"]
1992 GRPC_OP_COMPLETE = 2,
1993}
1994#[doc = " The result of an operation."]
1995#[doc = ""]
1996#[doc = "Returned by a completion queue when the operation started with tag."]
1997#[repr(C)]
1998#[derive(Debug, Copy, Clone)]
1999pub struct grpc_event {
2000 #[doc = " The type of the completion."]
2001 pub type_: grpc_completion_type,
2002 #[doc = " If the grpc_completion_type is GRPC_OP_COMPLETE, this field indicates"]
2003 #[doc = "whether the operation was successful or not; 0 in case of failure and"]
2004 #[doc = "non-zero in case of success."]
2005 #[doc = "If grpc_completion_type is GRPC_QUEUE_SHUTDOWN or GRPC_QUEUE_TIMEOUT, this"]
2006 #[doc = "field is guaranteed to be 0"]
2007 pub success: ::std::os::raw::c_int,
2008 #[doc = " The tag passed to grpc_call_start_batch etc to start this operation."]
2009 #[doc = "Only* GRPC_OP_COMPLETE has a tag. For all other grpc_completion_type"]
2010 #[doc = "values, tag is uninitialized."]
2011 pub tag: *mut ::std::os::raw::c_void,
2012}
2013#[test]
2014fn bindgen_test_layout_grpc_event() {
2015 assert_eq!(
2016 ::std::mem::size_of::<grpc_event>(),
2017 16usize,
2018 concat!("Size of: ", stringify!(grpc_event))
2019 );
2020 assert_eq!(
2021 ::std::mem::align_of::<grpc_event>(),
2022 8usize,
2023 concat!("Alignment of ", stringify!(grpc_event))
2024 );
2025 assert_eq!(
2026 unsafe { &(*(::std::ptr::null::<grpc_event>())).type_ as *const _ as usize },
2027 0usize,
2028 concat!(
2029 "Offset of field: ",
2030 stringify!(grpc_event),
2031 "::",
2032 stringify!(type_)
2033 )
2034 );
2035 assert_eq!(
2036 unsafe { &(*(::std::ptr::null::<grpc_event>())).success as *const _ as usize },
2037 4usize,
2038 concat!(
2039 "Offset of field: ",
2040 stringify!(grpc_event),
2041 "::",
2042 stringify!(success)
2043 )
2044 );
2045 assert_eq!(
2046 unsafe { &(*(::std::ptr::null::<grpc_event>())).tag as *const _ as usize },
2047 8usize,
2048 concat!(
2049 "Offset of field: ",
2050 stringify!(grpc_event),
2051 "::",
2052 stringify!(tag)
2053 )
2054 );
2055}
2056#[repr(C)]
2057#[derive(Debug, Copy, Clone)]
2058pub struct grpc_metadata_array {
2059 pub count: usize,
2060 pub capacity: usize,
2061 pub metadata: *mut grpc_metadata,
2062}
2063#[test]
2064fn bindgen_test_layout_grpc_metadata_array() {
2065 assert_eq!(
2066 ::std::mem::size_of::<grpc_metadata_array>(),
2067 24usize,
2068 concat!("Size of: ", stringify!(grpc_metadata_array))
2069 );
2070 assert_eq!(
2071 ::std::mem::align_of::<grpc_metadata_array>(),
2072 8usize,
2073 concat!("Alignment of ", stringify!(grpc_metadata_array))
2074 );
2075 assert_eq!(
2076 unsafe { &(*(::std::ptr::null::<grpc_metadata_array>())).count as *const _ as usize },
2077 0usize,
2078 concat!(
2079 "Offset of field: ",
2080 stringify!(grpc_metadata_array),
2081 "::",
2082 stringify!(count)
2083 )
2084 );
2085 assert_eq!(
2086 unsafe { &(*(::std::ptr::null::<grpc_metadata_array>())).capacity as *const _ as usize },
2087 8usize,
2088 concat!(
2089 "Offset of field: ",
2090 stringify!(grpc_metadata_array),
2091 "::",
2092 stringify!(capacity)
2093 )
2094 );
2095 assert_eq!(
2096 unsafe { &(*(::std::ptr::null::<grpc_metadata_array>())).metadata as *const _ as usize },
2097 16usize,
2098 concat!(
2099 "Offset of field: ",
2100 stringify!(grpc_metadata_array),
2101 "::",
2102 stringify!(metadata)
2103 )
2104 );
2105}
2106#[repr(C)]
2107#[derive(Copy, Clone)]
2108pub struct grpc_call_details {
2109 pub method: grpc_slice,
2110 pub host: grpc_slice,
2111 pub deadline: gpr_timespec,
2112 pub flags: u32,
2113 pub reserved: *mut ::std::os::raw::c_void,
2114}
2115#[test]
2116fn bindgen_test_layout_grpc_call_details() {
2117 assert_eq!(
2118 ::std::mem::size_of::<grpc_call_details>(),
2119 96usize,
2120 concat!("Size of: ", stringify!(grpc_call_details))
2121 );
2122 assert_eq!(
2123 ::std::mem::align_of::<grpc_call_details>(),
2124 8usize,
2125 concat!("Alignment of ", stringify!(grpc_call_details))
2126 );
2127 assert_eq!(
2128 unsafe { &(*(::std::ptr::null::<grpc_call_details>())).method as *const _ as usize },
2129 0usize,
2130 concat!(
2131 "Offset of field: ",
2132 stringify!(grpc_call_details),
2133 "::",
2134 stringify!(method)
2135 )
2136 );
2137 assert_eq!(
2138 unsafe { &(*(::std::ptr::null::<grpc_call_details>())).host as *const _ as usize },
2139 32usize,
2140 concat!(
2141 "Offset of field: ",
2142 stringify!(grpc_call_details),
2143 "::",
2144 stringify!(host)
2145 )
2146 );
2147 assert_eq!(
2148 unsafe { &(*(::std::ptr::null::<grpc_call_details>())).deadline as *const _ as usize },
2149 64usize,
2150 concat!(
2151 "Offset of field: ",
2152 stringify!(grpc_call_details),
2153 "::",
2154 stringify!(deadline)
2155 )
2156 );
2157 assert_eq!(
2158 unsafe { &(*(::std::ptr::null::<grpc_call_details>())).flags as *const _ as usize },
2159 80usize,
2160 concat!(
2161 "Offset of field: ",
2162 stringify!(grpc_call_details),
2163 "::",
2164 stringify!(flags)
2165 )
2166 );
2167 assert_eq!(
2168 unsafe { &(*(::std::ptr::null::<grpc_call_details>())).reserved as *const _ as usize },
2169 88usize,
2170 concat!(
2171 "Offset of field: ",
2172 stringify!(grpc_call_details),
2173 "::",
2174 stringify!(reserved)
2175 )
2176 );
2177}
2178impl ::std::fmt::Debug for grpc_call_details {
2179 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2180 write ! ( f , "grpc_call_details {{ method: {:?}, host: {:?}, deadline: {:?}, flags: {:?}, reserved: {:?} }}" , self . method , self . host , self . deadline , self . flags , self . reserved )
2181 }
2182}
2183#[repr(u32)]
2184#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
2185pub enum grpc_op_type {
2186 #[doc = " Send initial metadata: one and only one instance MUST be sent for each"]
2187 #[doc = "call, unless the call was cancelled - in which case this can be skipped."]
2188 #[doc = "This op completes after all bytes of metadata have been accepted by"]
2189 #[doc = "outgoing flow control."]
2190 GRPC_OP_SEND_INITIAL_METADATA = 0,
2191 #[doc = " Send a message: 0 or more of these operations can occur for each call."]
2192 #[doc = "This op completes after all bytes for the message have been accepted by"]
2193 #[doc = "outgoing flow control."]
2194 GRPC_OP_SEND_MESSAGE = 1,
2195 #[doc = " Send a close from the client: one and only one instance MUST be sent from"]
2196 #[doc = "the client, unless the call was cancelled - in which case this can be"]
2197 #[doc = "skipped. This op completes after all bytes for the call"]
2198 #[doc = "(including the close) have passed outgoing flow control."]
2199 GRPC_OP_SEND_CLOSE_FROM_CLIENT = 2,
2200 #[doc = " Send status from the server: one and only one instance MUST be sent from"]
2201 #[doc = "the server unless the call was cancelled - in which case this can be"]
2202 #[doc = "skipped. This op completes after all bytes for the call"]
2203 #[doc = "(including the status) have passed outgoing flow control."]
2204 GRPC_OP_SEND_STATUS_FROM_SERVER = 3,
2205 #[doc = " Receive initial metadata: one and only one MUST be made on the client,"]
2206 #[doc = "must not be made on the server."]
2207 #[doc = "This op completes after all initial metadata has been read from the"]
2208 #[doc = "peer."]
2209 GRPC_OP_RECV_INITIAL_METADATA = 4,
2210 #[doc = " Receive a message: 0 or more of these operations can occur for each call."]
2211 #[doc = "This op completes after all bytes of the received message have been"]
2212 #[doc = "read, or after a half-close has been received on this call."]
2213 GRPC_OP_RECV_MESSAGE = 5,
2214 #[doc = " Receive status on the client: one and only one must be made on the client."]
2215 #[doc = "This operation always succeeds, meaning ops paired with this operation"]
2216 #[doc = "will also appear to succeed, even though they may not have. In that case"]
2217 #[doc = "the status will indicate some failure."]
2218 #[doc = "This op completes after all activity on the call has completed."]
2219 GRPC_OP_RECV_STATUS_ON_CLIENT = 6,
2220 #[doc = " Receive close on the server: one and only one must be made on the"]
2221 #[doc = "server. This op completes after the close has been received by the"]
2222 #[doc = "server. This operation always succeeds, meaning ops paired with"]
2223 #[doc = "this operation will also appear to succeed, even though they may not"]
2224 #[doc = "have."]
2225 GRPC_OP_RECV_CLOSE_ON_SERVER = 7,
2226}
2227#[doc = " Operation data: one field for each op type (except SEND_CLOSE_FROM_CLIENT"]
2228#[doc = "which has no arguments)"]
2229#[repr(C)]
2230#[derive(Copy, Clone)]
2231pub struct grpc_op {
2232 #[doc = " Operation type, as defined by grpc_op_type"]
2233 pub op: grpc_op_type,
2234 #[doc = " Write flags bitset for grpc_begin_messages"]
2235 pub flags: u32,
2236 #[doc = " Reserved for future usage"]
2237 pub reserved: *mut ::std::os::raw::c_void,
2238 pub data: grpc_op_grpc_op_data,
2239}
2240#[repr(C)]
2241#[derive(Copy, Clone)]
2242pub union grpc_op_grpc_op_data {
2243 pub reserved: grpc_op_grpc_op_data__bindgen_ty_1,
2244 pub send_initial_metadata: grpc_op_grpc_op_data_grpc_op_send_initial_metadata,
2245 pub send_message: grpc_op_grpc_op_data_grpc_op_send_message,
2246 pub send_status_from_server: grpc_op_grpc_op_data_grpc_op_send_status_from_server,
2247 pub recv_initial_metadata: grpc_op_grpc_op_data_grpc_op_recv_initial_metadata,
2248 pub recv_message: grpc_op_grpc_op_data_grpc_op_recv_message,
2249 pub recv_status_on_client: grpc_op_grpc_op_data_grpc_op_recv_status_on_client,
2250 pub recv_close_on_server: grpc_op_grpc_op_data_grpc_op_recv_close_on_server,
2251 _bindgen_union_align: [u64; 8usize],
2252}
2253#[doc = " Reserved for future usage"]
2254#[repr(C)]
2255#[derive(Debug, Copy, Clone)]
2256pub struct grpc_op_grpc_op_data__bindgen_ty_1 {
2257 pub reserved: [*mut ::std::os::raw::c_void; 8usize],
2258}
2259#[test]
2260fn bindgen_test_layout_grpc_op_grpc_op_data__bindgen_ty_1() {
2261 assert_eq!(
2262 ::std::mem::size_of::<grpc_op_grpc_op_data__bindgen_ty_1>(),
2263 64usize,
2264 concat!("Size of: ", stringify!(grpc_op_grpc_op_data__bindgen_ty_1))
2265 );
2266 assert_eq!(
2267 ::std::mem::align_of::<grpc_op_grpc_op_data__bindgen_ty_1>(),
2268 8usize,
2269 concat!(
2270 "Alignment of ",
2271 stringify!(grpc_op_grpc_op_data__bindgen_ty_1)
2272 )
2273 );
2274 assert_eq!(
2275 unsafe {
2276 &(*(::std::ptr::null::<grpc_op_grpc_op_data__bindgen_ty_1>())).reserved as *const _
2277 as usize
2278 },
2279 0usize,
2280 concat!(
2281 "Offset of field: ",
2282 stringify!(grpc_op_grpc_op_data__bindgen_ty_1),
2283 "::",
2284 stringify!(reserved)
2285 )
2286 );
2287}
2288#[repr(C)]
2289#[derive(Debug, Copy, Clone)]
2290pub 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 , }
2291#[doc = " If \\a is_set, \\a compression_level will be used for the call."]
2292#[doc = " Otherwise, \\a compression_level won't be considered"]
2293#[repr(C)]
2294#[derive(Debug, Copy, Clone)]
2295pub struct grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level
2296{
2297 pub is_set: u8,
2298 pub level: grpc_compression_level,
2299}
2300#[test]
2301fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level(
2302) {
2303 assert_eq ! ( :: std :: mem :: size_of :: < grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level > ( ) , 8usize , concat ! ( "Size of: " , stringify ! ( grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level ) ) );
2304 assert_eq ! ( :: std :: mem :: align_of :: < grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level ) ) );
2305 assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level > ( ) ) ) . is_set as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level ) , "::" , stringify ! ( is_set ) ) );
2306 assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level > ( ) ) ) . level as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level ) , "::" , stringify ! ( level ) ) );
2307}
2308#[test]
2309fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_send_initial_metadata() {
2310 assert_eq!(
2311 ::std::mem::size_of::<grpc_op_grpc_op_data_grpc_op_send_initial_metadata>(),
2312 24usize,
2313 concat!(
2314 "Size of: ",
2315 stringify!(grpc_op_grpc_op_data_grpc_op_send_initial_metadata)
2316 )
2317 );
2318 assert_eq!(
2319 ::std::mem::align_of::<grpc_op_grpc_op_data_grpc_op_send_initial_metadata>(),
2320 8usize,
2321 concat!(
2322 "Alignment of ",
2323 stringify!(grpc_op_grpc_op_data_grpc_op_send_initial_metadata)
2324 )
2325 );
2326 assert_eq!(
2327 unsafe {
2328 &(*(::std::ptr::null::<grpc_op_grpc_op_data_grpc_op_send_initial_metadata>())).count
2329 as *const _ as usize
2330 },
2331 0usize,
2332 concat!(
2333 "Offset of field: ",
2334 stringify!(grpc_op_grpc_op_data_grpc_op_send_initial_metadata),
2335 "::",
2336 stringify!(count)
2337 )
2338 );
2339 assert_eq!(
2340 unsafe {
2341 &(*(::std::ptr::null::<grpc_op_grpc_op_data_grpc_op_send_initial_metadata>())).metadata
2342 as *const _ as usize
2343 },
2344 8usize,
2345 concat!(
2346 "Offset of field: ",
2347 stringify!(grpc_op_grpc_op_data_grpc_op_send_initial_metadata),
2348 "::",
2349 stringify!(metadata)
2350 )
2351 );
2352 assert_eq!(
2353 unsafe {
2354 &(*(::std::ptr::null::<grpc_op_grpc_op_data_grpc_op_send_initial_metadata>()))
2355 .maybe_compression_level as *const _ as usize
2356 },
2357 16usize,
2358 concat!(
2359 "Offset of field: ",
2360 stringify!(grpc_op_grpc_op_data_grpc_op_send_initial_metadata),
2361 "::",
2362 stringify!(maybe_compression_level)
2363 )
2364 );
2365}
2366#[repr(C)]
2367#[derive(Debug, Copy, Clone)]
2368pub struct grpc_op_grpc_op_data_grpc_op_send_message {
2369 #[doc = " This op takes ownership of the slices in send_message. After"]
2370 #[doc = " a call completes, the contents of send_message are not guaranteed"]
2371 #[doc = " and likely empty. The original owner should still call"]
2372 #[doc = " grpc_byte_buffer_destroy() on this object however."]
2373 pub send_message: *mut grpc_byte_buffer,
2374}
2375#[test]
2376fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_send_message() {
2377 assert_eq!(
2378 ::std::mem::size_of::<grpc_op_grpc_op_data_grpc_op_send_message>(),
2379 8usize,
2380 concat!(
2381 "Size of: ",
2382 stringify!(grpc_op_grpc_op_data_grpc_op_send_message)
2383 )
2384 );
2385 assert_eq!(
2386 ::std::mem::align_of::<grpc_op_grpc_op_data_grpc_op_send_message>(),
2387 8usize,
2388 concat!(
2389 "Alignment of ",
2390 stringify!(grpc_op_grpc_op_data_grpc_op_send_message)
2391 )
2392 );
2393 assert_eq!(
2394 unsafe {
2395 &(*(::std::ptr::null::<grpc_op_grpc_op_data_grpc_op_send_message>())).send_message
2396 as *const _ as usize
2397 },
2398 0usize,
2399 concat!(
2400 "Offset of field: ",
2401 stringify!(grpc_op_grpc_op_data_grpc_op_send_message),
2402 "::",
2403 stringify!(send_message)
2404 )
2405 );
2406}
2407#[repr(C)]
2408#[derive(Debug, Copy, Clone)]
2409pub struct grpc_op_grpc_op_data_grpc_op_send_status_from_server {
2410 pub trailing_metadata_count: usize,
2411 pub trailing_metadata: *mut grpc_metadata,
2412 pub status: grpc_status_code::Type,
2413 #[doc = " optional: set to NULL if no details need sending, non-NULL if they do"]
2414 #[doc = " pointer will not be retained past the start_batch call"]
2415 pub status_details: *mut grpc_slice,
2416}
2417#[test]
2418fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_send_status_from_server() {
2419 assert_eq!(
2420 ::std::mem::size_of::<grpc_op_grpc_op_data_grpc_op_send_status_from_server>(),
2421 32usize,
2422 concat!(
2423 "Size of: ",
2424 stringify!(grpc_op_grpc_op_data_grpc_op_send_status_from_server)
2425 )
2426 );
2427 assert_eq!(
2428 ::std::mem::align_of::<grpc_op_grpc_op_data_grpc_op_send_status_from_server>(),
2429 8usize,
2430 concat!(
2431 "Alignment of ",
2432 stringify!(grpc_op_grpc_op_data_grpc_op_send_status_from_server)
2433 )
2434 );
2435 assert_eq!(
2436 unsafe {
2437 &(*(::std::ptr::null::<grpc_op_grpc_op_data_grpc_op_send_status_from_server>()))
2438 .trailing_metadata_count as *const _ as usize
2439 },
2440 0usize,
2441 concat!(
2442 "Offset of field: ",
2443 stringify!(grpc_op_grpc_op_data_grpc_op_send_status_from_server),
2444 "::",
2445 stringify!(trailing_metadata_count)
2446 )
2447 );
2448 assert_eq!(
2449 unsafe {
2450 &(*(::std::ptr::null::<grpc_op_grpc_op_data_grpc_op_send_status_from_server>()))
2451 .trailing_metadata as *const _ as usize
2452 },
2453 8usize,
2454 concat!(
2455 "Offset of field: ",
2456 stringify!(grpc_op_grpc_op_data_grpc_op_send_status_from_server),
2457 "::",
2458 stringify!(trailing_metadata)
2459 )
2460 );
2461 assert_eq!(
2462 unsafe {
2463 &(*(::std::ptr::null::<grpc_op_grpc_op_data_grpc_op_send_status_from_server>())).status
2464 as *const _ as usize
2465 },
2466 16usize,
2467 concat!(
2468 "Offset of field: ",
2469 stringify!(grpc_op_grpc_op_data_grpc_op_send_status_from_server),
2470 "::",
2471 stringify!(status)
2472 )
2473 );
2474 assert_eq!(
2475 unsafe {
2476 &(*(::std::ptr::null::<grpc_op_grpc_op_data_grpc_op_send_status_from_server>()))
2477 .status_details as *const _ as usize
2478 },
2479 24usize,
2480 concat!(
2481 "Offset of field: ",
2482 stringify!(grpc_op_grpc_op_data_grpc_op_send_status_from_server),
2483 "::",
2484 stringify!(status_details)
2485 )
2486 );
2487}
2488#[doc = " ownership of the array is with the caller, but ownership of the elements"]
2489#[doc = "stays with the call object (ie key, value members are owned by the call"]
2490#[doc = "object, recv_initial_metadata->array is owned by the caller)."]
2491#[doc = "After the operation completes, call grpc_metadata_array_destroy on this"]
2492#[doc = "value, or reuse it in a future op."]
2493#[repr(C)]
2494#[derive(Debug, Copy, Clone)]
2495pub struct grpc_op_grpc_op_data_grpc_op_recv_initial_metadata {
2496 pub recv_initial_metadata: *mut grpc_metadata_array,
2497}
2498#[test]
2499fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_recv_initial_metadata() {
2500 assert_eq!(
2501 ::std::mem::size_of::<grpc_op_grpc_op_data_grpc_op_recv_initial_metadata>(),
2502 8usize,
2503 concat!(
2504 "Size of: ",
2505 stringify!(grpc_op_grpc_op_data_grpc_op_recv_initial_metadata)
2506 )
2507 );
2508 assert_eq!(
2509 ::std::mem::align_of::<grpc_op_grpc_op_data_grpc_op_recv_initial_metadata>(),
2510 8usize,
2511 concat!(
2512 "Alignment of ",
2513 stringify!(grpc_op_grpc_op_data_grpc_op_recv_initial_metadata)
2514 )
2515 );
2516 assert_eq!(
2517 unsafe {
2518 &(*(::std::ptr::null::<grpc_op_grpc_op_data_grpc_op_recv_initial_metadata>()))
2519 .recv_initial_metadata as *const _ as usize
2520 },
2521 0usize,
2522 concat!(
2523 "Offset of field: ",
2524 stringify!(grpc_op_grpc_op_data_grpc_op_recv_initial_metadata),
2525 "::",
2526 stringify!(recv_initial_metadata)
2527 )
2528 );
2529}
2530#[doc = " ownership of the byte buffer is moved to the caller; the caller must"]
2531#[doc = "call grpc_byte_buffer_destroy on this value, or reuse it in a future op."]
2532#[doc = "The returned byte buffer will be NULL if trailing metadata was"]
2533#[doc = "received instead of a message."]
2534#[repr(C)]
2535#[derive(Debug, Copy, Clone)]
2536pub struct grpc_op_grpc_op_data_grpc_op_recv_message {
2537 pub recv_message: *mut *mut grpc_byte_buffer,
2538}
2539#[test]
2540fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_recv_message() {
2541 assert_eq!(
2542 ::std::mem::size_of::<grpc_op_grpc_op_data_grpc_op_recv_message>(),
2543 8usize,
2544 concat!(
2545 "Size of: ",
2546 stringify!(grpc_op_grpc_op_data_grpc_op_recv_message)
2547 )
2548 );
2549 assert_eq!(
2550 ::std::mem::align_of::<grpc_op_grpc_op_data_grpc_op_recv_message>(),
2551 8usize,
2552 concat!(
2553 "Alignment of ",
2554 stringify!(grpc_op_grpc_op_data_grpc_op_recv_message)
2555 )
2556 );
2557 assert_eq!(
2558 unsafe {
2559 &(*(::std::ptr::null::<grpc_op_grpc_op_data_grpc_op_recv_message>())).recv_message
2560 as *const _ as usize
2561 },
2562 0usize,
2563 concat!(
2564 "Offset of field: ",
2565 stringify!(grpc_op_grpc_op_data_grpc_op_recv_message),
2566 "::",
2567 stringify!(recv_message)
2568 )
2569 );
2570}
2571#[repr(C)]
2572#[derive(Debug, Copy, Clone)]
2573pub struct grpc_op_grpc_op_data_grpc_op_recv_status_on_client {
2574 #[doc = " ownership of the array is with the caller, but ownership of the"]
2575 #[doc = "elements stays with the call object (ie key, value members are owned"]
2576 #[doc = "by the call object, trailing_metadata->array is owned by the caller)."]
2577 #[doc = "After the operation completes, call grpc_metadata_array_destroy on"]
2578 #[doc = "this value, or reuse it in a future op."]
2579 pub trailing_metadata: *mut grpc_metadata_array,
2580 pub status: *mut grpc_status_code::Type,
2581 pub status_details: *mut grpc_slice,
2582 #[doc = " If this is not nullptr, it will be populated with the full fidelity"]
2583 #[doc = " error string for debugging purposes. The application is responsible"]
2584 #[doc = " for freeing the data by using gpr_free()."]
2585 pub error_string: *mut *const ::std::os::raw::c_char,
2586}
2587#[test]
2588fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_recv_status_on_client() {
2589 assert_eq!(
2590 ::std::mem::size_of::<grpc_op_grpc_op_data_grpc_op_recv_status_on_client>(),
2591 32usize,
2592 concat!(
2593 "Size of: ",
2594 stringify!(grpc_op_grpc_op_data_grpc_op_recv_status_on_client)
2595 )
2596 );
2597 assert_eq!(
2598 ::std::mem::align_of::<grpc_op_grpc_op_data_grpc_op_recv_status_on_client>(),
2599 8usize,
2600 concat!(
2601 "Alignment of ",
2602 stringify!(grpc_op_grpc_op_data_grpc_op_recv_status_on_client)
2603 )
2604 );
2605 assert_eq!(
2606 unsafe {
2607 &(*(::std::ptr::null::<grpc_op_grpc_op_data_grpc_op_recv_status_on_client>()))
2608 .trailing_metadata as *const _ as usize
2609 },
2610 0usize,
2611 concat!(
2612 "Offset of field: ",
2613 stringify!(grpc_op_grpc_op_data_grpc_op_recv_status_on_client),
2614 "::",
2615 stringify!(trailing_metadata)
2616 )
2617 );
2618 assert_eq!(
2619 unsafe {
2620 &(*(::std::ptr::null::<grpc_op_grpc_op_data_grpc_op_recv_status_on_client>())).status
2621 as *const _ as usize
2622 },
2623 8usize,
2624 concat!(
2625 "Offset of field: ",
2626 stringify!(grpc_op_grpc_op_data_grpc_op_recv_status_on_client),
2627 "::",
2628 stringify!(status)
2629 )
2630 );
2631 assert_eq!(
2632 unsafe {
2633 &(*(::std::ptr::null::<grpc_op_grpc_op_data_grpc_op_recv_status_on_client>()))
2634 .status_details as *const _ as usize
2635 },
2636 16usize,
2637 concat!(
2638 "Offset of field: ",
2639 stringify!(grpc_op_grpc_op_data_grpc_op_recv_status_on_client),
2640 "::",
2641 stringify!(status_details)
2642 )
2643 );
2644 assert_eq!(
2645 unsafe {
2646 &(*(::std::ptr::null::<grpc_op_grpc_op_data_grpc_op_recv_status_on_client>()))
2647 .error_string as *const _ as usize
2648 },
2649 24usize,
2650 concat!(
2651 "Offset of field: ",
2652 stringify!(grpc_op_grpc_op_data_grpc_op_recv_status_on_client),
2653 "::",
2654 stringify!(error_string)
2655 )
2656 );
2657}
2658#[repr(C)]
2659#[derive(Debug, Copy, Clone)]
2660pub struct grpc_op_grpc_op_data_grpc_op_recv_close_on_server {
2661 #[doc = " out argument, set to 1 if the call failed in any way (seen as a"]
2662 #[doc = "cancellation on the server), or 0 if the call succeeded"]
2663 pub cancelled: *mut ::std::os::raw::c_int,
2664}
2665#[test]
2666fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_recv_close_on_server() {
2667 assert_eq!(
2668 ::std::mem::size_of::<grpc_op_grpc_op_data_grpc_op_recv_close_on_server>(),
2669 8usize,
2670 concat!(
2671 "Size of: ",
2672 stringify!(grpc_op_grpc_op_data_grpc_op_recv_close_on_server)
2673 )
2674 );
2675 assert_eq!(
2676 ::std::mem::align_of::<grpc_op_grpc_op_data_grpc_op_recv_close_on_server>(),
2677 8usize,
2678 concat!(
2679 "Alignment of ",
2680 stringify!(grpc_op_grpc_op_data_grpc_op_recv_close_on_server)
2681 )
2682 );
2683 assert_eq!(
2684 unsafe {
2685 &(*(::std::ptr::null::<grpc_op_grpc_op_data_grpc_op_recv_close_on_server>())).cancelled
2686 as *const _ as usize
2687 },
2688 0usize,
2689 concat!(
2690 "Offset of field: ",
2691 stringify!(grpc_op_grpc_op_data_grpc_op_recv_close_on_server),
2692 "::",
2693 stringify!(cancelled)
2694 )
2695 );
2696}
2697#[test]
2698fn bindgen_test_layout_grpc_op_grpc_op_data() {
2699 assert_eq!(
2700 ::std::mem::size_of::<grpc_op_grpc_op_data>(),
2701 64usize,
2702 concat!("Size of: ", stringify!(grpc_op_grpc_op_data))
2703 );
2704 assert_eq!(
2705 ::std::mem::align_of::<grpc_op_grpc_op_data>(),
2706 8usize,
2707 concat!("Alignment of ", stringify!(grpc_op_grpc_op_data))
2708 );
2709 assert_eq!(
2710 unsafe { &(*(::std::ptr::null::<grpc_op_grpc_op_data>())).reserved as *const _ as usize },
2711 0usize,
2712 concat!(
2713 "Offset of field: ",
2714 stringify!(grpc_op_grpc_op_data),
2715 "::",
2716 stringify!(reserved)
2717 )
2718 );
2719 assert_eq!(
2720 unsafe {
2721 &(*(::std::ptr::null::<grpc_op_grpc_op_data>())).send_initial_metadata as *const _
2722 as usize
2723 },
2724 0usize,
2725 concat!(
2726 "Offset of field: ",
2727 stringify!(grpc_op_grpc_op_data),
2728 "::",
2729 stringify!(send_initial_metadata)
2730 )
2731 );
2732 assert_eq!(
2733 unsafe {
2734 &(*(::std::ptr::null::<grpc_op_grpc_op_data>())).send_message as *const _ as usize
2735 },
2736 0usize,
2737 concat!(
2738 "Offset of field: ",
2739 stringify!(grpc_op_grpc_op_data),
2740 "::",
2741 stringify!(send_message)
2742 )
2743 );
2744 assert_eq!(
2745 unsafe {
2746 &(*(::std::ptr::null::<grpc_op_grpc_op_data>())).send_status_from_server as *const _
2747 as usize
2748 },
2749 0usize,
2750 concat!(
2751 "Offset of field: ",
2752 stringify!(grpc_op_grpc_op_data),
2753 "::",
2754 stringify!(send_status_from_server)
2755 )
2756 );
2757 assert_eq!(
2758 unsafe {
2759 &(*(::std::ptr::null::<grpc_op_grpc_op_data>())).recv_initial_metadata as *const _
2760 as usize
2761 },
2762 0usize,
2763 concat!(
2764 "Offset of field: ",
2765 stringify!(grpc_op_grpc_op_data),
2766 "::",
2767 stringify!(recv_initial_metadata)
2768 )
2769 );
2770 assert_eq!(
2771 unsafe {
2772 &(*(::std::ptr::null::<grpc_op_grpc_op_data>())).recv_message as *const _ as usize
2773 },
2774 0usize,
2775 concat!(
2776 "Offset of field: ",
2777 stringify!(grpc_op_grpc_op_data),
2778 "::",
2779 stringify!(recv_message)
2780 )
2781 );
2782 assert_eq!(
2783 unsafe {
2784 &(*(::std::ptr::null::<grpc_op_grpc_op_data>())).recv_status_on_client as *const _
2785 as usize
2786 },
2787 0usize,
2788 concat!(
2789 "Offset of field: ",
2790 stringify!(grpc_op_grpc_op_data),
2791 "::",
2792 stringify!(recv_status_on_client)
2793 )
2794 );
2795 assert_eq!(
2796 unsafe {
2797 &(*(::std::ptr::null::<grpc_op_grpc_op_data>())).recv_close_on_server as *const _
2798 as usize
2799 },
2800 0usize,
2801 concat!(
2802 "Offset of field: ",
2803 stringify!(grpc_op_grpc_op_data),
2804 "::",
2805 stringify!(recv_close_on_server)
2806 )
2807 );
2808}
2809impl ::std::fmt::Debug for grpc_op_grpc_op_data {
2810 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2811 write!(f, "grpc_op_grpc_op_data {{ union }}")
2812 }
2813}
2814#[test]
2815fn bindgen_test_layout_grpc_op() {
2816 assert_eq!(
2817 ::std::mem::size_of::<grpc_op>(),
2818 80usize,
2819 concat!("Size of: ", stringify!(grpc_op))
2820 );
2821 assert_eq!(
2822 ::std::mem::align_of::<grpc_op>(),
2823 8usize,
2824 concat!("Alignment of ", stringify!(grpc_op))
2825 );
2826 assert_eq!(
2827 unsafe { &(*(::std::ptr::null::<grpc_op>())).op as *const _ as usize },
2828 0usize,
2829 concat!(
2830 "Offset of field: ",
2831 stringify!(grpc_op),
2832 "::",
2833 stringify!(op)
2834 )
2835 );
2836 assert_eq!(
2837 unsafe { &(*(::std::ptr::null::<grpc_op>())).flags as *const _ as usize },
2838 4usize,
2839 concat!(
2840 "Offset of field: ",
2841 stringify!(grpc_op),
2842 "::",
2843 stringify!(flags)
2844 )
2845 );
2846 assert_eq!(
2847 unsafe { &(*(::std::ptr::null::<grpc_op>())).reserved as *const _ as usize },
2848 8usize,
2849 concat!(
2850 "Offset of field: ",
2851 stringify!(grpc_op),
2852 "::",
2853 stringify!(reserved)
2854 )
2855 );
2856 assert_eq!(
2857 unsafe { &(*(::std::ptr::null::<grpc_op>())).data as *const _ as usize },
2858 16usize,
2859 concat!(
2860 "Offset of field: ",
2861 stringify!(grpc_op),
2862 "::",
2863 stringify!(data)
2864 )
2865 );
2866}
2867impl ::std::fmt::Debug for grpc_op {
2868 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2869 write!(
2870 f,
2871 "grpc_op {{ op: {:?}, flags: {:?}, reserved: {:?}, data: {:?} }}",
2872 self.op, self.flags, self.reserved, self.data
2873 )
2874 }
2875}
2876#[doc = " Information requested from the channel."]
2877#[repr(C)]
2878#[derive(Debug, Copy, Clone)]
2879pub struct grpc_channel_info {
2880 #[doc = " If non-NULL, will be set to point to a string indicating the LB"]
2881 #[doc = " policy name. Caller takes ownership."]
2882 pub lb_policy_name: *mut *mut ::std::os::raw::c_char,
2883 #[doc = " If non-NULL, will be set to point to a string containing the"]
2884 #[doc = " service config used by the channel in JSON form."]
2885 pub service_config_json: *mut *mut ::std::os::raw::c_char,
2886}
2887#[test]
2888fn bindgen_test_layout_grpc_channel_info() {
2889 assert_eq!(
2890 ::std::mem::size_of::<grpc_channel_info>(),
2891 16usize,
2892 concat!("Size of: ", stringify!(grpc_channel_info))
2893 );
2894 assert_eq!(
2895 ::std::mem::align_of::<grpc_channel_info>(),
2896 8usize,
2897 concat!("Alignment of ", stringify!(grpc_channel_info))
2898 );
2899 assert_eq!(
2900 unsafe {
2901 &(*(::std::ptr::null::<grpc_channel_info>())).lb_policy_name as *const _ as usize
2902 },
2903 0usize,
2904 concat!(
2905 "Offset of field: ",
2906 stringify!(grpc_channel_info),
2907 "::",
2908 stringify!(lb_policy_name)
2909 )
2910 );
2911 assert_eq!(
2912 unsafe {
2913 &(*(::std::ptr::null::<grpc_channel_info>())).service_config_json as *const _ as usize
2914 },
2915 8usize,
2916 concat!(
2917 "Offset of field: ",
2918 stringify!(grpc_channel_info),
2919 "::",
2920 stringify!(service_config_json)
2921 )
2922 );
2923}
2924#[repr(C)]
2925#[derive(Debug, Copy, Clone)]
2926pub struct grpc_resource_quota {
2927 _unused: [u8; 0],
2928}
2929#[repr(u32)]
2930#[doc = " Completion queues internally MAY maintain a set of file descriptors in a"]
2931#[doc = "structure called 'pollset'. This enum specifies if a completion queue has an"]
2932#[doc = "associated pollset and any restrictions on the type of file descriptors that"]
2933#[doc = "can be present in the pollset."]
2934#[doc = ""]
2935#[doc = "I/O progress can only be made when grpc_completion_queue_next() or"]
2936#[doc = "grpc_completion_queue_pluck() are called on the completion queue (unless the"]
2937#[doc = "grpc_cq_polling_type is GRPC_CQ_NON_POLLING) and hence it is very important"]
2938#[doc = "to actively call these APIs"]
2939#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
2940pub enum grpc_cq_polling_type {
2941 #[doc = " The completion queue will have an associated pollset and there is no"]
2942 #[doc = "restriction on the type of file descriptors the pollset may contain"]
2943 GRPC_CQ_DEFAULT_POLLING = 0,
2944 #[doc = " Similar to GRPC_CQ_DEFAULT_POLLING except that the completion queues will"]
2945 #[doc = "not contain any 'listening file descriptors' (i.e file descriptors used to"]
2946 #[doc = "listen to incoming channels)"]
2947 GRPC_CQ_NON_LISTENING = 1,
2948 #[doc = " The completion queue will not have an associated pollset. Note that"]
2949 #[doc = "grpc_completion_queue_next() or grpc_completion_queue_pluck() MUST still"]
2950 #[doc = "be called to pop events from the completion queue; it is not required to"]
2951 #[doc = "call them actively to make I/O progress"]
2952 GRPC_CQ_NON_POLLING = 2,
2953}
2954#[repr(u32)]
2955#[doc = " Specifies the type of APIs to use to pop events from the completion queue"]
2956#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
2957pub enum grpc_cq_completion_type {
2958 #[doc = " Events are popped out by calling grpc_completion_queue_next() API ONLY"]
2959 GRPC_CQ_NEXT = 0,
2960 #[doc = " Events are popped out by calling grpc_completion_queue_pluck() API ONLY"]
2961 GRPC_CQ_PLUCK = 1,
2962 #[doc = " EXPERIMENTAL: Events trigger a callback specified as the tag"]
2963 GRPC_CQ_CALLBACK = 2,
2964}
2965#[doc = " EXPERIMENTAL: Specifies an interface class to be used as a tag"]
2966#[doc = "for callback-based completion queues. This can be used directly,"]
2967#[doc = "as the first element of a struct in C, or as a base class in C++."]
2968#[doc = "Its \"run\" value should be assigned to some non-member function, such as"]
2969#[doc = "a static method."]
2970#[repr(C)]
2971#[derive(Debug, Copy, Clone)]
2972pub struct grpc_experimental_completion_queue_functor {
2973 #[doc = " The run member specifies a function that will be called when this"]
2974 #[doc = "tag is extracted from the completion queue. Its arguments will be a"]
2975 #[doc = "pointer to this functor and a boolean that indicates whether the"]
2976 #[doc = "operation succeeded (non-zero) or failed (zero)"]
2977 pub functor_run: ::std::option::Option<
2978 unsafe extern "C" fn(
2979 arg1: *mut grpc_experimental_completion_queue_functor,
2980 arg2: ::std::os::raw::c_int,
2981 ),
2982 >,
2983 #[doc = " The inlineable member specifies whether this functor can be run inline."]
2984 #[doc = "This should only be used for trivial internally-defined functors."]
2985 pub inlineable: ::std::os::raw::c_int,
2986 #[doc = " The following fields are not API. They are meant for internal use."]
2987 pub internal_success: ::std::os::raw::c_int,
2988 pub internal_next: *mut grpc_experimental_completion_queue_functor,
2989}
2990#[test]
2991fn bindgen_test_layout_grpc_experimental_completion_queue_functor() {
2992 assert_eq!(
2993 ::std::mem::size_of::<grpc_experimental_completion_queue_functor>(),
2994 24usize,
2995 concat!(
2996 "Size of: ",
2997 stringify!(grpc_experimental_completion_queue_functor)
2998 )
2999 );
3000 assert_eq!(
3001 ::std::mem::align_of::<grpc_experimental_completion_queue_functor>(),
3002 8usize,
3003 concat!(
3004 "Alignment of ",
3005 stringify!(grpc_experimental_completion_queue_functor)
3006 )
3007 );
3008 assert_eq!(
3009 unsafe {
3010 &(*(::std::ptr::null::<grpc_experimental_completion_queue_functor>())).functor_run
3011 as *const _ as usize
3012 },
3013 0usize,
3014 concat!(
3015 "Offset of field: ",
3016 stringify!(grpc_experimental_completion_queue_functor),
3017 "::",
3018 stringify!(functor_run)
3019 )
3020 );
3021 assert_eq!(
3022 unsafe {
3023 &(*(::std::ptr::null::<grpc_experimental_completion_queue_functor>())).inlineable
3024 as *const _ as usize
3025 },
3026 8usize,
3027 concat!(
3028 "Offset of field: ",
3029 stringify!(grpc_experimental_completion_queue_functor),
3030 "::",
3031 stringify!(inlineable)
3032 )
3033 );
3034 assert_eq!(
3035 unsafe {
3036 &(*(::std::ptr::null::<grpc_experimental_completion_queue_functor>())).internal_success
3037 as *const _ as usize
3038 },
3039 12usize,
3040 concat!(
3041 "Offset of field: ",
3042 stringify!(grpc_experimental_completion_queue_functor),
3043 "::",
3044 stringify!(internal_success)
3045 )
3046 );
3047 assert_eq!(
3048 unsafe {
3049 &(*(::std::ptr::null::<grpc_experimental_completion_queue_functor>())).internal_next
3050 as *const _ as usize
3051 },
3052 16usize,
3053 concat!(
3054 "Offset of field: ",
3055 stringify!(grpc_experimental_completion_queue_functor),
3056 "::",
3057 stringify!(internal_next)
3058 )
3059 );
3060}
3061#[repr(C)]
3062#[derive(Debug, Copy, Clone)]
3063pub struct grpc_completion_queue_attributes {
3064 #[doc = " The version number of this structure. More fields might be added to this"]
3065 #[doc = "structure in future."]
3066 pub version: ::std::os::raw::c_int,
3067 #[doc = " Set to GRPC_CQ_CURRENT_VERSION"]
3068 pub cq_completion_type: grpc_cq_completion_type,
3069 pub cq_polling_type: grpc_cq_polling_type,
3070 #[doc = " When creating a callbackable CQ, pass in a functor to get invoked when"]
3071 #[doc = " shutdown is complete"]
3072 pub cq_shutdown_cb: *mut grpc_experimental_completion_queue_functor,
3073}
3074#[test]
3075fn bindgen_test_layout_grpc_completion_queue_attributes() {
3076 assert_eq!(
3077 ::std::mem::size_of::<grpc_completion_queue_attributes>(),
3078 24usize,
3079 concat!("Size of: ", stringify!(grpc_completion_queue_attributes))
3080 );
3081 assert_eq!(
3082 ::std::mem::align_of::<grpc_completion_queue_attributes>(),
3083 8usize,
3084 concat!(
3085 "Alignment of ",
3086 stringify!(grpc_completion_queue_attributes)
3087 )
3088 );
3089 assert_eq!(
3090 unsafe {
3091 &(*(::std::ptr::null::<grpc_completion_queue_attributes>())).version as *const _
3092 as usize
3093 },
3094 0usize,
3095 concat!(
3096 "Offset of field: ",
3097 stringify!(grpc_completion_queue_attributes),
3098 "::",
3099 stringify!(version)
3100 )
3101 );
3102 assert_eq!(
3103 unsafe {
3104 &(*(::std::ptr::null::<grpc_completion_queue_attributes>())).cq_completion_type
3105 as *const _ as usize
3106 },
3107 4usize,
3108 concat!(
3109 "Offset of field: ",
3110 stringify!(grpc_completion_queue_attributes),
3111 "::",
3112 stringify!(cq_completion_type)
3113 )
3114 );
3115 assert_eq!(
3116 unsafe {
3117 &(*(::std::ptr::null::<grpc_completion_queue_attributes>())).cq_polling_type as *const _
3118 as usize
3119 },
3120 8usize,
3121 concat!(
3122 "Offset of field: ",
3123 stringify!(grpc_completion_queue_attributes),
3124 "::",
3125 stringify!(cq_polling_type)
3126 )
3127 );
3128 assert_eq!(
3129 unsafe {
3130 &(*(::std::ptr::null::<grpc_completion_queue_attributes>())).cq_shutdown_cb as *const _
3131 as usize
3132 },
3133 16usize,
3134 concat!(
3135 "Offset of field: ",
3136 stringify!(grpc_completion_queue_attributes),
3137 "::",
3138 stringify!(cq_shutdown_cb)
3139 )
3140 );
3141}
3142#[repr(C)]
3143#[derive(Debug, Copy, Clone)]
3144pub struct grpc_completion_queue_factory {
3145 _unused: [u8; 0],
3146}
3147extern "C" {
3148 #[doc = " Returns a RAW byte buffer instance over the given slices (up to \\a nslices)."]
3149 #[doc = ""]
3150 #[doc = " Increases the reference count for all \\a slices processed. The user is"]
3151 #[doc = " responsible for invoking grpc_byte_buffer_destroy on the returned instance."]
3152 pub fn grpc_raw_byte_buffer_create(
3153 slices: *mut grpc_slice,
3154 nslices: usize,
3155 ) -> *mut grpc_byte_buffer;
3156}
3157extern "C" {
3158 #[doc = " Returns a *compressed* RAW byte buffer instance over the given slices (up to"]
3159 #[doc = " \\a nslices). The \\a compression argument defines the compression algorithm"]
3160 #[doc = " used to generate the data in \\a slices."]
3161 #[doc = ""]
3162 #[doc = " Increases the reference count for all \\a slices processed. The user is"]
3163 #[doc = " responsible for invoking grpc_byte_buffer_destroy on the returned instance."]
3164 pub fn grpc_raw_compressed_byte_buffer_create(
3165 slices: *mut grpc_slice,
3166 nslices: usize,
3167 compression: grpc_compression_algorithm,
3168 ) -> *mut grpc_byte_buffer;
3169}
3170extern "C" {
3171 #[doc = " Copies input byte buffer \\a bb."]
3172 #[doc = ""]
3173 #[doc = " Increases the reference count of all the source slices. The user is"]
3174 #[doc = " responsible for calling grpc_byte_buffer_destroy over the returned copy."]
3175 pub fn grpc_byte_buffer_copy(bb: *mut grpc_byte_buffer) -> *mut grpc_byte_buffer;
3176}
3177extern "C" {
3178 #[doc = " Returns the size of the given byte buffer, in bytes."]
3179 pub fn grpc_byte_buffer_length(bb: *mut grpc_byte_buffer) -> usize;
3180}
3181extern "C" {
3182 #[doc = " Destroys \\a byte_buffer deallocating all its memory."]
3183 pub fn grpc_byte_buffer_destroy(byte_buffer: *mut grpc_byte_buffer);
3184}
3185extern "C" {
3186 #[doc = " Initialize \\a reader to read over \\a buffer."]
3187 #[doc = " Returns 1 upon success, 0 otherwise."]
3188 pub fn grpc_byte_buffer_reader_init(
3189 reader: *mut grpc_byte_buffer_reader,
3190 buffer: *mut grpc_byte_buffer,
3191 ) -> ::std::os::raw::c_int;
3192}
3193extern "C" {
3194 #[doc = " Cleanup and destroy \\a reader"]
3195 pub fn grpc_byte_buffer_reader_destroy(reader: *mut grpc_byte_buffer_reader);
3196}
3197extern "C" {
3198 #[doc = " Updates \\a slice with the next piece of data from from \\a reader and returns"]
3199 #[doc = " 1. Returns 0 at the end of the stream. Caller is responsible for calling"]
3200 #[doc = " grpc_slice_unref on the result."]
3201 pub fn grpc_byte_buffer_reader_next(
3202 reader: *mut grpc_byte_buffer_reader,
3203 slice: *mut grpc_slice,
3204 ) -> ::std::os::raw::c_int;
3205}
3206extern "C" {
3207 #[doc = " EXPERIMENTAL API - This function may be removed and changed, in the future."]
3208 #[doc = ""]
3209 #[doc = " Updates \\a slice with the next piece of data from from \\a reader and returns"]
3210 #[doc = " 1. Returns 0 at the end of the stream. Caller is responsible for making sure"]
3211 #[doc = " the slice pointer remains valid when accessed."]
3212 #[doc = ""]
3213 #[doc = " NOTE: Do not use this function unless the caller can guarantee that the"]
3214 #[doc = " underlying grpc_byte_buffer outlasts the use of the slice. This is only"]
3215 #[doc = " safe when the underlying grpc_byte_buffer remains immutable while slice"]
3216 #[doc = " is being accessed."]
3217 pub fn grpc_byte_buffer_reader_peek(
3218 reader: *mut grpc_byte_buffer_reader,
3219 slice: *mut *mut grpc_slice,
3220 ) -> ::std::os::raw::c_int;
3221}
3222extern "C" {
3223 #[doc = " Merge all data from \\a reader into single slice"]
3224 pub fn grpc_byte_buffer_reader_readall(reader: *mut grpc_byte_buffer_reader) -> grpc_slice;
3225}
3226extern "C" {
3227 #[doc = " Returns a RAW byte buffer instance from the output of \\a reader."]
3228 pub fn grpc_raw_byte_buffer_from_reader(
3229 reader: *mut grpc_byte_buffer_reader,
3230 ) -> *mut grpc_byte_buffer;
3231}
3232extern "C" {
3233 #[doc = " initialize a slice buffer"]
3234 pub fn grpc_slice_buffer_init(sb: *mut grpc_slice_buffer);
3235}
3236extern "C" {
3237 #[doc = " destroy a slice buffer - unrefs any held elements"]
3238 pub fn grpc_slice_buffer_destroy(sb: *mut grpc_slice_buffer);
3239}
3240extern "C" {
3241 #[doc = " Add an element to a slice buffer - takes ownership of the slice."]
3242 #[doc = "This function is allowed to concatenate the passed in slice to the end of"]
3243 #[doc = "some other slice if desired by the slice buffer."]
3244 pub fn grpc_slice_buffer_add(sb: *mut grpc_slice_buffer, slice: grpc_slice);
3245}
3246extern "C" {
3247 #[doc = " add an element to a slice buffer - takes ownership of the slice and returns"]
3248 #[doc = "the index of the slice."]
3249 #[doc = "Guarantees that the slice will not be concatenated at the end of another"]
3250 #[doc = "slice (i.e. the data for this slice will begin at the first byte of the"]
3251 #[doc = "slice at the returned index in sb->slices)"]
3252 #[doc = "The implementation MAY decide to concatenate data at the end of a small"]
3253 #[doc = "slice added in this fashion."]
3254 pub fn grpc_slice_buffer_add_indexed(sb: *mut grpc_slice_buffer, slice: grpc_slice) -> usize;
3255}
3256extern "C" {
3257 pub fn grpc_slice_buffer_addn(sb: *mut grpc_slice_buffer, slices: *mut grpc_slice, n: usize);
3258}
3259extern "C" {
3260 #[doc = " add a very small (less than 8 bytes) amount of data to the end of a slice"]
3261 #[doc = "buffer: returns a pointer into which to add the data"]
3262 pub fn grpc_slice_buffer_tiny_add(sb: *mut grpc_slice_buffer, len: usize) -> *mut u8;
3263}
3264extern "C" {
3265 #[doc = " pop the last buffer, but don't unref it"]
3266 pub fn grpc_slice_buffer_pop(sb: *mut grpc_slice_buffer);
3267}
3268extern "C" {
3269 #[doc = " clear a slice buffer, unref all elements"]
3270 pub fn grpc_slice_buffer_reset_and_unref(sb: *mut grpc_slice_buffer);
3271}
3272extern "C" {
3273 #[doc = " swap the contents of two slice buffers"]
3274 pub fn grpc_slice_buffer_swap(a: *mut grpc_slice_buffer, b: *mut grpc_slice_buffer);
3275}
3276extern "C" {
3277 #[doc = " move all of the elements of src into dst"]
3278 pub fn grpc_slice_buffer_move_into(src: *mut grpc_slice_buffer, dst: *mut grpc_slice_buffer);
3279}
3280extern "C" {
3281 #[doc = " remove n bytes from the end of a slice buffer"]
3282 pub fn grpc_slice_buffer_trim_end(
3283 src: *mut grpc_slice_buffer,
3284 n: usize,
3285 garbage: *mut grpc_slice_buffer,
3286 );
3287}
3288extern "C" {
3289 #[doc = " move the first n bytes of src into dst"]
3290 pub fn grpc_slice_buffer_move_first(
3291 src: *mut grpc_slice_buffer,
3292 n: usize,
3293 dst: *mut grpc_slice_buffer,
3294 );
3295}
3296extern "C" {
3297 #[doc = " move the first n bytes of src into dst without adding references"]
3298 pub fn grpc_slice_buffer_move_first_no_ref(
3299 src: *mut grpc_slice_buffer,
3300 n: usize,
3301 dst: *mut grpc_slice_buffer,
3302 );
3303}
3304extern "C" {
3305 #[doc = " move the first n bytes of src into dst (copying them)"]
3306 pub fn grpc_slice_buffer_move_first_into_buffer(
3307 src: *mut grpc_slice_buffer,
3308 n: usize,
3309 dst: *mut ::std::os::raw::c_void,
3310 );
3311}
3312extern "C" {
3313 #[doc = " take the first slice in the slice buffer"]
3314 pub fn grpc_slice_buffer_take_first(src: *mut grpc_slice_buffer) -> grpc_slice;
3315}
3316extern "C" {
3317 #[doc = " undo the above with (a possibly different) \\a slice"]
3318 pub fn grpc_slice_buffer_undo_take_first(src: *mut grpc_slice_buffer, slice: grpc_slice);
3319}
3320#[repr(u32)]
3321#[doc = " Connectivity state of a channel."]
3322#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
3323pub enum grpc_connectivity_state {
3324 #[doc = " channel is idle"]
3325 GRPC_CHANNEL_IDLE = 0,
3326 #[doc = " channel is connecting"]
3327 GRPC_CHANNEL_CONNECTING = 1,
3328 #[doc = " channel is ready for work"]
3329 GRPC_CHANNEL_READY = 2,
3330 #[doc = " channel has seen a failure but expects to recover"]
3331 GRPC_CHANNEL_TRANSIENT_FAILURE = 3,
3332 #[doc = " channel has seen a failure that it cannot recover from"]
3333 GRPC_CHANNEL_SHUTDOWN = 4,
3334}
3335extern "C" {
3336 #[doc = " Time constants."]
3337 pub fn gpr_time_0(type_: gpr_clock_type) -> gpr_timespec;
3338}
3339extern "C" {
3340 #[doc = " The zero time interval."]
3341 pub fn gpr_inf_future(type_: gpr_clock_type) -> gpr_timespec;
3342}
3343extern "C" {
3344 #[doc = " The far future"]
3345 pub fn gpr_inf_past(type_: gpr_clock_type) -> gpr_timespec;
3346}
3347extern "C" {
3348 #[doc = " initialize time subsystem"]
3349 pub fn gpr_time_init();
3350}
3351extern "C" {
3352 #[doc = " Return the current time measured from the given clocks epoch."]
3353 pub fn gpr_now(clock: gpr_clock_type) -> gpr_timespec;
3354}
3355extern "C" {
3356 #[doc = " Convert a timespec from one clock to another"]
3357 pub fn gpr_convert_clock_type(t: gpr_timespec, target_clock: gpr_clock_type) -> gpr_timespec;
3358}
3359extern "C" {
3360 #[doc = " Return -ve, 0, or +ve according to whether a < b, a == b, or a > b"]
3361 #[doc = "respectively."]
3362 pub fn gpr_time_cmp(a: gpr_timespec, b: gpr_timespec) -> ::std::os::raw::c_int;
3363}
3364extern "C" {
3365 pub fn gpr_time_max(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec;
3366}
3367extern "C" {
3368 pub fn gpr_time_min(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec;
3369}
3370extern "C" {
3371 #[doc = " Add and subtract times. Calculations saturate at infinities."]
3372 pub fn gpr_time_add(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec;
3373}
3374extern "C" {
3375 pub fn gpr_time_sub(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec;
3376}
3377extern "C" {
3378 #[doc = " Return a timespec representing a given number of time units. INT64_MIN is"]
3379 #[doc = "interpreted as gpr_inf_past, and INT64_MAX as gpr_inf_future."]
3380 pub fn gpr_time_from_micros(x: i64, clock_type: gpr_clock_type) -> gpr_timespec;
3381}
3382extern "C" {
3383 pub fn gpr_time_from_nanos(x: i64, clock_type: gpr_clock_type) -> gpr_timespec;
3384}
3385extern "C" {
3386 pub fn gpr_time_from_millis(x: i64, clock_type: gpr_clock_type) -> gpr_timespec;
3387}
3388extern "C" {
3389 pub fn gpr_time_from_seconds(x: i64, clock_type: gpr_clock_type) -> gpr_timespec;
3390}
3391extern "C" {
3392 pub fn gpr_time_from_minutes(x: i64, clock_type: gpr_clock_type) -> gpr_timespec;
3393}
3394extern "C" {
3395 pub fn gpr_time_from_hours(x: i64, clock_type: gpr_clock_type) -> gpr_timespec;
3396}
3397extern "C" {
3398 pub fn gpr_time_to_millis(timespec: gpr_timespec) -> i32;
3399}
3400extern "C" {
3401 #[doc = " Return 1 if two times are equal or within threshold of each other,"]
3402 #[doc = "0 otherwise"]
3403 pub fn gpr_time_similar(
3404 a: gpr_timespec,
3405 b: gpr_timespec,
3406 threshold: gpr_timespec,
3407 ) -> ::std::os::raw::c_int;
3408}
3409extern "C" {
3410 #[doc = " Sleep until at least 'until' - an absolute timeout"]
3411 pub fn gpr_sleep_until(until: gpr_timespec);
3412}
3413extern "C" {
3414 pub fn gpr_timespec_to_micros(t: gpr_timespec) -> f64;
3415}
3416extern "C" {
3417 #[doc = " \\mainpage GRPC Core"]
3418 #[doc = ""]
3419 #[doc = " The GRPC Core library is a low-level library designed to be wrapped by higher"]
3420 #[doc = " level libraries. The top-level API is provided in grpc.h. Security related"]
3421 #[doc = " functionality lives in grpc_security.h."]
3422 pub fn grpc_metadata_array_init(array: *mut grpc_metadata_array);
3423}
3424extern "C" {
3425 pub fn grpc_metadata_array_destroy(array: *mut grpc_metadata_array);
3426}
3427extern "C" {
3428 pub fn grpc_call_details_init(details: *mut grpc_call_details);
3429}
3430extern "C" {
3431 pub fn grpc_call_details_destroy(details: *mut grpc_call_details);
3432}
3433extern "C" {
3434 #[doc = " Registers a plugin to be initialized and destroyed with the library."]
3435 #[doc = ""]
3436 #[doc = "The \\a init and \\a destroy functions will be invoked as part of"]
3437 #[doc = "\\a grpc_init() and \\a grpc_shutdown(), respectively."]
3438 #[doc = "Note that these functions can be invoked an arbitrary number of times"]
3439 #[doc = "(and hence so will \\a init and \\a destroy)."]
3440 #[doc = "It is safe to pass NULL to either argument. Plugins are destroyed in"]
3441 #[doc = "the reverse order they were initialized."]
3442 pub fn grpc_register_plugin(
3443 init: ::std::option::Option<unsafe extern "C" fn()>,
3444 destroy: ::std::option::Option<unsafe extern "C" fn()>,
3445 );
3446}
3447extern "C" {
3448 #[doc = " Initialize the grpc library."]
3449 #[doc = ""]
3450 #[doc = "After it's called, a matching invocation to grpc_shutdown() is expected."]
3451 #[doc = ""]
3452 #[doc = "It is not safe to call any other grpc functions before calling this."]
3453 #[doc = "(To avoid overhead, little checking is done, and some things may work. We"]
3454 #[doc = "do not warrant that they will continue to do so in future revisions of this"]
3455 #[doc = "library)."]
3456 pub fn grpc_init();
3457}
3458extern "C" {
3459 #[doc = " Shut down the grpc library."]
3460 #[doc = ""]
3461 #[doc = "Before it's called, there should haven been a matching invocation to"]
3462 #[doc = "grpc_init()."]
3463 #[doc = ""]
3464 #[doc = "The last call to grpc_shutdown will initiate cleaning up of grpc library"]
3465 #[doc = "internals, which can happen in another thread. Once the clean-up is done,"]
3466 #[doc = "no memory is used by grpc, nor are any instructions executing within the"]
3467 #[doc = "grpc library. Prior to calling, all application owned grpc objects must"]
3468 #[doc = "have been destroyed."]
3469 pub fn grpc_shutdown();
3470}
3471extern "C" {
3472 #[doc = " EXPERIMENTAL. Returns 1 if the grpc library has been initialized."]
3473 #[doc = "TODO(ericgribkoff) Decide if this should be promoted to non-experimental as"]
3474 #[doc = "part of stabilizing the fork support API, as tracked in"]
3475 #[doc = "https://github.com/grpc/grpc/issues/15334"]
3476 pub fn grpc_is_initialized() -> ::std::os::raw::c_int;
3477}
3478extern "C" {
3479 #[doc = " EXPERIMENTAL. Blocking shut down grpc library."]
3480 #[doc = "This is only for wrapped language to use now."]
3481 pub fn grpc_shutdown_blocking();
3482}
3483extern "C" {
3484 #[doc = " Return a string representing the current version of grpc"]
3485 pub fn grpc_version_string() -> *const ::std::os::raw::c_char;
3486}
3487extern "C" {
3488 #[doc = " Return a string specifying what the 'g' in gRPC stands for"]
3489 pub fn grpc_g_stands_for() -> *const ::std::os::raw::c_char;
3490}
3491extern "C" {
3492 #[doc = " Returns the completion queue factory based on the attributes. MAY return a"]
3493 #[doc = "NULL if no factory can be found"]
3494 pub fn grpc_completion_queue_factory_lookup(
3495 attributes: *const grpc_completion_queue_attributes,
3496 ) -> *const grpc_completion_queue_factory;
3497}
3498extern "C" {
3499 #[doc = " Helper function to create a completion queue with grpc_cq_completion_type"]
3500 #[doc = "of GRPC_CQ_NEXT and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING"]
3501 pub fn grpc_completion_queue_create_for_next(
3502 reserved: *mut ::std::os::raw::c_void,
3503 ) -> *mut grpc_completion_queue;
3504}
3505extern "C" {
3506 #[doc = " Helper function to create a completion queue with grpc_cq_completion_type"]
3507 #[doc = "of GRPC_CQ_PLUCK and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING"]
3508 pub fn grpc_completion_queue_create_for_pluck(
3509 reserved: *mut ::std::os::raw::c_void,
3510 ) -> *mut grpc_completion_queue;
3511}
3512extern "C" {
3513 #[doc = " Helper function to create a completion queue with grpc_cq_completion_type"]
3514 #[doc = "of GRPC_CQ_CALLBACK and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING."]
3515 #[doc = "This function is experimental."]
3516 pub fn grpc_completion_queue_create_for_callback(
3517 shutdown_callback: *mut grpc_experimental_completion_queue_functor,
3518 reserved: *mut ::std::os::raw::c_void,
3519 ) -> *mut grpc_completion_queue;
3520}
3521extern "C" {
3522 #[doc = " Create a completion queue"]
3523 pub fn grpc_completion_queue_create(
3524 factory: *const grpc_completion_queue_factory,
3525 attributes: *const grpc_completion_queue_attributes,
3526 reserved: *mut ::std::os::raw::c_void,
3527 ) -> *mut grpc_completion_queue;
3528}
3529extern "C" {
3530 #[doc = " Blocks until an event is available, the completion queue is being shut down,"]
3531 #[doc = "or deadline is reached."]
3532 #[doc = ""]
3533 #[doc = "Returns a grpc_event with type GRPC_QUEUE_TIMEOUT on timeout,"]
3534 #[doc = "otherwise a grpc_event describing the event that occurred."]
3535 #[doc = ""]
3536 #[doc = "Callers must not call grpc_completion_queue_next and"]
3537 #[doc = "grpc_completion_queue_pluck simultaneously on the same completion queue."]
3538 pub fn grpc_completion_queue_next(
3539 cq: *mut grpc_completion_queue,
3540 deadline: gpr_timespec,
3541 reserved: *mut ::std::os::raw::c_void,
3542 ) -> grpc_event;
3543}
3544extern "C" {
3545 #[doc = " Blocks until an event with tag 'tag' is available, the completion queue is"]
3546 #[doc = "being shutdown or deadline is reached."]
3547 #[doc = ""]
3548 #[doc = "Returns a grpc_event with type GRPC_QUEUE_TIMEOUT on timeout,"]
3549 #[doc = "otherwise a grpc_event describing the event that occurred."]
3550 #[doc = ""]
3551 #[doc = "Callers must not call grpc_completion_queue_next and"]
3552 #[doc = "grpc_completion_queue_pluck simultaneously on the same completion queue."]
3553 #[doc = ""]
3554 #[doc = "Completion queues support a maximum of GRPC_MAX_COMPLETION_QUEUE_PLUCKERS"]
3555 #[doc = "concurrently executing plucks at any time."]
3556 pub fn grpc_completion_queue_pluck(
3557 cq: *mut grpc_completion_queue,
3558 tag: *mut ::std::os::raw::c_void,
3559 deadline: gpr_timespec,
3560 reserved: *mut ::std::os::raw::c_void,
3561 ) -> grpc_event;
3562}
3563extern "C" {
3564 #[doc = " Begin destruction of a completion queue. Once all possible events are"]
3565 #[doc = "drained then grpc_completion_queue_next will start to produce"]
3566 #[doc = "GRPC_QUEUE_SHUTDOWN events only. At that point it's safe to call"]
3567 #[doc = "grpc_completion_queue_destroy."]
3568 #[doc = ""]
3569 #[doc = "After calling this function applications should ensure that no"]
3570 #[doc = "NEW work is added to be published on this completion queue."]
3571 pub fn grpc_completion_queue_shutdown(cq: *mut grpc_completion_queue);
3572}
3573extern "C" {
3574 #[doc = " Destroy a completion queue. The caller must ensure that the queue is"]
3575 #[doc = "drained and no threads are executing grpc_completion_queue_next"]
3576 pub fn grpc_completion_queue_destroy(cq: *mut grpc_completion_queue);
3577}
3578extern "C" {
3579 #[doc = " EXPERIMENTAL API ************/"]
3580 #[doc = " grpc_flush_cq_tls_cache() MUST be called on the same thread,"]
3581 #[doc = " with the same cq."]
3582 pub fn grpc_completion_queue_thread_local_cache_init(cq: *mut grpc_completion_queue);
3583}
3584extern "C" {
3585 #[doc = " EXPERIMENTAL API ************/"]
3586 #[doc = " Returns 1 if there was contents in the cache. If there was an event"]
3587 #[doc = " in \\a cq tls cache, its tag is placed in tag, and ok is set to the"]
3588 #[doc = " event success."]
3589 pub fn grpc_completion_queue_thread_local_cache_flush(
3590 cq: *mut grpc_completion_queue,
3591 tag: *mut *mut ::std::os::raw::c_void,
3592 ok: *mut ::std::os::raw::c_int,
3593 ) -> ::std::os::raw::c_int;
3594}
3595extern "C" {
3596 #[doc = " Check the connectivity state of a channel."]
3597 pub fn grpc_channel_check_connectivity_state(
3598 channel: *mut grpc_channel,
3599 try_to_connect: ::std::os::raw::c_int,
3600 ) -> grpc_connectivity_state;
3601}
3602extern "C" {
3603 #[doc = " Number of active \"external connectivity state watchers\" attached to a"]
3604 #[doc = " channel."]
3605 #[doc = " Useful for testing."]
3606 pub fn grpc_channel_num_external_connectivity_watchers(
3607 channel: *mut grpc_channel,
3608 ) -> ::std::os::raw::c_int;
3609}
3610extern "C" {
3611 #[doc = " Watch for a change in connectivity state."]
3612 #[doc = "Once the channel connectivity state is different from last_observed_state,"]
3613 #[doc = "tag will be enqueued on cq with success=1."]
3614 #[doc = "If deadline expires BEFORE the state is changed, tag will be enqueued on cq"]
3615 #[doc = "with success=0."]
3616 pub fn grpc_channel_watch_connectivity_state(
3617 channel: *mut grpc_channel,
3618 last_observed_state: grpc_connectivity_state,
3619 deadline: gpr_timespec,
3620 cq: *mut grpc_completion_queue,
3621 tag: *mut ::std::os::raw::c_void,
3622 );
3623}
3624extern "C" {
3625 #[doc = " Check whether a grpc channel supports connectivity watcher"]
3626 pub fn grpc_channel_support_connectivity_watcher(
3627 channel: *mut grpc_channel,
3628 ) -> ::std::os::raw::c_int;
3629}
3630extern "C" {
3631 #[doc = " Create a call given a grpc_channel, in order to call 'method'. All"]
3632 #[doc = "completions are sent to 'completion_queue'. 'method' and 'host' need only"]
3633 #[doc = "live through the invocation of this function."]
3634 #[doc = "If parent_call is non-NULL, it must be a server-side call. It will be used"]
3635 #[doc = "to propagate properties from the server call to this new client call,"]
3636 #[doc = "depending on the value of \\a propagation_mask (see propagation_bits.h for"]
3637 #[doc = "possible values)."]
3638 pub fn grpc_channel_create_call(
3639 channel: *mut grpc_channel,
3640 parent_call: *mut grpc_call,
3641 propagation_mask: u32,
3642 completion_queue: *mut grpc_completion_queue,
3643 method: grpc_slice,
3644 host: *const grpc_slice,
3645 deadline: gpr_timespec,
3646 reserved: *mut ::std::os::raw::c_void,
3647 ) -> *mut grpc_call;
3648}
3649extern "C" {
3650 #[doc = " Ping the channels peer (load balanced channels will select one sub-channel"]
3651 #[doc = "to ping); if the channel is not connected, posts a failed."]
3652 pub fn grpc_channel_ping(
3653 channel: *mut grpc_channel,
3654 cq: *mut grpc_completion_queue,
3655 tag: *mut ::std::os::raw::c_void,
3656 reserved: *mut ::std::os::raw::c_void,
3657 );
3658}
3659extern "C" {
3660 #[doc = " Pre-register a method/host pair on a channel."]
3661 #[doc = "method and host are not owned and must remain alive while the channel is"]
3662 #[doc = "alive."]
3663 pub fn grpc_channel_register_call(
3664 channel: *mut grpc_channel,
3665 method: *const ::std::os::raw::c_char,
3666 host: *const ::std::os::raw::c_char,
3667 reserved: *mut ::std::os::raw::c_void,
3668 ) -> *mut ::std::os::raw::c_void;
3669}
3670extern "C" {
3671 #[doc = " Create a call given a handle returned from grpc_channel_register_call."]
3672 #[doc = "\\sa grpc_channel_create_call."]
3673 pub fn grpc_channel_create_registered_call(
3674 channel: *mut grpc_channel,
3675 parent_call: *mut grpc_call,
3676 propagation_mask: u32,
3677 completion_queue: *mut grpc_completion_queue,
3678 registered_call_handle: *mut ::std::os::raw::c_void,
3679 deadline: gpr_timespec,
3680 reserved: *mut ::std::os::raw::c_void,
3681 ) -> *mut grpc_call;
3682}
3683extern "C" {
3684 #[doc = " Allocate memory in the grpc_call arena: this memory is automatically"]
3685 #[doc = "discarded at call completion"]
3686 pub fn grpc_call_arena_alloc(call: *mut grpc_call, size: usize) -> *mut ::std::os::raw::c_void;
3687}
3688extern "C" {
3689 #[doc = " Start a batch of operations defined in the array ops; when complete, post a"]
3690 #[doc = "completion of type 'tag' to the completion queue bound to the call."]
3691 #[doc = "The order of ops specified in the batch has no significance."]
3692 #[doc = "Only one operation of each type can be active at once in any given"]
3693 #[doc = "batch."]
3694 #[doc = "If a call to grpc_call_start_batch returns GRPC_CALL_OK you must call"]
3695 #[doc = "grpc_completion_queue_next or grpc_completion_queue_pluck on the completion"]
3696 #[doc = "queue associated with 'call' for work to be performed. If a call to"]
3697 #[doc = "grpc_call_start_batch returns any value other than GRPC_CALL_OK it is"]
3698 #[doc = "guaranteed that no state associated with 'call' is changed and it is not"]
3699 #[doc = "appropriate to call grpc_completion_queue_next or"]
3700 #[doc = "grpc_completion_queue_pluck consequent to the failed grpc_call_start_batch"]
3701 #[doc = "call."]
3702 #[doc = "If a call to grpc_call_start_batch with an empty batch returns"]
3703 #[doc = "GRPC_CALL_OK, the tag is put in the completion queue immediately."]
3704 #[doc = "THREAD SAFETY: access to grpc_call_start_batch in multi-threaded environment"]
3705 #[doc = "needs to be synchronized. As an optimization, you may synchronize batches"]
3706 #[doc = "containing just send operations independently from batches containing just"]
3707 #[doc = "receive operations. Access to grpc_call_start_batch with an empty batch is"]
3708 #[doc = "thread-compatible."]
3709 pub fn grpc_call_start_batch(
3710 call: *mut grpc_call,
3711 ops: *const grpc_op,
3712 nops: usize,
3713 tag: *mut ::std::os::raw::c_void,
3714 reserved: *mut ::std::os::raw::c_void,
3715 ) -> grpc_call_error;
3716}
3717extern "C" {
3718 #[doc = " Returns a newly allocated string representing the endpoint to which this"]
3719 #[doc = "call is communicating with. The string is in the uri format accepted by"]
3720 #[doc = "grpc_channel_create."]
3721 #[doc = "The returned string should be disposed of with gpr_free()."]
3722 #[doc = ""]
3723 #[doc = "WARNING: this value is never authenticated or subject to any security"]
3724 #[doc = "related code. It must not be used for any authentication related"]
3725 #[doc = "functionality. Instead, use grpc_auth_context."]
3726 pub fn grpc_call_get_peer(call: *mut grpc_call) -> *mut ::std::os::raw::c_char;
3727}
3728#[repr(C)]
3729#[derive(Debug, Copy, Clone)]
3730pub struct census_context {
3731 _unused: [u8; 0],
3732}
3733extern "C" {
3734 #[doc = " Set census context for a call; Must be called before first call to"]
3735 #[doc = "grpc_call_start_batch()."]
3736 pub fn grpc_census_call_set_context(call: *mut grpc_call, context: *mut census_context);
3737}
3738extern "C" {
3739 #[doc = " Retrieve the calls current census context."]
3740 pub fn grpc_census_call_get_context(call: *mut grpc_call) -> *mut census_context;
3741}
3742extern "C" {
3743 #[doc = " Return a newly allocated string representing the target a channel was"]
3744 #[doc = "created for."]
3745 pub fn grpc_channel_get_target(channel: *mut grpc_channel) -> *mut ::std::os::raw::c_char;
3746}
3747extern "C" {
3748 #[doc = " Request info about the channel."]
3749 #[doc = "\\a channel_info indicates what information is being requested and"]
3750 #[doc = "how that information will be returned."]
3751 #[doc = "\\a channel_info is owned by the caller."]
3752 pub fn grpc_channel_get_info(
3753 channel: *mut grpc_channel,
3754 channel_info: *const grpc_channel_info,
3755 );
3756}
3757extern "C" {
3758 #[doc = " EXPERIMENTAL. Resets the channel's connect backoff."]
3759 #[doc = "TODO(roth): When we see whether this proves useful, either promote"]
3760 #[doc = "to non-experimental or remove it."]
3761 pub fn grpc_channel_reset_connect_backoff(channel: *mut grpc_channel);
3762}
3763extern "C" {
3764 #[doc = " Create a client channel to 'target'. Additional channel level configuration"]
3765 #[doc = "MAY be provided by grpc_channel_args, though the expectation is that most"]
3766 #[doc = "clients will want to simply pass NULL. The user data in 'args' need only"]
3767 #[doc = "live through the invocation of this function. However, if any args of the"]
3768 #[doc = "'pointer' type are passed, then the referenced vtable must be maintained"]
3769 #[doc = "by the caller until grpc_channel_destroy terminates. See grpc_channel_args"]
3770 #[doc = "definition for more on this."]
3771 pub fn grpc_insecure_channel_create(
3772 target: *const ::std::os::raw::c_char,
3773 args: *const grpc_channel_args,
3774 reserved: *mut ::std::os::raw::c_void,
3775 ) -> *mut grpc_channel;
3776}
3777extern "C" {
3778 #[doc = " Create a lame client: this client fails every operation attempted on it."]
3779 pub fn grpc_lame_client_channel_create(
3780 target: *const ::std::os::raw::c_char,
3781 error_code: grpc_status_code::Type,
3782 error_message: *const ::std::os::raw::c_char,
3783 ) -> *mut grpc_channel;
3784}
3785extern "C" {
3786 #[doc = " Close and destroy a grpc channel"]
3787 pub fn grpc_channel_destroy(channel: *mut grpc_channel);
3788}
3789extern "C" {
3790 #[doc = " Cancel an RPC."]
3791 #[doc = "Can be called multiple times, from any thread."]
3792 #[doc = "THREAD-SAFETY grpc_call_cancel and grpc_call_cancel_with_status"]
3793 #[doc = "are thread-safe, and can be called at any point before grpc_call_unref"]
3794 #[doc = "is called."]
3795 pub fn grpc_call_cancel(
3796 call: *mut grpc_call,
3797 reserved: *mut ::std::os::raw::c_void,
3798 ) -> grpc_call_error;
3799}
3800extern "C" {
3801 #[doc = " Cancel an RPC."]
3802 #[doc = "Can be called multiple times, from any thread."]
3803 #[doc = "If a status has not been received for the call, set it to the status code"]
3804 #[doc = "and description passed in."]
3805 #[doc = "Importantly, this function does not send status nor description to the"]
3806 #[doc = "remote endpoint."]
3807 #[doc = "Note that \\a description doesn't need be a static string."]
3808 #[doc = "It doesn't need to be alive after the call to"]
3809 #[doc = "grpc_call_cancel_with_status completes."]
3810 pub fn grpc_call_cancel_with_status(
3811 call: *mut grpc_call,
3812 status: grpc_status_code::Type,
3813 description: *const ::std::os::raw::c_char,
3814 reserved: *mut ::std::os::raw::c_void,
3815 ) -> grpc_call_error;
3816}
3817extern "C" {
3818 #[doc = " Ref a call."]
3819 #[doc = "THREAD SAFETY: grpc_call_ref is thread-compatible"]
3820 pub fn grpc_call_ref(call: *mut grpc_call);
3821}
3822extern "C" {
3823 #[doc = " Unref a call."]
3824 #[doc = "THREAD SAFETY: grpc_call_unref is thread-compatible"]
3825 pub fn grpc_call_unref(call: *mut grpc_call);
3826}
3827extern "C" {
3828 #[doc = " Request notification of a new call."]
3829 #[doc = "Once a call is received, a notification tagged with \\a tag_new is added to"]
3830 #[doc = "\\a cq_for_notification. \\a call, \\a details and \\a request_metadata are"]
3831 #[doc = "updated with the appropriate call information. \\a cq_bound_to_call is bound"]
3832 #[doc = "to \\a call, and batch operation notifications for that call will be posted"]
3833 #[doc = "to \\a cq_bound_to_call."]
3834 #[doc = "Note that \\a cq_for_notification must have been registered to the server via"]
3835 #[doc = "\\a grpc_server_register_completion_queue."]
3836 pub fn grpc_server_request_call(
3837 server: *mut grpc_server,
3838 call: *mut *mut grpc_call,
3839 details: *mut grpc_call_details,
3840 request_metadata: *mut grpc_metadata_array,
3841 cq_bound_to_call: *mut grpc_completion_queue,
3842 cq_for_notification: *mut grpc_completion_queue,
3843 tag_new: *mut ::std::os::raw::c_void,
3844 ) -> grpc_call_error;
3845}
3846#[repr(u32)]
3847#[doc = " How to handle payloads for a registered method"]
3848#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
3849pub enum grpc_server_register_method_payload_handling {
3850 #[doc = " Don't try to read the payload"]
3851 GRPC_SRM_PAYLOAD_NONE = 0,
3852 #[doc = " Read the initial payload as a byte buffer"]
3853 GRPC_SRM_PAYLOAD_READ_INITIAL_BYTE_BUFFER = 1,
3854}
3855extern "C" {
3856 #[doc = " Registers a method in the server."]
3857 #[doc = "Methods to this (host, method) pair will not be reported by"]
3858 #[doc = "grpc_server_request_call, but instead be reported by"]
3859 #[doc = "grpc_server_request_registered_call when passed the appropriate"]
3860 #[doc = "registered_method (as returned by this function)."]
3861 #[doc = "Must be called before grpc_server_start."]
3862 #[doc = "Returns NULL on failure."]
3863 pub fn grpc_server_register_method(
3864 server: *mut grpc_server,
3865 method: *const ::std::os::raw::c_char,
3866 host: *const ::std::os::raw::c_char,
3867 payload_handling: grpc_server_register_method_payload_handling,
3868 flags: u32,
3869 ) -> *mut ::std::os::raw::c_void;
3870}
3871extern "C" {
3872 #[doc = " Request notification of a new pre-registered call. 'cq_for_notification'"]
3873 #[doc = "must have been registered to the server via"]
3874 #[doc = "grpc_server_register_completion_queue."]
3875 pub fn grpc_server_request_registered_call(
3876 server: *mut grpc_server,
3877 registered_method: *mut ::std::os::raw::c_void,
3878 call: *mut *mut grpc_call,
3879 deadline: *mut gpr_timespec,
3880 request_metadata: *mut grpc_metadata_array,
3881 optional_payload: *mut *mut grpc_byte_buffer,
3882 cq_bound_to_call: *mut grpc_completion_queue,
3883 cq_for_notification: *mut grpc_completion_queue,
3884 tag_new: *mut ::std::os::raw::c_void,
3885 ) -> grpc_call_error;
3886}
3887extern "C" {
3888 #[doc = " Create a server. Additional configuration for each incoming channel can"]
3889 #[doc = "be specified with args. If no additional configuration is needed, args can"]
3890 #[doc = "be NULL. The user data in 'args' need only live through the invocation of"]
3891 #[doc = "this function. However, if any args of the 'pointer' type are passed, then"]
3892 #[doc = "the referenced vtable must be maintained by the caller until"]
3893 #[doc = "grpc_server_destroy terminates. See grpc_channel_args definition for more"]
3894 #[doc = "on this."]
3895 pub fn grpc_server_create(
3896 args: *const grpc_channel_args,
3897 reserved: *mut ::std::os::raw::c_void,
3898 ) -> *mut grpc_server;
3899}
3900extern "C" {
3901 #[doc = " Register a completion queue with the server. Must be done for any"]
3902 #[doc = "notification completion queue that is passed to grpc_server_request_*_call"]
3903 #[doc = "and to grpc_server_shutdown_and_notify. Must be performed prior to"]
3904 #[doc = "grpc_server_start."]
3905 pub fn grpc_server_register_completion_queue(
3906 server: *mut grpc_server,
3907 cq: *mut grpc_completion_queue,
3908 reserved: *mut ::std::os::raw::c_void,
3909 );
3910}
3911extern "C" {
3912 #[doc = " Add a HTTP2 over plaintext over tcp listener."]
3913 #[doc = "Returns bound port number on success, 0 on failure."]
3914 #[doc = "REQUIRES: server not started"]
3915 pub fn grpc_server_add_insecure_http2_port(
3916 server: *mut grpc_server,
3917 addr: *const ::std::os::raw::c_char,
3918 ) -> ::std::os::raw::c_int;
3919}
3920extern "C" {
3921 #[doc = " Start a server - tells all listeners to start listening"]
3922 pub fn grpc_server_start(server: *mut grpc_server);
3923}
3924extern "C" {
3925 #[doc = " Begin shutting down a server."]
3926 #[doc = "After completion, no new calls or connections will be admitted."]
3927 #[doc = "Existing calls will be allowed to complete."]
3928 #[doc = "Send a GRPC_OP_COMPLETE event when there are no more calls being serviced."]
3929 #[doc = "Shutdown is idempotent, and all tags will be notified at once if multiple"]
3930 #[doc = "grpc_server_shutdown_and_notify calls are made. 'cq' must have been"]
3931 #[doc = "registered to this server via grpc_server_register_completion_queue."]
3932 pub fn grpc_server_shutdown_and_notify(
3933 server: *mut grpc_server,
3934 cq: *mut grpc_completion_queue,
3935 tag: *mut ::std::os::raw::c_void,
3936 );
3937}
3938extern "C" {
3939 #[doc = " Cancel all in-progress calls."]
3940 #[doc = "Only usable after shutdown."]
3941 pub fn grpc_server_cancel_all_calls(server: *mut grpc_server);
3942}
3943extern "C" {
3944 #[doc = " Destroy a server."]
3945 #[doc = "Shutdown must have completed beforehand (i.e. all tags generated by"]
3946 #[doc = "grpc_server_shutdown_and_notify must have been received, and at least"]
3947 #[doc = "one call to grpc_server_shutdown_and_notify must have been made)."]
3948 pub fn grpc_server_destroy(server: *mut grpc_server);
3949}
3950extern "C" {
3951 #[doc = " Enable or disable a tracer."]
3952 #[doc = ""]
3953 #[doc = "Tracers (usually controlled by the environment variable GRPC_TRACE)"]
3954 #[doc = "allow printf-style debugging on GRPC internals, and are useful for"]
3955 #[doc = "tracking down problems in the field."]
3956 #[doc = ""]
3957 #[doc = "Use of this function is not strictly thread-safe, but the"]
3958 #[doc = "thread-safety issues raised by it should not be of concern."]
3959 pub fn grpc_tracer_set_enabled(
3960 name: *const ::std::os::raw::c_char,
3961 enabled: ::std::os::raw::c_int,
3962 ) -> ::std::os::raw::c_int;
3963}
3964extern "C" {
3965 #[doc = " Check whether a metadata key is legal (will be accepted by core)"]
3966 pub fn grpc_header_key_is_legal(slice: grpc_slice) -> ::std::os::raw::c_int;
3967}
3968extern "C" {
3969 #[doc = " Check whether a non-binary metadata value is legal (will be accepted by"]
3970 #[doc = "core)"]
3971 pub fn grpc_header_nonbin_value_is_legal(slice: grpc_slice) -> ::std::os::raw::c_int;
3972}
3973extern "C" {
3974 #[doc = " Check whether a metadata key corresponds to a binary value"]
3975 pub fn grpc_is_binary_header(slice: grpc_slice) -> ::std::os::raw::c_int;
3976}
3977extern "C" {
3978 #[doc = " Convert grpc_call_error values to a string"]
3979 pub fn grpc_call_error_to_string(error: grpc_call_error) -> *const ::std::os::raw::c_char;
3980}
3981extern "C" {
3982 #[doc = " Create a buffer pool"]
3983 pub fn grpc_resource_quota_create(
3984 trace_name: *const ::std::os::raw::c_char,
3985 ) -> *mut grpc_resource_quota;
3986}
3987extern "C" {
3988 #[doc = " Add a reference to a buffer pool"]
3989 pub fn grpc_resource_quota_ref(resource_quota: *mut grpc_resource_quota);
3990}
3991extern "C" {
3992 #[doc = " Drop a reference to a buffer pool"]
3993 pub fn grpc_resource_quota_unref(resource_quota: *mut grpc_resource_quota);
3994}
3995extern "C" {
3996 #[doc = " Update the size of a buffer pool"]
3997 pub fn grpc_resource_quota_resize(resource_quota: *mut grpc_resource_quota, new_size: usize);
3998}
3999extern "C" {
4000 #[doc = " Update the size of the maximum number of threads allowed"]
4001 pub fn grpc_resource_quota_set_max_threads(
4002 resource_quota: *mut grpc_resource_quota,
4003 new_max_threads: ::std::os::raw::c_int,
4004 );
4005}
4006extern "C" {
4007 #[doc = " Fetch a vtable for a grpc_channel_arg that points to a grpc_resource_quota"]
4008 pub fn grpc_resource_quota_arg_vtable() -> *const grpc_arg_pointer_vtable;
4009}
4010extern "C" {
4011 #[doc = " CHANNELZ API *************/"]
4012 #[doc = "churn as the feature is implemented. This comment will be removed once"]
4013 #[doc = "channelz is officially supported, and these APIs become stable. For now"]
4014 #[doc = "you may track the progress by following this github issue:"]
4015 #[doc = "https://github.com/grpc/grpc/issues/15340"]
4016 #[doc = ""]
4017 #[doc = "the following APIs return allocated JSON strings that match the response"]
4018 #[doc = "objects from the channelz proto, found here:"]
4019 #[doc = "https://github.com/grpc/grpc/blob/master/src/proto/grpc/channelz/channelz.proto."]
4020 #[doc = ""]
4021 #[doc = "For easy conversion to protobuf, The JSON is formatted according to:"]
4022 #[doc = "https://developers.google.com/protocol-buffers/docs/proto3#json."]
4023 pub fn grpc_channelz_get_top_channels(start_channel_id: isize) -> *mut ::std::os::raw::c_char;
4024}
4025extern "C" {
4026 pub fn grpc_channelz_get_servers(start_server_id: isize) -> *mut ::std::os::raw::c_char;
4027}
4028extern "C" {
4029 pub fn grpc_channelz_get_server(server_id: isize) -> *mut ::std::os::raw::c_char;
4030}
4031extern "C" {
4032 pub fn grpc_channelz_get_server_sockets(
4033 server_id: isize,
4034 start_socket_id: isize,
4035 max_results: isize,
4036 ) -> *mut ::std::os::raw::c_char;
4037}
4038extern "C" {
4039 pub fn grpc_channelz_get_channel(channel_id: isize) -> *mut ::std::os::raw::c_char;
4040}
4041extern "C" {
4042 pub fn grpc_channelz_get_subchannel(subchannel_id: isize) -> *mut ::std::os::raw::c_char;
4043}
4044extern "C" {
4045 pub fn grpc_channelz_get_socket(socket_id: isize) -> *mut ::std::os::raw::c_char;
4046}
4047extern "C" {
4048 pub fn grpc_cronet_secure_channel_create(
4049 engine: *mut ::std::os::raw::c_void,
4050 target: *const ::std::os::raw::c_char,
4051 args: *const grpc_channel_args,
4052 reserved: *mut ::std::os::raw::c_void,
4053 ) -> *mut grpc_channel;
4054}
4055extern "C" {
4056 #[doc = " Create a client channel to 'target' using file descriptor 'fd'. The 'target'"]
4057 #[doc = "argument will be used to indicate the name for this channel. See the comment"]
4058 #[doc = "for grpc_insecure_channel_create for description of 'args' argument."]
4059 pub fn grpc_insecure_channel_create_from_fd(
4060 target: *const ::std::os::raw::c_char,
4061 fd: ::std::os::raw::c_int,
4062 args: *const grpc_channel_args,
4063 ) -> *mut grpc_channel;
4064}
4065extern "C" {
4066 #[doc = " Add the connected communication channel based on file descriptor 'fd' to the"]
4067 #[doc = "'server'. The 'fd' must be an open file descriptor corresponding to a"]
4068 #[doc = "connected socket. Events from the file descriptor may come on any of the"]
4069 #[doc = "server completion queues (i.e completion queues registered via the"]
4070 #[doc = "grpc_server_register_completion_queue API)."]
4071 #[doc = ""]
4072 #[doc = "The 'reserved' pointer MUST be NULL."]
4073 pub fn grpc_server_add_insecure_channel_from_fd(
4074 server: *mut grpc_server,
4075 reserved: *mut ::std::os::raw::c_void,
4076 fd: ::std::os::raw::c_int,
4077 );
4078}
4079#[repr(u32)]
4080#[doc = " Results for the SSL roots override callback."]
4081#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
4082pub enum grpc_ssl_roots_override_result {
4083 GRPC_SSL_ROOTS_OVERRIDE_OK = 0,
4084 GRPC_SSL_ROOTS_OVERRIDE_FAIL_PERMANENTLY = 1,
4085 #[doc = " Do not try fallback options."]
4086 GRPC_SSL_ROOTS_OVERRIDE_FAIL = 2,
4087}
4088#[repr(u32)]
4089#[doc = " Callback results for dynamically loading a SSL certificate config."]
4090#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
4091pub enum grpc_ssl_certificate_config_reload_status {
4092 GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_UNCHANGED = 0,
4093 GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_NEW = 1,
4094 GRPC_SSL_CERTIFICATE_CONFIG_RELOAD_FAIL = 2,
4095}
4096#[repr(u32)]
4097#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
4098pub enum grpc_ssl_client_certificate_request_type {
4099 #[doc = " Server does not request client certificate."]
4100 #[doc = "The certificate presented by the client is not checked by the server at"]
4101 #[doc = "all. (A client may present a self signed or signed certificate or not"]
4102 #[doc = "present a certificate at all and any of those option would be accepted)"]
4103 GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE = 0,
4104 #[doc = " Server requests client certificate but does not enforce that the client"]
4105 #[doc = "presents a certificate."]
4106 #[doc = ""]
4107 #[doc = "If the client presents a certificate, the client authentication is left to"]
4108 #[doc = "the application (the necessary metadata will be available to the"]
4109 #[doc = "application via authentication context properties, see grpc_auth_context)."]
4110 #[doc = ""]
4111 #[doc = "The client's key certificate pair must be valid for the SSL connection to"]
4112 #[doc = "be established."]
4113 GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY = 1,
4114 #[doc = " Server requests client certificate but does not enforce that the client"]
4115 #[doc = "presents a certificate."]
4116 #[doc = ""]
4117 #[doc = "If the client presents a certificate, the client authentication is done by"]
4118 #[doc = "the gRPC framework. (For a successful connection the client needs to either"]
4119 #[doc = "present a certificate that can be verified against the root certificate"]
4120 #[doc = "configured by the server or not present a certificate at all)"]
4121 #[doc = ""]
4122 #[doc = "The client's key certificate pair must be valid for the SSL connection to"]
4123 #[doc = "be established."]
4124 GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY = 2,
4125 #[doc = " Server requests client certificate and enforces that the client presents a"]
4126 #[doc = "certificate."]
4127 #[doc = ""]
4128 #[doc = "If the client presents a certificate, the client authentication is left to"]
4129 #[doc = "the application (the necessary metadata will be available to the"]
4130 #[doc = "application via authentication context properties, see grpc_auth_context)."]
4131 #[doc = ""]
4132 #[doc = "The client's key certificate pair must be valid for the SSL connection to"]
4133 #[doc = "be established."]
4134 GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY = 3,
4135 #[doc = " Server requests client certificate and enforces that the client presents a"]
4136 #[doc = "certificate."]
4137 #[doc = ""]
4138 #[doc = "The certificate presented by the client is verified by the gRPC framework."]
4139 #[doc = "(For a successful connection the client needs to present a certificate that"]
4140 #[doc = "can be verified against the root certificate configured by the server)"]
4141 #[doc = ""]
4142 #[doc = "The client's key certificate pair must be valid for the SSL connection to"]
4143 #[doc = "be established."]
4144 GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY = 4,
4145}
4146impl grpc_security_level {
4147 pub const GRPC_SECURITY_NONE: grpc_security_level = grpc_security_level::GRPC_SECURITY_MIN;
4148}
4149impl grpc_security_level {
4150 pub const GRPC_SECURITY_MAX: grpc_security_level =
4151 grpc_security_level::GRPC_PRIVACY_AND_INTEGRITY;
4152}
4153#[repr(u32)]
4154#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
4155pub enum grpc_security_level {
4156 GRPC_SECURITY_MIN = 0,
4157 GRPC_INTEGRITY_ONLY = 1,
4158 GRPC_PRIVACY_AND_INTEGRITY = 2,
4159}
4160#[repr(u32)]
4161#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
4162pub enum grpc_tls_server_verification_option {
4163 #[doc = " Default option: performs server certificate verification and hostname"]
4164 #[doc = "verification."]
4165 GRPC_TLS_SERVER_VERIFICATION = 0,
4166 #[doc = " Performs server certificate verification, but skips hostname verification"]
4167 #[doc = "Client is responsible for verifying server's identity via"]
4168 #[doc = "server authorization check callback."]
4169 GRPC_TLS_SKIP_HOSTNAME_VERIFICATION = 1,
4170 #[doc = " Skips both server certificate and hostname verification."]
4171 #[doc = "Client is responsible for verifying server's identity and"]
4172 #[doc = "server's certificate via server authorization check callback."]
4173 GRPC_TLS_SKIP_ALL_SERVER_VERIFICATION = 2,
4174}
4175#[repr(u32)]
4176#[doc = " Type of local connections for which local channel/server credentials will be"]
4177#[doc = " applied. It supports UDS and local TCP connections."]
4178#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
4179pub enum grpc_local_connect_type {
4180 UDS = 0,
4181 LOCAL_TCP = 1,
4182}
4183#[repr(C)]
4184#[derive(Debug, Copy, Clone)]
4185pub struct grpc_auth_context {
4186 _unused: [u8; 0],
4187}
4188#[repr(C)]
4189#[derive(Debug, Copy, Clone)]
4190pub struct grpc_auth_property_iterator {
4191 pub ctx: *const grpc_auth_context,
4192 pub index: usize,
4193 pub name: *const ::std::os::raw::c_char,
4194}
4195#[test]
4196fn bindgen_test_layout_grpc_auth_property_iterator() {
4197 assert_eq!(
4198 ::std::mem::size_of::<grpc_auth_property_iterator>(),
4199 24usize,
4200 concat!("Size of: ", stringify!(grpc_auth_property_iterator))
4201 );
4202 assert_eq!(
4203 ::std::mem::align_of::<grpc_auth_property_iterator>(),
4204 8usize,
4205 concat!("Alignment of ", stringify!(grpc_auth_property_iterator))
4206 );
4207 assert_eq!(
4208 unsafe { &(*(::std::ptr::null::<grpc_auth_property_iterator>())).ctx as *const _ as usize },
4209 0usize,
4210 concat!(
4211 "Offset of field: ",
4212 stringify!(grpc_auth_property_iterator),
4213 "::",
4214 stringify!(ctx)
4215 )
4216 );
4217 assert_eq!(
4218 unsafe {
4219 &(*(::std::ptr::null::<grpc_auth_property_iterator>())).index as *const _ as usize
4220 },
4221 8usize,
4222 concat!(
4223 "Offset of field: ",
4224 stringify!(grpc_auth_property_iterator),
4225 "::",
4226 stringify!(index)
4227 )
4228 );
4229 assert_eq!(
4230 unsafe {
4231 &(*(::std::ptr::null::<grpc_auth_property_iterator>())).name as *const _ as usize
4232 },
4233 16usize,
4234 concat!(
4235 "Offset of field: ",
4236 stringify!(grpc_auth_property_iterator),
4237 "::",
4238 stringify!(name)
4239 )
4240 );
4241}
4242#[doc = " value, if not NULL, is guaranteed to be NULL terminated."]
4243#[repr(C)]
4244#[derive(Debug, Copy, Clone)]
4245pub struct grpc_auth_property {
4246 pub name: *mut ::std::os::raw::c_char,
4247 pub value: *mut ::std::os::raw::c_char,
4248 pub value_length: usize,
4249}
4250#[test]
4251fn bindgen_test_layout_grpc_auth_property() {
4252 assert_eq!(
4253 ::std::mem::size_of::<grpc_auth_property>(),
4254 24usize,
4255 concat!("Size of: ", stringify!(grpc_auth_property))
4256 );
4257 assert_eq!(
4258 ::std::mem::align_of::<grpc_auth_property>(),
4259 8usize,
4260 concat!("Alignment of ", stringify!(grpc_auth_property))
4261 );
4262 assert_eq!(
4263 unsafe { &(*(::std::ptr::null::<grpc_auth_property>())).name as *const _ as usize },
4264 0usize,
4265 concat!(
4266 "Offset of field: ",
4267 stringify!(grpc_auth_property),
4268 "::",
4269 stringify!(name)
4270 )
4271 );
4272 assert_eq!(
4273 unsafe { &(*(::std::ptr::null::<grpc_auth_property>())).value as *const _ as usize },
4274 8usize,
4275 concat!(
4276 "Offset of field: ",
4277 stringify!(grpc_auth_property),
4278 "::",
4279 stringify!(value)
4280 )
4281 );
4282 assert_eq!(
4283 unsafe { &(*(::std::ptr::null::<grpc_auth_property>())).value_length as *const _ as usize },
4284 16usize,
4285 concat!(
4286 "Offset of field: ",
4287 stringify!(grpc_auth_property),
4288 "::",
4289 stringify!(value_length)
4290 )
4291 );
4292}
4293extern "C" {
4294 #[doc = " Returns NULL when the iterator is at the end."]
4295 pub fn grpc_auth_property_iterator_next(
4296 it: *mut grpc_auth_property_iterator,
4297 ) -> *const grpc_auth_property;
4298}
4299extern "C" {
4300 #[doc = " Iterates over the auth context."]
4301 pub fn grpc_auth_context_property_iterator(
4302 ctx: *const grpc_auth_context,
4303 ) -> grpc_auth_property_iterator;
4304}
4305extern "C" {
4306 #[doc = " Gets the peer identity. Returns an empty iterator (first _next will return"]
4307 #[doc = "NULL) if the peer is not authenticated."]
4308 pub fn grpc_auth_context_peer_identity(
4309 ctx: *const grpc_auth_context,
4310 ) -> grpc_auth_property_iterator;
4311}
4312extern "C" {
4313 #[doc = " Finds a property in the context. May return an empty iterator (first _next"]
4314 #[doc = "will return NULL) if no property with this name was found in the context."]
4315 pub fn grpc_auth_context_find_properties_by_name(
4316 ctx: *const grpc_auth_context,
4317 name: *const ::std::os::raw::c_char,
4318 ) -> grpc_auth_property_iterator;
4319}
4320extern "C" {
4321 #[doc = " Gets the name of the property that indicates the peer identity. Will return"]
4322 #[doc = "NULL if the peer is not authenticated."]
4323 pub fn grpc_auth_context_peer_identity_property_name(
4324 ctx: *const grpc_auth_context,
4325 ) -> *const ::std::os::raw::c_char;
4326}
4327extern "C" {
4328 #[doc = " Returns 1 if the peer is authenticated, 0 otherwise."]
4329 pub fn grpc_auth_context_peer_is_authenticated(
4330 ctx: *const grpc_auth_context,
4331 ) -> ::std::os::raw::c_int;
4332}
4333extern "C" {
4334 #[doc = " Gets the auth context from the call. Caller needs to call"]
4335 #[doc = "grpc_auth_context_release on the returned context."]
4336 pub fn grpc_call_auth_context(call: *mut grpc_call) -> *mut grpc_auth_context;
4337}
4338extern "C" {
4339 #[doc = " Releases the auth context returned from grpc_call_auth_context."]
4340 pub fn grpc_auth_context_release(context: *mut grpc_auth_context);
4341}
4342extern "C" {
4343 #[doc = " Add a property."]
4344 pub fn grpc_auth_context_add_property(
4345 ctx: *mut grpc_auth_context,
4346 name: *const ::std::os::raw::c_char,
4347 value: *const ::std::os::raw::c_char,
4348 value_length: usize,
4349 );
4350}
4351extern "C" {
4352 #[doc = " Add a C string property."]
4353 pub fn grpc_auth_context_add_cstring_property(
4354 ctx: *mut grpc_auth_context,
4355 name: *const ::std::os::raw::c_char,
4356 value: *const ::std::os::raw::c_char,
4357 );
4358}
4359extern "C" {
4360 #[doc = " Sets the property name. Returns 1 if successful or 0 in case of failure"]
4361 #[doc = "(which means that no property with this name exists)."]
4362 pub fn grpc_auth_context_set_peer_identity_property_name(
4363 ctx: *mut grpc_auth_context,
4364 name: *const ::std::os::raw::c_char,
4365 ) -> ::std::os::raw::c_int;
4366}
4367#[repr(C)]
4368#[derive(Debug, Copy, Clone)]
4369pub struct grpc_ssl_session_cache {
4370 _unused: [u8; 0],
4371}
4372extern "C" {
4373 #[doc = " Create LRU cache for client-side SSL sessions with the given capacity."]
4374 #[doc = "If capacity is < 1, a default capacity is used instead."]
4375 pub fn grpc_ssl_session_cache_create_lru(capacity: usize) -> *mut grpc_ssl_session_cache;
4376}
4377extern "C" {
4378 #[doc = " Destroy SSL session cache."]
4379 pub fn grpc_ssl_session_cache_destroy(cache: *mut grpc_ssl_session_cache);
4380}
4381extern "C" {
4382 #[doc = " Create a channel arg with the given cache object."]
4383 pub fn grpc_ssl_session_cache_create_channel_arg(
4384 cache: *mut grpc_ssl_session_cache,
4385 ) -> grpc_arg;
4386}
4387#[repr(C)]
4388#[derive(Debug, Copy, Clone)]
4389pub struct grpc_channel_credentials {
4390 _unused: [u8; 0],
4391}
4392extern "C" {
4393 #[doc = " Releases a channel credentials object."]
4394 #[doc = "The creator of the credentials object is responsible for its release."]
4395 pub fn grpc_channel_credentials_release(creds: *mut grpc_channel_credentials);
4396}
4397extern "C" {
4398 #[doc = " Creates default credentials to connect to a google gRPC service."]
4399 #[doc = "WARNING: Do NOT use this credentials to connect to a non-google service as"]
4400 #[doc = "this could result in an oauth2 token leak. The security level of the"]
4401 #[doc = "resulting connection is GRPC_PRIVACY_AND_INTEGRITY."]
4402 pub fn grpc_google_default_credentials_create() -> *mut grpc_channel_credentials;
4403}
4404#[doc = " Callback for getting the SSL roots override from the application."]
4405#[doc = "In case of success, *pem_roots_certs must be set to a NULL terminated string"]
4406#[doc = "containing the list of PEM encoded root certificates. The ownership is passed"]
4407#[doc = "to the core and freed (laster by the core) with gpr_free."]
4408#[doc = "If this function fails and GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment is"]
4409#[doc = "set to a valid path, it will override the roots specified this func"]
4410pub type grpc_ssl_roots_override_callback = ::std::option::Option<
4411 unsafe extern "C" fn(
4412 pem_root_certs: *mut *mut ::std::os::raw::c_char,
4413 ) -> grpc_ssl_roots_override_result,
4414>;
4415extern "C" {
4416 #[doc = " Setup a callback to override the default TLS/SSL roots."]
4417 #[doc = "This function is not thread-safe and must be called at initialization time"]
4418 #[doc = "before any ssl credentials are created to have the desired side effect."]
4419 #[doc = "If GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment is set to a valid path, the"]
4420 #[doc = "callback will not be called."]
4421 pub fn grpc_set_ssl_roots_override_callback(cb: grpc_ssl_roots_override_callback);
4422}
4423#[doc = " Object that holds a private key / certificate chain pair in PEM format."]
4424#[repr(C)]
4425#[derive(Debug, Copy, Clone)]
4426pub struct grpc_ssl_pem_key_cert_pair {
4427 #[doc = " private_key is the NULL-terminated string containing the PEM encoding of"]
4428 #[doc = "the client's private key."]
4429 pub private_key: *const ::std::os::raw::c_char,
4430 #[doc = " cert_chain is the NULL-terminated string containing the PEM encoding of"]
4431 #[doc = "the client's certificate chain."]
4432 pub cert_chain: *const ::std::os::raw::c_char,
4433}
4434#[test]
4435fn bindgen_test_layout_grpc_ssl_pem_key_cert_pair() {
4436 assert_eq!(
4437 ::std::mem::size_of::<grpc_ssl_pem_key_cert_pair>(),
4438 16usize,
4439 concat!("Size of: ", stringify!(grpc_ssl_pem_key_cert_pair))
4440 );
4441 assert_eq!(
4442 ::std::mem::align_of::<grpc_ssl_pem_key_cert_pair>(),
4443 8usize,
4444 concat!("Alignment of ", stringify!(grpc_ssl_pem_key_cert_pair))
4445 );
4446 assert_eq!(
4447 unsafe {
4448 &(*(::std::ptr::null::<grpc_ssl_pem_key_cert_pair>())).private_key as *const _ as usize
4449 },
4450 0usize,
4451 concat!(
4452 "Offset of field: ",
4453 stringify!(grpc_ssl_pem_key_cert_pair),
4454 "::",
4455 stringify!(private_key)
4456 )
4457 );
4458 assert_eq!(
4459 unsafe {
4460 &(*(::std::ptr::null::<grpc_ssl_pem_key_cert_pair>())).cert_chain as *const _ as usize
4461 },
4462 8usize,
4463 concat!(
4464 "Offset of field: ",
4465 stringify!(grpc_ssl_pem_key_cert_pair),
4466 "::",
4467 stringify!(cert_chain)
4468 )
4469 );
4470}
4471#[doc = " Deprecated in favor of grpc_ssl_verify_peer_options. It will be removed"]
4472#[doc = "after all of its call sites are migrated to grpc_ssl_verify_peer_options."]
4473#[doc = "Object that holds additional peer-verification options on a secure"]
4474#[doc = "channel."]
4475#[repr(C)]
4476#[derive(Debug, Copy, Clone)]
4477pub struct verify_peer_options {
4478 #[doc = " If non-NULL this callback will be invoked with the expected"]
4479 #[doc = "target_name, the peer's certificate (in PEM format), and whatever"]
4480 #[doc = "userdata pointer is set below. If a non-zero value is returned by this"]
4481 #[doc = "callback then it is treated as a verification failure. Invocation of"]
4482 #[doc = "the callback is blocking, so any implementation should be light-weight."]
4483 pub verify_peer_callback: ::std::option::Option<
4484 unsafe extern "C" fn(
4485 target_name: *const ::std::os::raw::c_char,
4486 peer_pem: *const ::std::os::raw::c_char,
4487 userdata: *mut ::std::os::raw::c_void,
4488 ) -> ::std::os::raw::c_int,
4489 >,
4490 #[doc = " Arbitrary userdata that will be passed as the last argument to"]
4491 #[doc = "verify_peer_callback."]
4492 pub verify_peer_callback_userdata: *mut ::std::os::raw::c_void,
4493 #[doc = " A destruct callback that will be invoked when the channel is being"]
4494 #[doc = "cleaned up. The userdata argument will be passed to it. The intent is"]
4495 #[doc = "to perform any cleanup associated with that userdata."]
4496 pub verify_peer_destruct:
4497 ::std::option::Option<unsafe extern "C" fn(userdata: *mut ::std::os::raw::c_void)>,
4498}
4499#[test]
4500fn bindgen_test_layout_verify_peer_options() {
4501 assert_eq!(
4502 ::std::mem::size_of::<verify_peer_options>(),
4503 24usize,
4504 concat!("Size of: ", stringify!(verify_peer_options))
4505 );
4506 assert_eq!(
4507 ::std::mem::align_of::<verify_peer_options>(),
4508 8usize,
4509 concat!("Alignment of ", stringify!(verify_peer_options))
4510 );
4511 assert_eq!(
4512 unsafe {
4513 &(*(::std::ptr::null::<verify_peer_options>())).verify_peer_callback as *const _
4514 as usize
4515 },
4516 0usize,
4517 concat!(
4518 "Offset of field: ",
4519 stringify!(verify_peer_options),
4520 "::",
4521 stringify!(verify_peer_callback)
4522 )
4523 );
4524 assert_eq!(
4525 unsafe {
4526 &(*(::std::ptr::null::<verify_peer_options>())).verify_peer_callback_userdata
4527 as *const _ as usize
4528 },
4529 8usize,
4530 concat!(
4531 "Offset of field: ",
4532 stringify!(verify_peer_options),
4533 "::",
4534 stringify!(verify_peer_callback_userdata)
4535 )
4536 );
4537 assert_eq!(
4538 unsafe {
4539 &(*(::std::ptr::null::<verify_peer_options>())).verify_peer_destruct as *const _
4540 as usize
4541 },
4542 16usize,
4543 concat!(
4544 "Offset of field: ",
4545 stringify!(verify_peer_options),
4546 "::",
4547 stringify!(verify_peer_destruct)
4548 )
4549 );
4550}
4551#[doc = " Object that holds additional peer-verification options on a secure"]
4552#[doc = "channel."]
4553#[repr(C)]
4554#[derive(Debug, Copy, Clone)]
4555pub struct grpc_ssl_verify_peer_options {
4556 #[doc = " If non-NULL this callback will be invoked with the expected"]
4557 #[doc = "target_name, the peer's certificate (in PEM format), and whatever"]
4558 #[doc = "userdata pointer is set below. If a non-zero value is returned by this"]
4559 #[doc = "callback then it is treated as a verification failure. Invocation of"]
4560 #[doc = "the callback is blocking, so any implementation should be light-weight."]
4561 pub verify_peer_callback: ::std::option::Option<
4562 unsafe extern "C" fn(
4563 target_name: *const ::std::os::raw::c_char,
4564 peer_pem: *const ::std::os::raw::c_char,
4565 userdata: *mut ::std::os::raw::c_void,
4566 ) -> ::std::os::raw::c_int,
4567 >,
4568 #[doc = " Arbitrary userdata that will be passed as the last argument to"]
4569 #[doc = "verify_peer_callback."]
4570 pub verify_peer_callback_userdata: *mut ::std::os::raw::c_void,
4571 #[doc = " A destruct callback that will be invoked when the channel is being"]
4572 #[doc = "cleaned up. The userdata argument will be passed to it. The intent is"]
4573 #[doc = "to perform any cleanup associated with that userdata."]
4574 pub verify_peer_destruct:
4575 ::std::option::Option<unsafe extern "C" fn(userdata: *mut ::std::os::raw::c_void)>,
4576}
4577#[test]
4578fn bindgen_test_layout_grpc_ssl_verify_peer_options() {
4579 assert_eq!(
4580 ::std::mem::size_of::<grpc_ssl_verify_peer_options>(),
4581 24usize,
4582 concat!("Size of: ", stringify!(grpc_ssl_verify_peer_options))
4583 );
4584 assert_eq!(
4585 ::std::mem::align_of::<grpc_ssl_verify_peer_options>(),
4586 8usize,
4587 concat!("Alignment of ", stringify!(grpc_ssl_verify_peer_options))
4588 );
4589 assert_eq!(
4590 unsafe {
4591 &(*(::std::ptr::null::<grpc_ssl_verify_peer_options>())).verify_peer_callback
4592 as *const _ as usize
4593 },
4594 0usize,
4595 concat!(
4596 "Offset of field: ",
4597 stringify!(grpc_ssl_verify_peer_options),
4598 "::",
4599 stringify!(verify_peer_callback)
4600 )
4601 );
4602 assert_eq!(
4603 unsafe {
4604 &(*(::std::ptr::null::<grpc_ssl_verify_peer_options>())).verify_peer_callback_userdata
4605 as *const _ as usize
4606 },
4607 8usize,
4608 concat!(
4609 "Offset of field: ",
4610 stringify!(grpc_ssl_verify_peer_options),
4611 "::",
4612 stringify!(verify_peer_callback_userdata)
4613 )
4614 );
4615 assert_eq!(
4616 unsafe {
4617 &(*(::std::ptr::null::<grpc_ssl_verify_peer_options>())).verify_peer_destruct
4618 as *const _ as usize
4619 },
4620 16usize,
4621 concat!(
4622 "Offset of field: ",
4623 stringify!(grpc_ssl_verify_peer_options),
4624 "::",
4625 stringify!(verify_peer_destruct)
4626 )
4627 );
4628}
4629extern "C" {
4630 #[doc = " Deprecated in favor of grpc_ssl_server_credentials_create_ex. It will be"]
4631 #[doc = "removed after all of its call sites are migrated to"]
4632 #[doc = "grpc_ssl_server_credentials_create_ex. Creates an SSL credentials object."]
4633 #[doc = "The security level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY."]
4634 #[doc = "- pem_root_certs is the NULL-terminated string containing the PEM encoding"]
4635 #[doc = "of the server root certificates. If this parameter is NULL, the"]
4636 #[doc = "implementation will first try to dereference the file pointed by the"]
4637 #[doc = "GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment variable, and if that fails,"]
4638 #[doc = "try to get the roots set by grpc_override_ssl_default_roots. Eventually,"]
4639 #[doc = "if all these fail, it will try to get the roots from a well-known place on"]
4640 #[doc = "disk (in the grpc install directory)."]
4641 #[doc = ""]
4642 #[doc = "gRPC has implemented root cache if the underlying OpenSSL library supports"]
4643 #[doc = "it. The gRPC root certificates cache is only applicable on the default"]
4644 #[doc = "root certificates, which is used when this parameter is nullptr. If user"]
4645 #[doc = "provides their own pem_root_certs, when creating an SSL credential object,"]
4646 #[doc = "gRPC would not be able to cache it, and each subchannel will generate a"]
4647 #[doc = "copy of the root store. So it is recommended to avoid providing large room"]
4648 #[doc = "pem with pem_root_certs parameter to avoid excessive memory consumption,"]
4649 #[doc = "particularly on mobile platforms such as iOS."]
4650 #[doc = "- pem_key_cert_pair is a pointer on the object containing client's private"]
4651 #[doc = "key and certificate chain. This parameter can be NULL if the client does"]
4652 #[doc = "not have such a key/cert pair."]
4653 #[doc = "- verify_options is an optional verify_peer_options object which holds"]
4654 #[doc = "additional options controlling how peer certificates are verified. For"]
4655 #[doc = "example, you can supply a callback which receives the peer's certificate"]
4656 #[doc = "with which you can do additional verification. Can be NULL, in which"]
4657 #[doc = "case verification will retain default behavior. Any settings in"]
4658 #[doc = "verify_options are copied during this call, so the verify_options"]
4659 #[doc = "object can be released afterwards."]
4660 pub fn grpc_ssl_credentials_create(
4661 pem_root_certs: *const ::std::os::raw::c_char,
4662 pem_key_cert_pair: *mut grpc_ssl_pem_key_cert_pair,
4663 verify_options: *const verify_peer_options,
4664 reserved: *mut ::std::os::raw::c_void,
4665 ) -> *mut grpc_channel_credentials;
4666}
4667extern "C" {
4668 pub fn grpc_ssl_credentials_create_ex(
4669 pem_root_certs: *const ::std::os::raw::c_char,
4670 pem_key_cert_pair: *mut grpc_ssl_pem_key_cert_pair,
4671 verify_options: *const grpc_ssl_verify_peer_options,
4672 reserved: *mut ::std::os::raw::c_void,
4673 ) -> *mut grpc_channel_credentials;
4674}
4675#[repr(C)]
4676#[derive(Debug, Copy, Clone)]
4677pub struct grpc_call_credentials {
4678 _unused: [u8; 0],
4679}
4680extern "C" {
4681 #[doc = " Releases a call credentials object."]
4682 #[doc = "The creator of the credentials object is responsible for its release."]
4683 pub fn grpc_call_credentials_release(creds: *mut grpc_call_credentials);
4684}
4685extern "C" {
4686 #[doc = " Creates a composite channel credentials object. The security level of"]
4687 #[doc = " resulting connection is determined by channel_creds."]
4688 pub fn grpc_composite_channel_credentials_create(
4689 channel_creds: *mut grpc_channel_credentials,
4690 call_creds: *mut grpc_call_credentials,
4691 reserved: *mut ::std::os::raw::c_void,
4692 ) -> *mut grpc_channel_credentials;
4693}
4694extern "C" {
4695 #[doc = " Creates a composite call credentials object."]
4696 pub fn grpc_composite_call_credentials_create(
4697 creds1: *mut grpc_call_credentials,
4698 creds2: *mut grpc_call_credentials,
4699 reserved: *mut ::std::os::raw::c_void,
4700 ) -> *mut grpc_call_credentials;
4701}
4702extern "C" {
4703 #[doc = " Creates a compute engine credentials object for connecting to Google."]
4704 #[doc = "WARNING: Do NOT use this credentials to connect to a non-google service as"]
4705 #[doc = "this could result in an oauth2 token leak."]
4706 pub fn grpc_google_compute_engine_credentials_create(
4707 reserved: *mut ::std::os::raw::c_void,
4708 ) -> *mut grpc_call_credentials;
4709}
4710extern "C" {
4711 pub fn grpc_max_auth_token_lifetime() -> gpr_timespec;
4712}
4713extern "C" {
4714 #[doc = " Creates a JWT credentials object. May return NULL if the input is invalid."]
4715 #[doc = "- json_key is the JSON key string containing the client's private key."]
4716 #[doc = "- token_lifetime is the lifetime of each Json Web Token (JWT) created with"]
4717 #[doc = "this credentials. It should not exceed grpc_max_auth_token_lifetime or"]
4718 #[doc = "will be cropped to this value."]
4719 pub fn grpc_service_account_jwt_access_credentials_create(
4720 json_key: *const ::std::os::raw::c_char,
4721 token_lifetime: gpr_timespec,
4722 reserved: *mut ::std::os::raw::c_void,
4723 ) -> *mut grpc_call_credentials;
4724}
4725extern "C" {
4726 #[doc = " Creates an Oauth2 Refresh Token credentials object for connecting to Google."]
4727 #[doc = "May return NULL if the input is invalid."]
4728 #[doc = "WARNING: Do NOT use this credentials to connect to a non-google service as"]
4729 #[doc = "this could result in an oauth2 token leak."]
4730 #[doc = "- json_refresh_token is the JSON string containing the refresh token itself"]
4731 #[doc = "along with a client_id and client_secret."]
4732 pub fn grpc_google_refresh_token_credentials_create(
4733 json_refresh_token: *const ::std::os::raw::c_char,
4734 reserved: *mut ::std::os::raw::c_void,
4735 ) -> *mut grpc_call_credentials;
4736}
4737extern "C" {
4738 #[doc = " Creates an Oauth2 Access Token credentials with an access token that was"]
4739 #[doc = "acquired by an out of band mechanism."]
4740 pub fn grpc_access_token_credentials_create(
4741 access_token: *const ::std::os::raw::c_char,
4742 reserved: *mut ::std::os::raw::c_void,
4743 ) -> *mut grpc_call_credentials;
4744}
4745extern "C" {
4746 #[doc = " Creates an IAM credentials object for connecting to Google."]
4747 pub fn grpc_google_iam_credentials_create(
4748 authorization_token: *const ::std::os::raw::c_char,
4749 authority_selector: *const ::std::os::raw::c_char,
4750 reserved: *mut ::std::os::raw::c_void,
4751 ) -> *mut grpc_call_credentials;
4752}
4753#[doc = " Options for creating STS Oauth Token Exchange credentials following the IETF"]
4754#[doc = "draft https://tools.ietf.org/html/draft-ietf-oauth-token-exchange-16."]
4755#[doc = "Optional fields may be set to NULL or empty string. It is the responsibility"]
4756#[doc = "of the caller to ensure that the subject and actor tokens are refreshed on"]
4757#[doc = "disk at the specified paths. This API is used for experimental purposes for"]
4758#[doc = "now and may change in the future."]
4759#[repr(C)]
4760#[derive(Debug, Copy, Clone)]
4761pub struct grpc_sts_credentials_options {
4762 pub token_exchange_service_uri: *const ::std::os::raw::c_char,
4763 pub resource: *const ::std::os::raw::c_char,
4764 pub audience: *const ::std::os::raw::c_char,
4765 pub scope: *const ::std::os::raw::c_char,
4766 pub requested_token_type: *const ::std::os::raw::c_char,
4767 pub subject_token_path: *const ::std::os::raw::c_char,
4768 pub subject_token_type: *const ::std::os::raw::c_char,
4769 pub actor_token_path: *const ::std::os::raw::c_char,
4770 pub actor_token_type: *const ::std::os::raw::c_char,
4771}
4772#[test]
4773fn bindgen_test_layout_grpc_sts_credentials_options() {
4774 assert_eq!(
4775 ::std::mem::size_of::<grpc_sts_credentials_options>(),
4776 72usize,
4777 concat!("Size of: ", stringify!(grpc_sts_credentials_options))
4778 );
4779 assert_eq!(
4780 ::std::mem::align_of::<grpc_sts_credentials_options>(),
4781 8usize,
4782 concat!("Alignment of ", stringify!(grpc_sts_credentials_options))
4783 );
4784 assert_eq!(
4785 unsafe {
4786 &(*(::std::ptr::null::<grpc_sts_credentials_options>())).token_exchange_service_uri
4787 as *const _ as usize
4788 },
4789 0usize,
4790 concat!(
4791 "Offset of field: ",
4792 stringify!(grpc_sts_credentials_options),
4793 "::",
4794 stringify!(token_exchange_service_uri)
4795 )
4796 );
4797 assert_eq!(
4798 unsafe {
4799 &(*(::std::ptr::null::<grpc_sts_credentials_options>())).resource as *const _ as usize
4800 },
4801 8usize,
4802 concat!(
4803 "Offset of field: ",
4804 stringify!(grpc_sts_credentials_options),
4805 "::",
4806 stringify!(resource)
4807 )
4808 );
4809 assert_eq!(
4810 unsafe {
4811 &(*(::std::ptr::null::<grpc_sts_credentials_options>())).audience as *const _ as usize
4812 },
4813 16usize,
4814 concat!(
4815 "Offset of field: ",
4816 stringify!(grpc_sts_credentials_options),
4817 "::",
4818 stringify!(audience)
4819 )
4820 );
4821 assert_eq!(
4822 unsafe {
4823 &(*(::std::ptr::null::<grpc_sts_credentials_options>())).scope as *const _ as usize
4824 },
4825 24usize,
4826 concat!(
4827 "Offset of field: ",
4828 stringify!(grpc_sts_credentials_options),
4829 "::",
4830 stringify!(scope)
4831 )
4832 );
4833 assert_eq!(
4834 unsafe {
4835 &(*(::std::ptr::null::<grpc_sts_credentials_options>())).requested_token_type
4836 as *const _ as usize
4837 },
4838 32usize,
4839 concat!(
4840 "Offset of field: ",
4841 stringify!(grpc_sts_credentials_options),
4842 "::",
4843 stringify!(requested_token_type)
4844 )
4845 );
4846 assert_eq!(
4847 unsafe {
4848 &(*(::std::ptr::null::<grpc_sts_credentials_options>())).subject_token_path as *const _
4849 as usize
4850 },
4851 40usize,
4852 concat!(
4853 "Offset of field: ",
4854 stringify!(grpc_sts_credentials_options),
4855 "::",
4856 stringify!(subject_token_path)
4857 )
4858 );
4859 assert_eq!(
4860 unsafe {
4861 &(*(::std::ptr::null::<grpc_sts_credentials_options>())).subject_token_type as *const _
4862 as usize
4863 },
4864 48usize,
4865 concat!(
4866 "Offset of field: ",
4867 stringify!(grpc_sts_credentials_options),
4868 "::",
4869 stringify!(subject_token_type)
4870 )
4871 );
4872 assert_eq!(
4873 unsafe {
4874 &(*(::std::ptr::null::<grpc_sts_credentials_options>())).actor_token_path as *const _
4875 as usize
4876 },
4877 56usize,
4878 concat!(
4879 "Offset of field: ",
4880 stringify!(grpc_sts_credentials_options),
4881 "::",
4882 stringify!(actor_token_path)
4883 )
4884 );
4885 assert_eq!(
4886 unsafe {
4887 &(*(::std::ptr::null::<grpc_sts_credentials_options>())).actor_token_type as *const _
4888 as usize
4889 },
4890 64usize,
4891 concat!(
4892 "Offset of field: ",
4893 stringify!(grpc_sts_credentials_options),
4894 "::",
4895 stringify!(actor_token_type)
4896 )
4897 );
4898}
4899extern "C" {
4900 #[doc = " Creates an STS credentials following the STS Token Exchanged specifed in the"]
4901 #[doc = "IETF draft https://tools.ietf.org/html/draft-ietf-oauth-token-exchange-16."]
4902 #[doc = "This API is used for experimental purposes for now and may change in the"]
4903 #[doc = "future."]
4904 pub fn grpc_sts_credentials_create(
4905 options: *const grpc_sts_credentials_options,
4906 reserved: *mut ::std::os::raw::c_void,
4907 ) -> *mut grpc_call_credentials;
4908}
4909#[doc = " Callback function to be called by the metadata credentials plugin"]
4910#[doc = "implementation when the metadata is ready."]
4911#[doc = "- user_data is the opaque pointer that was passed in the get_metadata method"]
4912#[doc = "of the grpc_metadata_credentials_plugin (see below)."]
4913#[doc = "- creds_md is an array of credentials metadata produced by the plugin. It"]
4914#[doc = "may be set to NULL in case of an error."]
4915#[doc = "- num_creds_md is the number of items in the creds_md array."]
4916#[doc = "- status must be GRPC_STATUS_OK in case of success or another specific error"]
4917#[doc = "code otherwise."]
4918#[doc = "- error_details contains details about the error if any. In case of success"]
4919#[doc = "it should be NULL and will be otherwise ignored."]
4920pub type grpc_credentials_plugin_metadata_cb = ::std::option::Option<
4921 unsafe extern "C" fn(
4922 user_data: *mut ::std::os::raw::c_void,
4923 creds_md: *const grpc_metadata,
4924 num_creds_md: usize,
4925 status: grpc_status_code::Type,
4926 error_details: *const ::std::os::raw::c_char,
4927 ),
4928>;
4929#[doc = " Context that can be used by metadata credentials plugin in order to create"]
4930#[doc = "auth related metadata."]
4931#[repr(C)]
4932#[derive(Debug, Copy, Clone)]
4933pub struct grpc_auth_metadata_context {
4934 #[doc = " The fully qualifed service url."]
4935 pub service_url: *const ::std::os::raw::c_char,
4936 #[doc = " The method name of the RPC being called (not fully qualified)."]
4937 #[doc = "The fully qualified method name can be built from the service_url:"]
4938 #[doc = "full_qualified_method_name = ctx->service_url + '/' + ctx->method_name."]
4939 pub method_name: *const ::std::os::raw::c_char,
4940 #[doc = " The auth_context of the channel which gives the server's identity."]
4941 pub channel_auth_context: *const grpc_auth_context,
4942 #[doc = " Reserved for future use."]
4943 pub reserved: *mut ::std::os::raw::c_void,
4944}
4945#[test]
4946fn bindgen_test_layout_grpc_auth_metadata_context() {
4947 assert_eq!(
4948 ::std::mem::size_of::<grpc_auth_metadata_context>(),
4949 32usize,
4950 concat!("Size of: ", stringify!(grpc_auth_metadata_context))
4951 );
4952 assert_eq!(
4953 ::std::mem::align_of::<grpc_auth_metadata_context>(),
4954 8usize,
4955 concat!("Alignment of ", stringify!(grpc_auth_metadata_context))
4956 );
4957 assert_eq!(
4958 unsafe {
4959 &(*(::std::ptr::null::<grpc_auth_metadata_context>())).service_url as *const _ as usize
4960 },
4961 0usize,
4962 concat!(
4963 "Offset of field: ",
4964 stringify!(grpc_auth_metadata_context),
4965 "::",
4966 stringify!(service_url)
4967 )
4968 );
4969 assert_eq!(
4970 unsafe {
4971 &(*(::std::ptr::null::<grpc_auth_metadata_context>())).method_name as *const _ as usize
4972 },
4973 8usize,
4974 concat!(
4975 "Offset of field: ",
4976 stringify!(grpc_auth_metadata_context),
4977 "::",
4978 stringify!(method_name)
4979 )
4980 );
4981 assert_eq!(
4982 unsafe {
4983 &(*(::std::ptr::null::<grpc_auth_metadata_context>())).channel_auth_context as *const _
4984 as usize
4985 },
4986 16usize,
4987 concat!(
4988 "Offset of field: ",
4989 stringify!(grpc_auth_metadata_context),
4990 "::",
4991 stringify!(channel_auth_context)
4992 )
4993 );
4994 assert_eq!(
4995 unsafe {
4996 &(*(::std::ptr::null::<grpc_auth_metadata_context>())).reserved as *const _ as usize
4997 },
4998 24usize,
4999 concat!(
5000 "Offset of field: ",
5001 stringify!(grpc_auth_metadata_context),
5002 "::",
5003 stringify!(reserved)
5004 )
5005 );
5006}
5007#[doc = " grpc_metadata_credentials plugin is an API user provided structure used to"]
5008#[doc = "create grpc_credentials objects that can be set on a channel (composed) or"]
5009#[doc = "a call. See grpc_credentials_metadata_create_from_plugin below."]
5010#[doc = "The grpc client stack will call the get_metadata method of the plugin for"]
5011#[doc = "every call in scope for the credentials created from it."]
5012#[repr(C)]
5013#[derive(Debug, Copy, Clone)]
5014pub struct grpc_metadata_credentials_plugin {
5015 #[doc = " The implementation of this method has to be non-blocking, but can"]
5016 #[doc = "be performed synchronously or asynchronously."]
5017 #[doc = ""]
5018 #[doc = "If processing occurs synchronously, returns non-zero and populates"]
5019 #[doc = "creds_md, num_creds_md, status, and error_details. In this case,"]
5020 #[doc = "the caller takes ownership of the entries in creds_md and of"]
5021 #[doc = "error_details. Note that if the plugin needs to return more than"]
5022 #[doc = "GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX entries in creds_md, it must"]
5023 #[doc = "return asynchronously."]
5024 #[doc = ""]
5025 #[doc = "If processing occurs asynchronously, returns zero and invokes \\a cb"]
5026 #[doc = "when processing is completed. \\a user_data will be passed as the"]
5027 #[doc = "first parameter of the callback. NOTE: \\a cb MUST be invoked in a"]
5028 #[doc = "different thread, not from the thread in which \\a get_metadata() is"]
5029 #[doc = "invoked."]
5030 #[doc = ""]
5031 #[doc = "\\a context is the information that can be used by the plugin to create"]
5032 #[doc = "auth metadata."]
5033 pub get_metadata: ::std::option::Option<
5034 unsafe extern "C" fn(
5035 state: *mut ::std::os::raw::c_void,
5036 context: grpc_auth_metadata_context,
5037 cb: grpc_credentials_plugin_metadata_cb,
5038 user_data: *mut ::std::os::raw::c_void,
5039 creds_md: *mut grpc_metadata,
5040 num_creds_md: *mut usize,
5041 status: *mut grpc_status_code::Type,
5042 error_details: *mut *const ::std::os::raw::c_char,
5043 ) -> ::std::os::raw::c_int,
5044 >,
5045 #[doc = " Implements debug string of the given plugin. This method returns an"]
5046 #[doc = " allocated string that the caller needs to free using gpr_free()"]
5047 pub debug_string: ::std::option::Option<
5048 unsafe extern "C" fn(state: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_char,
5049 >,
5050 #[doc = " Destroys the plugin state."]
5051 pub destroy: ::std::option::Option<unsafe extern "C" fn(state: *mut ::std::os::raw::c_void)>,
5052 #[doc = " State that will be set as the first parameter of the methods above."]
5053 pub state: *mut ::std::os::raw::c_void,
5054 #[doc = " Type of credentials that this plugin is implementing."]
5055 pub type_: *const ::std::os::raw::c_char,
5056}
5057#[test]
5058fn bindgen_test_layout_grpc_metadata_credentials_plugin() {
5059 assert_eq!(
5060 ::std::mem::size_of::<grpc_metadata_credentials_plugin>(),
5061 40usize,
5062 concat!("Size of: ", stringify!(grpc_metadata_credentials_plugin))
5063 );
5064 assert_eq!(
5065 ::std::mem::align_of::<grpc_metadata_credentials_plugin>(),
5066 8usize,
5067 concat!(
5068 "Alignment of ",
5069 stringify!(grpc_metadata_credentials_plugin)
5070 )
5071 );
5072 assert_eq!(
5073 unsafe {
5074 &(*(::std::ptr::null::<grpc_metadata_credentials_plugin>())).get_metadata as *const _
5075 as usize
5076 },
5077 0usize,
5078 concat!(
5079 "Offset of field: ",
5080 stringify!(grpc_metadata_credentials_plugin),
5081 "::",
5082 stringify!(get_metadata)
5083 )
5084 );
5085 assert_eq!(
5086 unsafe {
5087 &(*(::std::ptr::null::<grpc_metadata_credentials_plugin>())).debug_string as *const _
5088 as usize
5089 },
5090 8usize,
5091 concat!(
5092 "Offset of field: ",
5093 stringify!(grpc_metadata_credentials_plugin),
5094 "::",
5095 stringify!(debug_string)
5096 )
5097 );
5098 assert_eq!(
5099 unsafe {
5100 &(*(::std::ptr::null::<grpc_metadata_credentials_plugin>())).destroy as *const _
5101 as usize
5102 },
5103 16usize,
5104 concat!(
5105 "Offset of field: ",
5106 stringify!(grpc_metadata_credentials_plugin),
5107 "::",
5108 stringify!(destroy)
5109 )
5110 );
5111 assert_eq!(
5112 unsafe {
5113 &(*(::std::ptr::null::<grpc_metadata_credentials_plugin>())).state as *const _ as usize
5114 },
5115 24usize,
5116 concat!(
5117 "Offset of field: ",
5118 stringify!(grpc_metadata_credentials_plugin),
5119 "::",
5120 stringify!(state)
5121 )
5122 );
5123 assert_eq!(
5124 unsafe {
5125 &(*(::std::ptr::null::<grpc_metadata_credentials_plugin>())).type_ as *const _ as usize
5126 },
5127 32usize,
5128 concat!(
5129 "Offset of field: ",
5130 stringify!(grpc_metadata_credentials_plugin),
5131 "::",
5132 stringify!(type_)
5133 )
5134 );
5135}
5136extern "C" {
5137 #[doc = " Creates a credentials object from a plugin with a specified minimum security"]
5138 #[doc = " level."]
5139 pub fn grpc_metadata_credentials_create_from_plugin(
5140 plugin: grpc_metadata_credentials_plugin,
5141 min_security_level: grpc_security_level,
5142 reserved: *mut ::std::os::raw::c_void,
5143 ) -> *mut grpc_call_credentials;
5144}
5145extern "C" {
5146 #[doc = " Creates a secure channel using the passed-in credentials. Additional"]
5147 #[doc = "channel level configuration MAY be provided by grpc_channel_args, though"]
5148 #[doc = "the expectation is that most clients will want to simply pass NULL. The"]
5149 #[doc = "user data in 'args' need only live through the invocation of this function."]
5150 #[doc = "However, if any args of the 'pointer' type are passed, then the referenced"]
5151 #[doc = "vtable must be maintained by the caller until grpc_channel_destroy"]
5152 #[doc = "terminates. See grpc_channel_args definition for more on this."]
5153 pub fn grpc_secure_channel_create(
5154 creds: *mut grpc_channel_credentials,
5155 target: *const ::std::os::raw::c_char,
5156 args: *const grpc_channel_args,
5157 reserved: *mut ::std::os::raw::c_void,
5158 ) -> *mut grpc_channel;
5159}
5160#[repr(C)]
5161#[derive(Debug, Copy, Clone)]
5162pub struct grpc_server_credentials {
5163 _unused: [u8; 0],
5164}
5165extern "C" {
5166 #[doc = " Releases a server_credentials object."]
5167 #[doc = "The creator of the server_credentials object is responsible for its release."]
5168 pub fn grpc_server_credentials_release(creds: *mut grpc_server_credentials);
5169}
5170#[repr(C)]
5171#[derive(Debug, Copy, Clone)]
5172pub struct grpc_ssl_server_certificate_config {
5173 _unused: [u8; 0],
5174}
5175extern "C" {
5176 #[doc = " Creates a grpc_ssl_server_certificate_config object."]
5177 #[doc = "- pem_roots_cert is the NULL-terminated string containing the PEM encoding of"]
5178 #[doc = "the client root certificates. This parameter may be NULL if the server does"]
5179 #[doc = "not want the client to be authenticated with SSL."]
5180 #[doc = "- pem_key_cert_pairs is an array private key / certificate chains of the"]
5181 #[doc = "server. This parameter cannot be NULL."]
5182 #[doc = "- num_key_cert_pairs indicates the number of items in the private_key_files"]
5183 #[doc = "and cert_chain_files parameters. It must be at least 1."]
5184 #[doc = "- It is the caller's responsibility to free this object via"]
5185 #[doc = "grpc_ssl_server_certificate_config_destroy()."]
5186 pub fn grpc_ssl_server_certificate_config_create(
5187 pem_root_certs: *const ::std::os::raw::c_char,
5188 pem_key_cert_pairs: *const grpc_ssl_pem_key_cert_pair,
5189 num_key_cert_pairs: usize,
5190 ) -> *mut grpc_ssl_server_certificate_config;
5191}
5192extern "C" {
5193 #[doc = " Destroys a grpc_ssl_server_certificate_config object."]
5194 pub fn grpc_ssl_server_certificate_config_destroy(
5195 config: *mut grpc_ssl_server_certificate_config,
5196 );
5197}
5198#[doc = " Callback to retrieve updated SSL server certificates, private keys, and"]
5199#[doc = "trusted CAs (for client authentication)."]
5200#[doc = "- user_data parameter, if not NULL, contains opaque data to be used by the"]
5201#[doc = "callback."]
5202#[doc = "- Use grpc_ssl_server_certificate_config_create to create the config."]
5203#[doc = "- The caller assumes ownership of the config."]
5204pub type grpc_ssl_server_certificate_config_callback = ::std::option::Option<
5205 unsafe extern "C" fn(
5206 user_data: *mut ::std::os::raw::c_void,
5207 config: *mut *mut grpc_ssl_server_certificate_config,
5208 ) -> grpc_ssl_certificate_config_reload_status,
5209>;
5210extern "C" {
5211 #[doc = " Deprecated in favor of grpc_ssl_server_credentials_create_ex."]
5212 #[doc = "Creates an SSL server_credentials object."]
5213 #[doc = "- pem_roots_cert is the NULL-terminated string containing the PEM encoding of"]
5214 #[doc = "the client root certificates. This parameter may be NULL if the server does"]
5215 #[doc = "not want the client to be authenticated with SSL."]
5216 #[doc = "- pem_key_cert_pairs is an array private key / certificate chains of the"]
5217 #[doc = "server. This parameter cannot be NULL."]
5218 #[doc = "- num_key_cert_pairs indicates the number of items in the private_key_files"]
5219 #[doc = "and cert_chain_files parameters. It should be at least 1."]
5220 #[doc = "- force_client_auth, if set to non-zero will force the client to authenticate"]
5221 #[doc = "with an SSL cert. Note that this option is ignored if pem_root_certs is"]
5222 #[doc = "NULL."]
5223 pub fn grpc_ssl_server_credentials_create(
5224 pem_root_certs: *const ::std::os::raw::c_char,
5225 pem_key_cert_pairs: *mut grpc_ssl_pem_key_cert_pair,
5226 num_key_cert_pairs: usize,
5227 force_client_auth: ::std::os::raw::c_int,
5228 reserved: *mut ::std::os::raw::c_void,
5229 ) -> *mut grpc_server_credentials;
5230}
5231extern "C" {
5232 #[doc = " Deprecated in favor of grpc_ssl_server_credentials_create_with_options."]
5233 #[doc = "Same as grpc_ssl_server_credentials_create method except uses"]
5234 #[doc = "grpc_ssl_client_certificate_request_type enum to support more ways to"]
5235 #[doc = "authenticate client certificates."]
5236 pub fn grpc_ssl_server_credentials_create_ex(
5237 pem_root_certs: *const ::std::os::raw::c_char,
5238 pem_key_cert_pairs: *mut grpc_ssl_pem_key_cert_pair,
5239 num_key_cert_pairs: usize,
5240 client_certificate_request: grpc_ssl_client_certificate_request_type,
5241 reserved: *mut ::std::os::raw::c_void,
5242 ) -> *mut grpc_server_credentials;
5243}
5244#[repr(C)]
5245#[derive(Debug, Copy, Clone)]
5246pub struct grpc_ssl_server_credentials_options {
5247 _unused: [u8; 0],
5248}
5249extern "C" {
5250 #[doc = " Creates an options object using a certificate config. Use this method when"]
5251 #[doc = "the certificates and keys of the SSL server will not change during the"]
5252 #[doc = "server's lifetime."]
5253 #[doc = "- Takes ownership of the certificate_config parameter."]
5254 pub fn grpc_ssl_server_credentials_create_options_using_config(
5255 client_certificate_request: grpc_ssl_client_certificate_request_type,
5256 certificate_config: *mut grpc_ssl_server_certificate_config,
5257 ) -> *mut grpc_ssl_server_credentials_options;
5258}
5259extern "C" {
5260 #[doc = " Creates an options object using a certificate config fetcher. Use this"]
5261 #[doc = "method to reload the certificates and keys of the SSL server without"]
5262 #[doc = "interrupting the operation of the server. Initial certificate config will be"]
5263 #[doc = "fetched during server initialization."]
5264 #[doc = "- user_data parameter, if not NULL, contains opaque data which will be passed"]
5265 #[doc = "to the fetcher (see definition of"]
5266 #[doc = "grpc_ssl_server_certificate_config_callback)."]
5267 pub fn grpc_ssl_server_credentials_create_options_using_config_fetcher(
5268 client_certificate_request: grpc_ssl_client_certificate_request_type,
5269 cb: grpc_ssl_server_certificate_config_callback,
5270 user_data: *mut ::std::os::raw::c_void,
5271 ) -> *mut grpc_ssl_server_credentials_options;
5272}
5273extern "C" {
5274 #[doc = " Destroys a grpc_ssl_server_credentials_options object."]
5275 pub fn grpc_ssl_server_credentials_options_destroy(
5276 options: *mut grpc_ssl_server_credentials_options,
5277 );
5278}
5279extern "C" {
5280 #[doc = " Creates an SSL server_credentials object using the provided options struct."]
5281 #[doc = "- Takes ownership of the options parameter."]
5282 pub fn grpc_ssl_server_credentials_create_with_options(
5283 options: *mut grpc_ssl_server_credentials_options,
5284 ) -> *mut grpc_server_credentials;
5285}
5286extern "C" {
5287 #[doc = " Add a HTTP2 over an encrypted link over tcp listener."]
5288 #[doc = "Returns bound port number on success, 0 on failure."]
5289 #[doc = "REQUIRES: server not started"]
5290 pub fn grpc_server_add_secure_http2_port(
5291 server: *mut grpc_server,
5292 addr: *const ::std::os::raw::c_char,
5293 creds: *mut grpc_server_credentials,
5294 ) -> ::std::os::raw::c_int;
5295}
5296extern "C" {
5297 #[doc = " Sets a credentials to a call. Can only be called on the client side before"]
5298 #[doc = "grpc_call_start_batch."]
5299 pub fn grpc_call_set_credentials(
5300 call: *mut grpc_call,
5301 creds: *mut grpc_call_credentials,
5302 ) -> grpc_call_error;
5303}
5304#[doc = " Callback function that is called when the metadata processing is done."]
5305#[doc = "- Consumed metadata will be removed from the set of metadata available on the"]
5306#[doc = "call. consumed_md may be NULL if no metadata has been consumed."]
5307#[doc = "- Response metadata will be set on the response. response_md may be NULL."]
5308#[doc = "- status is GRPC_STATUS_OK for success or a specific status for an error."]
5309#[doc = "Common error status for auth metadata processing is either"]
5310#[doc = "GRPC_STATUS_UNAUTHENTICATED in case of an authentication failure or"]
5311#[doc = "GRPC_STATUS PERMISSION_DENIED in case of an authorization failure."]
5312#[doc = "- error_details gives details about the error. May be NULL."]
5313pub type grpc_process_auth_metadata_done_cb = ::std::option::Option<
5314 unsafe extern "C" fn(
5315 user_data: *mut ::std::os::raw::c_void,
5316 consumed_md: *const grpc_metadata,
5317 num_consumed_md: usize,
5318 response_md: *const grpc_metadata,
5319 num_response_md: usize,
5320 status: grpc_status_code::Type,
5321 error_details: *const ::std::os::raw::c_char,
5322 ),
5323>;
5324#[doc = " Pluggable server-side metadata processor object."]
5325#[repr(C)]
5326#[derive(Debug, Copy, Clone)]
5327pub struct grpc_auth_metadata_processor {
5328 #[doc = " The context object is read/write: it contains the properties of the"]
5329 #[doc = "channel peer and it is the job of the process function to augment it with"]
5330 #[doc = "properties derived from the passed-in metadata."]
5331 #[doc = "The lifetime of these objects is guaranteed until cb is invoked."]
5332 pub process: ::std::option::Option<
5333 unsafe extern "C" fn(
5334 state: *mut ::std::os::raw::c_void,
5335 context: *mut grpc_auth_context,
5336 md: *const grpc_metadata,
5337 num_md: usize,
5338 cb: grpc_process_auth_metadata_done_cb,
5339 user_data: *mut ::std::os::raw::c_void,
5340 ),
5341 >,
5342 pub destroy: ::std::option::Option<unsafe extern "C" fn(state: *mut ::std::os::raw::c_void)>,
5343 pub state: *mut ::std::os::raw::c_void,
5344}
5345#[test]
5346fn bindgen_test_layout_grpc_auth_metadata_processor() {
5347 assert_eq!(
5348 ::std::mem::size_of::<grpc_auth_metadata_processor>(),
5349 24usize,
5350 concat!("Size of: ", stringify!(grpc_auth_metadata_processor))
5351 );
5352 assert_eq!(
5353 ::std::mem::align_of::<grpc_auth_metadata_processor>(),
5354 8usize,
5355 concat!("Alignment of ", stringify!(grpc_auth_metadata_processor))
5356 );
5357 assert_eq!(
5358 unsafe {
5359 &(*(::std::ptr::null::<grpc_auth_metadata_processor>())).process as *const _ as usize
5360 },
5361 0usize,
5362 concat!(
5363 "Offset of field: ",
5364 stringify!(grpc_auth_metadata_processor),
5365 "::",
5366 stringify!(process)
5367 )
5368 );
5369 assert_eq!(
5370 unsafe {
5371 &(*(::std::ptr::null::<grpc_auth_metadata_processor>())).destroy as *const _ as usize
5372 },
5373 8usize,
5374 concat!(
5375 "Offset of field: ",
5376 stringify!(grpc_auth_metadata_processor),
5377 "::",
5378 stringify!(destroy)
5379 )
5380 );
5381 assert_eq!(
5382 unsafe {
5383 &(*(::std::ptr::null::<grpc_auth_metadata_processor>())).state as *const _ as usize
5384 },
5385 16usize,
5386 concat!(
5387 "Offset of field: ",
5388 stringify!(grpc_auth_metadata_processor),
5389 "::",
5390 stringify!(state)
5391 )
5392 );
5393}
5394extern "C" {
5395 pub fn grpc_server_credentials_set_auth_metadata_processor(
5396 creds: *mut grpc_server_credentials,
5397 processor: grpc_auth_metadata_processor,
5398 );
5399}
5400#[repr(C)]
5401#[derive(Debug, Copy, Clone)]
5402pub struct grpc_alts_credentials_options {
5403 _unused: [u8; 0],
5404}
5405extern "C" {
5406 #[doc = " This method creates a grpc ALTS credentials client options instance."]
5407 #[doc = " It is used for experimental purpose for now and subject to change."]
5408 pub fn grpc_alts_credentials_client_options_create() -> *mut grpc_alts_credentials_options;
5409}
5410extern "C" {
5411 #[doc = " This method creates a grpc ALTS credentials server options instance."]
5412 #[doc = " It is used for experimental purpose for now and subject to change."]
5413 pub fn grpc_alts_credentials_server_options_create() -> *mut grpc_alts_credentials_options;
5414}
5415extern "C" {
5416 #[doc = " This method adds a target service account to grpc client's ALTS credentials"]
5417 #[doc = " options instance. It is used for experimental purpose for now and subject"]
5418 #[doc = " to change."]
5419 #[doc = ""]
5420 #[doc = " - options: grpc ALTS credentials options instance."]
5421 #[doc = " - service_account: service account of target endpoint."]
5422 pub fn grpc_alts_credentials_client_options_add_target_service_account(
5423 options: *mut grpc_alts_credentials_options,
5424 service_account: *const ::std::os::raw::c_char,
5425 );
5426}
5427extern "C" {
5428 #[doc = " This method destroys a grpc_alts_credentials_options instance by"]
5429 #[doc = " de-allocating all of its occupied memory. It is used for experimental purpose"]
5430 #[doc = " for now and subject to change."]
5431 #[doc = ""]
5432 #[doc = " - options: a grpc_alts_credentials_options instance that needs to be"]
5433 #[doc = " destroyed."]
5434 pub fn grpc_alts_credentials_options_destroy(options: *mut grpc_alts_credentials_options);
5435}
5436extern "C" {
5437 #[doc = " This method creates an ALTS channel credential object. The security"]
5438 #[doc = " level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY."]
5439 #[doc = " It is used for experimental purpose for now and subject to change."]
5440 #[doc = ""]
5441 #[doc = " - options: grpc ALTS credentials options instance for client."]
5442 #[doc = ""]
5443 #[doc = " It returns the created ALTS channel credential object."]
5444 pub fn grpc_alts_credentials_create(
5445 options: *const grpc_alts_credentials_options,
5446 ) -> *mut grpc_channel_credentials;
5447}
5448extern "C" {
5449 #[doc = " This method creates an ALTS server credential object. It is used for"]
5450 #[doc = " experimental purpose for now and subject to change."]
5451 #[doc = ""]
5452 #[doc = " - options: grpc ALTS credentials options instance for server."]
5453 #[doc = ""]
5454 #[doc = " It returns the created ALTS server credential object."]
5455 pub fn grpc_alts_server_credentials_create(
5456 options: *const grpc_alts_credentials_options,
5457 ) -> *mut grpc_server_credentials;
5458}
5459extern "C" {
5460 #[doc = " This method creates a local channel credential object. The security level"]
5461 #[doc = " of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY for UDS and"]
5462 #[doc = " GRPC_SECURITY_NONE for LOCAL_TCP. It is used for experimental purpose"]
5463 #[doc = " for now and subject to change."]
5464 #[doc = ""]
5465 #[doc = " - type: local connection type"]
5466 #[doc = ""]
5467 #[doc = " It returns the created local channel credential object."]
5468 pub fn grpc_local_credentials_create(
5469 type_: grpc_local_connect_type,
5470 ) -> *mut grpc_channel_credentials;
5471}
5472extern "C" {
5473 #[doc = " This method creates a local server credential object. It is used for"]
5474 #[doc = " experimental purpose for now and subject to change."]
5475 #[doc = ""]
5476 #[doc = " - type: local connection type"]
5477 #[doc = ""]
5478 #[doc = " It returns the created local server credential object."]
5479 pub fn grpc_local_server_credentials_create(
5480 type_: grpc_local_connect_type,
5481 ) -> *mut grpc_server_credentials;
5482}
5483#[repr(C)]
5484#[derive(Debug, Copy, Clone)]
5485pub struct grpc_tls_error_details {
5486 _unused: [u8; 0],
5487}
5488#[repr(C)]
5489#[derive(Debug, Copy, Clone)]
5490pub struct grpc_tls_key_materials_config {
5491 _unused: [u8; 0],
5492}
5493#[repr(C)]
5494#[derive(Debug, Copy, Clone)]
5495pub struct grpc_tls_credential_reload_config {
5496 _unused: [u8; 0],
5497}
5498#[repr(C)]
5499#[derive(Debug, Copy, Clone)]
5500pub struct grpc_tls_server_authorization_check_config {
5501 _unused: [u8; 0],
5502}
5503#[repr(C)]
5504#[derive(Debug, Copy, Clone)]
5505pub struct grpc_tls_credentials_options {
5506 _unused: [u8; 0],
5507}
5508extern "C" {
5509 #[doc = " Create an empty TLS credentials options. It is used for"]
5510 #[doc = " experimental purpose for now and subject to change."]
5511 pub fn grpc_tls_credentials_options_create() -> *mut grpc_tls_credentials_options;
5512}
5513extern "C" {
5514 #[doc = " Set grpc_ssl_client_certificate_request_type field in credentials options"]
5515 #[doc = "with the provided type. options should not be NULL."]
5516 #[doc = "It returns 1 on success and 0 on failure. It is used for"]
5517 #[doc = "experimental purpose for now and subject to change."]
5518 pub fn grpc_tls_credentials_options_set_cert_request_type(
5519 options: *mut grpc_tls_credentials_options,
5520 type_: grpc_ssl_client_certificate_request_type,
5521 ) -> ::std::os::raw::c_int;
5522}
5523extern "C" {
5524 #[doc = " Set grpc_tls_server_verification_option field in credentials options"]
5525 #[doc = "with the provided server_verification_option. options should not be NULL."]
5526 #[doc = "This should be called only on the client side."]
5527 #[doc = "If grpc_tls_server_verification_option is not"]
5528 #[doc = "GRPC_TLS_SERVER_VERIFICATION, use of a customer server"]
5529 #[doc = "authorization check (grpc_tls_server_authorization_check_config)"]
5530 #[doc = "will be mandatory."]
5531 #[doc = "It returns 1 on success and 0 on failure. It is used for"]
5532 #[doc = "experimental purpose for now and subject to change."]
5533 pub fn grpc_tls_credentials_options_set_server_verification_option(
5534 options: *mut grpc_tls_credentials_options,
5535 server_verification_option: grpc_tls_server_verification_option,
5536 ) -> ::std::os::raw::c_int;
5537}
5538extern "C" {
5539 #[doc = " Set grpc_tls_key_materials_config field in credentials options"]
5540 #[doc = "with the provided config struct whose ownership is transferred."]
5541 #[doc = "Both parameters should not be NULL."]
5542 #[doc = "It returns 1 on success and 0 on failure. It is used for"]
5543 #[doc = "experimental purpose for now and subject to change."]
5544 pub fn grpc_tls_credentials_options_set_key_materials_config(
5545 options: *mut grpc_tls_credentials_options,
5546 config: *mut grpc_tls_key_materials_config,
5547 ) -> ::std::os::raw::c_int;
5548}
5549extern "C" {
5550 #[doc = " Set grpc_tls_credential_reload_config field in credentials options"]
5551 #[doc = "with the provided config struct whose ownership is transferred."]
5552 #[doc = "Both parameters should not be NULL."]
5553 #[doc = "It returns 1 on success and 0 on failure. It is used for"]
5554 #[doc = "experimental purpose for now and subject to change."]
5555 pub fn grpc_tls_credentials_options_set_credential_reload_config(
5556 options: *mut grpc_tls_credentials_options,
5557 config: *mut grpc_tls_credential_reload_config,
5558 ) -> ::std::os::raw::c_int;
5559}
5560extern "C" {
5561 #[doc = " Set grpc_tls_server_authorization_check_config field in credentials options"]
5562 #[doc = "with the provided config struct whose ownership is transferred."]
5563 #[doc = "Both parameters should not be NULL."]
5564 #[doc = "It returns 1 on success and 0 on failure. It is used for"]
5565 #[doc = "experimental purpose for now and subject to change."]
5566 pub fn grpc_tls_credentials_options_set_server_authorization_check_config(
5567 options: *mut grpc_tls_credentials_options,
5568 config: *mut grpc_tls_server_authorization_check_config,
5569 ) -> ::std::os::raw::c_int;
5570}
5571extern "C" {
5572 #[doc = " Create an empty grpc_tls_key_materials_config instance."]
5573 #[doc = " It is used for experimental purpose for now and subject to change."]
5574 pub fn grpc_tls_key_materials_config_create() -> *mut grpc_tls_key_materials_config;
5575}
5576extern "C" {
5577 #[doc = " Set grpc_tls_key_materials_config instance with provided a TLS certificate."]
5578 #[doc = "It's valid for the caller to provide nullptr pem_root_certs, in which case"]
5579 #[doc = "the gRPC-provided root cert will be used. pem_key_cert_pairs should not be"]
5580 #[doc = "NULL."]
5581 #[doc = "The ownerships of |pem_root_certs| and |pem_key_cert_pairs| remain with the"]
5582 #[doc = "caller."]
5583 #[doc = "It returns 1 on success and 0 on failure. It is used for experimental"]
5584 #[doc = "purpose for now and subject to change."]
5585 pub fn grpc_tls_key_materials_config_set_key_materials(
5586 config: *mut grpc_tls_key_materials_config,
5587 pem_root_certs: *const ::std::os::raw::c_char,
5588 pem_key_cert_pairs: *mut *const grpc_ssl_pem_key_cert_pair,
5589 num_key_cert_pairs: usize,
5590 ) -> ::std::os::raw::c_int;
5591}
5592extern "C" {
5593 #[doc = " Set grpc_tls_key_materials_config instance with a provided version number,"]
5594 #[doc = "which is used to keep track of the version of key materials."]
5595 #[doc = "It returns 1 on success and 0 on failure. It is used for"]
5596 #[doc = "experimental purpose for now and subject to change."]
5597 pub fn grpc_tls_key_materials_config_set_version(
5598 config: *mut grpc_tls_key_materials_config,
5599 version: ::std::os::raw::c_int,
5600 ) -> ::std::os::raw::c_int;
5601}
5602extern "C" {
5603 #[doc = " Get the version number of a grpc_tls_key_materials_config instance."]
5604 #[doc = "It returns the version number on success and -1 on failure."]
5605 #[doc = "It is used for experimental purpose for now and subject to change."]
5606 pub fn grpc_tls_key_materials_config_get_version(
5607 config: *mut grpc_tls_key_materials_config,
5608 ) -> ::std::os::raw::c_int;
5609}
5610#[doc = " A callback function provided by gRPC to handle the result of credential"]
5611#[doc = "reload. It is used when schedule API is implemented asynchronously and"]
5612#[doc = "serves to bring the control back to grpc C core. It is used for"]
5613#[doc = "experimental purpose for now and subject to change."]
5614pub type grpc_tls_on_credential_reload_done_cb =
5615 ::std::option::Option<unsafe extern "C" fn(arg: *mut grpc_tls_credential_reload_arg)>;
5616#[doc = " A struct containing all information necessary to schedule/cancel a"]
5617#[doc = "credential reload request."]
5618#[doc = "- cb and cb_user_data represent a gRPC-provided"]
5619#[doc = "callback and an argument passed to it."]
5620#[doc = "- key_materials_config is an in/output parameter containing currently"]
5621#[doc = "used/newly reloaded credentials. If credential reload does not result in"]
5622#[doc = "a new credential, key_materials_config should not be modified. The same"]
5623#[doc = "key_materials_config object can be updated if new key materials is"]
5624#[doc = "available."]
5625#[doc = "- status and error_details are used to hold information about"]
5626#[doc = "errors occurred when a credential reload request is scheduled/cancelled."]
5627#[doc = "- config is a pointer to the unique grpc_tls_credential_reload_config"]
5628#[doc = "instance that this argument corresponds to."]
5629#[doc = "- context is a pointer to a wrapped language implementation of this"]
5630#[doc = "grpc_tls_credential_reload_arg instance."]
5631#[doc = "- destroy_context is a pointer to a caller-provided method that cleans"]
5632#[doc = "up any data associated with the context pointer."]
5633#[doc = "It is used for experimental purposes for now and subject to change."]
5634#[repr(C)]
5635#[derive(Debug, Copy, Clone)]
5636pub struct grpc_tls_credential_reload_arg {
5637 pub cb: grpc_tls_on_credential_reload_done_cb,
5638 pub cb_user_data: *mut ::std::os::raw::c_void,
5639 pub key_materials_config: *mut grpc_tls_key_materials_config,
5640 pub status: grpc_ssl_certificate_config_reload_status,
5641 pub error_details: *mut grpc_tls_error_details,
5642 pub config: *mut grpc_tls_credential_reload_config,
5643 pub context: *mut ::std::os::raw::c_void,
5644 pub destroy_context:
5645 ::std::option::Option<unsafe extern "C" fn(ctx: *mut ::std::os::raw::c_void)>,
5646}
5647#[test]
5648fn bindgen_test_layout_grpc_tls_credential_reload_arg() {
5649 assert_eq!(
5650 ::std::mem::size_of::<grpc_tls_credential_reload_arg>(),
5651 64usize,
5652 concat!("Size of: ", stringify!(grpc_tls_credential_reload_arg))
5653 );
5654 assert_eq!(
5655 ::std::mem::align_of::<grpc_tls_credential_reload_arg>(),
5656 8usize,
5657 concat!("Alignment of ", stringify!(grpc_tls_credential_reload_arg))
5658 );
5659 assert_eq!(
5660 unsafe {
5661 &(*(::std::ptr::null::<grpc_tls_credential_reload_arg>())).cb as *const _ as usize
5662 },
5663 0usize,
5664 concat!(
5665 "Offset of field: ",
5666 stringify!(grpc_tls_credential_reload_arg),
5667 "::",
5668 stringify!(cb)
5669 )
5670 );
5671 assert_eq!(
5672 unsafe {
5673 &(*(::std::ptr::null::<grpc_tls_credential_reload_arg>())).cb_user_data as *const _
5674 as usize
5675 },
5676 8usize,
5677 concat!(
5678 "Offset of field: ",
5679 stringify!(grpc_tls_credential_reload_arg),
5680 "::",
5681 stringify!(cb_user_data)
5682 )
5683 );
5684 assert_eq!(
5685 unsafe {
5686 &(*(::std::ptr::null::<grpc_tls_credential_reload_arg>())).key_materials_config
5687 as *const _ as usize
5688 },
5689 16usize,
5690 concat!(
5691 "Offset of field: ",
5692 stringify!(grpc_tls_credential_reload_arg),
5693 "::",
5694 stringify!(key_materials_config)
5695 )
5696 );
5697 assert_eq!(
5698 unsafe {
5699 &(*(::std::ptr::null::<grpc_tls_credential_reload_arg>())).status as *const _ as usize
5700 },
5701 24usize,
5702 concat!(
5703 "Offset of field: ",
5704 stringify!(grpc_tls_credential_reload_arg),
5705 "::",
5706 stringify!(status)
5707 )
5708 );
5709 assert_eq!(
5710 unsafe {
5711 &(*(::std::ptr::null::<grpc_tls_credential_reload_arg>())).error_details as *const _
5712 as usize
5713 },
5714 32usize,
5715 concat!(
5716 "Offset of field: ",
5717 stringify!(grpc_tls_credential_reload_arg),
5718 "::",
5719 stringify!(error_details)
5720 )
5721 );
5722 assert_eq!(
5723 unsafe {
5724 &(*(::std::ptr::null::<grpc_tls_credential_reload_arg>())).config as *const _ as usize
5725 },
5726 40usize,
5727 concat!(
5728 "Offset of field: ",
5729 stringify!(grpc_tls_credential_reload_arg),
5730 "::",
5731 stringify!(config)
5732 )
5733 );
5734 assert_eq!(
5735 unsafe {
5736 &(*(::std::ptr::null::<grpc_tls_credential_reload_arg>())).context as *const _ as usize
5737 },
5738 48usize,
5739 concat!(
5740 "Offset of field: ",
5741 stringify!(grpc_tls_credential_reload_arg),
5742 "::",
5743 stringify!(context)
5744 )
5745 );
5746 assert_eq!(
5747 unsafe {
5748 &(*(::std::ptr::null::<grpc_tls_credential_reload_arg>())).destroy_context as *const _
5749 as usize
5750 },
5751 56usize,
5752 concat!(
5753 "Offset of field: ",
5754 stringify!(grpc_tls_credential_reload_arg),
5755 "::",
5756 stringify!(destroy_context)
5757 )
5758 );
5759}
5760extern "C" {
5761 #[doc = " Create a grpc_tls_credential_reload_config instance."]
5762 #[doc = "- config_user_data is config-specific, read-only user data"]
5763 #[doc = "that works for all channels created with a credential using the config."]
5764 #[doc = "- schedule is a pointer to an application-provided callback used to invoke"]
5765 #[doc = "credential reload API. The implementation of this method has to be"]
5766 #[doc = "non-blocking, but can be performed synchronously or asynchronously."]
5767 #[doc = "1) If processing occurs synchronously, it populates"]
5768 #[doc = "arg->key_materials_config, arg->status, and arg->error_details"]
5769 #[doc = "and returns zero."]
5770 #[doc = "2) If processing occurs asynchronously, it returns a non-zero value."]
5771 #[doc = "The application then invokes arg->cb when processing is completed. Note"]
5772 #[doc = "that arg->cb cannot be invoked before schedule API returns."]
5773 #[doc = "- cancel is a pointer to an application-provided callback used to cancel"]
5774 #[doc = "a credential reload request scheduled via an asynchronous schedule API."]
5775 #[doc = "arg is used to pinpoint an exact reloading request to be cancelled."]
5776 #[doc = "The operation may not have any effect if the request has already been"]
5777 #[doc = "processed."]
5778 #[doc = "- destruct is a pointer to an application-provided callback used to clean up"]
5779 #[doc = "any data associated with the config."]
5780 #[doc = "It is used for experimental purpose for now and subject to change."]
5781 pub fn grpc_tls_credential_reload_config_create(
5782 config_user_data: *const ::std::os::raw::c_void,
5783 schedule: ::std::option::Option<
5784 unsafe extern "C" fn(
5785 config_user_data: *mut ::std::os::raw::c_void,
5786 arg: *mut grpc_tls_credential_reload_arg,
5787 ) -> ::std::os::raw::c_int,
5788 >,
5789 cancel: ::std::option::Option<
5790 unsafe extern "C" fn(
5791 config_user_data: *mut ::std::os::raw::c_void,
5792 arg: *mut grpc_tls_credential_reload_arg,
5793 ),
5794 >,
5795 destruct: ::std::option::Option<
5796 unsafe extern "C" fn(config_user_data: *mut ::std::os::raw::c_void),
5797 >,
5798 ) -> *mut grpc_tls_credential_reload_config;
5799}
5800#[doc = " callback function provided by gRPC used to handle the result of server"]
5801#[doc = "authorization check. It is used when schedule API is implemented"]
5802#[doc = "asynchronously, and serves to bring the control back to gRPC C core. It is"]
5803#[doc = "used for experimental purpose for now and subject to change."]
5804pub type grpc_tls_on_server_authorization_check_done_cb =
5805 ::std::option::Option<unsafe extern "C" fn(arg: *mut grpc_tls_server_authorization_check_arg)>;
5806#[doc = " A struct containing all information necessary to schedule/cancel a server"]
5807#[doc = "authorization check request."]
5808#[doc = "- cb and cb_user_data represent a gRPC-provided callback and an argument"]
5809#[doc = "passed to it."]
5810#[doc = "- success will store the result of server authorization check. That is,"]
5811#[doc = "if success returns a non-zero value, it means the authorization check"]
5812#[doc = "passes and if returning zero, it means the check fails."]
5813#[doc = "- target_name is the name of an endpoint the channel is connecting to."]
5814#[doc = "- peer_cert represents a complete certificate chain including both"]
5815#[doc = "signing and leaf certificates."]
5816#[doc = "- status and error_details contain information"]
5817#[doc = "about errors occurred when a server authorization check request is"]
5818#[doc = "scheduled/cancelled."]
5819#[doc = "- config is a pointer to the unique"]
5820#[doc = "grpc_tls_server_authorization_check_config instance that this argument"]
5821#[doc = "corresponds to."]
5822#[doc = "- context is a pointer to a wrapped language implementation of this"]
5823#[doc = "grpc_tls_server_authorization_check_arg instance."]
5824#[doc = "- destroy_context is a pointer to a caller-provided method that cleans"]
5825#[doc = "up any data associated with the context pointer."]
5826#[doc = "It is used for experimental purpose for now and subject to change."]
5827#[repr(C)]
5828#[derive(Debug, Copy, Clone)]
5829pub struct grpc_tls_server_authorization_check_arg {
5830 pub cb: grpc_tls_on_server_authorization_check_done_cb,
5831 pub cb_user_data: *mut ::std::os::raw::c_void,
5832 pub success: ::std::os::raw::c_int,
5833 pub target_name: *const ::std::os::raw::c_char,
5834 pub peer_cert: *const ::std::os::raw::c_char,
5835 pub peer_cert_full_chain: *const ::std::os::raw::c_char,
5836 pub status: grpc_status_code::Type,
5837 pub error_details: *mut grpc_tls_error_details,
5838 pub config: *mut grpc_tls_server_authorization_check_config,
5839 pub context: *mut ::std::os::raw::c_void,
5840 pub destroy_context:
5841 ::std::option::Option<unsafe extern "C" fn(ctx: *mut ::std::os::raw::c_void)>,
5842}
5843#[test]
5844fn bindgen_test_layout_grpc_tls_server_authorization_check_arg() {
5845 assert_eq!(
5846 ::std::mem::size_of::<grpc_tls_server_authorization_check_arg>(),
5847 88usize,
5848 concat!(
5849 "Size of: ",
5850 stringify!(grpc_tls_server_authorization_check_arg)
5851 )
5852 );
5853 assert_eq!(
5854 ::std::mem::align_of::<grpc_tls_server_authorization_check_arg>(),
5855 8usize,
5856 concat!(
5857 "Alignment of ",
5858 stringify!(grpc_tls_server_authorization_check_arg)
5859 )
5860 );
5861 assert_eq!(
5862 unsafe {
5863 &(*(::std::ptr::null::<grpc_tls_server_authorization_check_arg>())).cb as *const _
5864 as usize
5865 },
5866 0usize,
5867 concat!(
5868 "Offset of field: ",
5869 stringify!(grpc_tls_server_authorization_check_arg),
5870 "::",
5871 stringify!(cb)
5872 )
5873 );
5874 assert_eq!(
5875 unsafe {
5876 &(*(::std::ptr::null::<grpc_tls_server_authorization_check_arg>())).cb_user_data
5877 as *const _ as usize
5878 },
5879 8usize,
5880 concat!(
5881 "Offset of field: ",
5882 stringify!(grpc_tls_server_authorization_check_arg),
5883 "::",
5884 stringify!(cb_user_data)
5885 )
5886 );
5887 assert_eq!(
5888 unsafe {
5889 &(*(::std::ptr::null::<grpc_tls_server_authorization_check_arg>())).success as *const _
5890 as usize
5891 },
5892 16usize,
5893 concat!(
5894 "Offset of field: ",
5895 stringify!(grpc_tls_server_authorization_check_arg),
5896 "::",
5897 stringify!(success)
5898 )
5899 );
5900 assert_eq!(
5901 unsafe {
5902 &(*(::std::ptr::null::<grpc_tls_server_authorization_check_arg>())).target_name
5903 as *const _ as usize
5904 },
5905 24usize,
5906 concat!(
5907 "Offset of field: ",
5908 stringify!(grpc_tls_server_authorization_check_arg),
5909 "::",
5910 stringify!(target_name)
5911 )
5912 );
5913 assert_eq!(
5914 unsafe {
5915 &(*(::std::ptr::null::<grpc_tls_server_authorization_check_arg>())).peer_cert
5916 as *const _ as usize
5917 },
5918 32usize,
5919 concat!(
5920 "Offset of field: ",
5921 stringify!(grpc_tls_server_authorization_check_arg),
5922 "::",
5923 stringify!(peer_cert)
5924 )
5925 );
5926 assert_eq!(
5927 unsafe {
5928 &(*(::std::ptr::null::<grpc_tls_server_authorization_check_arg>())).peer_cert_full_chain
5929 as *const _ as usize
5930 },
5931 40usize,
5932 concat!(
5933 "Offset of field: ",
5934 stringify!(grpc_tls_server_authorization_check_arg),
5935 "::",
5936 stringify!(peer_cert_full_chain)
5937 )
5938 );
5939 assert_eq!(
5940 unsafe {
5941 &(*(::std::ptr::null::<grpc_tls_server_authorization_check_arg>())).status as *const _
5942 as usize
5943 },
5944 48usize,
5945 concat!(
5946 "Offset of field: ",
5947 stringify!(grpc_tls_server_authorization_check_arg),
5948 "::",
5949 stringify!(status)
5950 )
5951 );
5952 assert_eq!(
5953 unsafe {
5954 &(*(::std::ptr::null::<grpc_tls_server_authorization_check_arg>())).error_details
5955 as *const _ as usize
5956 },
5957 56usize,
5958 concat!(
5959 "Offset of field: ",
5960 stringify!(grpc_tls_server_authorization_check_arg),
5961 "::",
5962 stringify!(error_details)
5963 )
5964 );
5965 assert_eq!(
5966 unsafe {
5967 &(*(::std::ptr::null::<grpc_tls_server_authorization_check_arg>())).config as *const _
5968 as usize
5969 },
5970 64usize,
5971 concat!(
5972 "Offset of field: ",
5973 stringify!(grpc_tls_server_authorization_check_arg),
5974 "::",
5975 stringify!(config)
5976 )
5977 );
5978 assert_eq!(
5979 unsafe {
5980 &(*(::std::ptr::null::<grpc_tls_server_authorization_check_arg>())).context as *const _
5981 as usize
5982 },
5983 72usize,
5984 concat!(
5985 "Offset of field: ",
5986 stringify!(grpc_tls_server_authorization_check_arg),
5987 "::",
5988 stringify!(context)
5989 )
5990 );
5991 assert_eq!(
5992 unsafe {
5993 &(*(::std::ptr::null::<grpc_tls_server_authorization_check_arg>())).destroy_context
5994 as *const _ as usize
5995 },
5996 80usize,
5997 concat!(
5998 "Offset of field: ",
5999 stringify!(grpc_tls_server_authorization_check_arg),
6000 "::",
6001 stringify!(destroy_context)
6002 )
6003 );
6004}
6005extern "C" {
6006 #[doc = " Create a grpc_tls_server_authorization_check_config instance."]
6007 #[doc = "- config_user_data is config-specific, read-only user data"]
6008 #[doc = "that works for all channels created with a credential using the config."]
6009 #[doc = "- schedule is a pointer to an application-provided callback used to invoke"]
6010 #[doc = "server authorization check API. The implementation of this method has to"]
6011 #[doc = "be non-blocking, but can be performed synchronously or asynchronously."]
6012 #[doc = "1)If processing occurs synchronously, it populates arg->result,"]
6013 #[doc = "arg->status, and arg->error_details and returns zero."]
6014 #[doc = "2) If processing occurs asynchronously, it returns a non-zero value. The"]
6015 #[doc = "application then invokes arg->cb when processing is completed. Note that"]
6016 #[doc = "arg->cb cannot be invoked before schedule API returns."]
6017 #[doc = "- cancel is a pointer to an application-provided callback used to cancel a"]
6018 #[doc = "server authorization check request scheduled via an asynchronous schedule"]
6019 #[doc = "API. arg is used to pinpoint an exact check request to be cancelled. The"]
6020 #[doc = "operation may not have any effect if the request has already been"]
6021 #[doc = "processed."]
6022 #[doc = "- destruct is a pointer to an application-provided callback used to clean up"]
6023 #[doc = "any data associated with the config."]
6024 #[doc = "It is used for experimental purpose for now and subject to change."]
6025 pub fn grpc_tls_server_authorization_check_config_create(
6026 config_user_data: *const ::std::os::raw::c_void,
6027 schedule: ::std::option::Option<
6028 unsafe extern "C" fn(
6029 config_user_data: *mut ::std::os::raw::c_void,
6030 arg: *mut grpc_tls_server_authorization_check_arg,
6031 ) -> ::std::os::raw::c_int,
6032 >,
6033 cancel: ::std::option::Option<
6034 unsafe extern "C" fn(
6035 config_user_data: *mut ::std::os::raw::c_void,
6036 arg: *mut grpc_tls_server_authorization_check_arg,
6037 ),
6038 >,
6039 destruct: ::std::option::Option<
6040 unsafe extern "C" fn(config_user_data: *mut ::std::os::raw::c_void),
6041 >,
6042 ) -> *mut grpc_tls_server_authorization_check_config;
6043}
6044extern "C" {
6045 #[doc = " This method creates a TLS channel credential object."]
6046 #[doc = " It takes ownership of the options parameter. The security level"]
6047 #[doc = " of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY."]
6048 #[doc = ""]
6049 #[doc = " - options: grpc TLS credentials options instance."]
6050 #[doc = ""]
6051 #[doc = " It returns the created credential object."]
6052 #[doc = ""]
6053 #[doc = " It is used for experimental purpose for now and subject"]
6054 #[doc = " to change."]
6055 pub fn grpc_tls_credentials_create(
6056 options: *mut grpc_tls_credentials_options,
6057 ) -> *mut grpc_channel_credentials;
6058}
6059extern "C" {
6060 #[doc = " This method creates a TLS server credential object."]
6061 #[doc = " It takes ownership of the options parameter."]
6062 #[doc = ""]
6063 #[doc = " - options: grpc TLS credentials options instance."]
6064 #[doc = ""]
6065 #[doc = " It returns the created credential object."]
6066 #[doc = ""]
6067 #[doc = " It is used for experimental purpose for now and subject"]
6068 #[doc = " to change."]
6069 pub fn grpc_tls_server_credentials_create(
6070 options: *mut grpc_tls_credentials_options,
6071 ) -> *mut grpc_server_credentials;
6072}
6073#[repr(u32)]
6074#[doc = " The severity of a log message - use the #defines below when calling into"]
6075#[doc = "gpr_log to additionally supply file and line data"]
6076#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
6077pub enum gpr_log_severity {
6078 GPR_LOG_SEVERITY_DEBUG = 0,
6079 GPR_LOG_SEVERITY_INFO = 1,
6080 GPR_LOG_SEVERITY_ERROR = 2,
6081}
6082extern "C" {
6083 #[doc = " Returns a string representation of the log severity"]
6084 pub fn gpr_log_severity_string(severity: gpr_log_severity) -> *const ::std::os::raw::c_char;
6085}
6086extern "C" {
6087 #[doc = " Log a message. It's advised to use GPR_xxx above to generate the context"]
6088 #[doc = " for each message"]
6089 pub fn gpr_log(
6090 file: *const ::std::os::raw::c_char,
6091 line: ::std::os::raw::c_int,
6092 severity: gpr_log_severity,
6093 format: *const ::std::os::raw::c_char,
6094 ...
6095 );
6096}
6097extern "C" {
6098 pub fn gpr_should_log(severity: gpr_log_severity) -> ::std::os::raw::c_int;
6099}
6100extern "C" {
6101 pub fn gpr_log_message(
6102 file: *const ::std::os::raw::c_char,
6103 line: ::std::os::raw::c_int,
6104 severity: gpr_log_severity,
6105 message: *const ::std::os::raw::c_char,
6106 );
6107}
6108extern "C" {
6109 #[doc = " Set global log verbosity"]
6110 pub fn gpr_set_log_verbosity(min_severity_to_print: gpr_log_severity);
6111}
6112extern "C" {
6113 pub fn gpr_log_verbosity_init();
6114}
6115#[doc = " Log overrides: applications can use this API to intercept logging calls"]
6116#[doc = "and use their own implementations"]
6117#[repr(C)]
6118#[derive(Debug, Copy, Clone)]
6119pub struct gpr_log_func_args {
6120 pub file: *const ::std::os::raw::c_char,
6121 pub line: ::std::os::raw::c_int,
6122 pub severity: gpr_log_severity,
6123 pub message: *const ::std::os::raw::c_char,
6124}
6125#[test]
6126fn bindgen_test_layout_gpr_log_func_args() {
6127 assert_eq!(
6128 ::std::mem::size_of::<gpr_log_func_args>(),
6129 24usize,
6130 concat!("Size of: ", stringify!(gpr_log_func_args))
6131 );
6132 assert_eq!(
6133 ::std::mem::align_of::<gpr_log_func_args>(),
6134 8usize,
6135 concat!("Alignment of ", stringify!(gpr_log_func_args))
6136 );
6137 assert_eq!(
6138 unsafe { &(*(::std::ptr::null::<gpr_log_func_args>())).file as *const _ as usize },
6139 0usize,
6140 concat!(
6141 "Offset of field: ",
6142 stringify!(gpr_log_func_args),
6143 "::",
6144 stringify!(file)
6145 )
6146 );
6147 assert_eq!(
6148 unsafe { &(*(::std::ptr::null::<gpr_log_func_args>())).line as *const _ as usize },
6149 8usize,
6150 concat!(
6151 "Offset of field: ",
6152 stringify!(gpr_log_func_args),
6153 "::",
6154 stringify!(line)
6155 )
6156 );
6157 assert_eq!(
6158 unsafe { &(*(::std::ptr::null::<gpr_log_func_args>())).severity as *const _ as usize },
6159 12usize,
6160 concat!(
6161 "Offset of field: ",
6162 stringify!(gpr_log_func_args),
6163 "::",
6164 stringify!(severity)
6165 )
6166 );
6167 assert_eq!(
6168 unsafe { &(*(::std::ptr::null::<gpr_log_func_args>())).message as *const _ as usize },
6169 16usize,
6170 concat!(
6171 "Offset of field: ",
6172 stringify!(gpr_log_func_args),
6173 "::",
6174 stringify!(message)
6175 )
6176 );
6177}
6178pub type gpr_log_func = ::std::option::Option<unsafe extern "C" fn(args: *mut gpr_log_func_args)>;
6179extern "C" {
6180 pub fn gpr_set_log_function(func: gpr_log_func);
6181}
6182extern "C" {
6183 #[doc = " malloc."]
6184 #[doc = " If size==0, always returns NULL. Otherwise this function never returns NULL."]
6185 #[doc = " The pointer returned is suitably aligned for any kind of variable it could"]
6186 #[doc = " contain."]
6187 pub fn gpr_malloc(size: usize) -> *mut ::std::os::raw::c_void;
6188}
6189extern "C" {
6190 #[doc = " like malloc, but zero all bytes before returning them"]
6191 pub fn gpr_zalloc(size: usize) -> *mut ::std::os::raw::c_void;
6192}
6193extern "C" {
6194 #[doc = " free"]
6195 pub fn gpr_free(ptr: *mut ::std::os::raw::c_void);
6196}
6197extern "C" {
6198 #[doc = " realloc, never returns NULL"]
6199 pub fn gpr_realloc(p: *mut ::std::os::raw::c_void, size: usize) -> *mut ::std::os::raw::c_void;
6200}
6201extern "C" {
6202 #[doc = " aligned malloc, never returns NULL, will align to alignment, which"]
6203 #[doc = " must be a power of 2."]
6204 pub fn gpr_malloc_aligned(size: usize, alignment: usize) -> *mut ::std::os::raw::c_void;
6205}
6206extern "C" {
6207 #[doc = " free memory allocated by gpr_malloc_aligned"]
6208 pub fn gpr_free_aligned(ptr: *mut ::std::os::raw::c_void);
6209}
6210extern "C" {
6211 #[doc = " Return the number of CPU cores on the current system. Will return 0 if"]
6212 #[doc = "the information is not available."]
6213 pub fn gpr_cpu_num_cores() -> ::std::os::raw::c_uint;
6214}
6215extern "C" {
6216 #[doc = " Return the CPU on which the current thread is executing; N.B. This should"]
6217 #[doc = "be considered advisory only - it is possible that the thread is switched"]
6218 #[doc = "to a different CPU at any time. Returns a value in range"]
6219 #[doc = "[0, gpr_cpu_num_cores() - 1]"]
6220 pub fn gpr_cpu_current_cpu() -> ::std::os::raw::c_uint;
6221}
6222extern "C" {
6223 #[doc = " Returns a string allocated with gpr_malloc that contains a UTF-8"]
6224 #[doc = " formatted error message, corresponding to the error messageid."]
6225 #[doc = " Use in conjunction with GetLastError() et al."]
6226 pub fn gpr_format_message(messageid: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char;
6227}
6228extern "C" {
6229 #[doc = " Returns a copy of src that can be passed to gpr_free()."]
6230 #[doc = "If allocation fails or if src is NULL, returns NULL."]
6231 pub fn gpr_strdup(src: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char;
6232}
6233extern "C" {
6234 #[doc = " printf to a newly-allocated string. The set of supported formats may vary"]
6235 #[doc = "between platforms."]
6236 #[doc = ""]
6237 #[doc = "On success, returns the number of bytes printed (excluding the final '\\0'),"]
6238 #[doc = "and *strp points to a string which must later be destroyed with gpr_free()."]
6239 #[doc = ""]
6240 #[doc = "On error, returns -1 and sets *strp to NULL. If the format string is bad,"]
6241 #[doc = "the result is undefined."]
6242 pub fn gpr_asprintf(
6243 strp: *mut *mut ::std::os::raw::c_char,
6244 format: *const ::std::os::raw::c_char,
6245 ...
6246 ) -> ::std::os::raw::c_int;
6247}
6248pub type gpr_thd_id = usize;
6249extern "C" {
6250 #[doc = " Returns the identifier of the current thread."]
6251 pub fn gpr_thd_currentid() -> gpr_thd_id;
6252}
6253#[doc = " Reader for byte buffers. Iterates over slices in the byte buffer"]
6254#[repr(C)]
6255#[derive(Copy, Clone)]
6256pub struct grpc_byte_buffer_reader {
6257 pub buffer_in: *mut grpc_byte_buffer,
6258 pub buffer_out: *mut grpc_byte_buffer,
6259 pub current: grpc_byte_buffer_reader_grpc_byte_buffer_reader_current,
6260}
6261#[doc = " Different current objects correspond to different types of byte buffers"]
6262#[repr(C)]
6263#[derive(Copy, Clone)]
6264pub union grpc_byte_buffer_reader_grpc_byte_buffer_reader_current {
6265 #[doc = " Index into a slice buffer's array of slices"]
6266 pub index: ::std::os::raw::c_uint,
6267 _bindgen_union_align: u32,
6268}
6269#[test]
6270fn bindgen_test_layout_grpc_byte_buffer_reader_grpc_byte_buffer_reader_current() {
6271 assert_eq!(
6272 ::std::mem::size_of::<grpc_byte_buffer_reader_grpc_byte_buffer_reader_current>(),
6273 4usize,
6274 concat!(
6275 "Size of: ",
6276 stringify!(grpc_byte_buffer_reader_grpc_byte_buffer_reader_current)
6277 )
6278 );
6279 assert_eq!(
6280 ::std::mem::align_of::<grpc_byte_buffer_reader_grpc_byte_buffer_reader_current>(),
6281 4usize,
6282 concat!(
6283 "Alignment of ",
6284 stringify!(grpc_byte_buffer_reader_grpc_byte_buffer_reader_current)
6285 )
6286 );
6287 assert_eq!(
6288 unsafe {
6289 &(*(::std::ptr::null::<grpc_byte_buffer_reader_grpc_byte_buffer_reader_current>()))
6290 .index as *const _ as usize
6291 },
6292 0usize,
6293 concat!(
6294 "Offset of field: ",
6295 stringify!(grpc_byte_buffer_reader_grpc_byte_buffer_reader_current),
6296 "::",
6297 stringify!(index)
6298 )
6299 );
6300}
6301impl ::std::fmt::Debug for grpc_byte_buffer_reader_grpc_byte_buffer_reader_current {
6302 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
6303 write!(
6304 f,
6305 "grpc_byte_buffer_reader_grpc_byte_buffer_reader_current {{ union }}"
6306 )
6307 }
6308}
6309#[test]
6310fn bindgen_test_layout_grpc_byte_buffer_reader() {
6311 assert_eq!(
6312 ::std::mem::size_of::<grpc_byte_buffer_reader>(),
6313 24usize,
6314 concat!("Size of: ", stringify!(grpc_byte_buffer_reader))
6315 );
6316 assert_eq!(
6317 ::std::mem::align_of::<grpc_byte_buffer_reader>(),
6318 8usize,
6319 concat!("Alignment of ", stringify!(grpc_byte_buffer_reader))
6320 );
6321 assert_eq!(
6322 unsafe {
6323 &(*(::std::ptr::null::<grpc_byte_buffer_reader>())).buffer_in as *const _ as usize
6324 },
6325 0usize,
6326 concat!(
6327 "Offset of field: ",
6328 stringify!(grpc_byte_buffer_reader),
6329 "::",
6330 stringify!(buffer_in)
6331 )
6332 );
6333 assert_eq!(
6334 unsafe {
6335 &(*(::std::ptr::null::<grpc_byte_buffer_reader>())).buffer_out as *const _ as usize
6336 },
6337 8usize,
6338 concat!(
6339 "Offset of field: ",
6340 stringify!(grpc_byte_buffer_reader),
6341 "::",
6342 stringify!(buffer_out)
6343 )
6344 );
6345 assert_eq!(
6346 unsafe { &(*(::std::ptr::null::<grpc_byte_buffer_reader>())).current as *const _ as usize },
6347 16usize,
6348 concat!(
6349 "Offset of field: ",
6350 stringify!(grpc_byte_buffer_reader),
6351 "::",
6352 stringify!(current)
6353 )
6354 );
6355}
6356impl ::std::fmt::Debug for grpc_byte_buffer_reader {
6357 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
6358 write!(
6359 f,
6360 "grpc_byte_buffer_reader {{ buffer_in: {:?}, buffer_out: {:?}, current: {:?} }}",
6361 self.buffer_in, self.buffer_out, self.current
6362 )
6363 }
6364}
6365#[repr(C)]
6366#[derive(Copy, Clone)]
6367pub struct grpcwrap_batch_context {
6368 pub send_initial_metadata: grpc_metadata_array,
6369 pub send_message: *mut grpc_byte_buffer,
6370 pub send_status_from_server: grpcwrap_batch_context__bindgen_ty_1,
6371 pub recv_initial_metadata: grpc_metadata_array,
6372 pub recv_message: *mut grpc_byte_buffer,
6373 pub recv_status_on_client: grpcwrap_batch_context__bindgen_ty_2,
6374 pub recv_close_on_server_cancelled: ::std::os::raw::c_int,
6375}
6376#[repr(C)]
6377#[derive(Debug, Copy, Clone)]
6378pub struct grpcwrap_batch_context__bindgen_ty_1 {
6379 pub trailing_metadata: grpc_metadata_array,
6380}
6381#[test]
6382fn bindgen_test_layout_grpcwrap_batch_context__bindgen_ty_1() {
6383 assert_eq!(
6384 ::std::mem::size_of::<grpcwrap_batch_context__bindgen_ty_1>(),
6385 24usize,
6386 concat!(
6387 "Size of: ",
6388 stringify!(grpcwrap_batch_context__bindgen_ty_1)
6389 )
6390 );
6391 assert_eq!(
6392 ::std::mem::align_of::<grpcwrap_batch_context__bindgen_ty_1>(),
6393 8usize,
6394 concat!(
6395 "Alignment of ",
6396 stringify!(grpcwrap_batch_context__bindgen_ty_1)
6397 )
6398 );
6399 assert_eq!(
6400 unsafe {
6401 &(*(::std::ptr::null::<grpcwrap_batch_context__bindgen_ty_1>())).trailing_metadata
6402 as *const _ as usize
6403 },
6404 0usize,
6405 concat!(
6406 "Offset of field: ",
6407 stringify!(grpcwrap_batch_context__bindgen_ty_1),
6408 "::",
6409 stringify!(trailing_metadata)
6410 )
6411 );
6412}
6413#[repr(C)]
6414#[derive(Copy, Clone)]
6415pub struct grpcwrap_batch_context__bindgen_ty_2 {
6416 pub trailing_metadata: grpc_metadata_array,
6417 pub status: grpc_status_code::Type,
6418 pub status_details: grpc_slice,
6419}
6420#[test]
6421fn bindgen_test_layout_grpcwrap_batch_context__bindgen_ty_2() {
6422 assert_eq!(
6423 ::std::mem::size_of::<grpcwrap_batch_context__bindgen_ty_2>(),
6424 64usize,
6425 concat!(
6426 "Size of: ",
6427 stringify!(grpcwrap_batch_context__bindgen_ty_2)
6428 )
6429 );
6430 assert_eq!(
6431 ::std::mem::align_of::<grpcwrap_batch_context__bindgen_ty_2>(),
6432 8usize,
6433 concat!(
6434 "Alignment of ",
6435 stringify!(grpcwrap_batch_context__bindgen_ty_2)
6436 )
6437 );
6438 assert_eq!(
6439 unsafe {
6440 &(*(::std::ptr::null::<grpcwrap_batch_context__bindgen_ty_2>())).trailing_metadata
6441 as *const _ as usize
6442 },
6443 0usize,
6444 concat!(
6445 "Offset of field: ",
6446 stringify!(grpcwrap_batch_context__bindgen_ty_2),
6447 "::",
6448 stringify!(trailing_metadata)
6449 )
6450 );
6451 assert_eq!(
6452 unsafe {
6453 &(*(::std::ptr::null::<grpcwrap_batch_context__bindgen_ty_2>())).status as *const _
6454 as usize
6455 },
6456 24usize,
6457 concat!(
6458 "Offset of field: ",
6459 stringify!(grpcwrap_batch_context__bindgen_ty_2),
6460 "::",
6461 stringify!(status)
6462 )
6463 );
6464 assert_eq!(
6465 unsafe {
6466 &(*(::std::ptr::null::<grpcwrap_batch_context__bindgen_ty_2>())).status_details
6467 as *const _ as usize
6468 },
6469 32usize,
6470 concat!(
6471 "Offset of field: ",
6472 stringify!(grpcwrap_batch_context__bindgen_ty_2),
6473 "::",
6474 stringify!(status_details)
6475 )
6476 );
6477}
6478impl ::std::fmt::Debug for grpcwrap_batch_context__bindgen_ty_2 {
6479 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
6480 write ! ( f , "grpcwrap_batch_context__bindgen_ty_2 {{ trailing_metadata: {:?}, status: {:?}, status_details: {:?} }}" , self . trailing_metadata , self . status , self . status_details )
6481 }
6482}
6483#[test]
6484fn bindgen_test_layout_grpcwrap_batch_context() {
6485 assert_eq!(
6486 ::std::mem::size_of::<grpcwrap_batch_context>(),
6487 160usize,
6488 concat!("Size of: ", stringify!(grpcwrap_batch_context))
6489 );
6490 assert_eq!(
6491 ::std::mem::align_of::<grpcwrap_batch_context>(),
6492 8usize,
6493 concat!("Alignment of ", stringify!(grpcwrap_batch_context))
6494 );
6495 assert_eq!(
6496 unsafe {
6497 &(*(::std::ptr::null::<grpcwrap_batch_context>())).send_initial_metadata as *const _
6498 as usize
6499 },
6500 0usize,
6501 concat!(
6502 "Offset of field: ",
6503 stringify!(grpcwrap_batch_context),
6504 "::",
6505 stringify!(send_initial_metadata)
6506 )
6507 );
6508 assert_eq!(
6509 unsafe {
6510 &(*(::std::ptr::null::<grpcwrap_batch_context>())).send_message as *const _ as usize
6511 },
6512 24usize,
6513 concat!(
6514 "Offset of field: ",
6515 stringify!(grpcwrap_batch_context),
6516 "::",
6517 stringify!(send_message)
6518 )
6519 );
6520 assert_eq!(
6521 unsafe {
6522 &(*(::std::ptr::null::<grpcwrap_batch_context>())).send_status_from_server as *const _
6523 as usize
6524 },
6525 32usize,
6526 concat!(
6527 "Offset of field: ",
6528 stringify!(grpcwrap_batch_context),
6529 "::",
6530 stringify!(send_status_from_server)
6531 )
6532 );
6533 assert_eq!(
6534 unsafe {
6535 &(*(::std::ptr::null::<grpcwrap_batch_context>())).recv_initial_metadata as *const _
6536 as usize
6537 },
6538 56usize,
6539 concat!(
6540 "Offset of field: ",
6541 stringify!(grpcwrap_batch_context),
6542 "::",
6543 stringify!(recv_initial_metadata)
6544 )
6545 );
6546 assert_eq!(
6547 unsafe {
6548 &(*(::std::ptr::null::<grpcwrap_batch_context>())).recv_message as *const _ as usize
6549 },
6550 80usize,
6551 concat!(
6552 "Offset of field: ",
6553 stringify!(grpcwrap_batch_context),
6554 "::",
6555 stringify!(recv_message)
6556 )
6557 );
6558 assert_eq!(
6559 unsafe {
6560 &(*(::std::ptr::null::<grpcwrap_batch_context>())).recv_status_on_client as *const _
6561 as usize
6562 },
6563 88usize,
6564 concat!(
6565 "Offset of field: ",
6566 stringify!(grpcwrap_batch_context),
6567 "::",
6568 stringify!(recv_status_on_client)
6569 )
6570 );
6571 assert_eq!(
6572 unsafe {
6573 &(*(::std::ptr::null::<grpcwrap_batch_context>())).recv_close_on_server_cancelled
6574 as *const _ as usize
6575 },
6576 152usize,
6577 concat!(
6578 "Offset of field: ",
6579 stringify!(grpcwrap_batch_context),
6580 "::",
6581 stringify!(recv_close_on_server_cancelled)
6582 )
6583 );
6584}
6585impl ::std::fmt::Debug for grpcwrap_batch_context {
6586 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
6587 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 )
6588 }
6589}
6590extern "C" {
6591 pub fn grpcwrap_batch_context_create() -> *mut grpcwrap_batch_context;
6592}
6593#[repr(C)]
6594#[derive(Copy, Clone)]
6595pub struct grpcwrap_request_call_context {
6596 pub call: *mut grpc_call,
6597 pub call_details: grpc_call_details,
6598 pub request_metadata: grpc_metadata_array,
6599}
6600#[test]
6601fn bindgen_test_layout_grpcwrap_request_call_context() {
6602 assert_eq!(
6603 ::std::mem::size_of::<grpcwrap_request_call_context>(),
6604 128usize,
6605 concat!("Size of: ", stringify!(grpcwrap_request_call_context))
6606 );
6607 assert_eq!(
6608 ::std::mem::align_of::<grpcwrap_request_call_context>(),
6609 8usize,
6610 concat!("Alignment of ", stringify!(grpcwrap_request_call_context))
6611 );
6612 assert_eq!(
6613 unsafe {
6614 &(*(::std::ptr::null::<grpcwrap_request_call_context>())).call as *const _ as usize
6615 },
6616 0usize,
6617 concat!(
6618 "Offset of field: ",
6619 stringify!(grpcwrap_request_call_context),
6620 "::",
6621 stringify!(call)
6622 )
6623 );
6624 assert_eq!(
6625 unsafe {
6626 &(*(::std::ptr::null::<grpcwrap_request_call_context>())).call_details as *const _
6627 as usize
6628 },
6629 8usize,
6630 concat!(
6631 "Offset of field: ",
6632 stringify!(grpcwrap_request_call_context),
6633 "::",
6634 stringify!(call_details)
6635 )
6636 );
6637 assert_eq!(
6638 unsafe {
6639 &(*(::std::ptr::null::<grpcwrap_request_call_context>())).request_metadata as *const _
6640 as usize
6641 },
6642 104usize,
6643 concat!(
6644 "Offset of field: ",
6645 stringify!(grpcwrap_request_call_context),
6646 "::",
6647 stringify!(request_metadata)
6648 )
6649 );
6650}
6651impl ::std::fmt::Debug for grpcwrap_request_call_context {
6652 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
6653 write ! ( f , "grpcwrap_request_call_context {{ call: {:?}, call_details: {:?}, request_metadata: {:?} }}" , self . call , self . call_details , self . request_metadata )
6654 }
6655}
6656extern "C" {
6657 pub fn grpcwrap_request_call_context_create() -> *mut grpcwrap_request_call_context;
6658}
6659extern "C" {
6660 #[link_name = "\u{1}_Z45grpcwrap_metadata_array_destroy_metadata_onlyP19grpc_metadata_array"]
6661 pub fn grpcwrap_metadata_array_destroy_metadata_only(array: *mut grpc_metadata_array);
6662}
6663extern "C" {
6664 #[link_name = "\u{1}_Z58grpcwrap_metadata_array_destroy_metadata_including_entriesP19grpc_metadata_array"]
6665 pub fn grpcwrap_metadata_array_destroy_metadata_including_entries(
6666 array: *mut grpc_metadata_array,
6667 );
6668}
6669extern "C" {
6670 pub fn grpcwrap_metadata_array_destroy_full(array: *mut grpc_metadata_array);
6671}
6672extern "C" {
6673 pub fn grpcwrap_metadata_array_init(array: *mut grpc_metadata_array, capacity: usize);
6674}
6675extern "C" {
6676 pub fn grpcwrap_metadata_array_add(
6677 array: *mut grpc_metadata_array,
6678 key: *const ::std::os::raw::c_char,
6679 key_length: usize,
6680 value: *const ::std::os::raw::c_char,
6681 value_length: usize,
6682 );
6683}
6684extern "C" {
6685 pub fn grpcwrap_metadata_array_get_key(
6686 array: *const grpc_metadata_array,
6687 index: usize,
6688 key_length: *mut usize,
6689 ) -> *const ::std::os::raw::c_char;
6690}
6691extern "C" {
6692 pub fn grpcwrap_metadata_array_get_value(
6693 array: *const grpc_metadata_array,
6694 index: usize,
6695 value_length: *mut usize,
6696 ) -> *const ::std::os::raw::c_char;
6697}
6698extern "C" {
6699 pub fn grpcwrap_metadata_array_cleanup(array: *mut grpc_metadata_array);
6700}
6701extern "C" {
6702 pub fn grpcwrap_metadata_array_shrink_to_fit(array: *mut grpc_metadata_array);
6703}
6704extern "C" {
6705 #[link_name = "\u{1}_Z28grpcwrap_metadata_array_moveP19grpc_metadata_arrayS0_"]
6706 pub fn grpcwrap_metadata_array_move(
6707 dest: *mut grpc_metadata_array,
6708 src: *mut grpc_metadata_array,
6709 );
6710}
6711extern "C" {
6712 pub fn grpcwrap_batch_context_destroy(ctx: *mut grpcwrap_batch_context);
6713}
6714extern "C" {
6715 pub fn grpcwrap_request_call_context_destroy(ctx: *mut grpcwrap_request_call_context);
6716}
6717extern "C" {
6718 pub fn grpcwrap_batch_context_recv_initial_metadata(
6719 ctx: *const grpcwrap_batch_context,
6720 ) -> *const grpc_metadata_array;
6721}
6722extern "C" {
6723 pub fn grpcwrap_slice_raw_offset(
6724 slice: *const grpc_slice,
6725 offset: usize,
6726 len: *mut usize,
6727 ) -> *const ::std::os::raw::c_char;
6728}
6729extern "C" {
6730 pub fn grpcwrap_slice_copy(slice: *const grpc_slice) -> grpc_slice;
6731}
6732extern "C" {
6733 pub fn grpcwrap_slice_unref(slice: *const grpc_slice);
6734}
6735extern "C" {
6736 pub fn grpcwrap_slice_ref(slice: *const grpc_slice) -> grpc_slice;
6737}
6738extern "C" {
6739 pub fn grpcwrap_slice_length(slice: *const grpc_slice) -> usize;
6740}
6741extern "C" {
6742 pub fn grpcwrap_batch_context_take_recv_message(
6743 ctx: *mut grpcwrap_batch_context,
6744 ) -> *mut grpc_byte_buffer;
6745}
6746extern "C" {
6747 pub fn grpcwrap_batch_context_recv_status_on_client_status(
6748 ctx: *const grpcwrap_batch_context,
6749 ) -> grpc_status_code::Type;
6750}
6751extern "C" {
6752 pub fn grpcwrap_batch_context_recv_status_on_client_details(
6753 ctx: *const grpcwrap_batch_context,
6754 details_length: *mut usize,
6755 ) -> *const ::std::os::raw::c_char;
6756}
6757extern "C" {
6758 pub fn grpcwrap_batch_context_recv_status_on_client_trailing_metadata(
6759 ctx: *const grpcwrap_batch_context,
6760 ) -> *const grpc_metadata_array;
6761}
6762extern "C" {
6763 pub fn grpcwrap_request_call_context_ref_call(
6764 ctx: *mut grpcwrap_request_call_context,
6765 ) -> *mut grpc_call;
6766}
6767extern "C" {
6768 pub fn grpcwrap_request_call_context_get_call(
6769 ctx: *mut grpcwrap_request_call_context,
6770 ) -> *mut grpc_call;
6771}
6772extern "C" {
6773 pub fn grpcwrap_request_call_context_method(
6774 ctx: *const grpcwrap_request_call_context,
6775 method_length: *mut usize,
6776 ) -> *const ::std::os::raw::c_char;
6777}
6778extern "C" {
6779 pub fn grpcwrap_request_call_context_host(
6780 ctx: *const grpcwrap_request_call_context,
6781 host_length: *mut usize,
6782 ) -> *const ::std::os::raw::c_char;
6783}
6784extern "C" {
6785 pub fn grpcwrap_request_call_context_deadline(
6786 ctx: *const grpcwrap_request_call_context,
6787 ) -> gpr_timespec;
6788}
6789extern "C" {
6790 pub fn grpcwrap_request_call_context_metadata_array(
6791 ctx: *const grpcwrap_request_call_context,
6792 ) -> *const grpc_metadata_array;
6793}
6794extern "C" {
6795 pub fn grpcwrap_batch_context_recv_close_on_server_cancelled(
6796 ctx: *const grpcwrap_batch_context,
6797 ) -> i32;
6798}
6799extern "C" {
6800 pub fn grpcwrap_channel_create_call(
6801 channel: *mut grpc_channel,
6802 parent_call: *mut grpc_call,
6803 propagation_mask: u32,
6804 cq: *mut grpc_completion_queue,
6805 method: *const ::std::os::raw::c_char,
6806 method_len: usize,
6807 host: *const ::std::os::raw::c_char,
6808 host_len: usize,
6809 deadline: gpr_timespec,
6810 ) -> *mut grpc_call;
6811}
6812extern "C" {
6813 pub fn grpcwrap_channel_args_create(num_args: usize) -> *mut grpc_channel_args;
6814}
6815extern "C" {
6816 pub fn grpcwrap_channel_args_set_string(
6817 args: *mut grpc_channel_args,
6818 index: usize,
6819 key: *const ::std::os::raw::c_char,
6820 value: *const ::std::os::raw::c_char,
6821 );
6822}
6823extern "C" {
6824 pub fn grpcwrap_channel_args_set_integer(
6825 args: *mut grpc_channel_args,
6826 index: usize,
6827 key: *const ::std::os::raw::c_char,
6828 value: ::std::os::raw::c_int,
6829 );
6830}
6831extern "C" {
6832 pub fn grpcwrap_channel_args_set_pointer_vtable(
6833 args: *mut grpc_channel_args,
6834 index: usize,
6835 key: *const ::std::os::raw::c_char,
6836 value: *mut ::std::os::raw::c_void,
6837 vtable: *const grpc_arg_pointer_vtable,
6838 );
6839}
6840extern "C" {
6841 pub fn grpcwrap_channel_args_destroy(args: *mut grpc_channel_args);
6842}
6843extern "C" {
6844 pub fn grpcwrap_call_start_unary(
6845 call: *mut grpc_call,
6846 ctx: *mut grpcwrap_batch_context,
6847 send_buffer: *const ::std::os::raw::c_char,
6848 send_buffer_len: usize,
6849 write_flags: u32,
6850 initial_metadata: *mut grpc_metadata_array,
6851 initial_metadata_flags: u32,
6852 tag: *mut ::std::os::raw::c_void,
6853 ) -> grpc_call_error;
6854}
6855extern "C" {
6856 pub fn grpcwrap_call_start_client_streaming(
6857 call: *mut grpc_call,
6858 ctx: *mut grpcwrap_batch_context,
6859 initial_metadata: *mut grpc_metadata_array,
6860 initial_metadata_flags: u32,
6861 tag: *mut ::std::os::raw::c_void,
6862 ) -> grpc_call_error;
6863}
6864extern "C" {
6865 pub fn grpcwrap_call_start_server_streaming(
6866 call: *mut grpc_call,
6867 ctx: *mut grpcwrap_batch_context,
6868 send_buffer: *const ::std::os::raw::c_char,
6869 send_buffer_len: usize,
6870 write_flags: u32,
6871 initial_metadata: *mut grpc_metadata_array,
6872 initial_metadata_flags: u32,
6873 tag: *mut ::std::os::raw::c_void,
6874 ) -> grpc_call_error;
6875}
6876extern "C" {
6877 pub fn grpcwrap_call_start_duplex_streaming(
6878 call: *mut grpc_call,
6879 ctx: *mut grpcwrap_batch_context,
6880 initial_metadata: *mut grpc_metadata_array,
6881 initial_metadata_flags: u32,
6882 tag: *mut ::std::os::raw::c_void,
6883 ) -> grpc_call_error;
6884}
6885extern "C" {
6886 pub fn grpcwrap_call_recv_initial_metadata(
6887 call: *mut grpc_call,
6888 ctx: *mut grpcwrap_batch_context,
6889 tag: *mut ::std::os::raw::c_void,
6890 ) -> grpc_call_error;
6891}
6892extern "C" {
6893 pub fn grpcwrap_call_send_message(
6894 call: *mut grpc_call,
6895 ctx: *mut grpcwrap_batch_context,
6896 send_buffer: *const ::std::os::raw::c_char,
6897 send_buffer_len: usize,
6898 write_flags: u32,
6899 send_empty_initial_metadata: i32,
6900 tag: *mut ::std::os::raw::c_void,
6901 ) -> grpc_call_error;
6902}
6903extern "C" {
6904 pub fn grpcwrap_call_send_close_from_client(
6905 call: *mut grpc_call,
6906 tag: *mut ::std::os::raw::c_void,
6907 ) -> grpc_call_error;
6908}
6909extern "C" {
6910 pub fn grpcwrap_call_send_status_from_server(
6911 call: *mut grpc_call,
6912 ctx: *mut grpcwrap_batch_context,
6913 status_code: grpc_status_code::Type,
6914 status_details: *const ::std::os::raw::c_char,
6915 status_details_len: usize,
6916 trailing_metadata: *mut grpc_metadata_array,
6917 send_empty_initial_metadata: i32,
6918 optional_send_buffer: *const ::std::os::raw::c_char,
6919 optional_send_buffer_len: usize,
6920 write_flags: u32,
6921 tag: *mut ::std::os::raw::c_void,
6922 ) -> grpc_call_error;
6923}
6924extern "C" {
6925 pub fn grpcwrap_call_recv_message(
6926 call: *mut grpc_call,
6927 ctx: *mut grpcwrap_batch_context,
6928 tag: *mut ::std::os::raw::c_void,
6929 ) -> grpc_call_error;
6930}
6931extern "C" {
6932 pub fn grpcwrap_call_start_serverside(
6933 call: *mut grpc_call,
6934 ctx: *mut grpcwrap_batch_context,
6935 tag: *mut ::std::os::raw::c_void,
6936 ) -> grpc_call_error;
6937}
6938extern "C" {
6939 pub fn grpcwrap_call_send_initial_metadata(
6940 call: *mut grpc_call,
6941 ctx: *mut grpcwrap_batch_context,
6942 initial_metadata: *mut grpc_metadata_array,
6943 tag: *mut ::std::os::raw::c_void,
6944 ) -> grpc_call_error;
6945}
6946extern "C" {
6947 #[doc = " Kick call's completion queue, it should be called after there is an event"]
6948 #[doc = "ready to poll."]
6949 #[doc = "THREAD SAFETY: grpcwrap_call_kick_completion_queue is thread-safe"]
6950 #[doc = "because it does not change the call's state."]
6951 pub fn grpcwrap_call_kick_completion_queue(
6952 call: *mut grpc_call,
6953 tag: *mut ::std::os::raw::c_void,
6954 ) -> grpc_call_error;
6955}
6956extern "C" {
6957 pub fn grpcwrap_server_request_call(
6958 server: *mut grpc_server,
6959 cq: *mut grpc_completion_queue,
6960 ctx: *mut grpcwrap_request_call_context,
6961 tag: *mut ::std::os::raw::c_void,
6962 ) -> grpc_call_error;
6963}