diff --git a/.cargo/config b/.cargo/config.toml similarity index 100% rename from .cargo/config rename to .cargo/config.toml diff --git a/Cargo.toml b/Cargo.toml index 2334a4242..307267acb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ futures-executor = "0.3" futures-util = { version = "0.3", default-features = false, features = ["std", "sink"] } protobuf = { version = "2.0", optional = true } protobufv3 = { package = "protobuf", version = "3.2", optional = true } -prost = { version = "0.11", optional = true } +prost = { version = "0.12", optional = true } bytes = { version = "1.0", optional = true } log = "0.4" parking_lot = "0.12" diff --git a/benchmark/Cargo.toml b/benchmark/Cargo.toml index c59a351a2..013aed500 100644 --- a/benchmark/Cargo.toml +++ b/benchmark/Cargo.toml @@ -18,11 +18,11 @@ futures-executor = "0.3" futures-util = { version = "0.3", default-features = false, features = ["std", "sink"] } libc = "0.2" grpcio-sys = { path = "../grpc-sys" } -rand = "0.7" -rand_distr = "0.2" -rand_xorshift = "0.2" +rand = "0.8" +rand_distr = "0.4" +rand_xorshift = "0.3" futures-timer = "3.0" -clap = "2.23" +clap = "4.5" log = "0.4" slog = "2.0" slog-async = "2.1" diff --git a/benchmark/src/main.rs b/benchmark/src/main.rs index b907d88bc..01ed9af49 100644 --- a/benchmark/src/main.rs +++ b/benchmark/src/main.rs @@ -9,7 +9,7 @@ use std::env; use std::sync::Arc; use benchmark::{init_log, Worker}; -use clap::{App, Arg}; +use clap::Parser; use futures_channel::oneshot; use grpc::{Environment, ServerBuilder, ServerCredentials}; use grpc_proto::testing::services_grpc::create_worker_service; @@ -17,17 +17,19 @@ use rand::Rng; const LOG_FILE: &str = "GRPCIO_BENCHMARK_LOG_FILE"; +/// Benchmark QpsWorker +/// +/// ref http://www.grpc.io/docs/guides/benchmarking.html. +#[derive(Parser)] +struct WorkerCli { + /// The port the worker should listen on. For example, 8080 + #[arg(long)] + driver_port: Option, +} + fn main() { - let matches = App::new("Benchmark QpsWorker") - .about("ref http://www.grpc.io/docs/guides/benchmarking.html") - .arg( - Arg::with_name("port") - .long("driver_port") - .help("The port the worker should listen on. For example, \"8080\"") - .takes_value(true), - ) - .get_matches(); - let port: u16 = matches.value_of("port").unwrap_or("8080").parse().unwrap(); + let cli = WorkerCli::parse(); + let port = cli.driver_port.unwrap_or(8080); let _log_guard = init_log( env::var(LOG_FILE) diff --git a/compiler/Cargo.toml b/compiler/Cargo.toml index 622443cf3..73055c9fb 100644 --- a/compiler/Cargo.toml +++ b/compiler/Cargo.toml @@ -18,10 +18,10 @@ prost-codec = ["prost-build", "prost-types", "prost", "derive-new", "tempfile"] [dependencies] protobuf = { version = "2", optional = true } -prost = { version = "0.11", optional = true } -prost-build = { version = "0.11", optional = true } -prost-types = { version = "0.11", optional = true } -derive-new = { version = "0.5", optional = true } +prost = { version = "0.12", optional = true } +prost-build = { version = "0.12", optional = true } +prost-types = { version = "0.12", optional = true } +derive-new = { version = "0.6", optional = true } tempfile = { version = "3.0", optional = true } [[bin]] diff --git a/grpc-sys/Cargo.toml b/grpc-sys/Cargo.toml index 40221057e..9352f920d 100644 --- a/grpc-sys/Cargo.toml +++ b/grpc-sys/Cargo.toml @@ -68,7 +68,7 @@ _gen-bindings = ["bindgen"] _list-package = [] [target.'cfg(not(all(any(target_os = "linux", target_os = "macos"), any(target_arch = "x86_64", target_arch = "aarch64"))))'.build-dependencies] -bindgen = "0.59.0" +bindgen = { version = "0.69.0", default-features = false, features = ["runtime"] } [build-dependencies] cc = "1.0" @@ -76,5 +76,5 @@ cmake = "0.1" pkg-config = "0.3" walkdir = "2.2.9" # Because of rust-lang/cargo#5237, bindgen should not be upgraded util a minor or major release. -bindgen = { version = "0.59.0", default-features = false, optional = true, features = ["runtime"] } +bindgen = { version = "0.69.0", default-features = false, optional = true, features = ["runtime"] } boringssl-src = { version = "0.6.0", optional = true } diff --git a/grpc-sys/bindings/bindings.rs b/grpc-sys/bindings/bindings.rs index b503a167f..270d7aa97 100644 --- a/grpc-sys/bindings/bindings.rs +++ b/grpc-sys/bindings/bindings.rs @@ -1,140 +1,126 @@ pub const GRPC_ARES: u32 = 1; pub const GRPC_IF_NAMETOINDEX: u32 = 1; pub const GRPC_ALLOW_EXCEPTIONS: u32 = 1; -pub const GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY: &[u8; 31usize] = +pub const GRPC_COMPRESSION_REQUEST_ALGORITHM_MD_KEY: &[u8; 31] = b"grpc-internal-encoding-request\0"; -pub const GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM: &[u8; 35usize] = +pub const GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM: &[u8; 35] = b"grpc.default_compression_algorithm\0"; -pub const GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL: &[u8; 31usize] = - b"grpc.default_compression_level\0"; -pub const GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET: &[u8; 43usize] = +pub const GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL: &[u8; 31] = b"grpc.default_compression_level\0"; +pub const GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET: &[u8; 43] = b"grpc.compression_enabled_algorithms_bitset\0"; pub const GRPC_SLICE_BUFFER_INLINE_ELEMENTS: u32 = 8; -pub const GRPC_ARG_ENABLE_CENSUS: &[u8; 12usize] = b"grpc.census\0"; -pub const GRPC_ARG_ENABLE_LOAD_REPORTING: &[u8; 19usize] = b"grpc.loadreporting\0"; -pub const GRPC_ARG_SERVER_CALL_METRIC_RECORDING: &[u8; 34usize] = - b"grpc.server_call_metric_recording\0"; -pub const GRPC_ARG_MINIMAL_STACK: &[u8; 19usize] = b"grpc.minimal_stack\0"; -pub const GRPC_ARG_MAX_CONCURRENT_STREAMS: &[u8; 28usize] = b"grpc.max_concurrent_streams\0"; -pub const GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH: &[u8; 32usize] = - b"grpc.max_receive_message_length\0"; -pub const GRPC_ARG_MAX_MESSAGE_LENGTH: &[u8; 32usize] = b"grpc.max_receive_message_length\0"; -pub const GRPC_ARG_MAX_SEND_MESSAGE_LENGTH: &[u8; 29usize] = b"grpc.max_send_message_length\0"; -pub const GRPC_ARG_MAX_CONNECTION_IDLE_MS: &[u8; 28usize] = b"grpc.max_connection_idle_ms\0"; -pub const GRPC_ARG_MAX_CONNECTION_AGE_MS: &[u8; 27usize] = b"grpc.max_connection_age_ms\0"; -pub const GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS: &[u8; 33usize] = - b"grpc.max_connection_age_grace_ms\0"; -pub const GRPC_ARG_CLIENT_IDLE_TIMEOUT_MS: &[u8; 28usize] = b"grpc.client_idle_timeout_ms\0"; -pub const GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION: &[u8; 29usize] = - b"grpc.per_message_compression\0"; -pub const GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION: &[u8; 31usize] = +pub const GRPC_ARG_ENABLE_CENSUS: &[u8; 12] = b"grpc.census\0"; +pub const GRPC_ARG_ENABLE_LOAD_REPORTING: &[u8; 19] = b"grpc.loadreporting\0"; +pub const GRPC_ARG_SERVER_CALL_METRIC_RECORDING: &[u8; 34] = b"grpc.server_call_metric_recording\0"; +pub const GRPC_ARG_MINIMAL_STACK: &[u8; 19] = b"grpc.minimal_stack\0"; +pub const GRPC_ARG_MAX_CONCURRENT_STREAMS: &[u8; 28] = b"grpc.max_concurrent_streams\0"; +pub const GRPC_ARG_MAX_RECEIVE_MESSAGE_LENGTH: &[u8; 32] = b"grpc.max_receive_message_length\0"; +pub const GRPC_ARG_MAX_MESSAGE_LENGTH: &[u8; 32] = b"grpc.max_receive_message_length\0"; +pub const GRPC_ARG_MAX_SEND_MESSAGE_LENGTH: &[u8; 29] = b"grpc.max_send_message_length\0"; +pub const GRPC_ARG_MAX_CONNECTION_IDLE_MS: &[u8; 28] = b"grpc.max_connection_idle_ms\0"; +pub const GRPC_ARG_MAX_CONNECTION_AGE_MS: &[u8; 27] = b"grpc.max_connection_age_ms\0"; +pub const GRPC_ARG_MAX_CONNECTION_AGE_GRACE_MS: &[u8; 33] = b"grpc.max_connection_age_grace_ms\0"; +pub const GRPC_ARG_CLIENT_IDLE_TIMEOUT_MS: &[u8; 28] = b"grpc.client_idle_timeout_ms\0"; +pub const GRPC_ARG_ENABLE_PER_MESSAGE_COMPRESSION: &[u8; 29] = b"grpc.per_message_compression\0"; +pub const GRPC_ARG_ENABLE_PER_MESSAGE_DECOMPRESSION: &[u8; 31] = b"grpc.per_message_decompression\0"; -pub const GRPC_ARG_ENABLE_DEADLINE_CHECKS: &[u8; 30usize] = b"grpc.enable_deadline_checking\0"; -pub const GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER: &[u8; 35usize] = +pub const GRPC_ARG_ENABLE_DEADLINE_CHECKS: &[u8; 30] = b"grpc.enable_deadline_checking\0"; +pub const GRPC_ARG_HTTP2_INITIAL_SEQUENCE_NUMBER: &[u8; 35] = b"grpc.http2.initial_sequence_number\0"; -pub const GRPC_ARG_HTTP2_STREAM_LOOKAHEAD_BYTES: &[u8; 27usize] = b"grpc.http2.lookahead_bytes\0"; -pub const GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_DECODER: &[u8; 36usize] = +pub const GRPC_ARG_HTTP2_STREAM_LOOKAHEAD_BYTES: &[u8; 27] = b"grpc.http2.lookahead_bytes\0"; +pub const GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_DECODER: &[u8; 36] = b"grpc.http2.hpack_table_size.decoder\0"; -pub const GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_ENCODER: &[u8; 36usize] = +pub const GRPC_ARG_HTTP2_HPACK_TABLE_SIZE_ENCODER: &[u8; 36] = b"grpc.http2.hpack_table_size.encoder\0"; -pub const GRPC_ARG_HTTP2_MAX_FRAME_SIZE: &[u8; 26usize] = b"grpc.http2.max_frame_size\0"; -pub const GRPC_ARG_HTTP2_BDP_PROBE: &[u8; 21usize] = b"grpc.http2.bdp_probe\0"; -pub const GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS: &[u8; 37usize] = +pub const GRPC_ARG_HTTP2_MAX_FRAME_SIZE: &[u8; 26] = b"grpc.http2.max_frame_size\0"; +pub const GRPC_ARG_HTTP2_BDP_PROBE: &[u8; 21] = b"grpc.http2.bdp_probe\0"; +pub const GRPC_ARG_HTTP2_MIN_SENT_PING_INTERVAL_WITHOUT_DATA_MS: &[u8; 37] = b"grpc.http2.min_time_between_pings_ms\0"; -pub const GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS: &[u8; 45usize] = +pub const GRPC_ARG_HTTP2_MIN_RECV_PING_INTERVAL_WITHOUT_DATA_MS: &[u8; 45] = b"grpc.http2.min_ping_interval_without_data_ms\0"; -pub const GRPC_ARG_HTTP2_SCHEME: &[u8; 18usize] = b"grpc.http2_scheme\0"; -pub const GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA: &[u8; 34usize] = - b"grpc.http2.max_pings_without_data\0"; -pub const GRPC_ARG_HTTP2_MAX_PING_STRIKES: &[u8; 28usize] = b"grpc.http2.max_ping_strikes\0"; -pub const GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE: &[u8; 29usize] = b"grpc.http2.write_buffer_size\0"; -pub const GRPC_ARG_HTTP2_ENABLE_TRUE_BINARY: &[u8; 23usize] = b"grpc.http2.true_binary\0"; -pub const GRPC_ARG_EXPERIMENTAL_HTTP2_PREFERRED_CRYPTO_FRAME_SIZE: &[u8; 52usize] = +pub const GRPC_ARG_HTTP2_SCHEME: &[u8; 18] = b"grpc.http2_scheme\0"; +pub const GRPC_ARG_HTTP2_MAX_PINGS_WITHOUT_DATA: &[u8; 34] = b"grpc.http2.max_pings_without_data\0"; +pub const GRPC_ARG_HTTP2_MAX_PING_STRIKES: &[u8; 28] = b"grpc.http2.max_ping_strikes\0"; +pub const GRPC_ARG_HTTP2_WRITE_BUFFER_SIZE: &[u8; 29] = b"grpc.http2.write_buffer_size\0"; +pub const GRPC_ARG_HTTP2_ENABLE_TRUE_BINARY: &[u8; 23] = b"grpc.http2.true_binary\0"; +pub const GRPC_ARG_EXPERIMENTAL_HTTP2_PREFERRED_CRYPTO_FRAME_SIZE: &[u8; 52] = b"grpc.experimental.http2.enable_preferred_frame_size\0"; -pub const GRPC_ARG_KEEPALIVE_TIME_MS: &[u8; 23usize] = b"grpc.keepalive_time_ms\0"; -pub const GRPC_ARG_KEEPALIVE_TIMEOUT_MS: &[u8; 26usize] = b"grpc.keepalive_timeout_ms\0"; -pub const GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS: &[u8; 36usize] = +pub const GRPC_ARG_KEEPALIVE_TIME_MS: &[u8; 23] = b"grpc.keepalive_time_ms\0"; +pub const GRPC_ARG_KEEPALIVE_TIMEOUT_MS: &[u8; 26] = b"grpc.keepalive_timeout_ms\0"; +pub const GRPC_ARG_KEEPALIVE_PERMIT_WITHOUT_CALLS: &[u8; 36] = b"grpc.keepalive_permit_without_calls\0"; -pub const GRPC_ARG_DEFAULT_AUTHORITY: &[u8; 23usize] = b"grpc.default_authority\0"; -pub const GRPC_ARG_PRIMARY_USER_AGENT_STRING: &[u8; 24usize] = b"grpc.primary_user_agent\0"; -pub const GRPC_ARG_SECONDARY_USER_AGENT_STRING: &[u8; 26usize] = b"grpc.secondary_user_agent\0"; -pub const GRPC_ARG_MIN_RECONNECT_BACKOFF_MS: &[u8; 30usize] = b"grpc.min_reconnect_backoff_ms\0"; -pub const GRPC_ARG_MAX_RECONNECT_BACKOFF_MS: &[u8; 30usize] = b"grpc.max_reconnect_backoff_ms\0"; -pub const GRPC_ARG_INITIAL_RECONNECT_BACKOFF_MS: &[u8; 34usize] = - b"grpc.initial_reconnect_backoff_ms\0"; -pub const GRPC_ARG_DNS_MIN_TIME_BETWEEN_RESOLUTIONS_MS: &[u8; 41usize] = +pub const GRPC_ARG_DEFAULT_AUTHORITY: &[u8; 23] = b"grpc.default_authority\0"; +pub const GRPC_ARG_PRIMARY_USER_AGENT_STRING: &[u8; 24] = b"grpc.primary_user_agent\0"; +pub const GRPC_ARG_SECONDARY_USER_AGENT_STRING: &[u8; 26] = b"grpc.secondary_user_agent\0"; +pub const GRPC_ARG_MIN_RECONNECT_BACKOFF_MS: &[u8; 30] = b"grpc.min_reconnect_backoff_ms\0"; +pub const GRPC_ARG_MAX_RECONNECT_BACKOFF_MS: &[u8; 30] = b"grpc.max_reconnect_backoff_ms\0"; +pub const GRPC_ARG_INITIAL_RECONNECT_BACKOFF_MS: &[u8; 34] = b"grpc.initial_reconnect_backoff_ms\0"; +pub const GRPC_ARG_DNS_MIN_TIME_BETWEEN_RESOLUTIONS_MS: &[u8; 41] = b"grpc.dns_min_time_between_resolutions_ms\0"; -pub const GRPC_ARG_SERVER_HANDSHAKE_TIMEOUT_MS: &[u8; 33usize] = - b"grpc.server_handshake_timeout_ms\0"; -pub const GRPC_SSL_TARGET_NAME_OVERRIDE_ARG: &[u8; 30usize] = b"grpc.ssl_target_name_override\0"; -pub const GRPC_SSL_SESSION_CACHE_ARG: &[u8; 23usize] = b"grpc.ssl_session_cache\0"; -pub const GRPC_ARG_TSI_MAX_FRAME_SIZE: &[u8; 24usize] = b"grpc.tsi.max_frame_size\0"; -pub const GRPC_ARG_MAX_METADATA_SIZE: &[u8; 23usize] = b"grpc.max_metadata_size\0"; -pub const GRPC_ARG_ABSOLUTE_MAX_METADATA_SIZE: &[u8; 32usize] = - b"grpc.absolute_max_metadata_size\0"; -pub const GRPC_ARG_ALLOW_REUSEPORT: &[u8; 18usize] = b"grpc.so_reuseport\0"; -pub const GRPC_ARG_RESOURCE_QUOTA: &[u8; 20usize] = b"grpc.resource_quota\0"; -pub const GRPC_ARG_EXPAND_WILDCARD_ADDRS: &[u8; 27usize] = b"grpc.expand_wildcard_addrs\0"; -pub const GRPC_ARG_SERVICE_CONFIG: &[u8; 20usize] = b"grpc.service_config\0"; -pub const GRPC_ARG_SERVICE_CONFIG_DISABLE_RESOLUTION: &[u8; 39usize] = +pub const GRPC_ARG_SERVER_HANDSHAKE_TIMEOUT_MS: &[u8; 33] = b"grpc.server_handshake_timeout_ms\0"; +pub const GRPC_SSL_TARGET_NAME_OVERRIDE_ARG: &[u8; 30] = b"grpc.ssl_target_name_override\0"; +pub const GRPC_SSL_SESSION_CACHE_ARG: &[u8; 23] = b"grpc.ssl_session_cache\0"; +pub const GRPC_ARG_TSI_MAX_FRAME_SIZE: &[u8; 24] = b"grpc.tsi.max_frame_size\0"; +pub const GRPC_ARG_MAX_METADATA_SIZE: &[u8; 23] = b"grpc.max_metadata_size\0"; +pub const GRPC_ARG_ABSOLUTE_MAX_METADATA_SIZE: &[u8; 32] = b"grpc.absolute_max_metadata_size\0"; +pub const GRPC_ARG_ALLOW_REUSEPORT: &[u8; 18] = b"grpc.so_reuseport\0"; +pub const GRPC_ARG_RESOURCE_QUOTA: &[u8; 20] = b"grpc.resource_quota\0"; +pub const GRPC_ARG_EXPAND_WILDCARD_ADDRS: &[u8; 27] = b"grpc.expand_wildcard_addrs\0"; +pub const GRPC_ARG_SERVICE_CONFIG: &[u8; 20] = b"grpc.service_config\0"; +pub const GRPC_ARG_SERVICE_CONFIG_DISABLE_RESOLUTION: &[u8; 39] = b"grpc.service_config_disable_resolution\0"; -pub const GRPC_ARG_LB_POLICY_NAME: &[u8; 20usize] = b"grpc.lb_policy_name\0"; -pub const GRPC_ARG_RING_HASH_LB_RING_SIZE_CAP: &[u8; 32usize] = - b"grpc.lb.ring_hash.ring_size_cap\0"; -pub const GRPC_ARG_SOCKET_MUTATOR: &[u8; 20usize] = b"grpc.socket_mutator\0"; -pub const GRPC_ARG_SOCKET_FACTORY: &[u8; 20usize] = b"grpc.socket_factory\0"; -pub const GRPC_ARG_GZIP_COMPRESSION_LEVEL: &[u8; 28usize] = b"grpc.gzip_compression_level\0"; -pub const GRPC_ARG_MIN_MESSAGE_SIZE_TO_COMPRESS: &[u8; 39usize] = +pub const GRPC_ARG_LB_POLICY_NAME: &[u8; 20] = b"grpc.lb_policy_name\0"; +pub const GRPC_ARG_RING_HASH_LB_RING_SIZE_CAP: &[u8; 32] = b"grpc.lb.ring_hash.ring_size_cap\0"; +pub const GRPC_ARG_SOCKET_MUTATOR: &[u8; 20] = b"grpc.socket_mutator\0"; +pub const GRPC_ARG_SOCKET_FACTORY: &[u8; 20] = b"grpc.socket_factory\0"; +pub const GRPC_ARG_GZIP_COMPRESSION_LEVEL: &[u8; 28] = b"grpc.gzip_compression_level\0"; +pub const GRPC_ARG_MIN_MESSAGE_SIZE_TO_COMPRESS: &[u8; 39] = b"grpc.gprc_min_message_size_to_compress\0"; -pub const GRPC_ARG_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE: &[u8; 45usize] = +pub const GRPC_ARG_MAX_CHANNEL_TRACE_EVENT_MEMORY_PER_NODE: &[u8; 45] = b"grpc.max_channel_trace_event_memory_per_node\0"; -pub const GRPC_ARG_ENABLE_CHANNELZ: &[u8; 21usize] = b"grpc.enable_channelz\0"; -pub const GRPC_ARG_USE_CRONET_PACKET_COALESCING: &[u8; 34usize] = - b"grpc.use_cronet_packet_coalescing\0"; -pub const GRPC_ARG_TCP_READ_CHUNK_SIZE: &[u8; 38usize] = b"grpc.experimental.tcp_read_chunk_size\0"; +pub const GRPC_ARG_ENABLE_CHANNELZ: &[u8; 21] = b"grpc.enable_channelz\0"; +pub const GRPC_ARG_USE_CRONET_PACKET_COALESCING: &[u8; 34] = b"grpc.use_cronet_packet_coalescing\0"; +pub const GRPC_ARG_TCP_READ_CHUNK_SIZE: &[u8; 38] = b"grpc.experimental.tcp_read_chunk_size\0"; pub const GRPC_TCP_DEFAULT_READ_SLICE_SIZE: u32 = 8192; -pub const GRPC_ARG_TCP_MIN_READ_CHUNK_SIZE: &[u8; 42usize] = +pub const GRPC_ARG_TCP_MIN_READ_CHUNK_SIZE: &[u8; 42] = b"grpc.experimental.tcp_min_read_chunk_size\0"; -pub const GRPC_ARG_TCP_MAX_READ_CHUNK_SIZE: &[u8; 42usize] = +pub const GRPC_ARG_TCP_MAX_READ_CHUNK_SIZE: &[u8; 42] = b"grpc.experimental.tcp_max_read_chunk_size\0"; -pub const GRPC_ARG_TCP_TX_ZEROCOPY_ENABLED: &[u8; 42usize] = +pub const GRPC_ARG_TCP_TX_ZEROCOPY_ENABLED: &[u8; 42] = b"grpc.experimental.tcp_tx_zerocopy_enabled\0"; -pub const GRPC_ARG_TCP_TX_ZEROCOPY_SEND_BYTES_THRESHOLD: &[u8; 55usize] = +pub const GRPC_ARG_TCP_TX_ZEROCOPY_SEND_BYTES_THRESHOLD: &[u8; 55] = b"grpc.experimental.tcp_tx_zerocopy_send_bytes_threshold\0"; -pub const GRPC_ARG_TCP_TX_ZEROCOPY_MAX_SIMULT_SENDS: &[u8; 57usize] = +pub const GRPC_ARG_TCP_TX_ZEROCOPY_MAX_SIMULT_SENDS: &[u8; 57] = b"grpc.experimental.tcp_tx_zerocopy_max_simultaneous_sends\0"; -pub const GRPC_ARG_TCP_RECEIVE_BUFFER_SIZE: &[u8; 29usize] = b"grpc.tcp_receive_buffer_size\0"; -pub const GRPC_ARG_GRPCLB_CALL_TIMEOUT_MS: &[u8; 28usize] = b"grpc.grpclb_call_timeout_ms\0"; -pub const GRPC_ARG_TEST_ONLY_DO_NOT_USE_IN_PROD_XDS_BOOTSTRAP_CONFIG: &[u8; 55usize] = +pub const GRPC_ARG_TCP_RECEIVE_BUFFER_SIZE: &[u8; 29] = b"grpc.tcp_receive_buffer_size\0"; +pub const GRPC_ARG_GRPCLB_CALL_TIMEOUT_MS: &[u8; 28] = b"grpc.grpclb_call_timeout_ms\0"; +pub const GRPC_ARG_TEST_ONLY_DO_NOT_USE_IN_PROD_XDS_BOOTSTRAP_CONFIG: &[u8; 55] = b"grpc.TEST_ONLY_DO_NOT_USE_IN_PROD.xds_bootstrap_config\0"; -pub const GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS: &[u8; 32usize] = - b"grpc.grpclb_fallback_timeout_ms\0"; -pub const GRPC_ARG_EXPERIMENTAL_GRPCLB_CHANNEL_ARGS: &[u8; 38usize] = +pub const GRPC_ARG_GRPCLB_FALLBACK_TIMEOUT_MS: &[u8; 32] = b"grpc.grpclb_fallback_timeout_ms\0"; +pub const GRPC_ARG_EXPERIMENTAL_GRPCLB_CHANNEL_ARGS: &[u8; 38] = b"grpc.experimental.grpclb_channel_args\0"; -pub const GRPC_ARG_PRIORITY_FAILOVER_TIMEOUT_MS: &[u8; 34usize] = - b"grpc.priority_failover_timeout_ms\0"; -pub const GRPC_ARG_WORKAROUND_CRONET_COMPRESSION: &[u8; 35usize] = +pub const GRPC_ARG_PRIORITY_FAILOVER_TIMEOUT_MS: &[u8; 34] = b"grpc.priority_failover_timeout_ms\0"; +pub const GRPC_ARG_WORKAROUND_CRONET_COMPRESSION: &[u8; 35] = b"grpc.workaround.cronet_compression\0"; -pub const GRPC_ARG_OPTIMIZATION_TARGET: &[u8; 25usize] = b"grpc.optimization_target\0"; -pub const GRPC_ARG_ENABLE_RETRIES: &[u8; 20usize] = b"grpc.enable_retries\0"; -pub const GRPC_ARG_EXPERIMENTAL_ENABLE_HEDGING: &[u8; 33usize] = - b"grpc.experimental.enable_hedging\0"; -pub const GRPC_ARG_PER_RPC_RETRY_BUFFER_SIZE: &[u8; 31usize] = b"grpc.per_rpc_retry_buffer_size\0"; -pub const GRPC_ARG_MOBILE_LOG_CONTEXT: &[u8; 24usize] = b"grpc.mobile_log_context\0"; -pub const GRPC_ARG_DISABLE_CLIENT_AUTHORITY_FILTER: &[u8; 37usize] = +pub const GRPC_ARG_OPTIMIZATION_TARGET: &[u8; 25] = b"grpc.optimization_target\0"; +pub const GRPC_ARG_ENABLE_RETRIES: &[u8; 20] = b"grpc.enable_retries\0"; +pub const GRPC_ARG_EXPERIMENTAL_ENABLE_HEDGING: &[u8; 33] = b"grpc.experimental.enable_hedging\0"; +pub const GRPC_ARG_PER_RPC_RETRY_BUFFER_SIZE: &[u8; 31] = b"grpc.per_rpc_retry_buffer_size\0"; +pub const GRPC_ARG_MOBILE_LOG_CONTEXT: &[u8; 24] = b"grpc.mobile_log_context\0"; +pub const GRPC_ARG_DISABLE_CLIENT_AUTHORITY_FILTER: &[u8; 37] = b"grpc.disable_client_authority_filter\0"; -pub const GRPC_ARG_ENABLE_HTTP_PROXY: &[u8; 23usize] = b"grpc.enable_http_proxy\0"; -pub const GRPC_ARG_HTTP_PROXY: &[u8; 16usize] = b"grpc.http_proxy\0"; -pub const GRPC_ARG_SURFACE_USER_AGENT: &[u8; 24usize] = b"grpc.surface_user_agent\0"; -pub const GRPC_ARG_INHIBIT_HEALTH_CHECKING: &[u8; 29usize] = b"grpc.inhibit_health_checking\0"; -pub const GRPC_ARG_DNS_ENABLE_SRV_QUERIES: &[u8; 28usize] = b"grpc.dns_enable_srv_queries\0"; -pub const GRPC_ARG_DNS_ARES_QUERY_TIMEOUT_MS: &[u8; 28usize] = b"grpc.dns_ares_query_timeout\0"; -pub const GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL: &[u8; 31usize] = b"grpc.use_local_subchannel_pool\0"; -pub const GRPC_ARG_CHANNEL_POOL_DOMAIN: &[u8; 28usize] = b"grpc.channel_pooling_domain\0"; -pub const GRPC_ARG_CHANNEL_ID: &[u8; 16usize] = b"grpc.channel_id\0"; -pub const GRPC_ARG_AUTHORIZATION_POLICY_PROVIDER: &[u8; 35usize] = +pub const GRPC_ARG_ENABLE_HTTP_PROXY: &[u8; 23] = b"grpc.enable_http_proxy\0"; +pub const GRPC_ARG_HTTP_PROXY: &[u8; 16] = b"grpc.http_proxy\0"; +pub const GRPC_ARG_SURFACE_USER_AGENT: &[u8; 24] = b"grpc.surface_user_agent\0"; +pub const GRPC_ARG_INHIBIT_HEALTH_CHECKING: &[u8; 29] = b"grpc.inhibit_health_checking\0"; +pub const GRPC_ARG_DNS_ENABLE_SRV_QUERIES: &[u8; 28] = b"grpc.dns_enable_srv_queries\0"; +pub const GRPC_ARG_DNS_ARES_QUERY_TIMEOUT_MS: &[u8; 28] = b"grpc.dns_ares_query_timeout\0"; +pub const GRPC_ARG_USE_LOCAL_SUBCHANNEL_POOL: &[u8; 31] = b"grpc.use_local_subchannel_pool\0"; +pub const GRPC_ARG_CHANNEL_POOL_DOMAIN: &[u8; 28] = b"grpc.channel_pooling_domain\0"; +pub const GRPC_ARG_CHANNEL_ID: &[u8; 16] = b"grpc.channel_id\0"; +pub const GRPC_ARG_AUTHORIZATION_POLICY_PROVIDER: &[u8; 35] = b"grpc.authorization_policy_provider\0"; -pub const GRPC_ARG_SERVER_CONFIG_CHANGE_DRAIN_GRACE_TIME_MS: &[u8; 59usize] = +pub const GRPC_ARG_SERVER_CONFIG_CHANGE_DRAIN_GRACE_TIME_MS: &[u8; 59] = b"grpc.experimental.server_config_change_drain_grace_time_ms\0"; pub const GRPC_DEFAULT_MAX_SEND_MESSAGE_LENGTH: i32 = -1; pub const GRPC_DEFAULT_MAX_RECV_MESSAGE_LENGTH: u32 = 4194304; @@ -148,35 +134,34 @@ pub const GRPC_INITIAL_METADATA_USED_MASK: u32 = 164; pub const GRPC_CQ_CURRENT_VERSION: u32 = 2; pub const GRPC_CQ_VERSION_MINIMUM_FOR_CALLBACKABLE: u32 = 2; pub const GRPC_MAX_COMPLETION_QUEUE_PLUCKERS: u32 = 6; -pub const GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME: &[u8; 24usize] = b"transport_security_type\0"; -pub const GRPC_SSL_TRANSPORT_SECURITY_TYPE: &[u8; 4usize] = b"ssl\0"; -pub const GRPC_TLS_TRANSPORT_SECURITY_TYPE: &[u8; 4usize] = b"tls\0"; -pub const GRPC_X509_CN_PROPERTY_NAME: &[u8; 17usize] = b"x509_common_name\0"; -pub const GRPC_X509_SUBJECT_PROPERTY_NAME: &[u8; 13usize] = b"x509_subject\0"; -pub const GRPC_X509_SAN_PROPERTY_NAME: &[u8; 30usize] = b"x509_subject_alternative_name\0"; -pub const GRPC_X509_PEM_CERT_PROPERTY_NAME: &[u8; 14usize] = b"x509_pem_cert\0"; -pub const GRPC_X509_PEM_CERT_CHAIN_PROPERTY_NAME: &[u8; 20usize] = b"x509_pem_cert_chain\0"; -pub const GRPC_SSL_SESSION_REUSED_PROPERTY: &[u8; 19usize] = b"ssl_session_reused\0"; -pub const GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME: &[u8; 15usize] = b"security_level\0"; -pub const GRPC_PEER_DNS_PROPERTY_NAME: &[u8; 9usize] = b"peer_dns\0"; -pub const GRPC_PEER_SPIFFE_ID_PROPERTY_NAME: &[u8; 15usize] = b"peer_spiffe_id\0"; -pub const GRPC_PEER_URI_PROPERTY_NAME: &[u8; 9usize] = b"peer_uri\0"; -pub const GRPC_PEER_EMAIL_PROPERTY_NAME: &[u8; 11usize] = b"peer_email\0"; -pub const GRPC_PEER_IP_PROPERTY_NAME: &[u8; 8usize] = b"peer_ip\0"; -pub const GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR: &[u8; 33usize] = +pub const GRPC_TRANSPORT_SECURITY_TYPE_PROPERTY_NAME: &[u8; 24] = b"transport_security_type\0"; +pub const GRPC_SSL_TRANSPORT_SECURITY_TYPE: &[u8; 4] = b"ssl\0"; +pub const GRPC_TLS_TRANSPORT_SECURITY_TYPE: &[u8; 4] = b"tls\0"; +pub const GRPC_X509_CN_PROPERTY_NAME: &[u8; 17] = b"x509_common_name\0"; +pub const GRPC_X509_SUBJECT_PROPERTY_NAME: &[u8; 13] = b"x509_subject\0"; +pub const GRPC_X509_SAN_PROPERTY_NAME: &[u8; 30] = b"x509_subject_alternative_name\0"; +pub const GRPC_X509_PEM_CERT_PROPERTY_NAME: &[u8; 14] = b"x509_pem_cert\0"; +pub const GRPC_X509_PEM_CERT_CHAIN_PROPERTY_NAME: &[u8; 20] = b"x509_pem_cert_chain\0"; +pub const GRPC_SSL_SESSION_REUSED_PROPERTY: &[u8; 19] = b"ssl_session_reused\0"; +pub const GRPC_TRANSPORT_SECURITY_LEVEL_PROPERTY_NAME: &[u8; 15] = b"security_level\0"; +pub const GRPC_PEER_DNS_PROPERTY_NAME: &[u8; 9] = b"peer_dns\0"; +pub const GRPC_PEER_SPIFFE_ID_PROPERTY_NAME: &[u8; 15] = b"peer_spiffe_id\0"; +pub const GRPC_PEER_URI_PROPERTY_NAME: &[u8; 9] = b"peer_uri\0"; +pub const GRPC_PEER_EMAIL_PROPERTY_NAME: &[u8; 11] = b"peer_email\0"; +pub const GRPC_PEER_IP_PROPERTY_NAME: &[u8; 8] = b"peer_ip\0"; +pub const GRPC_DEFAULT_SSL_ROOTS_FILE_PATH_ENV_VAR: &[u8; 33] = b"GRPC_DEFAULT_SSL_ROOTS_FILE_PATH\0"; -pub const GRPC_GOOGLE_CREDENTIALS_ENV_VAR: &[u8; 31usize] = b"GOOGLE_APPLICATION_CREDENTIALS\0"; +pub const GRPC_GOOGLE_CREDENTIALS_ENV_VAR: &[u8; 31] = b"GOOGLE_APPLICATION_CREDENTIALS\0"; pub const GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX: u32 = 4; extern "C" { pub fn gpr_unreachable_code( reason: *const ::std::os::raw::c_char, file: *const ::std::os::raw::c_char, line: ::std::os::raw::c_int, - ); + ) -> !; } #[repr(u32)] -#[doc = " The various compression algorithms supported by gRPC (not sorted by"] -#[doc = " compression level)"] +#[doc = " The various compression algorithms supported by gRPC (not sorted by\n compression level)"] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum grpc_compression_algorithm { GRPC_COMPRESS_NONE = 0, @@ -185,10 +170,7 @@ pub enum grpc_compression_algorithm { GRPC_COMPRESS_ALGORITHMS_COUNT = 3, } #[repr(u32)] -#[doc = " Compression levels allow a party with knowledge of its peer's accepted"] -#[doc = " encodings to request compression in an abstract way. The level-algorithm"] -#[doc = " mapping is performed internally and depends on the peer's supported"] -#[doc = " compression algorithms."] +#[doc = " Compression levels allow a party with knowledge of its peer's accepted\n encodings to request compression in an abstract way. The level-algorithm\n mapping is performed internally and depends on the peer's supported\n compression algorithms."] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum grpc_compression_level { GRPC_COMPRESS_LEVEL_NONE = 0, @@ -200,26 +182,19 @@ pub enum grpc_compression_level { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_compression_options { - #[doc = " All algs are enabled by default. This option corresponds to the channel"] - #[doc = " argument key behind \\a GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET"] + #[doc = " All algs are enabled by default. This option corresponds to the channel\n argument key behind \\a GRPC_COMPRESSION_CHANNEL_ENABLED_ALGORITHMS_BITSET"] pub enabled_algorithms_bitset: u32, pub default_level: grpc_compression_options_grpc_compression_options_default_level, pub default_algorithm: grpc_compression_options_grpc_compression_options_default_algorithm, } -#[doc = " The default compression level. It'll be used in the absence of call"] -#[doc = " specific settings. This option corresponds to the channel"] -#[doc = " argument key behind \\a GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL. If present,"] -#[doc = " takes precedence over \\a default_algorithm."] -#[doc = " TODO(dgq): currently only available for server channels."] +#[doc = " The default compression level. It'll be used in the absence of call\n specific settings. This option corresponds to the channel\n argument key behind \\a GRPC_COMPRESSION_CHANNEL_DEFAULT_LEVEL. If present,\n takes precedence over \\a default_algorithm.\n TODO(dgq): currently only available for server channels."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_compression_options_grpc_compression_options_default_level { pub is_set: ::std::os::raw::c_int, pub level: grpc_compression_level, } -#[doc = " The default message compression algorithm. It'll be used in the absence of"] -#[doc = " call specific settings. This option corresponds to the channel argument key"] -#[doc = " behind \\a GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM."] +#[doc = " The default message compression algorithm. It'll be used in the absence of\n call specific settings. This option corresponds to the channel argument key\n behind \\a GRPC_COMPRESSION_CHANNEL_DEFAULT_ALGORITHM."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_compression_options_grpc_compression_options_default_algorithm { @@ -231,18 +206,7 @@ pub struct grpc_compression_options_grpc_compression_options_default_algorithm { pub struct grpc_slice_refcount { _unused: [u8; 0], } -#[doc = " A grpc_slice s, if initialized, represents the byte range"] -#[doc = "s.bytes[0..s.length-1]."] -#[doc = ""] -#[doc = "It can have an associated ref count which has a destruction routine to be run"] -#[doc = "when the ref count reaches zero (see grpc_slice_new() and grp_slice_unref())."] -#[doc = "Multiple grpc_slice values may share a ref count."] -#[doc = ""] -#[doc = "If the slice does not have a refcount, it represents an inlined small piece"] -#[doc = "of data that is copied by value."] -#[doc = ""] -#[doc = "As a special case, a slice can be given refcount == uintptr_t(1), meaning"] -#[doc = "that the slice represents external data that is not refcounted."] +#[doc = " A grpc_slice s, if initialized, represents the byte range\ns.bytes[0..s.length-1].\n\nIt can have an associated ref count which has a destruction routine to be run\nwhen the ref count reaches zero (see grpc_slice_new() and grp_slice_unref()).\nMultiple grpc_slice values may share a ref count.\n\nIf the slice does not have a refcount, it represents an inlined small piece\nof data that is copied by value.\n\nAs a special case, a slice can be given refcount == uintptr_t(1), meaning\nthat the slice represents external data that is not refcounted."] #[repr(C)] #[derive(Copy, Clone)] pub struct grpc_slice { @@ -281,20 +245,17 @@ impl ::std::fmt::Debug for grpc_slice { ) } } -#[doc = " Represents an expandable array of slices, to be interpreted as a"] -#[doc = "single item."] +#[doc = " Represents an expandable array of slices, to be interpreted as a\nsingle item."] #[repr(C)] #[derive(Copy, Clone)] pub struct grpc_slice_buffer { - #[doc = " This is for internal use only. External users (i.e any code outside grpc"] - #[doc = " core) MUST NOT use this field"] + #[doc = " This is for internal use only. External users (i.e any code outside grpc\n core) MUST NOT use this field"] pub base_slices: *mut grpc_slice, #[doc = " slices in the array (Points to the first valid grpc_slice in the array)"] pub slices: *mut grpc_slice, #[doc = " the number of slices in the array"] pub count: usize, - #[doc = " the number of slices allocated in the array. External users (i.e any code"] - #[doc = " outside grpc core) MUST NOT use this field"] + #[doc = " the number of slices allocated in the array. External users (i.e any code\n outside grpc core) MUST NOT use this field"] pub capacity: usize, #[doc = " the combined length of all slices in the array"] pub length: usize, @@ -316,29 +277,24 @@ impl ::std::fmt::Debug for grpc_slice_buffer { pub enum gpr_clock_type { #[doc = " Monotonic clock. Epoch undefined. Always moves forwards."] GPR_CLOCK_MONOTONIC = 0, - #[doc = " Realtime clock. May jump forwards or backwards. Settable by"] - #[doc = "the system administrator. Has its epoch at 0:00:00 UTC 1 Jan 1970."] + #[doc = " Realtime clock. May jump forwards or backwards. Settable by\nthe system administrator. Has its epoch at 0:00:00 UTC 1 Jan 1970."] GPR_CLOCK_REALTIME = 1, - #[doc = " CPU cycle time obtained by rdtsc instruction on x86 platforms. Epoch"] - #[doc = "undefined. Degrades to GPR_CLOCK_REALTIME on other platforms."] + #[doc = " CPU cycle time obtained by rdtsc instruction on x86 platforms. Epoch\nundefined. Degrades to GPR_CLOCK_REALTIME on other platforms."] GPR_CLOCK_PRECISE = 2, - #[doc = " Unmeasurable clock type: no base, created by taking the difference"] - #[doc = "between two times"] + #[doc = " Unmeasurable clock type: no base, created by taking the difference\nbetween two times"] GPR_TIMESPAN = 3, } -#[doc = " Analogous to struct timespec. On some machines, absolute times may be in"] -#[doc = " local time."] +#[doc = " Analogous to struct timespec. On some machines, absolute times may be in\n local time."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct gpr_timespec { pub tv_sec: i64, pub tv_nsec: i32, - #[doc = " Against which clock was this time measured? (or GPR_TIMESPAN if"] - #[doc = "this is a relative time measure)"] + #[doc = " Against which clock was this time measured? (or GPR_TIMESPAN if\nthis is a relative time measure)"] pub clock_type: gpr_clock_type, } extern "C" { - #[doc = " Time constants. */"] + #[doc = " Time constants. */\n/** The zero time interval."] pub fn gpr_time_0(type_: gpr_clock_type) -> gpr_timespec; } extern "C" { @@ -362,8 +318,7 @@ extern "C" { pub fn gpr_convert_clock_type(t: gpr_timespec, clock_type: gpr_clock_type) -> gpr_timespec; } extern "C" { - #[doc = " Return -ve, 0, or +ve according to whether a < b, a == b, or a > b"] - #[doc = "respectively."] + #[doc = " Return -ve, 0, or +ve according to whether a < b, a == b, or a > b\nrespectively."] pub fn gpr_time_cmp(a: gpr_timespec, b: gpr_timespec) -> ::std::os::raw::c_int; } extern "C" { @@ -380,8 +335,7 @@ extern "C" { pub fn gpr_time_sub(a: gpr_timespec, b: gpr_timespec) -> gpr_timespec; } extern "C" { - #[doc = " Return a timespec representing a given number of time units. INT64_MIN is"] - #[doc = "interpreted as gpr_inf_past, and INT64_MAX as gpr_inf_future."] + #[doc = " Return a timespec representing a given number of time units. INT64_MIN is\ninterpreted as gpr_inf_past, and INT64_MAX as gpr_inf_future."] pub fn gpr_time_from_micros(us: i64, clock_type: gpr_clock_type) -> gpr_timespec; } extern "C" { @@ -403,8 +357,7 @@ extern "C" { pub fn gpr_time_to_millis(timespec: gpr_timespec) -> i32; } extern "C" { - #[doc = " Return 1 if two times are equal or within threshold of each other,"] - #[doc = "0 otherwise"] + #[doc = " Return 1 if two times are equal or within threshold of each other,\n0 otherwise"] pub fn gpr_time_similar( a: gpr_timespec, b: gpr_timespec, @@ -420,8 +373,7 @@ extern "C" { } pub type gpr_atm = isize; extern "C" { - #[doc = " Adds \\a delta to \\a *value, clamping the result to the range specified"] - #[doc = "by \\a min and \\a max. Returns the new value."] + #[doc = " Adds \\a delta to \\a *value, clamping the result to the range specified\nby \\a min and \\a max. Returns the new value."] pub fn gpr_atm_no_barrier_clamped_add( value: *mut gpr_atm, delta: gpr_atm, @@ -449,25 +401,15 @@ extern "C" { pub fn gpr_event_init(ev: *mut gpr_event); } extern "C" { - #[doc = " Set *ev so that gpr_event_get() and gpr_event_wait() will return value."] - #[doc = "Requires: *ev initialized; value != NULL; no prior or concurrent calls to"] - #[doc = "gpr_event_set(ev, ...) since initialization."] + #[doc = " Set *ev so that gpr_event_get() and gpr_event_wait() will return value.\nRequires: *ev initialized; value != NULL; no prior or concurrent calls to\ngpr_event_set(ev, ...) since initialization."] pub fn gpr_event_set(ev: *mut gpr_event, value: *mut ::std::os::raw::c_void); } extern "C" { - #[doc = " Return the value set by gpr_event_set(ev, ...), or NULL if no such call has"] - #[doc = "completed. If the result is non-NULL, all operations that occurred prior to"] - #[doc = "the gpr_event_set(ev, ...) set will be visible after this call returns."] - #[doc = "Requires: *ev initialized. This operation is faster than acquiring a mutex"] - #[doc = "on most platforms."] + #[doc = " Return the value set by gpr_event_set(ev, ...), or NULL if no such call has\ncompleted. If the result is non-NULL, all operations that occurred prior to\nthe gpr_event_set(ev, ...) set will be visible after this call returns.\nRequires: *ev initialized. This operation is faster than acquiring a mutex\non most platforms."] pub fn gpr_event_get(ev: *mut gpr_event) -> *mut ::std::os::raw::c_void; } extern "C" { - #[doc = " Wait until *ev is set by gpr_event_set(ev, ...), or abs_deadline is"] - #[doc = "exceeded, then return gpr_event_get(ev). Requires: *ev initialized. Use"] - #[doc = "abs_deadline==gpr_inf_future for no deadline. When the event has been"] - #[doc = "signalled before the call, this operation is faster than acquiring a mutex"] - #[doc = "on most platforms."] + #[doc = " Wait until *ev is set by gpr_event_set(ev, ...), or abs_deadline is\nexceeded, then return gpr_event_get(ev). Requires: *ev initialized. Use\nabs_deadline==gpr_inf_future for no deadline. When the event has been\nsignalled before the call, this operation is faster than acquiring a mutex\non most platforms."] pub fn gpr_event_wait( ev: *mut gpr_event, abs_deadline: gpr_timespec, @@ -482,8 +424,7 @@ extern "C" { pub fn gpr_ref(r: *mut gpr_refcount); } extern "C" { - #[doc = " Increment the reference count *r. Requires *r initialized."] - #[doc = "Crashes if refcount is zero"] + #[doc = " Increment the reference count *r. Requires *r initialized.\nCrashes if refcount is zero"] pub fn gpr_ref_non_zero(r: *mut gpr_refcount); } extern "C" { @@ -491,13 +432,11 @@ extern "C" { pub fn gpr_refn(r: *mut gpr_refcount, n: ::std::os::raw::c_int); } extern "C" { - #[doc = " Decrement the reference count *r and return non-zero iff it has reached"] - #[doc = "zero. . Requires *r initialized."] + #[doc = " Decrement the reference count *r and return non-zero iff it has reached\nzero. . Requires *r initialized."] pub fn gpr_unref(r: *mut gpr_refcount) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " Return non-zero iff the reference count of *r is one, and thus is owned"] - #[doc = "by exactly one object."] + #[doc = " Return non-zero iff the reference count of *r is one, and thus is owned\nby exactly one object."] pub fn gpr_ref_is_unique(r: *mut gpr_refcount) -> ::std::os::raw::c_int; } extern "C" { @@ -513,17 +452,11 @@ extern "C" { pub fn gpr_stats_read(c: *const gpr_stats_counter) -> isize; } extern "C" { - #[doc = " Increment the refcount of s. Requires slice is initialized."] - #[doc = "Returns s."] + #[doc = " Increment the refcount of s. Requires slice is initialized.\nReturns s."] pub fn grpc_slice_ref(s: grpc_slice) -> grpc_slice; } extern "C" { - #[doc = " Decrement the ref count of s. If the ref count of s reaches zero, all"] - #[doc = "slices sharing the ref count are destroyed, and considered no longer"] - #[doc = "initialized. If s is ultimately derived from a call to grpc_slice_new(start,"] - #[doc = "len, dest) where dest!=NULL , then (*dest)(start) is called, else if s is"] - #[doc = "ultimately derived from a call to grpc_slice_new_with_len(start, len, dest)"] - #[doc = "where dest!=NULL , then (*dest)(start, len). Requires s initialized."] + #[doc = " Decrement the ref count of s. If the ref count of s reaches zero, all\nslices sharing the ref count are destroyed, and considered no longer\ninitialized. If s is ultimately derived from a call to grpc_slice_new(start,\nlen, dest) where dest!=NULL , then (*dest)(start) is called, else if s is\nultimately derived from a call to grpc_slice_new_with_len(start, len, dest)\nwhere dest!=NULL , then (*dest)(start, len). Requires s initialized."] pub fn grpc_slice_unref(s: grpc_slice); } extern "C" { @@ -531,9 +464,7 @@ extern "C" { pub fn grpc_slice_copy(s: grpc_slice) -> grpc_slice; } extern "C" { - #[doc = " Create a slice pointing at some data. Calls malloc to allocate a refcount"] - #[doc = "for the object, and arranges that destroy will be called with the pointer"] - #[doc = "passed in at destruction."] + #[doc = " Create a slice pointing at some data. Calls malloc to allocate a refcount\nfor the object, and arranges that destroy will be called with the pointer\npassed in at destruction."] pub fn grpc_slice_new( p: *mut ::std::os::raw::c_void, len: usize, @@ -541,10 +472,7 @@ extern "C" { ) -> grpc_slice; } extern "C" { - #[doc = " Equivalent to grpc_slice_new, but with a separate pointer that is"] - #[doc = "passed to the destroy function. This function can be useful when"] - #[doc = "the data is part of a larger structure that must be destroyed when"] - #[doc = "the data is no longer needed."] + #[doc = " Equivalent to grpc_slice_new, but with a separate pointer that is\npassed to the destroy function. This function can be useful when\nthe data is part of a larger structure that must be destroyed when\nthe data is no longer needed."] pub fn grpc_slice_new_with_user_data( p: *mut ::std::os::raw::c_void, len: usize, @@ -553,8 +481,7 @@ extern "C" { ) -> grpc_slice; } extern "C" { - #[doc = " Equivalent to grpc_slice_new, but with a two argument destroy function that"] - #[doc = "also takes the slice length."] + #[doc = " Equivalent to grpc_slice_new, but with a two argument destroy function that\nalso takes the slice length."] pub fn grpc_slice_new_with_len( p: *mut ::std::os::raw::c_void, len: usize, @@ -564,28 +491,18 @@ extern "C" { ) -> grpc_slice; } extern "C" { - #[doc = " Equivalent to grpc_slice_new(malloc(len), len, free), but saves one malloc()"] - #[doc = "call."] - #[doc = "Aborts if malloc() fails."] + #[doc = " Equivalent to grpc_slice_new(malloc(len), len, free), but saves one malloc()\ncall.\nAborts if malloc() fails."] pub fn grpc_slice_malloc(length: usize) -> grpc_slice; } extern "C" { pub fn grpc_slice_malloc_large(length: usize) -> grpc_slice; } extern "C" { - #[doc = " Create a slice by copying a string."] - #[doc = "Does not preserve null terminators."] - #[doc = "Equivalent to:"] - #[doc = "size_t len = strlen(source);"] - #[doc = "grpc_slice slice = grpc_slice_malloc(len);"] - #[doc = "memcpy(slice->data, source, len);"] + #[doc = " Create a slice by copying a string.\nDoes not preserve null terminators.\nEquivalent to:\nsize_t len = strlen(source);\ngrpc_slice slice = grpc_slice_malloc(len);\nmemcpy(slice->data, source, len);"] pub fn grpc_slice_from_copied_string(source: *const ::std::os::raw::c_char) -> grpc_slice; } extern "C" { - #[doc = " Create a slice by copying a buffer."] - #[doc = "Equivalent to:"] - #[doc = "grpc_slice slice = grpc_slice_malloc(len);"] - #[doc = "memcpy(slice->data, source, len);"] + #[doc = " Create a slice by copying a buffer.\nEquivalent to:\ngrpc_slice slice = grpc_slice_malloc(len);\nmemcpy(slice->data, source, len);"] pub fn grpc_slice_from_copied_buffer( source: *const ::std::os::raw::c_char, len: usize, @@ -603,11 +520,7 @@ extern "C" { ) -> grpc_slice; } extern "C" { - #[doc = " Return a result slice derived from s, which shares a ref count with \\a s,"] - #[doc = "where result.data==s.data+begin, and result.length==end-begin. The ref count"] - #[doc = "of \\a s is increased by one. Do not assign result back to \\a s."] - #[doc = "Requires s initialized, begin <= end, begin <= s.length, and"] - #[doc = "end <= source->length."] + #[doc = " Return a result slice derived from s, which shares a ref count with \\a s,\nwhere result.data==s.data+begin, and result.length==end-begin. The ref count\nof \\a s is increased by one. Do not assign result back to \\a s.\nRequires s initialized, begin <= end, begin <= s.length, and\nend <= source->length."] pub fn grpc_slice_sub(s: grpc_slice, begin: usize, end: usize) -> grpc_slice; } extern "C" { @@ -615,9 +528,7 @@ extern "C" { pub fn grpc_slice_sub_no_ref(s: grpc_slice, begin: usize, end: usize) -> grpc_slice; } extern "C" { - #[doc = " Splits s into two: modifies s to be s[0:split], and returns a new slice,"] - #[doc = "sharing a refcount with s, that contains s[split:s.length]."] - #[doc = "Requires s initialized, split <= s.length"] + #[doc = " Splits s into two: modifies s to be s[0:split], and returns a new slice,\nsharing a refcount with s, that contains s[split:s.length].\nRequires s initialized, split <= s.length"] pub fn grpc_slice_split_tail(s: *mut grpc_slice, split: usize) -> grpc_slice; } #[repr(u32)] @@ -628,9 +539,7 @@ pub enum grpc_slice_ref_whom { GRPC_SLICE_REF_BOTH = 3, } extern "C" { - #[doc = " The same as grpc_slice_split_tail, but with an option to skip altering"] - #[doc = " refcounts (grpc_slice_split_tail_maybe_ref(..., true) is equivalent to"] - #[doc = " grpc_slice_split_tail(...))"] + #[doc = " The same as grpc_slice_split_tail, but with an option to skip altering\n refcounts (grpc_slice_split_tail_maybe_ref(..., true) is equivalent to\n grpc_slice_split_tail(...))"] pub fn grpc_slice_split_tail_maybe_ref( s: *mut grpc_slice, split: usize, @@ -638,9 +547,7 @@ extern "C" { ) -> grpc_slice; } extern "C" { - #[doc = " Splits s into two: modifies s to be s[split:s.length], and returns a new"] - #[doc = "slice, sharing a refcount with s, that contains s[0:split]."] - #[doc = "Requires s initialized, split <= s.length"] + #[doc = " Splits s into two: modifies s to be s[split:s.length], and returns a new\nslice, sharing a refcount with s, that contains s[0:split].\nRequires s initialized, split <= s.length"] pub fn grpc_slice_split_head(s: *mut grpc_slice, split: usize) -> grpc_slice; } extern "C" { @@ -650,9 +557,7 @@ extern "C" { pub fn grpc_slice_eq(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " Returns <0 if a < b, ==0 if a == b, >0 if a > b"] - #[doc = "The order is arbitrary, and is not guaranteed to be stable across different"] - #[doc = "versions of the API."] + #[doc = " Returns <0 if a < b, ==0 if a == b, >0 if a > b\nThe order is arbitrary, and is not guaranteed to be stable across different\nversions of the API."] pub fn grpc_slice_cmp(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int; } extern "C" { @@ -677,23 +582,19 @@ extern "C" { pub fn grpc_slice_chr(s: grpc_slice, c: ::std::os::raw::c_char) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " return the index of the first occurrence of \\a needle in \\a haystack, or -1"] - #[doc = "if it's not found"] + #[doc = " return the index of the first occurrence of \\a needle in \\a haystack, or -1\nif it's not found"] pub fn grpc_slice_slice(haystack: grpc_slice, needle: grpc_slice) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " Do two slices point at the same memory, with the same length"] - #[doc = "If a or b is inlined, actually compares data"] + #[doc = " Do two slices point at the same memory, with the same length\nIf a or b is inlined, actually compares data"] pub fn grpc_slice_is_equivalent(a: grpc_slice, b: grpc_slice) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " Return a slice pointing to newly allocated memory that has the same contents"] - #[doc = " as \\a s"] + #[doc = " Return a slice pointing to newly allocated memory that has the same contents\n as \\a s"] pub fn grpc_slice_dup(a: grpc_slice) -> grpc_slice; } extern "C" { - #[doc = " Return a copy of slice as a C string. Offers no protection against embedded"] - #[doc = "NULL's. Returned string must be freed with gpr_free."] + #[doc = " Return a copy of slice as a C string. Offers no protection against embedded\nNULL's. Returned string must be freed with gpr_free."] pub fn grpc_slice_to_c_string(s: grpc_slice) -> *mut ::std::os::raw::c_char; } pub mod grpc_status_code { @@ -702,101 +603,33 @@ pub mod grpc_status_code { pub const GRPC_STATUS_OK: Type = 0; #[doc = " The operation was cancelled (typically by the caller)."] pub const GRPC_STATUS_CANCELLED: Type = 1; - #[doc = " Unknown error. An example of where this error may be returned is"] - #[doc = "if a Status value received from another address space belongs to"] - #[doc = "an error-space that is not known in this address space. Also"] - #[doc = "errors raised by APIs that do not return enough error information"] - #[doc = "may be converted to this error."] + #[doc = " Unknown error. An example of where this error may be returned is\nif a Status value received from another address space belongs to\nan error-space that is not known in this address space. Also\nerrors raised by APIs that do not return enough error information\nmay be converted to this error."] pub const GRPC_STATUS_UNKNOWN: Type = 2; - #[doc = " Client specified an invalid argument. Note that this differs"] - #[doc = "from FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments"] - #[doc = "that are problematic regardless of the state of the system"] - #[doc = "(e.g., a malformed file name)."] + #[doc = " Client specified an invalid argument. Note that this differs\nfrom FAILED_PRECONDITION. INVALID_ARGUMENT indicates arguments\nthat are problematic regardless of the state of the system\n(e.g., a malformed file name)."] pub const GRPC_STATUS_INVALID_ARGUMENT: Type = 3; - #[doc = " Deadline expired before operation could complete. For operations"] - #[doc = "that change the state of the system, this error may be returned"] - #[doc = "even if the operation has completed successfully. For example, a"] - #[doc = "successful response from a server could have been delayed long"] - #[doc = "enough for the deadline to expire."] + #[doc = " Deadline expired before operation could complete. For operations\nthat change the state of the system, this error may be returned\neven if the operation has completed successfully. For example, a\nsuccessful response from a server could have been delayed long\nenough for the deadline to expire."] pub const GRPC_STATUS_DEADLINE_EXCEEDED: Type = 4; #[doc = " Some requested entity (e.g., file or directory) was not found."] pub const GRPC_STATUS_NOT_FOUND: Type = 5; - #[doc = " Some entity that we attempted to create (e.g., file or directory)"] - #[doc = "already exists."] + #[doc = " Some entity that we attempted to create (e.g., file or directory)\nalready exists."] pub const GRPC_STATUS_ALREADY_EXISTS: Type = 6; - #[doc = " The caller does not have permission to execute the specified"] - #[doc = "operation. PERMISSION_DENIED must not be used for rejections"] - #[doc = "caused by exhausting some resource (use RESOURCE_EXHAUSTED"] - #[doc = "instead for those errors). PERMISSION_DENIED must not be"] - #[doc = "used if the caller can not be identified (use UNAUTHENTICATED"] - #[doc = "instead for those errors)."] + #[doc = " The caller does not have permission to execute the specified\noperation. PERMISSION_DENIED must not be used for rejections\ncaused by exhausting some resource (use RESOURCE_EXHAUSTED\ninstead for those errors). PERMISSION_DENIED must not be\nused if the caller can not be identified (use UNAUTHENTICATED\ninstead for those errors)."] pub const GRPC_STATUS_PERMISSION_DENIED: Type = 7; - #[doc = " The request does not have valid authentication credentials for the"] - #[doc = "operation."] + #[doc = " The request does not have valid authentication credentials for the\noperation."] pub const GRPC_STATUS_UNAUTHENTICATED: Type = 16; - #[doc = " Some resource has been exhausted, perhaps a per-user quota, or"] - #[doc = "perhaps the entire file system is out of space."] + #[doc = " Some resource has been exhausted, perhaps a per-user quota, or\nperhaps the entire file system is out of space."] pub const GRPC_STATUS_RESOURCE_EXHAUSTED: Type = 8; - #[doc = " Operation was rejected because the system is not in a state"] - #[doc = "required for the operation's execution. For example, directory"] - #[doc = "to be deleted may be non-empty, an rmdir operation is applied to"] - #[doc = "a non-directory, etc."] - #[doc = ""] - #[doc = "A litmus test that may help a service implementor in deciding"] - #[doc = "between FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:"] - #[doc = "(a) Use UNAVAILABLE if the client can retry just the failing call."] - #[doc = "(b) Use ABORTED if the client should retry at a higher-level"] - #[doc = "(e.g., restarting a read-modify-write sequence)."] - #[doc = "(c) Use FAILED_PRECONDITION if the client should not retry until"] - #[doc = "the system state has been explicitly fixed. E.g., if an \"rmdir\""] - #[doc = "fails because the directory is non-empty, FAILED_PRECONDITION"] - #[doc = "should be returned since the client should not retry unless"] - #[doc = "they have first fixed up the directory by deleting files from it."] - #[doc = "(d) Use FAILED_PRECONDITION if the client performs conditional"] - #[doc = "REST Get/Update/Delete on a resource and the resource on the"] - #[doc = "server does not match the condition. E.g., conflicting"] - #[doc = "read-modify-write on the same resource."] + #[doc = " Operation was rejected because the system is not in a state\nrequired for the operation's execution. For example, directory\nto be deleted may be non-empty, an rmdir operation is applied to\na non-directory, etc.\n\nA litmus test that may help a service implementor in deciding\nbetween FAILED_PRECONDITION, ABORTED, and UNAVAILABLE:\n(a) Use UNAVAILABLE if the client can retry just the failing call.\n(b) Use ABORTED if the client should retry at a higher-level\n(e.g., restarting a read-modify-write sequence).\n(c) Use FAILED_PRECONDITION if the client should not retry until\nthe system state has been explicitly fixed. E.g., if an \"rmdir\"\nfails because the directory is non-empty, FAILED_PRECONDITION\nshould be returned since the client should not retry unless\nthey have first fixed up the directory by deleting files from it.\n(d) Use FAILED_PRECONDITION if the client performs conditional\nREST Get/Update/Delete on a resource and the resource on the\nserver does not match the condition. E.g., conflicting\nread-modify-write on the same resource."] pub const GRPC_STATUS_FAILED_PRECONDITION: Type = 9; - #[doc = " The operation was aborted, typically due to a concurrency issue"] - #[doc = "like sequencer check failures, transaction aborts, etc."] - #[doc = ""] - #[doc = "See litmus test above for deciding between FAILED_PRECONDITION,"] - #[doc = "ABORTED, and UNAVAILABLE."] + #[doc = " The operation was aborted, typically due to a concurrency issue\nlike sequencer check failures, transaction aborts, etc.\n\nSee litmus test above for deciding between FAILED_PRECONDITION,\nABORTED, and UNAVAILABLE."] pub const GRPC_STATUS_ABORTED: Type = 10; - #[doc = " Operation was attempted past the valid range. E.g., seeking or"] - #[doc = "reading past end of file."] - #[doc = ""] - #[doc = "Unlike INVALID_ARGUMENT, this error indicates a problem that may"] - #[doc = "be fixed if the system state changes. For example, a 32-bit file"] - #[doc = "system will generate INVALID_ARGUMENT if asked to read at an"] - #[doc = "offset that is not in the range [0,2^32-1], but it will generate"] - #[doc = "OUT_OF_RANGE if asked to read from an offset past the current"] - #[doc = "file size."] - #[doc = ""] - #[doc = "There is a fair bit of overlap between FAILED_PRECONDITION and"] - #[doc = "OUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific"] - #[doc = "error) when it applies so that callers who are iterating through"] - #[doc = "a space can easily look for an OUT_OF_RANGE error to detect when"] - #[doc = "they are done."] + #[doc = " Operation was attempted past the valid range. E.g., seeking or\nreading past end of file.\n\nUnlike INVALID_ARGUMENT, this error indicates a problem that may\nbe fixed if the system state changes. For example, a 32-bit file\nsystem will generate INVALID_ARGUMENT if asked to read at an\noffset that is not in the range [0,2^32-1], but it will generate\nOUT_OF_RANGE if asked to read from an offset past the current\nfile size.\n\nThere is a fair bit of overlap between FAILED_PRECONDITION and\nOUT_OF_RANGE. We recommend using OUT_OF_RANGE (the more specific\nerror) when it applies so that callers who are iterating through\na space can easily look for an OUT_OF_RANGE error to detect when\nthey are done."] pub const GRPC_STATUS_OUT_OF_RANGE: Type = 11; #[doc = " Operation is not implemented or not supported/enabled in this service."] pub const GRPC_STATUS_UNIMPLEMENTED: Type = 12; - #[doc = " Internal errors. Means some invariants expected by underlying"] - #[doc = "system has been broken. If you see one of these errors,"] - #[doc = "something is very broken."] + #[doc = " Internal errors. Means some invariants expected by underlying\nsystem has been broken. If you see one of these errors,\nsomething is very broken."] pub const GRPC_STATUS_INTERNAL: Type = 13; - #[doc = " The service is currently unavailable. This is a most likely a"] - #[doc = "transient condition and may be corrected by retrying with"] - #[doc = "a backoff. Note that it is not always safe to retry non-idempotent"] - #[doc = "operations."] - #[doc = ""] - #[doc = "WARNING: Although data MIGHT not have been transmitted when this"] - #[doc = "status occurs, there is NOT A GUARANTEE that the server has not seen"] - #[doc = "anything. So in general it is unsafe to retry on this status code"] - #[doc = "if the call is non-idempotent."] - #[doc = ""] - #[doc = "See litmus test above for deciding between FAILED_PRECONDITION,"] - #[doc = "ABORTED, and UNAVAILABLE."] + #[doc = " The service is currently unavailable. This is a most likely a\ntransient condition and may be corrected by retrying with\na backoff. Note that it is not always safe to retry non-idempotent\noperations.\n\nWARNING: Although data MIGHT not have been transmitted when this\nstatus occurs, there is NOT A GUARANTEE that the server has not seen\nanything. So in general it is unsafe to retry on this status code\nif the call is non-idempotent.\n\nSee litmus test above for deciding between FAILED_PRECONDITION,\nABORTED, and UNAVAILABLE."] pub const GRPC_STATUS_UNAVAILABLE: Type = 14; #[doc = " Unrecoverable data loss or corruption."] pub const GRPC_STATUS_DATA_LOSS: Type = 15; @@ -903,18 +736,7 @@ pub struct grpc_arg_pointer_vtable { ) -> ::std::os::raw::c_int, >, } -#[doc = " A single argument... each argument has a key and a value"] -#[doc = ""] -#[doc = "A note on naming keys:"] -#[doc = "Keys are namespaced into groups, usually grouped by library, and are"] -#[doc = "keys for module XYZ are named XYZ.key1, XYZ.key2, etc. Module names must"] -#[doc = "be restricted to the regex [A-Za-z][_A-Za-z0-9]{,15}."] -#[doc = "Key names must be restricted to the regex [A-Za-z][_A-Za-z0-9]{,47}."] -#[doc = ""] -#[doc = "GRPC core library keys are prefixed by grpc."] -#[doc = ""] -#[doc = "Library authors are strongly encouraged to \\#define symbolic constants for"] -#[doc = "their keys so that it's possible to change them in the future."] +#[doc = " A single argument... each argument has a key and a value\n\nA note on naming keys:\nKeys are namespaced into groups, usually grouped by library, and are\nkeys for module XYZ are named XYZ.key1, XYZ.key2, etc. Module names must\nbe restricted to the regex [A-Za-z][_A-Za-z0-9]{,15}.\nKey names must be restricted to the regex [A-Za-z][_A-Za-z0-9]{,47}.\n\nGRPC core library keys are prefixed by grpc.\n\nLibrary authors are strongly encouraged to \\#define symbolic constants for\ntheir keys so that it's possible to change them in the future."] #[repr(C)] #[derive(Copy, Clone)] pub struct grpc_arg { @@ -949,22 +771,7 @@ impl ::std::fmt::Debug for grpc_arg { ) } } -#[doc = " An array of arguments that can be passed around."] -#[doc = ""] -#[doc = "Used to set optional channel-level configuration."] -#[doc = "These configuration options are modelled as key-value pairs as defined"] -#[doc = "by grpc_arg; keys are strings to allow easy backwards-compatible extension"] -#[doc = "by arbitrary parties. All evaluation is performed at channel creation"] -#[doc = "time (i.e. the keys and values in this structure need only live through the"] -#[doc = "creation invocation)."] -#[doc = ""] -#[doc = "However, if one of the args has grpc_arg_type==GRPC_ARG_POINTER, then the"] -#[doc = "grpc_arg_pointer_vtable must live until the channel args are done being"] -#[doc = "used by core (i.e. when the object for use with which they were passed"] -#[doc = "is destroyed)."] -#[doc = ""] -#[doc = "See the description of the \\ref grpc_arg_keys \"available args\" for more"] -#[doc = "details."] +#[doc = " An array of arguments that can be passed around.\n\nUsed to set optional channel-level configuration.\nThese configuration options are modelled as key-value pairs as defined\nby grpc_arg; keys are strings to allow easy backwards-compatible extension\nby arbitrary parties. All evaluation is performed at channel creation\ntime (i.e. the keys and values in this structure need only live through the\ncreation invocation).\n\nHowever, if one of the args has grpc_arg_type==GRPC_ARG_POINTER, then the\ngrpc_arg_pointer_vtable must live until the channel args are done being\nused by core (i.e. when the object for use with which they were passed\nis destroyed).\n\nSee the description of the \\ref grpc_arg_keys \"available args\" for more\ndetails."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_channel_args { @@ -972,10 +779,7 @@ pub struct grpc_channel_args { pub args: *mut grpc_arg, } #[repr(u32)] -#[doc = " Result of a grpc call. If the caller satisfies the prerequisites of a"] -#[doc = "particular operation, the grpc_call_error returned will be GRPC_CALL_OK."] -#[doc = "Receiving any other value listed here is an indication of a bug in the"] -#[doc = "caller."] +#[doc = " Result of a grpc call. If the caller satisfies the prerequisites of a\nparticular operation, the grpc_call_error returned will be GRPC_CALL_OK.\nReceiving any other value listed here is an indication of a bug in the\ncaller."] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum grpc_call_error { #[doc = " everything went ok"] @@ -992,8 +796,7 @@ pub enum grpc_call_error { GRPC_CALL_ERROR_ALREADY_INVOKED = 5, #[doc = " this method must be called after invoke"] GRPC_CALL_ERROR_NOT_INVOKED = 6, - #[doc = " this call is already finished"] - #[doc = "(writes_done or write_status has already been called)"] + #[doc = " this call is already finished\n(writes_done or write_status has already been called)"] GRPC_CALL_ERROR_ALREADY_FINISHED = 7, #[doc = " there is already an outstanding read/write operation on the call"] GRPC_CALL_ERROR_TOO_MANY_OPERATIONS = 8, @@ -1003,8 +806,7 @@ pub enum grpc_call_error { GRPC_CALL_ERROR_INVALID_METADATA = 10, #[doc = " invalid message was passed to this call"] GRPC_CALL_ERROR_INVALID_MESSAGE = 11, - #[doc = " completion queue for notification has not been registered"] - #[doc = " with the server"] + #[doc = " completion queue for notification has not been registered\n with the server"] GRPC_CALL_ERROR_NOT_SERVER_COMPLETION_QUEUE = 12, #[doc = " this batch of operations leads to more operations than allowed"] GRPC_CALL_ERROR_BATCH_TOO_BIG = 13, @@ -1017,15 +819,12 @@ pub enum grpc_call_error { #[repr(C)] #[derive(Copy, Clone)] pub struct grpc_metadata { - #[doc = " the key, value values are expected to line up with grpc_mdelem: if"] - #[doc = "changing them, update metadata.h at the same time."] + #[doc = " the key, value values are expected to line up with grpc_mdelem: if\nchanging them, update metadata.h at the same time."] pub key: grpc_slice, pub value: grpc_slice, pub internal_data: grpc_metadata__bindgen_ty_1, } -#[doc = " The following fields are reserved for grpc internal use."] -#[doc = "There is no need to initialize them, and they will be set to garbage"] -#[doc = "during calls to grpc."] +#[doc = " The following fields are reserved for grpc internal use.\nThere is no need to initialize them, and they will be set to garbage\nduring calls to grpc."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_metadata__bindgen_ty_1 { @@ -1051,23 +850,15 @@ pub enum grpc_completion_type { #[doc = " Operation completion"] GRPC_OP_COMPLETE = 2, } -#[doc = " The result of an operation."] -#[doc = ""] -#[doc = "Returned by a completion queue when the operation started with tag."] +#[doc = " The result of an operation.\n\nReturned by a completion queue when the operation started with tag."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_event { #[doc = " The type of the completion."] pub type_: grpc_completion_type, - #[doc = " If the grpc_completion_type is GRPC_OP_COMPLETE, this field indicates"] - #[doc = "whether the operation was successful or not; 0 in case of failure and"] - #[doc = "non-zero in case of success."] - #[doc = "If grpc_completion_type is GRPC_QUEUE_SHUTDOWN or GRPC_QUEUE_TIMEOUT, this"] - #[doc = "field is guaranteed to be 0"] + #[doc = " If the grpc_completion_type is GRPC_OP_COMPLETE, this field indicates\nwhether the operation was successful or not; 0 in case of failure and\nnon-zero in case of success.\nIf grpc_completion_type is GRPC_QUEUE_SHUTDOWN or GRPC_QUEUE_TIMEOUT, this\nfield is guaranteed to be 0"] pub success: ::std::os::raw::c_int, - #[doc = " The tag passed to grpc_call_start_batch etc to start this operation."] - #[doc = "Only* GRPC_OP_COMPLETE has a tag. For all other grpc_completion_type"] - #[doc = "values, tag is uninitialized."] + #[doc = " The tag passed to grpc_call_start_batch etc to start this operation.\nOnly* GRPC_OP_COMPLETE has a tag. For all other grpc_completion_type\nvalues, tag is uninitialized."] pub tag: *mut ::std::os::raw::c_void, } #[repr(C)] @@ -1096,49 +887,24 @@ impl ::std::fmt::Debug for grpc_call_details { #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum grpc_op_type { - #[doc = " Send initial metadata: one and only one instance MUST be sent for each"] - #[doc = "call, unless the call was cancelled - in which case this can be skipped."] - #[doc = "This op completes after all bytes of metadata have been accepted by"] - #[doc = "outgoing flow control."] + #[doc = " Send initial metadata: one and only one instance MUST be sent for each\ncall, unless the call was cancelled - in which case this can be skipped.\nThis op completes after all bytes of metadata have been accepted by\noutgoing flow control."] GRPC_OP_SEND_INITIAL_METADATA = 0, - #[doc = " Send a message: 0 or more of these operations can occur for each call."] - #[doc = "This op completes after all bytes for the message have been accepted by"] - #[doc = "outgoing flow control."] + #[doc = " Send a message: 0 or more of these operations can occur for each call.\nThis op completes after all bytes for the message have been accepted by\noutgoing flow control."] GRPC_OP_SEND_MESSAGE = 1, - #[doc = " Send a close from the client: one and only one instance MUST be sent from"] - #[doc = "the client, unless the call was cancelled - in which case this can be"] - #[doc = "skipped. This op completes after all bytes for the call"] - #[doc = "(including the close) have passed outgoing flow control."] + #[doc = " Send a close from the client: one and only one instance MUST be sent from\nthe client, unless the call was cancelled - in which case this can be\nskipped. This op completes after all bytes for the call\n(including the close) have passed outgoing flow control."] GRPC_OP_SEND_CLOSE_FROM_CLIENT = 2, - #[doc = " Send status from the server: one and only one instance MUST be sent from"] - #[doc = "the server unless the call was cancelled - in which case this can be"] - #[doc = "skipped. This op completes after all bytes for the call"] - #[doc = "(including the status) have passed outgoing flow control."] + #[doc = " Send status from the server: one and only one instance MUST be sent from\nthe server unless the call was cancelled - in which case this can be\nskipped. This op completes after all bytes for the call\n(including the status) have passed outgoing flow control."] GRPC_OP_SEND_STATUS_FROM_SERVER = 3, - #[doc = " Receive initial metadata: one and only one MUST be made on the client,"] - #[doc = "must not be made on the server."] - #[doc = "This op completes after all initial metadata has been read from the"] - #[doc = "peer."] + #[doc = " Receive initial metadata: one and only one MUST be made on the client,\nmust not be made on the server.\nThis op completes after all initial metadata has been read from the\npeer."] GRPC_OP_RECV_INITIAL_METADATA = 4, - #[doc = " Receive a message: 0 or more of these operations can occur for each call."] - #[doc = "This op completes after all bytes of the received message have been"] - #[doc = "read, or after a half-close has been received on this call."] + #[doc = " Receive a message: 0 or more of these operations can occur for each call.\nThis op completes after all bytes of the received message have been\nread, or after a half-close has been received on this call."] GRPC_OP_RECV_MESSAGE = 5, - #[doc = " Receive status on the client: one and only one must be made on the client."] - #[doc = "This operation always succeeds, meaning ops paired with this operation"] - #[doc = "will also appear to succeed, even though they may not have. In that case"] - #[doc = "the status will indicate some failure."] - #[doc = "This op completes after all activity on the call has completed."] + #[doc = " Receive status on the client: one and only one must be made on the client.\nThis operation always succeeds, meaning ops paired with this operation\nwill also appear to succeed, even though they may not have. In that case\nthe status will indicate some failure.\nThis op completes after all activity on the call has completed."] GRPC_OP_RECV_STATUS_ON_CLIENT = 6, - #[doc = " Receive close on the server: one and only one must be made on the"] - #[doc = "server. This op completes after the close has been received by the"] - #[doc = "server. This operation always succeeds, meaning ops paired with"] - #[doc = "this operation will also appear to succeed, even though they may not"] - #[doc = "have."] + #[doc = " Receive close on the server: one and only one must be made on the\nserver. This op completes after the close has been received by the\nserver. This operation always succeeds, meaning ops paired with\nthis operation will also appear to succeed, even though they may not\nhave."] GRPC_OP_RECV_CLOSE_ON_SERVER = 7, } -#[doc = " Operation data: one field for each op type (except SEND_CLOSE_FROM_CLIENT"] -#[doc = "which has no arguments)"] +#[doc = " Operation data: one field for each op type (except SEND_CLOSE_FROM_CLIENT\nwhich has no arguments)"] #[repr(C)] #[derive(Copy, Clone)] pub struct grpc_op { @@ -1171,8 +937,7 @@ pub struct grpc_op_grpc_op_data__bindgen_ty_1 { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_op_grpc_op_data_grpc_op_send_initial_metadata { pub count : usize , pub metadata : * mut grpc_metadata , pub maybe_compression_level : grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level , } -#[doc = " If \\a is_set, \\a compression_level will be used for the call."] -#[doc = " Otherwise, \\a compression_level won't be considered"] +#[doc = " If \\a is_set, \\a compression_level will be used for the call.\n Otherwise, \\a compression_level won't be considered"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level @@ -1183,10 +948,7 @@ pub struct grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initi #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_op_grpc_op_data_grpc_op_send_message { - #[doc = " This op takes ownership of the slices in send_message. After"] - #[doc = " a call completes, the contents of send_message are not guaranteed"] - #[doc = " and likely empty. The original owner should still call"] - #[doc = " grpc_byte_buffer_destroy() on this object however."] + #[doc = " This op takes ownership of the slices in send_message. After\n a call completes, the contents of send_message are not guaranteed\n and likely empty. The original owner should still call\n grpc_byte_buffer_destroy() on this object however."] pub send_message: *mut grpc_byte_buffer, } #[repr(C)] @@ -1195,24 +957,16 @@ pub struct grpc_op_grpc_op_data_grpc_op_send_status_from_server { pub trailing_metadata_count: usize, pub trailing_metadata: *mut grpc_metadata, pub status: grpc_status_code::Type, - #[doc = " optional: set to NULL if no details need sending, non-NULL if they do"] - #[doc = " pointer will not be retained past the start_batch call"] + #[doc = " optional: set to NULL if no details need sending, non-NULL if they do\n pointer will not be retained past the start_batch call"] pub status_details: *mut grpc_slice, } -#[doc = " ownership of the array is with the caller, but ownership of the elements"] -#[doc = "stays with the call object (ie key, value members are owned by the call"] -#[doc = "object, recv_initial_metadata->array is owned by the caller)."] -#[doc = "After the operation completes, call grpc_metadata_array_destroy on this"] -#[doc = "value, or reuse it in a future op."] +#[doc = " ownership of the array is with the caller, but ownership of the elements\nstays with the call object (ie key, value members are owned by the call\nobject, recv_initial_metadata->array is owned by the caller).\nAfter the operation completes, call grpc_metadata_array_destroy on this\nvalue, or reuse it in a future op."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_op_grpc_op_data_grpc_op_recv_initial_metadata { pub recv_initial_metadata: *mut grpc_metadata_array, } -#[doc = " ownership of the byte buffer is moved to the caller; the caller must"] -#[doc = "call grpc_byte_buffer_destroy on this value, or reuse it in a future op."] -#[doc = "The returned byte buffer will be NULL if trailing metadata was"] -#[doc = "received instead of a message."] +#[doc = " ownership of the byte buffer is moved to the caller; the caller must\ncall grpc_byte_buffer_destroy on this value, or reuse it in a future op.\nThe returned byte buffer will be NULL if trailing metadata was\nreceived instead of a message."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_op_grpc_op_data_grpc_op_recv_message { @@ -1221,26 +975,17 @@ pub struct grpc_op_grpc_op_data_grpc_op_recv_message { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_op_grpc_op_data_grpc_op_recv_status_on_client { - #[doc = " ownership of the array is with the caller, but ownership of the"] - #[doc = "elements stays with the call object (ie key, value members are owned"] - #[doc = "by the call object, trailing_metadata->array is owned by the caller)."] - #[doc = "After the operation completes, call grpc_metadata_array_destroy on"] - #[doc = "this value, or reuse it in a future op."] + #[doc = " ownership of the array is with the caller, but ownership of the\nelements stays with the call object (ie key, value members are owned\nby the call object, trailing_metadata->array is owned by the caller).\nAfter the operation completes, call grpc_metadata_array_destroy on\nthis value, or reuse it in a future op."] pub trailing_metadata: *mut grpc_metadata_array, pub status: *mut grpc_status_code::Type, pub status_details: *mut grpc_slice, - #[doc = " If this is not nullptr, it will be populated with the full fidelity"] - #[doc = " error string for debugging purposes. The application is responsible"] - #[doc = " for freeing the data by using gpr_free()."] + #[doc = " If this is not nullptr, it will be populated with the full fidelity\n error string for debugging purposes. The application is responsible\n for freeing the data by using gpr_free()."] pub error_string: *mut *const ::std::os::raw::c_char, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_op_grpc_op_data_grpc_op_recv_close_on_server { - #[doc = " out argument, set to 1 if the call failed at the server for"] - #[doc = "a reason other than a non-OK status (cancel, deadline"] - #[doc = "exceeded, network failure, etc.), 0 otherwise (RPC processing ran to"] - #[doc = "completion and was able to provide any status from the server)"] + #[doc = " out argument, set to 1 if the call failed at the server for\na reason other than a non-OK status (cancel, deadline\nexceeded, network failure, etc.), 0 otherwise (RPC processing ran to\ncompletion and was able to provide any status from the server)"] pub cancelled: *mut ::std::os::raw::c_int, } impl ::std::fmt::Debug for grpc_op_grpc_op_data { @@ -1261,11 +1006,9 @@ impl ::std::fmt::Debug for grpc_op { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_channel_info { - #[doc = " If non-NULL, will be set to point to a string indicating the LB"] - #[doc = " policy name. Caller takes ownership."] + #[doc = " If non-NULL, will be set to point to a string indicating the LB\n policy name. Caller takes ownership."] pub lb_policy_name: *mut *mut ::std::os::raw::c_char, - #[doc = " If non-NULL, will be set to point to a string containing the"] - #[doc = " service config used by the channel in JSON form."] + #[doc = " If non-NULL, will be set to point to a string containing the\n service config used by the channel in JSON form."] pub service_config_json: *mut *mut ::std::os::raw::c_char, } #[repr(C)] @@ -1274,28 +1017,14 @@ pub struct grpc_resource_quota { _unused: [u8; 0], } #[repr(u32)] -#[doc = " Completion queues internally MAY maintain a set of file descriptors in a"] -#[doc = "structure called 'pollset'. This enum specifies if a completion queue has an"] -#[doc = "associated pollset and any restrictions on the type of file descriptors that"] -#[doc = "can be present in the pollset."] -#[doc = ""] -#[doc = "I/O progress can only be made when grpc_completion_queue_next() or"] -#[doc = "grpc_completion_queue_pluck() are called on the completion queue (unless the"] -#[doc = "grpc_cq_polling_type is GRPC_CQ_NON_POLLING) and hence it is very important"] -#[doc = "to actively call these APIs"] +#[doc = " Completion queues internally MAY maintain a set of file descriptors in a\nstructure called 'pollset'. This enum specifies if a completion queue has an\nassociated pollset and any restrictions on the type of file descriptors that\ncan be present in the pollset.\n\nI/O progress can only be made when grpc_completion_queue_next() or\ngrpc_completion_queue_pluck() are called on the completion queue (unless the\ngrpc_cq_polling_type is GRPC_CQ_NON_POLLING) and hence it is very important\nto actively call these APIs"] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum grpc_cq_polling_type { - #[doc = " The completion queue will have an associated pollset and there is no"] - #[doc = "restriction on the type of file descriptors the pollset may contain"] + #[doc = " The completion queue will have an associated pollset and there is no\nrestriction on the type of file descriptors the pollset may contain"] GRPC_CQ_DEFAULT_POLLING = 0, - #[doc = " Similar to GRPC_CQ_DEFAULT_POLLING except that the completion queues will"] - #[doc = "not contain any 'listening file descriptors' (i.e file descriptors used to"] - #[doc = "listen to incoming channels)"] + #[doc = " Similar to GRPC_CQ_DEFAULT_POLLING except that the completion queues will\nnot contain any 'listening file descriptors' (i.e file descriptors used to\nlisten to incoming channels)"] GRPC_CQ_NON_LISTENING = 1, - #[doc = " The completion queue will not have an associated pollset. Note that"] - #[doc = "grpc_completion_queue_next() or grpc_completion_queue_pluck() MUST still"] - #[doc = "be called to pop events from the completion queue; it is not required to"] - #[doc = "call them actively to make I/O progress"] + #[doc = " The completion queue will not have an associated pollset. Note that\ngrpc_completion_queue_next() or grpc_completion_queue_pluck() MUST still\nbe called to pop events from the completion queue; it is not required to\ncall them actively to make I/O progress"] GRPC_CQ_NON_POLLING = 2, } #[repr(u32)] @@ -1309,22 +1038,15 @@ pub enum grpc_cq_completion_type { #[doc = " Events trigger a callback specified as the tag"] GRPC_CQ_CALLBACK = 2, } -#[doc = " Specifies an interface class to be used as a tag for callback-based"] -#[doc = " completion queues. This can be used directly, as the first element of a"] -#[doc = " struct in C, or as a base class in C++. Its \"run\" value should be assigned to"] -#[doc = " some non-member function, such as a static method."] +#[doc = " Specifies an interface class to be used as a tag for callback-based\n completion queues. This can be used directly, as the first element of a\n struct in C, or as a base class in C++. Its \"run\" value should be assigned to\n some non-member function, such as a static method."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_completion_queue_functor { - #[doc = " The run member specifies a function that will be called when this"] - #[doc = "tag is extracted from the completion queue. Its arguments will be a"] - #[doc = "pointer to this functor and a boolean that indicates whether the"] - #[doc = "operation succeeded (non-zero) or failed (zero)"] + #[doc = " The run member specifies a function that will be called when this\ntag is extracted from the completion queue. Its arguments will be a\npointer to this functor and a boolean that indicates whether the\noperation succeeded (non-zero) or failed (zero)"] pub functor_run: ::std::option::Option< unsafe extern "C" fn(arg1: *mut grpc_completion_queue_functor, arg2: ::std::os::raw::c_int), >, - #[doc = " The inlineable member specifies whether this functor can be run inline."] - #[doc = "This should only be used for trivial internally-defined functors."] + #[doc = " The inlineable member specifies whether this functor can be run inline.\nThis should only be used for trivial internally-defined functors."] pub inlineable: ::std::os::raw::c_int, #[doc = " The following fields are not API. They are meant for internal use."] pub internal_success: ::std::os::raw::c_int, @@ -1333,14 +1055,12 @@ pub struct grpc_completion_queue_functor { #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_completion_queue_attributes { - #[doc = " The version number of this structure. More fields might be added to this"] - #[doc = "structure in future."] + #[doc = " The version number of this structure. More fields might be added to this\nstructure in future."] pub version: ::std::os::raw::c_int, #[doc = " Set to GRPC_CQ_CURRENT_VERSION"] pub cq_completion_type: grpc_cq_completion_type, pub cq_polling_type: grpc_cq_polling_type, - #[doc = " When creating a callbackable CQ, pass in a functor to get invoked when"] - #[doc = " shutdown is complete"] + #[doc = " When creating a callbackable CQ, pass in a functor to get invoked when\n shutdown is complete"] pub cq_shutdown_cb: *mut grpc_completion_queue_functor, } #[repr(C)] @@ -1357,27 +1077,18 @@ extern "C" { pub fn grpc_slice_buffer_destroy(sb: *mut grpc_slice_buffer); } extern "C" { - #[doc = " Add an element to a slice buffer - takes ownership of the slice."] - #[doc = "This function is allowed to concatenate the passed in slice to the end of"] - #[doc = "some other slice if desired by the slice buffer."] + #[doc = " Add an element to a slice buffer - takes ownership of the slice.\nThis function is allowed to concatenate the passed in slice to the end of\nsome other slice if desired by the slice buffer."] pub fn grpc_slice_buffer_add(sb: *mut grpc_slice_buffer, slice: grpc_slice); } extern "C" { - #[doc = " add an element to a slice buffer - takes ownership of the slice and returns"] - #[doc = "the index of the slice."] - #[doc = "Guarantees that the slice will not be concatenated at the end of another"] - #[doc = "slice (i.e. the data for this slice will begin at the first byte of the"] - #[doc = "slice at the returned index in sb->slices)"] - #[doc = "The implementation MAY decide to concatenate data at the end of a small"] - #[doc = "slice added in this fashion."] + #[doc = " add an element to a slice buffer - takes ownership of the slice and returns\nthe index of the slice.\nGuarantees that the slice will not be concatenated at the end of another\nslice (i.e. the data for this slice will begin at the first byte of the\nslice at the returned index in sb->slices)\nThe implementation MAY decide to concatenate data at the end of a small\nslice added in this fashion."] pub fn grpc_slice_buffer_add_indexed(sb: *mut grpc_slice_buffer, slice: grpc_slice) -> usize; } extern "C" { pub fn grpc_slice_buffer_addn(sb: *mut grpc_slice_buffer, slices: *mut grpc_slice, n: usize); } extern "C" { - #[doc = " add a very small (less than 8 bytes) amount of data to the end of a slice"] - #[doc = "buffer: returns a pointer into which to add the data"] + #[doc = " add a very small (less than 8 bytes) amount of data to the end of a slice\nbuffer: returns a pointer into which to add the data"] pub fn grpc_slice_buffer_tiny_add(sb: *mut grpc_slice_buffer, len: usize) -> *mut u8; } extern "C" { @@ -1437,22 +1148,14 @@ extern "C" { pub fn grpc_slice_buffer_undo_take_first(sb: *mut grpc_slice_buffer, slice: grpc_slice); } extern "C" { - #[doc = " Returns a RAW byte buffer instance over the given slices (up to \\a nslices)."] - #[doc = ""] - #[doc = " Increases the reference count for all \\a slices processed. The user is"] - #[doc = " responsible for invoking grpc_byte_buffer_destroy on the returned instance."] + #[doc = " Returns a RAW byte buffer instance over the given slices (up to \\a nslices).\n\n Increases the reference count for all \\a slices processed. The user is\n responsible for invoking grpc_byte_buffer_destroy on the returned instance."] pub fn grpc_raw_byte_buffer_create( slices: *mut grpc_slice, nslices: usize, ) -> *mut grpc_byte_buffer; } extern "C" { - #[doc = " Returns a *compressed* RAW byte buffer instance over the given slices (up to"] - #[doc = " \\a nslices). The \\a compression argument defines the compression algorithm"] - #[doc = " used to generate the data in \\a slices."] - #[doc = ""] - #[doc = " Increases the reference count for all \\a slices processed. The user is"] - #[doc = " responsible for invoking grpc_byte_buffer_destroy on the returned instance."] + #[doc = " Returns a *compressed* RAW byte buffer instance over the given slices (up to\n \\a nslices). The \\a compression argument defines the compression algorithm\n used to generate the data in \\a slices.\n\n Increases the reference count for all \\a slices processed. The user is\n responsible for invoking grpc_byte_buffer_destroy on the returned instance."] pub fn grpc_raw_compressed_byte_buffer_create( slices: *mut grpc_slice, nslices: usize, @@ -1460,10 +1163,7 @@ extern "C" { ) -> *mut grpc_byte_buffer; } extern "C" { - #[doc = " Copies input byte buffer \\a bb."] - #[doc = ""] - #[doc = " Increases the reference count of all the source slices. The user is"] - #[doc = " responsible for calling grpc_byte_buffer_destroy over the returned copy."] + #[doc = " Copies input byte buffer \\a bb.\n\n Increases the reference count of all the source slices. The user is\n responsible for calling grpc_byte_buffer_destroy over the returned copy."] pub fn grpc_byte_buffer_copy(bb: *mut grpc_byte_buffer) -> *mut grpc_byte_buffer; } extern "C" { @@ -1475,8 +1175,7 @@ extern "C" { pub fn grpc_byte_buffer_destroy(bb: *mut grpc_byte_buffer); } extern "C" { - #[doc = " Initialize \\a reader to read over \\a buffer."] - #[doc = " Returns 1 upon success, 0 otherwise."] + #[doc = " Initialize \\a reader to read over \\a buffer.\n Returns 1 upon success, 0 otherwise."] pub fn grpc_byte_buffer_reader_init( reader: *mut grpc_byte_buffer_reader, buffer: *mut grpc_byte_buffer, @@ -1487,25 +1186,14 @@ extern "C" { pub fn grpc_byte_buffer_reader_destroy(reader: *mut grpc_byte_buffer_reader); } extern "C" { - #[doc = " Updates \\a slice with the next piece of data from from \\a reader and returns"] - #[doc = " 1. Returns 0 at the end of the stream. Caller is responsible for calling"] - #[doc = " grpc_slice_unref on the result."] + #[doc = " Updates \\a slice with the next piece of data from from \\a reader and returns\n 1. Returns 0 at the end of the stream. Caller is responsible for calling\n grpc_slice_unref on the result."] pub fn grpc_byte_buffer_reader_next( reader: *mut grpc_byte_buffer_reader, slice: *mut grpc_slice, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " EXPERIMENTAL API - This function may be removed and changed, in the future."] - #[doc = ""] - #[doc = " Updates \\a slice with the next piece of data from from \\a reader and returns"] - #[doc = " 1. Returns 0 at the end of the stream. Caller is responsible for making sure"] - #[doc = " the slice pointer remains valid when accessed."] - #[doc = ""] - #[doc = " NOTE: Do not use this function unless the caller can guarantee that the"] - #[doc = " underlying grpc_byte_buffer outlasts the use of the slice. This is only"] - #[doc = " safe when the underlying grpc_byte_buffer remains immutable while slice"] - #[doc = " is being accessed."] + #[doc = " EXPERIMENTAL API - This function may be removed and changed, in the future.\n\n Updates \\a slice with the next piece of data from from \\a reader and returns\n 1. Returns 0 at the end of the stream. Caller is responsible for making sure\n the slice pointer remains valid when accessed.\n\n NOTE: Do not use this function unless the caller can guarantee that the\n underlying grpc_byte_buffer outlasts the use of the slice. This is only\n safe when the underlying grpc_byte_buffer remains immutable while slice\n is being accessed."] pub fn grpc_byte_buffer_reader_peek( reader: *mut grpc_byte_buffer_reader, slice: *mut *mut grpc_slice, @@ -1534,25 +1222,21 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " Parses the \\a slice as a grpc_compression_algorithm instance and updating \\a"] - #[doc = " algorithm. Returns 1 upon success, 0 otherwise."] + #[doc = " Parses the \\a slice as a grpc_compression_algorithm instance and updating \\a\n algorithm. Returns 1 upon success, 0 otherwise."] pub fn grpc_compression_algorithm_parse( name: grpc_slice, algorithm: *mut grpc_compression_algorithm, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " Updates \\a name with the encoding name corresponding to a valid \\a"] - #[doc = " algorithm. Note that \\a name is statically allocated and must *not* be freed."] - #[doc = " Returns 1 upon success, 0 otherwise."] + #[doc = " Updates \\a name with the encoding name corresponding to a valid \\a\n algorithm. Note that \\a name is statically allocated and must *not* be freed.\n Returns 1 upon success, 0 otherwise."] pub fn grpc_compression_algorithm_name( algorithm: grpc_compression_algorithm, name: *mut *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " Returns the compression algorithm corresponding to \\a level for the"] - #[doc = " compression algorithms encoded in the \\a accepted_encodings bitset."] + #[doc = " Returns the compression algorithm corresponding to \\a level for the\n compression algorithms encoded in the \\a accepted_encodings bitset."] pub fn grpc_compression_algorithm_for_level( level: grpc_compression_level, accepted_encodings: u32, @@ -1598,11 +1282,7 @@ pub enum grpc_connectivity_state { GRPC_CHANNEL_SHUTDOWN = 4, } extern "C" { - #[doc = " \\mainpage GRPC Core"] - #[doc = ""] - #[doc = " The GRPC Core library is a low-level library designed to be wrapped by higher"] - #[doc = " level libraries. The top-level API is provided in grpc.h. Security related"] - #[doc = " functionality lives in grpc_security.h."] + #[doc = " \\mainpage GRPC Core\n\n The GRPC Core library is a low-level library designed to be wrapped by higher\n level libraries. The top-level API is provided in grpc.h. Security related\n functionality lives in grpc_security.h."] pub fn grpc_metadata_array_init(array: *mut grpc_metadata_array); } extern "C" { @@ -1615,34 +1295,15 @@ extern "C" { pub fn grpc_call_details_destroy(details: *mut grpc_call_details); } extern "C" { - #[doc = " Initialize the grpc library."] - #[doc = ""] - #[doc = "After it's called, a matching invocation to grpc_shutdown() is expected."] - #[doc = ""] - #[doc = "It is not safe to call any other grpc functions before calling this."] - #[doc = "(To avoid overhead, little checking is done, and some things may work. We"] - #[doc = "do not warrant that they will continue to do so in future revisions of this"] - #[doc = "library)."] + #[doc = " Initialize the grpc library.\n\nAfter it's called, a matching invocation to grpc_shutdown() is expected.\n\nIt is not safe to call any other grpc functions before calling this.\n(To avoid overhead, little checking is done, and some things may work. We\ndo not warrant that they will continue to do so in future revisions of this\nlibrary)."] pub fn grpc_init(); } extern "C" { - #[doc = " Shut down the grpc library."] - #[doc = ""] - #[doc = "Before it's called, there should haven been a matching invocation to"] - #[doc = "grpc_init()."] - #[doc = ""] - #[doc = "The last call to grpc_shutdown will initiate cleaning up of grpc library"] - #[doc = "internals, which can happen in another thread. Once the clean-up is done,"] - #[doc = "no memory is used by grpc, nor are any instructions executing within the"] - #[doc = "grpc library. Prior to calling, all application owned grpc objects must"] - #[doc = "have been destroyed."] + #[doc = " Shut down the grpc library.\n\nBefore it's called, there should haven been a matching invocation to\ngrpc_init().\n\nThe last call to grpc_shutdown will initiate cleaning up of grpc library\ninternals, which can happen in another thread. Once the clean-up is done,\nno memory is used by grpc, nor are any instructions executing within the\ngrpc library. Prior to calling, all application owned grpc objects must\nhave been destroyed."] pub fn grpc_shutdown(); } extern "C" { - #[doc = " EXPERIMENTAL. Returns 1 if the grpc library has been initialized."] - #[doc = "TODO(ericgribkoff) Decide if this should be promoted to non-experimental as"] - #[doc = "part of stabilizing the fork support API, as tracked in"] - #[doc = "https://github.com/grpc/grpc/issues/15334"] + #[doc = " EXPERIMENTAL. Returns 1 if the grpc library has been initialized.\nTODO(ericgribkoff) Decide if this should be promoted to non-experimental as\npart of stabilizing the fork support API, as tracked in\nhttps://github.com/grpc/grpc/issues/15334"] pub fn grpc_is_initialized() -> ::std::os::raw::c_int; } extern "C" { @@ -1658,30 +1319,25 @@ extern "C" { pub fn grpc_g_stands_for() -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " Returns the completion queue factory based on the attributes. MAY return a"] - #[doc = "NULL if no factory can be found"] + #[doc = " Returns the completion queue factory based on the attributes. MAY return a\nNULL if no factory can be found"] pub fn grpc_completion_queue_factory_lookup( attributes: *const grpc_completion_queue_attributes, ) -> *const grpc_completion_queue_factory; } extern "C" { - #[doc = " Helper function to create a completion queue with grpc_cq_completion_type"] - #[doc = "of GRPC_CQ_NEXT and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING"] + #[doc = " Helper function to create a completion queue with grpc_cq_completion_type\nof GRPC_CQ_NEXT and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING"] pub fn grpc_completion_queue_create_for_next( reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_completion_queue; } extern "C" { - #[doc = " Helper function to create a completion queue with grpc_cq_completion_type"] - #[doc = "of GRPC_CQ_PLUCK and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING"] + #[doc = " Helper function to create a completion queue with grpc_cq_completion_type\nof GRPC_CQ_PLUCK and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING"] pub fn grpc_completion_queue_create_for_pluck( reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_completion_queue; } extern "C" { - #[doc = " Helper function to create a completion queue with grpc_cq_completion_type"] - #[doc = "of GRPC_CQ_CALLBACK and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING."] - #[doc = "This function is experimental."] + #[doc = " Helper function to create a completion queue with grpc_cq_completion_type\nof GRPC_CQ_CALLBACK and grpc_cq_polling_type of GRPC_CQ_DEFAULT_POLLING.\nThis function is experimental."] pub fn grpc_completion_queue_create_for_callback( shutdown_callback: *mut grpc_completion_queue_functor, reserved: *mut ::std::os::raw::c_void, @@ -1696,14 +1352,7 @@ extern "C" { ) -> *mut grpc_completion_queue; } extern "C" { - #[doc = " Blocks until an event is available, the completion queue is being shut down,"] - #[doc = "or deadline is reached."] - #[doc = ""] - #[doc = "Returns a grpc_event with type GRPC_QUEUE_TIMEOUT on timeout,"] - #[doc = "otherwise a grpc_event describing the event that occurred."] - #[doc = ""] - #[doc = "Callers must not call grpc_completion_queue_next and"] - #[doc = "grpc_completion_queue_pluck simultaneously on the same completion queue."] + #[doc = " Blocks until an event is available, the completion queue is being shut down,\nor deadline is reached.\n\nReturns a grpc_event with type GRPC_QUEUE_TIMEOUT on timeout,\notherwise a grpc_event describing the event that occurred.\n\nCallers must not call grpc_completion_queue_next and\ngrpc_completion_queue_pluck simultaneously on the same completion queue."] pub fn grpc_completion_queue_next( cq: *mut grpc_completion_queue, deadline: gpr_timespec, @@ -1711,17 +1360,7 @@ extern "C" { ) -> grpc_event; } extern "C" { - #[doc = " Blocks until an event with tag 'tag' is available, the completion queue is"] - #[doc = "being shutdown or deadline is reached."] - #[doc = ""] - #[doc = "Returns a grpc_event with type GRPC_QUEUE_TIMEOUT on timeout,"] - #[doc = "otherwise a grpc_event describing the event that occurred."] - #[doc = ""] - #[doc = "Callers must not call grpc_completion_queue_next and"] - #[doc = "grpc_completion_queue_pluck simultaneously on the same completion queue."] - #[doc = ""] - #[doc = "Completion queues support a maximum of GRPC_MAX_COMPLETION_QUEUE_PLUCKERS"] - #[doc = "concurrently executing plucks at any time."] + #[doc = " Blocks until an event with tag 'tag' is available, the completion queue is\nbeing shutdown or deadline is reached.\n\nReturns a grpc_event with type GRPC_QUEUE_TIMEOUT on timeout,\notherwise a grpc_event describing the event that occurred.\n\nCallers must not call grpc_completion_queue_next and\ngrpc_completion_queue_pluck simultaneously on the same completion queue.\n\nCompletion queues support a maximum of GRPC_MAX_COMPLETION_QUEUE_PLUCKERS\nconcurrently executing plucks at any time."] pub fn grpc_completion_queue_pluck( cq: *mut grpc_completion_queue, tag: *mut ::std::os::raw::c_void, @@ -1730,31 +1369,19 @@ extern "C" { ) -> grpc_event; } extern "C" { - #[doc = " Begin destruction of a completion queue. Once all possible events are"] - #[doc = "drained then grpc_completion_queue_next will start to produce"] - #[doc = "GRPC_QUEUE_SHUTDOWN events only. At that point it's safe to call"] - #[doc = "grpc_completion_queue_destroy."] - #[doc = ""] - #[doc = "After calling this function applications should ensure that no"] - #[doc = "NEW work is added to be published on this completion queue."] + #[doc = " Begin destruction of a completion queue. Once all possible events are\ndrained then grpc_completion_queue_next will start to produce\nGRPC_QUEUE_SHUTDOWN events only. At that point it's safe to call\ngrpc_completion_queue_destroy.\n\nAfter calling this function applications should ensure that no\nNEW work is added to be published on this completion queue."] pub fn grpc_completion_queue_shutdown(cq: *mut grpc_completion_queue); } extern "C" { - #[doc = " Destroy a completion queue. The caller must ensure that the queue is"] - #[doc = "drained and no threads are executing grpc_completion_queue_next"] + #[doc = " Destroy a completion queue. The caller must ensure that the queue is\ndrained and no threads are executing grpc_completion_queue_next"] pub fn grpc_completion_queue_destroy(cq: *mut grpc_completion_queue); } extern "C" { - #[doc = " EXPERIMENTAL API ************/"] - #[doc = " grpc_flush_cq_tls_cache() MUST be called on the same thread,"] - #[doc = " with the same cq."] + #[doc = " EXPERIMENTAL API ************/\n/** Initializes a thread local cache for \\a cq.\n grpc_flush_cq_tls_cache() MUST be called on the same thread,\n with the same cq."] pub fn grpc_completion_queue_thread_local_cache_init(cq: *mut grpc_completion_queue); } extern "C" { - #[doc = " EXPERIMENTAL API ************/"] - #[doc = " Returns 1 if there was contents in the cache. If there was an event"] - #[doc = " in \\a cq tls cache, its tag is placed in tag, and ok is set to the"] - #[doc = " event success."] + #[doc = " EXPERIMENTAL API ************/\n/** Flushes the thread local cache for \\a cq.\n Returns 1 if there was contents in the cache. If there was an event\n in \\a cq tls cache, its tag is placed in tag, and ok is set to the\n event success."] pub fn grpc_completion_queue_thread_local_cache_flush( cq: *mut grpc_completion_queue, tag: *mut *mut ::std::os::raw::c_void, @@ -1769,19 +1396,13 @@ extern "C" { ) -> grpc_connectivity_state; } extern "C" { - #[doc = " Number of active \"external connectivity state watchers\" attached to a"] - #[doc = " channel."] - #[doc = " Useful for testing."] + #[doc = " Number of active \"external connectivity state watchers\" attached to a\n channel.\n Useful for testing."] pub fn grpc_channel_num_external_connectivity_watchers( channel: *mut grpc_channel, ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " Watch for a change in connectivity state."] - #[doc = "Once the channel connectivity state is different from last_observed_state,"] - #[doc = "tag will be enqueued on cq with success=1."] - #[doc = "If deadline expires BEFORE the state is changed, tag will be enqueued on cq"] - #[doc = "with success=0."] + #[doc = " Watch for a change in connectivity state.\nOnce the channel connectivity state is different from last_observed_state,\ntag will be enqueued on cq with success=1.\nIf deadline expires BEFORE the state is changed, tag will be enqueued on cq\nwith success=0."] pub fn grpc_channel_watch_connectivity_state( channel: *mut grpc_channel, last_observed_state: grpc_connectivity_state, @@ -1797,13 +1418,7 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " Create a call given a grpc_channel, in order to call 'method'. All"] - #[doc = "completions are sent to 'completion_queue'. 'method' and 'host' need only"] - #[doc = "live through the invocation of this function."] - #[doc = "If parent_call is non-NULL, it must be a server-side call. It will be used"] - #[doc = "to propagate properties from the server call to this new client call,"] - #[doc = "depending on the value of \\a propagation_mask (see propagation_bits.h for"] - #[doc = "possible values)."] + #[doc = " Create a call given a grpc_channel, in order to call 'method'. All\ncompletions are sent to 'completion_queue'. 'method' and 'host' need only\nlive through the invocation of this function.\nIf parent_call is non-NULL, it must be a server-side call. It will be used\nto propagate properties from the server call to this new client call,\ndepending on the value of \\a propagation_mask (see propagation_bits.h for\npossible values)."] pub fn grpc_channel_create_call( channel: *mut grpc_channel, parent_call: *mut grpc_call, @@ -1816,9 +1431,7 @@ extern "C" { ) -> *mut grpc_call; } extern "C" { - #[doc = " Pre-register a method/host pair on a channel."] - #[doc = "method and host are not owned and must remain alive while the channel is"] - #[doc = "alive."] + #[doc = " Pre-register a method/host pair on a channel.\nmethod and host are not owned and must remain alive while the channel is\nalive."] pub fn grpc_channel_register_call( channel: *mut grpc_channel, method: *const ::std::os::raw::c_char, @@ -1827,8 +1440,7 @@ extern "C" { ) -> *mut ::std::os::raw::c_void; } extern "C" { - #[doc = " Create a call given a handle returned from grpc_channel_register_call."] - #[doc = "\\sa grpc_channel_create_call."] + #[doc = " Create a call given a handle returned from grpc_channel_register_call.\n\\sa grpc_channel_create_call."] pub fn grpc_channel_create_registered_call( channel: *mut grpc_channel, parent_call: *mut grpc_call, @@ -1840,31 +1452,11 @@ extern "C" { ) -> *mut grpc_call; } extern "C" { - #[doc = " Allocate memory in the grpc_call arena: this memory is automatically"] - #[doc = "discarded at call completion"] + #[doc = " Allocate memory in the grpc_call arena: this memory is automatically\ndiscarded at call completion"] pub fn grpc_call_arena_alloc(call: *mut grpc_call, size: usize) -> *mut ::std::os::raw::c_void; } extern "C" { - #[doc = " Start a batch of operations defined in the array ops; when complete, post a"] - #[doc = "completion of type 'tag' to the completion queue bound to the call."] - #[doc = "The order of ops specified in the batch has no significance."] - #[doc = "Only one operation of each type can be active at once in any given"] - #[doc = "batch."] - #[doc = "If a call to grpc_call_start_batch returns GRPC_CALL_OK you must call"] - #[doc = "grpc_completion_queue_next or grpc_completion_queue_pluck on the completion"] - #[doc = "queue associated with 'call' for work to be performed. If a call to"] - #[doc = "grpc_call_start_batch returns any value other than GRPC_CALL_OK it is"] - #[doc = "guaranteed that no state associated with 'call' is changed and it is not"] - #[doc = "appropriate to call grpc_completion_queue_next or"] - #[doc = "grpc_completion_queue_pluck consequent to the failed grpc_call_start_batch"] - #[doc = "call."] - #[doc = "If a call to grpc_call_start_batch with an empty batch returns"] - #[doc = "GRPC_CALL_OK, the tag is put in the completion queue immediately."] - #[doc = "THREAD SAFETY: access to grpc_call_start_batch in multi-threaded environment"] - #[doc = "needs to be synchronized. As an optimization, you may synchronize batches"] - #[doc = "containing just send operations independently from batches containing just"] - #[doc = "receive operations. Access to grpc_call_start_batch with an empty batch is"] - #[doc = "thread-compatible."] + #[doc = " Start a batch of operations defined in the array ops; when complete, post a\ncompletion of type 'tag' to the completion queue bound to the call.\nThe order of ops specified in the batch has no significance.\nOnly one operation of each type can be active at once in any given\nbatch.\nIf a call to grpc_call_start_batch returns GRPC_CALL_OK you must call\ngrpc_completion_queue_next or grpc_completion_queue_pluck on the completion\nqueue associated with 'call' for work to be performed. If a call to\ngrpc_call_start_batch returns any value other than GRPC_CALL_OK it is\nguaranteed that no state associated with 'call' is changed and it is not\nappropriate to call grpc_completion_queue_next or\ngrpc_completion_queue_pluck consequent to the failed grpc_call_start_batch\ncall.\nIf a call to grpc_call_start_batch with an empty batch returns\nGRPC_CALL_OK, the tag is put in the completion queue immediately.\nTHREAD SAFETY: access to grpc_call_start_batch in multi-threaded environment\nneeds to be synchronized. As an optimization, you may synchronize batches\ncontaining just send operations independently from batches containing just\nreceive operations. Access to grpc_call_start_batch with an empty batch is\nthread-compatible."] pub fn grpc_call_start_batch( call: *mut grpc_call, ops: *const grpc_op, @@ -1874,14 +1466,7 @@ extern "C" { ) -> grpc_call_error; } extern "C" { - #[doc = " Returns a newly allocated string representing the endpoint to which this"] - #[doc = "call is communicating with. The string is in the uri format accepted by"] - #[doc = "grpc_channel_create."] - #[doc = "The returned string should be disposed of with gpr_free()."] - #[doc = ""] - #[doc = "WARNING: this value is never authenticated or subject to any security"] - #[doc = "related code. It must not be used for any authentication related"] - #[doc = "functionality. Instead, use grpc_auth_context."] + #[doc = " Returns a newly allocated string representing the endpoint to which this\ncall is communicating with. The string is in the uri format accepted by\ngrpc_channel_create.\nThe returned string should be disposed of with gpr_free().\n\nWARNING: this value is never authenticated or subject to any security\nrelated code. It must not be used for any authentication related\nfunctionality. Instead, use grpc_auth_context."] pub fn grpc_call_get_peer(call: *mut grpc_call) -> *mut ::std::os::raw::c_char; } #[repr(C)] @@ -1890,8 +1475,7 @@ pub struct census_context { _unused: [u8; 0], } extern "C" { - #[doc = " Set census context for a call; Must be called before first call to"] - #[doc = "grpc_call_start_batch()."] + #[doc = " Set census context for a call; Must be called before first call to\ngrpc_call_start_batch()."] pub fn grpc_census_call_set_context(call: *mut grpc_call, context: *mut census_context); } extern "C" { @@ -1899,24 +1483,18 @@ extern "C" { pub fn grpc_census_call_get_context(call: *mut grpc_call) -> *mut census_context; } extern "C" { - #[doc = " Return a newly allocated string representing the target a channel was"] - #[doc = "created for."] + #[doc = " Return a newly allocated string representing the target a channel was\ncreated for."] pub fn grpc_channel_get_target(channel: *mut grpc_channel) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " Request info about the channel."] - #[doc = "\\a channel_info indicates what information is being requested and"] - #[doc = "how that information will be returned."] - #[doc = "\\a channel_info is owned by the caller."] + #[doc = " Request info about the channel.\n\\a channel_info indicates what information is being requested and\nhow that information will be returned.\n\\a channel_info is owned by the caller."] pub fn grpc_channel_get_info( channel: *mut grpc_channel, channel_info: *const grpc_channel_info, ); } extern "C" { - #[doc = " EXPERIMENTAL. Resets the channel's connect backoff."] - #[doc = "TODO(roth): When we see whether this proves useful, either promote"] - #[doc = "to non-experimental or remove it."] + #[doc = " EXPERIMENTAL. Resets the channel's connect backoff.\nTODO(roth): When we see whether this proves useful, either promote\nto non-experimental or remove it."] pub fn grpc_channel_reset_connect_backoff(channel: *mut grpc_channel); } #[repr(C)] @@ -1925,8 +1503,7 @@ pub struct grpc_channel_credentials { _unused: [u8; 0], } extern "C" { - #[doc = " Releases a channel credentials object."] - #[doc = "The creator of the credentials object is responsible for its release."] + #[doc = " Releases a channel credentials object.\nThe creator of the credentials object is responsible for its release."] pub fn grpc_channel_credentials_release(creds: *mut grpc_channel_credentials); } #[repr(C)] @@ -1935,18 +1512,11 @@ pub struct grpc_server_credentials { _unused: [u8; 0], } extern "C" { - #[doc = " Releases a server_credentials object."] - #[doc = "The creator of the server_credentials object is responsible for its release."] + #[doc = " Releases a server_credentials object.\nThe creator of the server_credentials object is responsible for its release."] pub fn grpc_server_credentials_release(creds: *mut grpc_server_credentials); } extern "C" { - #[doc = " Creates a secure channel using the passed-in credentials. Additional"] - #[doc = "channel level configuration MAY be provided by grpc_channel_args, though"] - #[doc = "the expectation is that most clients will want to simply pass NULL. The"] - #[doc = "user data in 'args' need only live through the invocation of this function."] - #[doc = "However, if any args of the 'pointer' type are passed, then the referenced"] - #[doc = "vtable must be maintained by the caller until grpc_channel_destroy"] - #[doc = "terminates. See grpc_channel_args definition for more on this."] + #[doc = " Creates a secure channel using the passed-in credentials. Additional\nchannel level configuration MAY be provided by grpc_channel_args, though\nthe expectation is that most clients will want to simply pass NULL. The\nuser data in 'args' need only live through the invocation of this function.\nHowever, if any args of the 'pointer' type are passed, then the referenced\nvtable must be maintained by the caller until grpc_channel_destroy\nterminates. See grpc_channel_args definition for more on this."] pub fn grpc_channel_create( target: *const ::std::os::raw::c_char, creds: *mut grpc_channel_credentials, @@ -1966,26 +1536,14 @@ extern "C" { pub fn grpc_channel_destroy(channel: *mut grpc_channel); } extern "C" { - #[doc = " Cancel an RPC."] - #[doc = "Can be called multiple times, from any thread."] - #[doc = "THREAD-SAFETY grpc_call_cancel and grpc_call_cancel_with_status"] - #[doc = "are thread-safe, and can be called at any point before grpc_call_unref"] - #[doc = "is called."] + #[doc = " Cancel an RPC.\nCan be called multiple times, from any thread.\nTHREAD-SAFETY grpc_call_cancel and grpc_call_cancel_with_status\nare thread-safe, and can be called at any point before grpc_call_unref\nis called."] pub fn grpc_call_cancel( call: *mut grpc_call, reserved: *mut ::std::os::raw::c_void, ) -> grpc_call_error; } extern "C" { - #[doc = " Cancel an RPC."] - #[doc = "Can be called multiple times, from any thread."] - #[doc = "If a status has not been received for the call, set it to the status code"] - #[doc = "and description passed in."] - #[doc = "Importantly, this function does not send status nor description to the"] - #[doc = "remote endpoint."] - #[doc = "Note that \\a description doesn't need be a static string."] - #[doc = "It doesn't need to be alive after the call to"] - #[doc = "grpc_call_cancel_with_status completes."] + #[doc = " Cancel an RPC.\nCan be called multiple times, from any thread.\nIf a status has not been received for the call, set it to the status code\nand description passed in.\nImportantly, this function does not send status nor description to the\nremote endpoint.\nNote that \\a description doesn't need be a static string.\nIt doesn't need to be alive after the call to\ngrpc_call_cancel_with_status completes."] pub fn grpc_call_cancel_with_status( call: *mut grpc_call, status: grpc_status_code::Type, @@ -1997,24 +1555,15 @@ extern "C" { pub fn grpc_call_failed_before_recv_message(c: *const grpc_call) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " Ref a call."] - #[doc = "THREAD SAFETY: grpc_call_ref is thread-compatible"] + #[doc = " Ref a call.\nTHREAD SAFETY: grpc_call_ref is thread-compatible"] pub fn grpc_call_ref(call: *mut grpc_call); } extern "C" { - #[doc = " Unref a call."] - #[doc = "THREAD SAFETY: grpc_call_unref is thread-compatible"] + #[doc = " Unref a call.\nTHREAD SAFETY: grpc_call_unref is thread-compatible"] pub fn grpc_call_unref(call: *mut grpc_call); } extern "C" { - #[doc = " Request notification of a new call."] - #[doc = "Once a call is received, a notification tagged with \\a tag_new is added to"] - #[doc = "\\a cq_for_notification. \\a call, \\a details and \\a request_metadata are"] - #[doc = "updated with the appropriate call information. \\a cq_bound_to_call is bound"] - #[doc = "to \\a call, and batch operation notifications for that call will be posted"] - #[doc = "to \\a cq_bound_to_call."] - #[doc = "Note that \\a cq_for_notification must have been registered to the server via"] - #[doc = "\\a grpc_server_register_completion_queue."] + #[doc = " Request notification of a new call.\nOnce a call is received, a notification tagged with \\a tag_new is added to\n\\a cq_for_notification. \\a call, \\a details and \\a request_metadata are\nupdated with the appropriate call information. \\a cq_bound_to_call is bound\nto \\a call, and batch operation notifications for that call will be posted\nto \\a cq_bound_to_call.\nNote that \\a cq_for_notification must have been registered to the server via\n\\a grpc_server_register_completion_queue."] pub fn grpc_server_request_call( server: *mut grpc_server, call: *mut *mut grpc_call, @@ -2035,13 +1584,7 @@ pub enum grpc_server_register_method_payload_handling { GRPC_SRM_PAYLOAD_READ_INITIAL_BYTE_BUFFER = 1, } extern "C" { - #[doc = " Registers a method in the server."] - #[doc = "Methods to this (host, method) pair will not be reported by"] - #[doc = "grpc_server_request_call, but instead be reported by"] - #[doc = "grpc_server_request_registered_call when passed the appropriate"] - #[doc = "registered_method (as returned by this function)."] - #[doc = "Must be called before grpc_server_start."] - #[doc = "Returns NULL on failure."] + #[doc = " Registers a method in the server.\nMethods to this (host, method) pair will not be reported by\ngrpc_server_request_call, but instead be reported by\ngrpc_server_request_registered_call when passed the appropriate\nregistered_method (as returned by this function).\nMust be called before grpc_server_start.\nReturns NULL on failure."] pub fn grpc_server_register_method( server: *mut grpc_server, method: *const ::std::os::raw::c_char, @@ -2051,9 +1594,7 @@ extern "C" { ) -> *mut ::std::os::raw::c_void; } extern "C" { - #[doc = " Request notification of a new pre-registered call. 'cq_for_notification'"] - #[doc = "must have been registered to the server via"] - #[doc = "grpc_server_register_completion_queue."] + #[doc = " Request notification of a new pre-registered call. 'cq_for_notification'\nmust have been registered to the server via\ngrpc_server_register_completion_queue."] pub fn grpc_server_request_registered_call( server: *mut grpc_server, registered_method: *mut ::std::os::raw::c_void, @@ -2067,23 +1608,14 @@ extern "C" { ) -> grpc_call_error; } extern "C" { - #[doc = " Create a server. Additional configuration for each incoming channel can"] - #[doc = "be specified with args. If no additional configuration is needed, args can"] - #[doc = "be NULL. The user data in 'args' need only live through the invocation of"] - #[doc = "this function. However, if any args of the 'pointer' type are passed, then"] - #[doc = "the referenced vtable must be maintained by the caller until"] - #[doc = "grpc_server_destroy terminates. See grpc_channel_args definition for more"] - #[doc = "on this."] + #[doc = " Create a server. Additional configuration for each incoming channel can\nbe specified with args. If no additional configuration is needed, args can\nbe NULL. The user data in 'args' need only live through the invocation of\nthis function. However, if any args of the 'pointer' type are passed, then\nthe referenced vtable must be maintained by the caller until\ngrpc_server_destroy terminates. See grpc_channel_args definition for more\non this."] pub fn grpc_server_create( args: *const grpc_channel_args, reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_server; } extern "C" { - #[doc = " Register a completion queue with the server. Must be done for any"] - #[doc = "notification completion queue that is passed to grpc_server_request_*_call"] - #[doc = "and to grpc_server_shutdown_and_notify. Must be performed prior to"] - #[doc = "grpc_server_start."] + #[doc = " Register a completion queue with the server. Must be done for any\nnotification completion queue that is passed to grpc_server_request_*_call\nand to grpc_server_shutdown_and_notify. Must be performed prior to\ngrpc_server_start."] pub fn grpc_server_register_completion_queue( server: *mut grpc_server, cq: *mut grpc_completion_queue, @@ -2125,17 +1657,14 @@ extern "C" { pub fn grpc_server_config_fetcher_destroy(config_fetcher: *mut grpc_server_config_fetcher); } extern "C" { - #[doc = " EXPERIMENTAL. Sets the server's config fetcher. Takes ownership."] - #[doc = "Must be called before adding ports"] + #[doc = " EXPERIMENTAL. Sets the server's config fetcher. Takes ownership.\nMust be called before adding ports"] pub fn grpc_server_set_config_fetcher( server: *mut grpc_server, config_fetcher: *mut grpc_server_config_fetcher, ); } extern "C" { - #[doc = " Add a HTTP2 over an encrypted link over tcp listener."] - #[doc = "Returns bound port number on success, 0 on failure."] - #[doc = "REQUIRES: server not started"] + #[doc = " Add a HTTP2 over an encrypted link over tcp listener.\nReturns bound port number on success, 0 on failure.\nREQUIRES: server not started"] pub fn grpc_server_add_http2_port( server: *mut grpc_server, addr: *const ::std::os::raw::c_char, @@ -2147,13 +1676,7 @@ extern "C" { pub fn grpc_server_start(server: *mut grpc_server); } extern "C" { - #[doc = " Begin shutting down a server."] - #[doc = "After completion, no new calls or connections will be admitted."] - #[doc = "Existing calls will be allowed to complete."] - #[doc = "Send a GRPC_OP_COMPLETE event when there are no more calls being serviced."] - #[doc = "Shutdown is idempotent, and all tags will be notified at once if multiple"] - #[doc = "grpc_server_shutdown_and_notify calls are made. 'cq' must have been"] - #[doc = "registered to this server via grpc_server_register_completion_queue."] + #[doc = " Begin shutting down a server.\nAfter completion, no new calls or connections will be admitted.\nExisting calls will be allowed to complete.\nSend a GRPC_OP_COMPLETE event when there are no more calls being serviced.\nShutdown is idempotent, and all tags will be notified at once if multiple\ngrpc_server_shutdown_and_notify calls are made. 'cq' must have been\nregistered to this server via grpc_server_register_completion_queue."] pub fn grpc_server_shutdown_and_notify( server: *mut grpc_server, cq: *mut grpc_completion_queue, @@ -2161,26 +1684,15 @@ extern "C" { ); } extern "C" { - #[doc = " Cancel all in-progress calls."] - #[doc = "Only usable after shutdown."] + #[doc = " Cancel all in-progress calls.\nOnly usable after shutdown."] pub fn grpc_server_cancel_all_calls(server: *mut grpc_server); } extern "C" { - #[doc = " Destroy a server."] - #[doc = "Shutdown must have completed beforehand (i.e. all tags generated by"] - #[doc = "grpc_server_shutdown_and_notify must have been received, and at least"] - #[doc = "one call to grpc_server_shutdown_and_notify must have been made)."] + #[doc = " Destroy a server.\nShutdown must have completed beforehand (i.e. all tags generated by\ngrpc_server_shutdown_and_notify must have been received, and at least\none call to grpc_server_shutdown_and_notify must have been made)."] pub fn grpc_server_destroy(server: *mut grpc_server); } extern "C" { - #[doc = " Enable or disable a tracer."] - #[doc = ""] - #[doc = "Tracers (usually controlled by the environment variable GRPC_TRACE)"] - #[doc = "allow printf-style debugging on GRPC internals, and are useful for"] - #[doc = "tracking down problems in the field."] - #[doc = ""] - #[doc = "Use of this function is not strictly thread-safe, but the"] - #[doc = "thread-safety issues raised by it should not be of concern."] + #[doc = " Enable or disable a tracer.\n\nTracers (usually controlled by the environment variable GRPC_TRACE)\nallow printf-style debugging on GRPC internals, and are useful for\ntracking down problems in the field.\n\nUse of this function is not strictly thread-safe, but the\nthread-safety issues raised by it should not be of concern."] pub fn grpc_tracer_set_enabled( name: *const ::std::os::raw::c_char, enabled: ::std::os::raw::c_int, @@ -2191,8 +1703,7 @@ extern "C" { pub fn grpc_header_key_is_legal(slice: grpc_slice) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " Check whether a non-binary metadata value is legal (will be accepted by"] - #[doc = "core)"] + #[doc = " Check whether a non-binary metadata value is legal (will be accepted by\ncore)"] pub fn grpc_header_nonbin_value_is_legal(slice: grpc_slice) -> ::std::os::raw::c_int; } extern "C" { @@ -2229,8 +1740,7 @@ extern "C" { ); } extern "C" { - #[doc = " EXPERIMENTAL. Dumps xDS configs as a serialized ClientConfig proto."] - #[doc = "The full name of the proto is envoy.service.status.v3.ClientConfig."] + #[doc = " EXPERIMENTAL. Dumps xDS configs as a serialized ClientConfig proto.\nThe full name of the proto is envoy.service.status.v3.ClientConfig."] pub fn grpc_dump_xds_configs() -> grpc_slice; } extern "C" { @@ -2238,18 +1748,7 @@ extern "C" { pub fn grpc_resource_quota_arg_vtable() -> *const grpc_arg_pointer_vtable; } extern "C" { - #[doc = " CHANNELZ API *************/"] - #[doc = "churn as the feature is implemented. This comment will be removed once"] - #[doc = "channelz is officially supported, and these APIs become stable. For now"] - #[doc = "you may track the progress by following this github issue:"] - #[doc = "https://github.com/grpc/grpc/issues/15340"] - #[doc = ""] - #[doc = "the following APIs return allocated JSON strings that match the response"] - #[doc = "objects from the channelz proto, found here:"] - #[doc = "https://github.com/grpc/grpc/blob/master/src/proto/grpc/channelz/channelz.proto."] - #[doc = ""] - #[doc = "For easy conversion to protobuf, The JSON is formatted according to:"] - #[doc = "https://developers.google.com/protocol-buffers/docs/proto3#json."] + #[doc = " CHANNELZ API *************/\n/** Channelz is under active development. The following APIs will see some\nchurn as the feature is implemented. This comment will be removed once\nchannelz is officially supported, and these APIs become stable. For now\nyou may track the progress by following this github issue:\nhttps://github.com/grpc/grpc/issues/15340\n\nthe following APIs return allocated JSON strings that match the response\nobjects from the channelz proto, found here:\nhttps://github.com/grpc/grpc/blob/master/src/proto/grpc/channelz/channelz.proto.\n\nFor easy conversion to protobuf, The JSON is formatted according to:\nhttps://developers.google.com/protocol-buffers/docs/proto3#json."] pub fn grpc_channelz_get_top_channels(start_channel_id: isize) -> *mut ::std::os::raw::c_char; } extern "C" { @@ -2275,9 +1774,7 @@ extern "C" { pub fn grpc_channelz_get_socket(socket_id: isize) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " EXPERIMENTAL - Subject to change."] - #[doc = " Fetch a vtable for grpc_channel_arg that points to"] - #[doc = " grpc_authorization_policy_provider."] + #[doc = " EXPERIMENTAL - Subject to change.\n Fetch a vtable for grpc_channel_arg that points to\n grpc_authorization_policy_provider."] pub fn grpc_authorization_policy_provider_arg_vtable() -> *const grpc_arg_pointer_vtable; } extern "C" { @@ -2289,10 +1786,7 @@ extern "C" { ) -> *mut grpc_channel; } extern "C" { - #[doc = " Create a secure channel to 'target' using file descriptor 'fd' and passed-in"] - #[doc = "credentials. The 'target' argument will be used to indicate the name for"] - #[doc = "this channel. Note that this API currently only supports insecure channel"] - #[doc = "credentials. Using other types of credentials will result in a failure."] + #[doc = " Create a secure channel to 'target' using file descriptor 'fd' and passed-in\ncredentials. The 'target' argument will be used to indicate the name for\nthis channel. Note that this API currently only supports insecure channel\ncredentials. Using other types of credentials will result in a failure."] pub fn grpc_channel_create_from_fd( target: *const ::std::os::raw::c_char, fd: ::std::os::raw::c_int, @@ -2301,15 +1795,7 @@ extern "C" { ) -> *mut grpc_channel; } extern "C" { - #[doc = " Add the connected secure communication channel based on file descriptor 'fd'"] - #[doc = "to the 'server' and server credentials 'creds'. The 'fd' must be an open file"] - #[doc = "descriptor corresponding to a connected socket. Events from the file"] - #[doc = "descriptor may come on any of the server completion queues (i.e completion"] - #[doc = "queues registered via the grpc_server_register_completion_queue API)."] - #[doc = "Note that this API currently only supports inseure server credentials"] - #[doc = "Using other types of credentials will result in a failure."] - #[doc = "TODO(hork): add channel_args to this API to allow endpoints and transports"] - #[doc = "created in this function to participate in the resource quota feature."] + #[doc = " Add the connected secure communication channel based on file descriptor 'fd'\nto the 'server' and server credentials 'creds'. The 'fd' must be an open file\ndescriptor corresponding to a connected socket. Events from the file\ndescriptor may come on any of the server completion queues (i.e completion\nqueues registered via the grpc_server_register_completion_queue API).\nNote that this API currently only supports inseure server credentials\nUsing other types of credentials will result in a failure.\nTODO(hork): add channel_args to this API to allow endpoints and transports\ncreated in this function to participate in the resource quota feature."] pub fn grpc_server_add_channel_from_fd( server: *mut grpc_server, fd: ::std::os::raw::c_int, @@ -2336,51 +1822,15 @@ pub enum grpc_ssl_certificate_config_reload_status { #[repr(u32)] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum grpc_ssl_client_certificate_request_type { - #[doc = " Server does not request client certificate."] - #[doc = "The certificate presented by the client is not checked by the server at"] - #[doc = "all. (A client may present a self signed or signed certificate or not"] - #[doc = "present a certificate at all and any of those option would be accepted)"] + #[doc = " Server does not request client certificate.\nThe certificate presented by the client is not checked by the server at\nall. (A client may present a self signed or signed certificate or not\npresent a certificate at all and any of those option would be accepted)"] GRPC_SSL_DONT_REQUEST_CLIENT_CERTIFICATE = 0, - #[doc = " Server requests client certificate but does not enforce that the client"] - #[doc = "presents a certificate."] - #[doc = ""] - #[doc = "If the client presents a certificate, the client authentication is left to"] - #[doc = "the application (the necessary metadata will be available to the"] - #[doc = "application via authentication context properties, see grpc_auth_context)."] - #[doc = ""] - #[doc = "The client's key certificate pair must be valid for the SSL connection to"] - #[doc = "be established."] + #[doc = " Server requests client certificate but does not enforce that the client\npresents a certificate.\n\nIf the client presents a certificate, the client authentication is left to\nthe application (the necessary metadata will be available to the\napplication via authentication context properties, see grpc_auth_context).\n\nThe client's key certificate pair must be valid for the SSL connection to\nbe established."] GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY = 1, - #[doc = " Server requests client certificate but does not enforce that the client"] - #[doc = "presents a certificate."] - #[doc = ""] - #[doc = "If the client presents a certificate, the client authentication is done by"] - #[doc = "the gRPC framework. (For a successful connection the client needs to either"] - #[doc = "present a certificate that can be verified against the root certificate"] - #[doc = "configured by the server or not present a certificate at all)"] - #[doc = ""] - #[doc = "The client's key certificate pair must be valid for the SSL connection to"] - #[doc = "be established."] + #[doc = " Server requests client certificate but does not enforce that the client\npresents a certificate.\n\nIf the client presents a certificate, the client authentication is done by\nthe gRPC framework. (For a successful connection the client needs to either\npresent a certificate that can be verified against the root certificate\nconfigured by the server or not present a certificate at all)\n\nThe client's key certificate pair must be valid for the SSL connection to\nbe established."] GRPC_SSL_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY = 2, - #[doc = " Server requests client certificate and enforces that the client presents a"] - #[doc = "certificate."] - #[doc = ""] - #[doc = "If the client presents a certificate, the client authentication is left to"] - #[doc = "the application (the necessary metadata will be available to the"] - #[doc = "application via authentication context properties, see grpc_auth_context)."] - #[doc = ""] - #[doc = "The client's key certificate pair must be valid for the SSL connection to"] - #[doc = "be established."] + #[doc = " Server requests client certificate and enforces that the client presents a\ncertificate.\n\nIf the client presents a certificate, the client authentication is left to\nthe application (the necessary metadata will be available to the\napplication via authentication context properties, see grpc_auth_context).\n\nThe client's key certificate pair must be valid for the SSL connection to\nbe established."] GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY = 3, - #[doc = " Server requests client certificate and enforces that the client presents a"] - #[doc = "certificate."] - #[doc = ""] - #[doc = "The certificate presented by the client is verified by the gRPC framework."] - #[doc = "(For a successful connection the client needs to present a certificate that"] - #[doc = "can be verified against the root certificate configured by the server)"] - #[doc = ""] - #[doc = "The client's key certificate pair must be valid for the SSL connection to"] - #[doc = "be established."] + #[doc = " Server requests client certificate and enforces that the client presents a\ncertificate.\n\nThe certificate presented by the client is verified by the gRPC framework.\n(For a successful connection the client needs to present a certificate that\ncan be verified against the root certificate configured by the server)\n\nThe client's key certificate pair must be valid for the SSL connection to\nbe established."] GRPC_SSL_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY = 4, } impl grpc_security_level { @@ -2398,8 +1848,7 @@ pub enum grpc_security_level { GRPC_PRIVACY_AND_INTEGRITY = 2, } #[repr(u32)] -#[doc = " Type of local connections for which local channel/server credentials will be"] -#[doc = " applied. It supports UDS and local TCP connections."] +#[doc = " Type of local connections for which local channel/server credentials will be\n applied. It supports UDS and local TCP connections."] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum grpc_local_connect_type { UDS = 0, @@ -2445,23 +1894,20 @@ extern "C" { ) -> grpc_auth_property_iterator; } extern "C" { - #[doc = " Gets the peer identity. Returns an empty iterator (first _next will return"] - #[doc = "NULL) if the peer is not authenticated."] + #[doc = " Gets the peer identity. Returns an empty iterator (first _next will return\nNULL) if the peer is not authenticated."] pub fn grpc_auth_context_peer_identity( ctx: *const grpc_auth_context, ) -> grpc_auth_property_iterator; } extern "C" { - #[doc = " Finds a property in the context. May return an empty iterator (first _next"] - #[doc = "will return NULL) if no property with this name was found in the context."] + #[doc = " Finds a property in the context. May return an empty iterator (first _next\nwill return NULL) if no property with this name was found in the context."] pub fn grpc_auth_context_find_properties_by_name( ctx: *const grpc_auth_context, name: *const ::std::os::raw::c_char, ) -> grpc_auth_property_iterator; } extern "C" { - #[doc = " Gets the name of the property that indicates the peer identity. Will return"] - #[doc = "NULL if the peer is not authenticated."] + #[doc = " Gets the name of the property that indicates the peer identity. Will return\nNULL if the peer is not authenticated."] pub fn grpc_auth_context_peer_identity_property_name( ctx: *const grpc_auth_context, ) -> *const ::std::os::raw::c_char; @@ -2473,8 +1919,7 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " Gets the auth context from the call. Caller needs to call"] - #[doc = "grpc_auth_context_release on the returned context."] + #[doc = " Gets the auth context from the call. Caller needs to call\ngrpc_auth_context_release on the returned context."] pub fn grpc_call_auth_context(call: *mut grpc_call) -> *mut grpc_auth_context; } extern "C" { @@ -2499,8 +1944,7 @@ extern "C" { ); } extern "C" { - #[doc = " Sets the property name. Returns 1 if successful or 0 in case of failure"] - #[doc = "(which means that no property with this name exists)."] + #[doc = " Sets the property name. Returns 1 if successful or 0 in case of failure\n(which means that no property with this name exists)."] pub fn grpc_auth_context_set_peer_identity_property_name( ctx: *mut grpc_auth_context, name: *const ::std::os::raw::c_char, @@ -2512,8 +1956,7 @@ pub struct grpc_ssl_session_cache { _unused: [u8; 0], } extern "C" { - #[doc = " Create LRU cache for client-side SSL sessions with the given capacity."] - #[doc = "If capacity is < 1, a default capacity is used instead."] + #[doc = " Create LRU cache for client-side SSL sessions with the given capacity.\nIf capacity is < 1, a default capacity is used instead."] pub fn grpc_ssl_session_cache_create_lru(capacity: usize) -> *mut grpc_ssl_session_cache; } extern "C" { @@ -2532,74 +1975,39 @@ pub struct grpc_call_credentials { _unused: [u8; 0], } extern "C" { - #[doc = " Releases a call credentials object."] - #[doc = "The creator of the credentials object is responsible for its release."] + #[doc = " Releases a call credentials object.\nThe creator of the credentials object is responsible for its release."] pub fn grpc_call_credentials_release(creds: *mut grpc_call_credentials); } extern "C" { - #[doc = " Creates default credentials to connect to a google gRPC service."] - #[doc = "WARNING: Do NOT use this credentials to connect to a non-google service as"] - #[doc = "this could result in an oauth2 token leak. The security level of the"] - #[doc = "resulting connection is GRPC_PRIVACY_AND_INTEGRITY."] - #[doc = ""] - #[doc = "If specified, the supplied call credentials object will be attached to the"] - #[doc = "returned channel credentials object. The call_credentials object must remain"] - #[doc = "valid throughout the lifetime of the returned grpc_channel_credentials"] - #[doc = "object. It is expected that the call credentials object was generated"] - #[doc = "according to the Application Default Credentials mechanism and asserts the"] - #[doc = "identity of the default service account of the machine. Supplying any other"] - #[doc = "sort of call credential will result in undefined behavior, up to and"] - #[doc = "including the sudden and unexpected failure of RPCs."] - #[doc = ""] - #[doc = "If nullptr is supplied, the returned channel credentials object will use a"] - #[doc = "call credentials object based on the Application Default Credentials"] - #[doc = "mechanism."] + #[doc = " Creates default credentials to connect to a google gRPC service.\nWARNING: Do NOT use this credentials to connect to a non-google service as\nthis could result in an oauth2 token leak. The security level of the\nresulting connection is GRPC_PRIVACY_AND_INTEGRITY.\n\nIf specified, the supplied call credentials object will be attached to the\nreturned channel credentials object. The call_credentials object must remain\nvalid throughout the lifetime of the returned grpc_channel_credentials\nobject. It is expected that the call credentials object was generated\naccording to the Application Default Credentials mechanism and asserts the\nidentity of the default service account of the machine. Supplying any other\nsort of call credential will result in undefined behavior, up to and\nincluding the sudden and unexpected failure of RPCs.\n\nIf nullptr is supplied, the returned channel credentials object will use a\ncall credentials object based on the Application Default Credentials\nmechanism."] pub fn grpc_google_default_credentials_create( call_credentials: *mut grpc_call_credentials, ) -> *mut grpc_channel_credentials; } -#[doc = " Callback for getting the SSL roots override from the application."] -#[doc = "In case of success, *pem_roots_certs must be set to a NULL terminated string"] -#[doc = "containing the list of PEM encoded root certificates. The ownership is passed"] -#[doc = "to the core and freed (laster by the core) with gpr_free."] -#[doc = "If this function fails and GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment is"] -#[doc = "set to a valid path, it will override the roots specified this func"] +#[doc = " Callback for getting the SSL roots override from the application.\nIn case of success, *pem_roots_certs must be set to a NULL terminated string\ncontaining the list of PEM encoded root certificates. The ownership is passed\nto the core and freed (laster by the core) with gpr_free.\nIf this function fails and GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment is\nset to a valid path, it will override the roots specified this func"] pub type grpc_ssl_roots_override_callback = ::std::option::Option< unsafe extern "C" fn( pem_root_certs: *mut *mut ::std::os::raw::c_char, ) -> grpc_ssl_roots_override_result, >; extern "C" { - #[doc = " Setup a callback to override the default TLS/SSL roots."] - #[doc = "This function is not thread-safe and must be called at initialization time"] - #[doc = "before any ssl credentials are created to have the desired side effect."] - #[doc = "If GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment is set to a valid path, the"] - #[doc = "callback will not be called."] + #[doc = " Setup a callback to override the default TLS/SSL roots.\nThis function is not thread-safe and must be called at initialization time\nbefore any ssl credentials are created to have the desired side effect.\nIf GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment is set to a valid path, the\ncallback will not be called."] pub fn grpc_set_ssl_roots_override_callback(cb: grpc_ssl_roots_override_callback); } #[doc = " Object that holds a private key / certificate chain pair in PEM format."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_ssl_pem_key_cert_pair { - #[doc = " private_key is the NULL-terminated string containing the PEM encoding of"] - #[doc = "the client's private key."] + #[doc = " private_key is the NULL-terminated string containing the PEM encoding of\nthe client's private key."] pub private_key: *const ::std::os::raw::c_char, - #[doc = " cert_chain is the NULL-terminated string containing the PEM encoding of"] - #[doc = "the client's certificate chain."] + #[doc = " cert_chain is the NULL-terminated string containing the PEM encoding of\nthe client's certificate chain."] pub cert_chain: *const ::std::os::raw::c_char, } -#[doc = " Deprecated in favor of grpc_ssl_verify_peer_options. It will be removed"] -#[doc = "after all of its call sites are migrated to grpc_ssl_verify_peer_options."] -#[doc = "Object that holds additional peer-verification options on a secure"] -#[doc = "channel."] +#[doc = " Deprecated in favor of grpc_ssl_verify_peer_options. It will be removed\nafter all of its call sites are migrated to grpc_ssl_verify_peer_options.\nObject that holds additional peer-verification options on a secure\nchannel."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct verify_peer_options { - #[doc = " If non-NULL this callback will be invoked with the expected"] - #[doc = "target_name, the peer's certificate (in PEM format), and whatever"] - #[doc = "userdata pointer is set below. If a non-zero value is returned by this"] - #[doc = "callback then it is treated as a verification failure. Invocation of"] - #[doc = "the callback is blocking, so any implementation should be light-weight."] + #[doc = " If non-NULL this callback will be invoked with the expected\ntarget_name, the peer's certificate (in PEM format), and whatever\nuserdata pointer is set below. If a non-zero value is returned by this\ncallback then it is treated as a verification failure. Invocation of\nthe callback is blocking, so any implementation should be light-weight."] pub verify_peer_callback: ::std::option::Option< unsafe extern "C" fn( target_name: *const ::std::os::raw::c_char, @@ -2607,25 +2015,17 @@ pub struct verify_peer_options { userdata: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >, - #[doc = " Arbitrary userdata that will be passed as the last argument to"] - #[doc = "verify_peer_callback."] + #[doc = " Arbitrary userdata that will be passed as the last argument to\nverify_peer_callback."] pub verify_peer_callback_userdata: *mut ::std::os::raw::c_void, - #[doc = " A destruct callback that will be invoked when the channel is being"] - #[doc = "cleaned up. The userdata argument will be passed to it. The intent is"] - #[doc = "to perform any cleanup associated with that userdata."] + #[doc = " A destruct callback that will be invoked when the channel is being\ncleaned up. The userdata argument will be passed to it. The intent is\nto perform any cleanup associated with that userdata."] pub verify_peer_destruct: ::std::option::Option, } -#[doc = " Object that holds additional peer-verification options on a secure"] -#[doc = "channel."] +#[doc = " Object that holds additional peer-verification options on a secure\nchannel."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_ssl_verify_peer_options { - #[doc = " If non-NULL this callback will be invoked with the expected"] - #[doc = "target_name, the peer's certificate (in PEM format), and whatever"] - #[doc = "userdata pointer is set below. If a non-zero value is returned by this"] - #[doc = "callback then it is treated as a verification failure. Invocation of"] - #[doc = "the callback is blocking, so any implementation should be light-weight."] + #[doc = " If non-NULL this callback will be invoked with the expected\ntarget_name, the peer's certificate (in PEM format), and whatever\nuserdata pointer is set below. If a non-zero value is returned by this\ncallback then it is treated as a verification failure. Invocation of\nthe callback is blocking, so any implementation should be light-weight."] pub verify_peer_callback: ::std::option::Option< unsafe extern "C" fn( target_name: *const ::std::os::raw::c_char, @@ -2633,46 +2033,14 @@ pub struct grpc_ssl_verify_peer_options { userdata: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >, - #[doc = " Arbitrary userdata that will be passed as the last argument to"] - #[doc = "verify_peer_callback."] + #[doc = " Arbitrary userdata that will be passed as the last argument to\nverify_peer_callback."] pub verify_peer_callback_userdata: *mut ::std::os::raw::c_void, - #[doc = " A destruct callback that will be invoked when the channel is being"] - #[doc = "cleaned up. The userdata argument will be passed to it. The intent is"] - #[doc = "to perform any cleanup associated with that userdata."] + #[doc = " A destruct callback that will be invoked when the channel is being\ncleaned up. The userdata argument will be passed to it. The intent is\nto perform any cleanup associated with that userdata."] pub verify_peer_destruct: ::std::option::Option, } extern "C" { - #[doc = " Deprecated in favor of grpc_ssl_server_credentials_create_ex. It will be"] - #[doc = "removed after all of its call sites are migrated to"] - #[doc = "grpc_ssl_server_credentials_create_ex. Creates an SSL credentials object."] - #[doc = "The security level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY."] - #[doc = "- pem_root_certs is the NULL-terminated string containing the PEM encoding"] - #[doc = "of the server root certificates. If this parameter is NULL, the"] - #[doc = "implementation will first try to dereference the file pointed by the"] - #[doc = "GRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment variable, and if that fails,"] - #[doc = "try to get the roots set by grpc_override_ssl_default_roots. Eventually,"] - #[doc = "if all these fail, it will try to get the roots from a well-known place on"] - #[doc = "disk (in the grpc install directory)."] - #[doc = ""] - #[doc = "gRPC has implemented root cache if the underlying OpenSSL library supports"] - #[doc = "it. The gRPC root certificates cache is only applicable on the default"] - #[doc = "root certificates, which is used when this parameter is nullptr. If user"] - #[doc = "provides their own pem_root_certs, when creating an SSL credential object,"] - #[doc = "gRPC would not be able to cache it, and each subchannel will generate a"] - #[doc = "copy of the root store. So it is recommended to avoid providing large room"] - #[doc = "pem with pem_root_certs parameter to avoid excessive memory consumption,"] - #[doc = "particularly on mobile platforms such as iOS."] - #[doc = "- pem_key_cert_pair is a pointer on the object containing client's private"] - #[doc = "key and certificate chain. This parameter can be NULL if the client does"] - #[doc = "not have such a key/cert pair."] - #[doc = "- verify_options is an optional verify_peer_options object which holds"] - #[doc = "additional options controlling how peer certificates are verified. For"] - #[doc = "example, you can supply a callback which receives the peer's certificate"] - #[doc = "with which you can do additional verification. Can be NULL, in which"] - #[doc = "case verification will retain default behavior. Any settings in"] - #[doc = "verify_options are copied during this call, so the verify_options"] - #[doc = "object can be released afterwards."] + #[doc = " Deprecated in favor of grpc_ssl_server_credentials_create_ex. It will be\nremoved after all of its call sites are migrated to\ngrpc_ssl_server_credentials_create_ex. Creates an SSL credentials object.\nThe security level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY.\n- pem_root_certs is the NULL-terminated string containing the PEM encoding\nof the server root certificates. If this parameter is NULL, the\nimplementation will first try to dereference the file pointed by the\nGRPC_DEFAULT_SSL_ROOTS_FILE_PATH environment variable, and if that fails,\ntry to get the roots set by grpc_override_ssl_default_roots. Eventually,\nif all these fail, it will try to get the roots from a well-known place on\ndisk (in the grpc install directory).\n\ngRPC has implemented root cache if the underlying OpenSSL library supports\nit. The gRPC root certificates cache is only applicable on the default\nroot certificates, which is used when this parameter is nullptr. If user\nprovides their own pem_root_certs, when creating an SSL credential object,\ngRPC would not be able to cache it, and each subchannel will generate a\ncopy of the root store. So it is recommended to avoid providing large room\npem with pem_root_certs parameter to avoid excessive memory consumption,\nparticularly on mobile platforms such as iOS.\n- pem_key_cert_pair is a pointer on the object containing client's private\nkey and certificate chain. This parameter can be NULL if the client does\nnot have such a key/cert pair.\n- verify_options is an optional verify_peer_options object which holds\nadditional options controlling how peer certificates are verified. For\nexample, you can supply a callback which receives the peer's certificate\nwith which you can do additional verification. Can be NULL, in which\ncase verification will retain default behavior. Any settings in\nverify_options are copied during this call, so the verify_options\nobject can be released afterwards."] pub fn grpc_ssl_credentials_create( pem_root_certs: *const ::std::os::raw::c_char, pem_key_cert_pair: *mut grpc_ssl_pem_key_cert_pair, @@ -2689,8 +2057,7 @@ extern "C" { ) -> *mut grpc_channel_credentials; } extern "C" { - #[doc = " Creates a composite channel credentials object. The security level of"] - #[doc = " resulting connection is determined by channel_creds."] + #[doc = " Creates a composite channel credentials object. The security level of\n resulting connection is determined by channel_creds."] pub fn grpc_composite_channel_credentials_create( channel_creds: *mut grpc_channel_credentials, call_creds: *mut grpc_call_credentials, @@ -2706,9 +2073,7 @@ extern "C" { ) -> *mut grpc_call_credentials; } extern "C" { - #[doc = " Creates a compute engine credentials object for connecting to Google."] - #[doc = "WARNING: Do NOT use this credentials to connect to a non-google service as"] - #[doc = "this could result in an oauth2 token leak."] + #[doc = " Creates a compute engine credentials object for connecting to Google.\nWARNING: Do NOT use this credentials to connect to a non-google service as\nthis could result in an oauth2 token leak."] pub fn grpc_google_compute_engine_credentials_create( reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_call_credentials; @@ -2717,11 +2082,7 @@ extern "C" { pub fn grpc_max_auth_token_lifetime() -> gpr_timespec; } extern "C" { - #[doc = " Creates a JWT credentials object. May return NULL if the input is invalid."] - #[doc = "- json_key is the JSON key string containing the client's private key."] - #[doc = "- token_lifetime is the lifetime of each Json Web Token (JWT) created with"] - #[doc = "this credentials. It should not exceed grpc_max_auth_token_lifetime or"] - #[doc = "will be cropped to this value."] + #[doc = " Creates a JWT credentials object. May return NULL if the input is invalid.\n- json_key is the JSON key string containing the client's private key.\n- token_lifetime is the lifetime of each Json Web Token (JWT) created with\nthis credentials. It should not exceed grpc_max_auth_token_lifetime or\nwill be cropped to this value."] pub fn grpc_service_account_jwt_access_credentials_create( json_key: *const ::std::os::raw::c_char, token_lifetime: gpr_timespec, @@ -2729,31 +2090,21 @@ extern "C" { ) -> *mut grpc_call_credentials; } extern "C" { - #[doc = " Builds External Account credentials."] - #[doc = "- json_string is the JSON string containing the credentials options."] - #[doc = "- scopes_string contains the scopes to be binded with the credentials."] - #[doc = "This API is used for experimental purposes for now and may change in the"] - #[doc = "future."] + #[doc = " Builds External Account credentials.\n- json_string is the JSON string containing the credentials options.\n- scopes_string contains the scopes to be binded with the credentials.\nThis API is used for experimental purposes for now and may change in the\nfuture."] pub fn grpc_external_account_credentials_create( json_string: *const ::std::os::raw::c_char, scopes_string: *const ::std::os::raw::c_char, ) -> *mut grpc_call_credentials; } extern "C" { - #[doc = " Creates an Oauth2 Refresh Token credentials object for connecting to Google."] - #[doc = "May return NULL if the input is invalid."] - #[doc = "WARNING: Do NOT use this credentials to connect to a non-google service as"] - #[doc = "this could result in an oauth2 token leak."] - #[doc = "- json_refresh_token is the JSON string containing the refresh token itself"] - #[doc = "along with a client_id and client_secret."] + #[doc = " Creates an Oauth2 Refresh Token credentials object for connecting to Google.\nMay return NULL if the input is invalid.\nWARNING: Do NOT use this credentials to connect to a non-google service as\nthis could result in an oauth2 token leak.\n- json_refresh_token is the JSON string containing the refresh token itself\nalong with a client_id and client_secret."] pub fn grpc_google_refresh_token_credentials_create( json_refresh_token: *const ::std::os::raw::c_char, reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_call_credentials; } extern "C" { - #[doc = " Creates an Oauth2 Access Token credentials with an access token that was"] - #[doc = "acquired by an out of band mechanism."] + #[doc = " Creates an Oauth2 Access Token credentials with an access token that was\nacquired by an out of band mechanism."] pub fn grpc_access_token_credentials_create( access_token: *const ::std::os::raw::c_char, reserved: *mut ::std::os::raw::c_void, @@ -2767,12 +2118,7 @@ extern "C" { reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_call_credentials; } -#[doc = " Options for creating STS Oauth Token Exchange credentials following the IETF"] -#[doc = "draft https://tools.ietf.org/html/draft-ietf-oauth-token-exchange-16."] -#[doc = "Optional fields may be set to NULL or empty string. It is the responsibility"] -#[doc = "of the caller to ensure that the subject and actor tokens are refreshed on"] -#[doc = "disk at the specified paths. This API is used for experimental purposes for"] -#[doc = "now and may change in the future."] +#[doc = " Options for creating STS Oauth Token Exchange credentials following the IETF\ndraft https://tools.ietf.org/html/draft-ietf-oauth-token-exchange-16.\nOptional fields may be set to NULL or empty string. It is the responsibility\nof the caller to ensure that the subject and actor tokens are refreshed on\ndisk at the specified paths. This API is used for experimental purposes for\nnow and may change in the future."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_sts_credentials_options { @@ -2787,26 +2133,13 @@ pub struct grpc_sts_credentials_options { pub actor_token_type: *const ::std::os::raw::c_char, } extern "C" { - #[doc = " Creates an STS credentials following the STS Token Exchanged specifed in the"] - #[doc = "IETF draft https://tools.ietf.org/html/draft-ietf-oauth-token-exchange-16."] - #[doc = "This API is used for experimental purposes for now and may change in the"] - #[doc = "future."] + #[doc = " Creates an STS credentials following the STS Token Exchanged specifed in the\nIETF draft https://tools.ietf.org/html/draft-ietf-oauth-token-exchange-16.\nThis API is used for experimental purposes for now and may change in the\nfuture."] pub fn grpc_sts_credentials_create( options: *const grpc_sts_credentials_options, reserved: *mut ::std::os::raw::c_void, ) -> *mut grpc_call_credentials; } -#[doc = " Callback function to be called by the metadata credentials plugin"] -#[doc = "implementation when the metadata is ready."] -#[doc = "- user_data is the opaque pointer that was passed in the get_metadata method"] -#[doc = "of the grpc_metadata_credentials_plugin (see below)."] -#[doc = "- creds_md is an array of credentials metadata produced by the plugin. It"] -#[doc = "may be set to NULL in case of an error."] -#[doc = "- num_creds_md is the number of items in the creds_md array."] -#[doc = "- status must be GRPC_STATUS_OK in case of success or another specific error"] -#[doc = "code otherwise."] -#[doc = "- error_details contains details about the error if any. In case of success"] -#[doc = "it should be NULL and will be otherwise ignored."] +#[doc = " Callback function to be called by the metadata credentials plugin\nimplementation when the metadata is ready.\n- user_data is the opaque pointer that was passed in the get_metadata method\nof the grpc_metadata_credentials_plugin (see below).\n- creds_md is an array of credentials metadata produced by the plugin. It\nmay be set to NULL in case of an error.\n- num_creds_md is the number of items in the creds_md array.\n- status must be GRPC_STATUS_OK in case of success or another specific error\ncode otherwise.\n- error_details contains details about the error if any. In case of success\nit should be NULL and will be otherwise ignored."] pub type grpc_credentials_plugin_metadata_cb = ::std::option::Option< unsafe extern "C" fn( user_data: *mut ::std::os::raw::c_void, @@ -2816,16 +2149,13 @@ pub type grpc_credentials_plugin_metadata_cb = ::std::option::Option< error_details: *const ::std::os::raw::c_char, ), >; -#[doc = " Context that can be used by metadata credentials plugin in order to create"] -#[doc = "auth related metadata."] +#[doc = " Context that can be used by metadata credentials plugin in order to create\nauth related metadata."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_auth_metadata_context { #[doc = " The fully qualifed service url."] pub service_url: *const ::std::os::raw::c_char, - #[doc = " The method name of the RPC being called (not fully qualified)."] - #[doc = "The fully qualified method name can be built from the service_url:"] - #[doc = "full_qualified_method_name = ctx->service_url + '/' + ctx->method_name."] + #[doc = " The method name of the RPC being called (not fully qualified).\nThe fully qualified method name can be built from the service_url:\nfull_qualified_method_name = ctx->service_url + '/' + ctx->method_name."] pub method_name: *const ::std::os::raw::c_char, #[doc = " The auth_context of the channel which gives the server's identity."] pub channel_auth_context: *const grpc_auth_context, @@ -2843,32 +2173,11 @@ extern "C" { #[doc = " Releases internal resources held by \\a context."] pub fn grpc_auth_metadata_context_reset(context: *mut grpc_auth_metadata_context); } -#[doc = " grpc_metadata_credentials plugin is an API user provided structure used to"] -#[doc = "create grpc_credentials objects that can be set on a channel (composed) or"] -#[doc = "a call. See grpc_credentials_metadata_create_from_plugin below."] -#[doc = "The grpc client stack will call the get_metadata method of the plugin for"] -#[doc = "every call in scope for the credentials created from it."] +#[doc = " grpc_metadata_credentials plugin is an API user provided structure used to\ncreate grpc_credentials objects that can be set on a channel (composed) or\na call. See grpc_credentials_metadata_create_from_plugin below.\nThe grpc client stack will call the get_metadata method of the plugin for\nevery call in scope for the credentials created from it."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_metadata_credentials_plugin { - #[doc = " The implementation of this method has to be non-blocking, but can"] - #[doc = "be performed synchronously or asynchronously."] - #[doc = ""] - #[doc = "If processing occurs synchronously, returns non-zero and populates"] - #[doc = "creds_md, num_creds_md, status, and error_details. In this case,"] - #[doc = "the caller takes ownership of the entries in creds_md and of"] - #[doc = "error_details. Note that if the plugin needs to return more than"] - #[doc = "GRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX entries in creds_md, it must"] - #[doc = "return asynchronously."] - #[doc = ""] - #[doc = "If processing occurs asynchronously, returns zero and invokes \\a cb"] - #[doc = "when processing is completed. \\a user_data will be passed as the"] - #[doc = "first parameter of the callback. NOTE: \\a cb MUST be invoked in a"] - #[doc = "different thread, not from the thread in which \\a get_metadata() is"] - #[doc = "invoked."] - #[doc = ""] - #[doc = "\\a context is the information that can be used by the plugin to create"] - #[doc = "auth metadata."] + #[doc = " The implementation of this method has to be non-blocking, but can\nbe performed synchronously or asynchronously.\n\nIf processing occurs synchronously, returns non-zero and populates\ncreds_md, num_creds_md, status, and error_details. In this case,\nthe caller takes ownership of the entries in creds_md and of\nerror_details. Note that if the plugin needs to return more than\nGRPC_METADATA_CREDENTIALS_PLUGIN_SYNC_MAX entries in creds_md, it must\nreturn asynchronously.\n\nIf processing occurs asynchronously, returns zero and invokes \\a cb\nwhen processing is completed. \\a user_data will be passed as the\nfirst parameter of the callback. NOTE: \\a cb MUST be invoked in a\ndifferent thread, not from the thread in which \\a get_metadata() is\ninvoked.\n\n\\a context is the information that can be used by the plugin to create\nauth metadata."] pub get_metadata: ::std::option::Option< unsafe extern "C" fn( state: *mut ::std::os::raw::c_void, @@ -2881,8 +2190,7 @@ pub struct grpc_metadata_credentials_plugin { error_details: *mut *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_int, >, - #[doc = " Implements debug string of the given plugin. This method returns an"] - #[doc = " allocated string that the caller needs to free using gpr_free()"] + #[doc = " Implements debug string of the given plugin. This method returns an\n allocated string that the caller needs to free using gpr_free()"] pub debug_string: ::std::option::Option< unsafe extern "C" fn(state: *mut ::std::os::raw::c_void) -> *mut ::std::os::raw::c_char, >, @@ -2894,8 +2202,7 @@ pub struct grpc_metadata_credentials_plugin { pub type_: *const ::std::os::raw::c_char, } extern "C" { - #[doc = " Creates a credentials object from a plugin with a specified minimum security"] - #[doc = " level."] + #[doc = " Creates a credentials object from a plugin with a specified minimum security\n level."] pub fn grpc_metadata_credentials_create_from_plugin( plugin: grpc_metadata_credentials_plugin, min_security_level: grpc_security_level, @@ -2908,16 +2215,7 @@ pub struct grpc_ssl_server_certificate_config { _unused: [u8; 0], } extern "C" { - #[doc = " Creates a grpc_ssl_server_certificate_config object."] - #[doc = "- pem_roots_cert is the NULL-terminated string containing the PEM encoding of"] - #[doc = "the client root certificates. This parameter may be NULL if the server does"] - #[doc = "not want the client to be authenticated with SSL."] - #[doc = "- pem_key_cert_pairs is an array private key / certificate chains of the"] - #[doc = "server. This parameter cannot be NULL."] - #[doc = "- num_key_cert_pairs indicates the number of items in the private_key_files"] - #[doc = "and cert_chain_files parameters. It must be at least 1."] - #[doc = "- It is the caller's responsibility to free this object via"] - #[doc = "grpc_ssl_server_certificate_config_destroy()."] + #[doc = " Creates a grpc_ssl_server_certificate_config object.\n- pem_roots_cert is the NULL-terminated string containing the PEM encoding of\nthe client root certificates. This parameter may be NULL if the server does\nnot want the client to be authenticated with SSL.\n- pem_key_cert_pairs is an array private key / certificate chains of the\nserver. This parameter cannot be NULL.\n- num_key_cert_pairs indicates the number of items in the private_key_files\nand cert_chain_files parameters. It must be at least 1.\n- It is the caller's responsibility to free this object via\ngrpc_ssl_server_certificate_config_destroy()."] pub fn grpc_ssl_server_certificate_config_create( pem_root_certs: *const ::std::os::raw::c_char, pem_key_cert_pairs: *const grpc_ssl_pem_key_cert_pair, @@ -2930,12 +2228,7 @@ extern "C" { config: *mut grpc_ssl_server_certificate_config, ); } -#[doc = " Callback to retrieve updated SSL server certificates, private keys, and"] -#[doc = "trusted CAs (for client authentication)."] -#[doc = "- user_data parameter, if not NULL, contains opaque data to be used by the"] -#[doc = "callback."] -#[doc = "- Use grpc_ssl_server_certificate_config_create to create the config."] -#[doc = "- The caller assumes ownership of the config."] +#[doc = " Callback to retrieve updated SSL server certificates, private keys, and\ntrusted CAs (for client authentication).\n- user_data parameter, if not NULL, contains opaque data to be used by the\ncallback.\n- Use grpc_ssl_server_certificate_config_create to create the config.\n- The caller assumes ownership of the config."] pub type grpc_ssl_server_certificate_config_callback = ::std::option::Option< unsafe extern "C" fn( user_data: *mut ::std::os::raw::c_void, @@ -2943,18 +2236,7 @@ pub type grpc_ssl_server_certificate_config_callback = ::std::option::Option< ) -> grpc_ssl_certificate_config_reload_status, >; extern "C" { - #[doc = " Deprecated in favor of grpc_ssl_server_credentials_create_ex."] - #[doc = "Creates an SSL server_credentials object."] - #[doc = "- pem_roots_cert is the NULL-terminated string containing the PEM encoding of"] - #[doc = "the client root certificates. This parameter may be NULL if the server does"] - #[doc = "not want the client to be authenticated with SSL."] - #[doc = "- pem_key_cert_pairs is an array private key / certificate chains of the"] - #[doc = "server. This parameter cannot be NULL."] - #[doc = "- num_key_cert_pairs indicates the number of items in the private_key_files"] - #[doc = "and cert_chain_files parameters. It should be at least 1."] - #[doc = "- force_client_auth, if set to non-zero will force the client to authenticate"] - #[doc = "with an SSL cert. Note that this option is ignored if pem_root_certs is"] - #[doc = "NULL."] + #[doc = " Deprecated in favor of grpc_ssl_server_credentials_create_ex.\nCreates an SSL server_credentials object.\n- pem_roots_cert is the NULL-terminated string containing the PEM encoding of\nthe client root certificates. This parameter may be NULL if the server does\nnot want the client to be authenticated with SSL.\n- pem_key_cert_pairs is an array private key / certificate chains of the\nserver. This parameter cannot be NULL.\n- num_key_cert_pairs indicates the number of items in the private_key_files\nand cert_chain_files parameters. It should be at least 1.\n- force_client_auth, if set to non-zero will force the client to authenticate\nwith an SSL cert. Note that this option is ignored if pem_root_certs is\nNULL."] pub fn grpc_ssl_server_credentials_create( pem_root_certs: *const ::std::os::raw::c_char, pem_key_cert_pairs: *mut grpc_ssl_pem_key_cert_pair, @@ -2964,10 +2246,7 @@ extern "C" { ) -> *mut grpc_server_credentials; } extern "C" { - #[doc = " Deprecated in favor of grpc_ssl_server_credentials_create_with_options."] - #[doc = "Same as grpc_ssl_server_credentials_create method except uses"] - #[doc = "grpc_ssl_client_certificate_request_type enum to support more ways to"] - #[doc = "authenticate client certificates."] + #[doc = " Deprecated in favor of grpc_ssl_server_credentials_create_with_options.\nSame as grpc_ssl_server_credentials_create method except uses\ngrpc_ssl_client_certificate_request_type enum to support more ways to\nauthenticate client certificates."] pub fn grpc_ssl_server_credentials_create_ex( pem_root_certs: *const ::std::os::raw::c_char, pem_key_cert_pairs: *mut grpc_ssl_pem_key_cert_pair, @@ -2982,23 +2261,14 @@ pub struct grpc_ssl_server_credentials_options { _unused: [u8; 0], } extern "C" { - #[doc = " Creates an options object using a certificate config. Use this method when"] - #[doc = "the certificates and keys of the SSL server will not change during the"] - #[doc = "server's lifetime."] - #[doc = "- Takes ownership of the certificate_config parameter."] + #[doc = " Creates an options object using a certificate config. Use this method when\nthe certificates and keys of the SSL server will not change during the\nserver's lifetime.\n- Takes ownership of the certificate_config parameter."] pub fn grpc_ssl_server_credentials_create_options_using_config( client_certificate_request: grpc_ssl_client_certificate_request_type, certificate_config: *mut grpc_ssl_server_certificate_config, ) -> *mut grpc_ssl_server_credentials_options; } extern "C" { - #[doc = " Creates an options object using a certificate config fetcher. Use this"] - #[doc = "method to reload the certificates and keys of the SSL server without"] - #[doc = "interrupting the operation of the server. Initial certificate config will be"] - #[doc = "fetched during server initialization."] - #[doc = "- user_data parameter, if not NULL, contains opaque data which will be passed"] - #[doc = "to the fetcher (see definition of"] - #[doc = "grpc_ssl_server_certificate_config_callback)."] + #[doc = " Creates an options object using a certificate config fetcher. Use this\nmethod to reload the certificates and keys of the SSL server without\ninterrupting the operation of the server. Initial certificate config will be\nfetched during server initialization.\n- user_data parameter, if not NULL, contains opaque data which will be passed\nto the fetcher (see definition of\ngrpc_ssl_server_certificate_config_callback)."] pub fn grpc_ssl_server_credentials_create_options_using_config_fetcher( client_certificate_request: grpc_ssl_client_certificate_request_type, cb: grpc_ssl_server_certificate_config_callback, @@ -3012,29 +2282,19 @@ extern "C" { ); } extern "C" { - #[doc = " Creates an SSL server_credentials object using the provided options struct."] - #[doc = "- Takes ownership of the options parameter."] + #[doc = " Creates an SSL server_credentials object using the provided options struct.\n- Takes ownership of the options parameter."] pub fn grpc_ssl_server_credentials_create_with_options( options: *mut grpc_ssl_server_credentials_options, ) -> *mut grpc_server_credentials; } extern "C" { - #[doc = " Sets a credentials to a call. Can only be called on the client side before"] - #[doc = "grpc_call_start_batch."] + #[doc = " Sets a credentials to a call. Can only be called on the client side before\ngrpc_call_start_batch."] pub fn grpc_call_set_credentials( call: *mut grpc_call, creds: *mut grpc_call_credentials, ) -> grpc_call_error; } -#[doc = " Callback function that is called when the metadata processing is done."] -#[doc = "- Consumed metadata will be removed from the set of metadata available on the"] -#[doc = "call. consumed_md may be NULL if no metadata has been consumed."] -#[doc = "- Response metadata will be set on the response. response_md may be NULL."] -#[doc = "- status is GRPC_STATUS_OK for success or a specific status for an error."] -#[doc = "Common error status for auth metadata processing is either"] -#[doc = "GRPC_STATUS_UNAUTHENTICATED in case of an authentication failure or"] -#[doc = "GRPC_STATUS PERMISSION_DENIED in case of an authorization failure."] -#[doc = "- error_details gives details about the error. May be NULL."] +#[doc = " Callback function that is called when the metadata processing is done.\n- Consumed metadata will be removed from the set of metadata available on the\ncall. consumed_md may be NULL if no metadata has been consumed.\n- Response metadata will be set on the response. response_md may be NULL.\n- status is GRPC_STATUS_OK for success or a specific status for an error.\nCommon error status for auth metadata processing is either\nGRPC_STATUS_UNAUTHENTICATED in case of an authentication failure or\nGRPC_STATUS PERMISSION_DENIED in case of an authorization failure.\n- error_details gives details about the error. May be NULL."] pub type grpc_process_auth_metadata_done_cb = ::std::option::Option< unsafe extern "C" fn( user_data: *mut ::std::os::raw::c_void, @@ -3050,10 +2310,7 @@ pub type grpc_process_auth_metadata_done_cb = ::std::option::Option< #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_auth_metadata_processor { - #[doc = " The context object is read/write: it contains the properties of the"] - #[doc = "channel peer and it is the job of the process function to augment it with"] - #[doc = "properties derived from the passed-in metadata."] - #[doc = "The lifetime of these objects is guaranteed until cb is invoked."] + #[doc = " The context object is read/write: it contains the properties of the\nchannel peer and it is the job of the process function to augment it with\nproperties derived from the passed-in metadata.\nThe lifetime of these objects is guaranteed until cb is invoked."] pub process: ::std::option::Option< unsafe extern "C" fn( state: *mut ::std::os::raw::c_void, @@ -3079,79 +2336,44 @@ pub struct grpc_alts_credentials_options { _unused: [u8; 0], } extern "C" { - #[doc = " This method creates a grpc ALTS credentials client options instance."] - #[doc = " It is used for experimental purpose for now and subject to change."] + #[doc = " This method creates a grpc ALTS credentials client options instance.\n It is used for experimental purpose for now and subject to change."] pub fn grpc_alts_credentials_client_options_create() -> *mut grpc_alts_credentials_options; } extern "C" { - #[doc = " This method creates a grpc ALTS credentials server options instance."] - #[doc = " It is used for experimental purpose for now and subject to change."] + #[doc = " This method creates a grpc ALTS credentials server options instance.\n It is used for experimental purpose for now and subject to change."] pub fn grpc_alts_credentials_server_options_create() -> *mut grpc_alts_credentials_options; } extern "C" { - #[doc = " This method adds a target service account to grpc client's ALTS credentials"] - #[doc = " options instance. It is used for experimental purpose for now and subject"] - #[doc = " to change."] - #[doc = ""] - #[doc = " - options: grpc ALTS credentials options instance."] - #[doc = " - service_account: service account of target endpoint."] + #[doc = " This method adds a target service account to grpc client's ALTS credentials\n options instance. It is used for experimental purpose for now and subject\n to change.\n\n - options: grpc ALTS credentials options instance.\n - service_account: service account of target endpoint."] pub fn grpc_alts_credentials_client_options_add_target_service_account( options: *mut grpc_alts_credentials_options, service_account: *const ::std::os::raw::c_char, ); } extern "C" { - #[doc = " This method destroys a grpc_alts_credentials_options instance by"] - #[doc = " de-allocating all of its occupied memory. It is used for experimental purpose"] - #[doc = " for now and subject to change."] - #[doc = ""] - #[doc = " - options: a grpc_alts_credentials_options instance that needs to be"] - #[doc = " destroyed."] + #[doc = " This method destroys a grpc_alts_credentials_options instance by\n de-allocating all of its occupied memory. It is used for experimental purpose\n for now and subject to change.\n\n - options: a grpc_alts_credentials_options instance that needs to be\n destroyed."] pub fn grpc_alts_credentials_options_destroy(options: *mut grpc_alts_credentials_options); } extern "C" { - #[doc = " This method creates an ALTS channel credential object. The security"] - #[doc = " level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY."] - #[doc = " It is used for experimental purpose for now and subject to change."] - #[doc = ""] - #[doc = " - options: grpc ALTS credentials options instance for client."] - #[doc = ""] - #[doc = " It returns the created ALTS channel credential object."] + #[doc = " This method creates an ALTS channel credential object. The security\n level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY.\n It is used for experimental purpose for now and subject to change.\n\n - options: grpc ALTS credentials options instance for client.\n\n It returns the created ALTS channel credential object."] pub fn grpc_alts_credentials_create( options: *const grpc_alts_credentials_options, ) -> *mut grpc_channel_credentials; } extern "C" { - #[doc = " This method creates an ALTS server credential object. It is used for"] - #[doc = " experimental purpose for now and subject to change."] - #[doc = ""] - #[doc = " - options: grpc ALTS credentials options instance for server."] - #[doc = ""] - #[doc = " It returns the created ALTS server credential object."] + #[doc = " This method creates an ALTS server credential object. It is used for\n experimental purpose for now and subject to change.\n\n - options: grpc ALTS credentials options instance for server.\n\n It returns the created ALTS server credential object."] pub fn grpc_alts_server_credentials_create( options: *const grpc_alts_credentials_options, ) -> *mut grpc_server_credentials; } extern "C" { - #[doc = " This method creates a local channel credential object. The security level"] - #[doc = " of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY for UDS and"] - #[doc = " GRPC_SECURITY_NONE for LOCAL_TCP. It is used for experimental purpose"] - #[doc = " for now and subject to change."] - #[doc = ""] - #[doc = " - type: local connection type"] - #[doc = ""] - #[doc = " It returns the created local channel credential object."] + #[doc = " This method creates a local channel credential object. The security level\n of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY for UDS and\n GRPC_SECURITY_NONE for LOCAL_TCP. It is used for experimental purpose\n for now and subject to change.\n\n - type: local connection type\n\n It returns the created local channel credential object."] pub fn grpc_local_credentials_create( type_: grpc_local_connect_type, ) -> *mut grpc_channel_credentials; } extern "C" { - #[doc = " This method creates a local server credential object. It is used for"] - #[doc = " experimental purpose for now and subject to change."] - #[doc = ""] - #[doc = " - type: local connection type"] - #[doc = ""] - #[doc = " It returns the created local server credential object."] + #[doc = " This method creates a local server credential object. It is used for\n experimental purpose for now and subject to change.\n\n - type: local connection type\n\n It returns the created local server credential object."] pub fn grpc_local_server_credentials_create( type_: grpc_local_connect_type, ) -> *mut grpc_server_credentials; @@ -3172,18 +2394,11 @@ pub struct grpc_tls_identity_pairs { _unused: [u8; 0], } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " Creates a grpc_tls_identity_pairs that stores a list of identity credential"] - #[doc = " data, including identity private key and identity certificate chain."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n Creates a grpc_tls_identity_pairs that stores a list of identity credential\n data, including identity private key and identity certificate chain."] pub fn grpc_tls_identity_pairs_create() -> *mut grpc_tls_identity_pairs; } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " Adds a identity private key and a identity certificate chain to"] - #[doc = " grpc_tls_identity_pairs. This function will make an internal copy of"] - #[doc = " |private_key| and |cert_chain|."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n Adds a identity private key and a identity certificate chain to\n grpc_tls_identity_pairs. This function will make an internal copy of\n |private_key| and |cert_chain|."] pub fn grpc_tls_identity_pairs_add_pair( pairs: *mut grpc_tls_identity_pairs, private_key: *const ::std::os::raw::c_char, @@ -3191,49 +2406,18 @@ extern "C" { ); } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " Destroys a grpc_tls_identity_pairs object. If this object is passed to a"] - #[doc = " provider initiation function, the ownership is transferred so this function"] - #[doc = " doesn't need to be called. Otherwise the creator of the"] - #[doc = " grpc_tls_identity_pairs object is responsible for its destruction."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n Destroys a grpc_tls_identity_pairs object. If this object is passed to a\n provider initiation function, the ownership is transferred so this function\n doesn't need to be called. Otherwise the creator of the\n grpc_tls_identity_pairs object is responsible for its destruction."] pub fn grpc_tls_identity_pairs_destroy(pairs: *mut grpc_tls_identity_pairs); } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " Creates a grpc_tls_certificate_provider that will load credential data from"] - #[doc = " static string during initialization. This provider will always return the"] - #[doc = " same cert data for all cert names."] - #[doc = " root_certificate and pem_key_cert_pairs can be nullptr, indicating the"] - #[doc = " corresponding credential data is not needed."] - #[doc = " This function will make a copy of |root_certificate|."] - #[doc = " The ownership of |pem_key_cert_pairs| is transferred."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n Creates a grpc_tls_certificate_provider that will load credential data from\n static string during initialization. This provider will always return the\n same cert data for all cert names.\n root_certificate and pem_key_cert_pairs can be nullptr, indicating the\n corresponding credential data is not needed.\n This function will make a copy of |root_certificate|.\n The ownership of |pem_key_cert_pairs| is transferred."] pub fn grpc_tls_certificate_provider_static_data_create( root_certificate: *const ::std::os::raw::c_char, pem_key_cert_pairs: *mut grpc_tls_identity_pairs, ) -> *mut grpc_tls_certificate_provider; } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " Creates a grpc_tls_certificate_provider that will watch the credential"] - #[doc = " changes on the file system. This provider will always return the up-to-date"] - #[doc = " cert data for all the cert names callers set through"] - #[doc = " |grpc_tls_credentials_options|. Note that this API only supports one key-cert"] - #[doc = " file and hence one set of identity key-cert pair, so SNI(Server Name"] - #[doc = " Indication) is not supported."] - #[doc = " - private_key_path is the file path of the private key. This must be set if"] - #[doc = " |identity_certificate_path| is set. Otherwise, it could be null if no"] - #[doc = " identity credentials are needed."] - #[doc = " - identity_certificate_path is the file path of the identity certificate"] - #[doc = " chain. This must be set if |private_key_path| is set. Otherwise, it could"] - #[doc = " be null if no identity credentials are needed."] - #[doc = " - root_cert_path is the file path to the root certificate bundle. This"] - #[doc = " may be null if no root certs are needed."] - #[doc = " - refresh_interval_sec is the refreshing interval that we will check the"] - #[doc = " files for updates."] - #[doc = " It does not take ownership of parameters."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n Creates a grpc_tls_certificate_provider that will watch the credential\n changes on the file system. This provider will always return the up-to-date\n cert data for all the cert names callers set through\n |grpc_tls_credentials_options|. Note that this API only supports one key-cert\n file and hence one set of identity key-cert pair, so SNI(Server Name\n Indication) is not supported.\n - private_key_path is the file path of the private key. This must be set if\n |identity_certificate_path| is set. Otherwise, it could be null if no\n identity credentials are needed.\n - identity_certificate_path is the file path of the identity certificate\n chain. This must be set if |private_key_path| is set. Otherwise, it could\n be null if no identity credentials are needed.\n - root_cert_path is the file path to the root certificate bundle. This\n may be null if no root certs are needed.\n - refresh_interval_sec is the refreshing interval that we will check the\n files for updates.\n It does not take ownership of parameters."] pub fn grpc_tls_certificate_provider_file_watcher_create( private_key_path: *const ::std::os::raw::c_char, identity_certificate_path: *const ::std::os::raw::c_char, @@ -3242,130 +2426,75 @@ extern "C" { ) -> *mut grpc_tls_certificate_provider; } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " Releases a grpc_tls_certificate_provider object. The creator of the"] - #[doc = " grpc_tls_certificate_provider object is responsible for its release."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n Releases a grpc_tls_certificate_provider object. The creator of the\n grpc_tls_certificate_provider object is responsible for its release."] pub fn grpc_tls_certificate_provider_release(provider: *mut grpc_tls_certificate_provider); } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " Creates an grpc_tls_credentials_options."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n Creates an grpc_tls_credentials_options."] pub fn grpc_tls_credentials_options_create() -> *mut grpc_tls_credentials_options; } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " Sets the credential provider in the options."] - #[doc = " The |options| will implicitly take a new ref to the |provider|."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n Sets the credential provider in the options.\n The |options| will implicitly take a new ref to the |provider|."] pub fn grpc_tls_credentials_options_set_certificate_provider( options: *mut grpc_tls_credentials_options, provider: *mut grpc_tls_certificate_provider, ); } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " If set, gRPC stack will keep watching the root certificates with"] - #[doc = " name |root_cert_name|."] - #[doc = " If this is not set on the client side, we will use the root certificates"] - #[doc = " stored in the default system location, since client side must provide root"] - #[doc = " certificates in TLS."] - #[doc = " If this is not set on the server side, we will not watch any root certificate"] - #[doc = " updates, and assume no root certificates needed for the server(single-side"] - #[doc = " TLS). Default root certs on the server side is not supported."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n If set, gRPC stack will keep watching the root certificates with\n name |root_cert_name|.\n If this is not set on the client side, we will use the root certificates\n stored in the default system location, since client side must provide root\n certificates in TLS.\n If this is not set on the server side, we will not watch any root certificate\n updates, and assume no root certificates needed for the server(single-side\n TLS). Default root certs on the server side is not supported."] pub fn grpc_tls_credentials_options_watch_root_certs( options: *mut grpc_tls_credentials_options, ); } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " Sets the name of the root certificates being watched."] - #[doc = " If not set, We will use a default empty string as the root certificate name."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n Sets the name of the root certificates being watched.\n If not set, We will use a default empty string as the root certificate name."] pub fn grpc_tls_credentials_options_set_root_cert_name( options: *mut grpc_tls_credentials_options, root_cert_name: *const ::std::os::raw::c_char, ); } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " If set, gRPC stack will keep watching the identity key-cert pairs"] - #[doc = " with name |identity_cert_name|."] - #[doc = " This is required on the server side, and optional on the client side."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n If set, gRPC stack will keep watching the identity key-cert pairs\n with name |identity_cert_name|.\n This is required on the server side, and optional on the client side."] pub fn grpc_tls_credentials_options_watch_identity_key_cert_pairs( options: *mut grpc_tls_credentials_options, ); } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " Sets the name of the identity certificates being watched."] - #[doc = " If not set, We will use a default empty string as the identity certificate"] - #[doc = " name."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n Sets the name of the identity certificates being watched.\n If not set, We will use a default empty string as the identity certificate\n name."] pub fn grpc_tls_credentials_options_set_identity_cert_name( options: *mut grpc_tls_credentials_options, identity_cert_name: *const ::std::os::raw::c_char, ); } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " Sets the options of whether to request and/or verify client certs. This shall"] - #[doc = " only be called on the server side."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n Sets the options of whether to request and/or verify client certs. This shall\n only be called on the server side."] pub fn grpc_tls_credentials_options_set_cert_request_type( options: *mut grpc_tls_credentials_options, type_: grpc_ssl_client_certificate_request_type, ); } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " If set, gRPC will read all hashed x.509 CRL files in the directory and"] - #[doc = " enforce the CRL files on all TLS handshakes. Only supported for OpenSSL"] - #[doc = " version > 1.1."] - #[doc = " It is used for experimental purpose for now and subject to change."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n If set, gRPC will read all hashed x.509 CRL files in the directory and\n enforce the CRL files on all TLS handshakes. Only supported for OpenSSL\n version > 1.1.\n It is used for experimental purpose for now and subject to change."] pub fn grpc_tls_credentials_options_set_crl_directory( options: *mut grpc_tls_credentials_options, crl_directory: *const ::std::os::raw::c_char, ); } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " Sets the options of whether to verify server certs on the client side."] - #[doc = " Passing in a non-zero value indicates verifying the certs."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n Sets the options of whether to verify server certs on the client side.\n Passing in a non-zero value indicates verifying the certs."] pub fn grpc_tls_credentials_options_set_verify_server_cert( options: *mut grpc_tls_credentials_options, verify_server_cert: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " Sets whether or not a TLS server should send a list of CA names in the"] - #[doc = " ServerHello. This list of CA names is read from the server's trust bundle, so"] - #[doc = " that the client can use this list as a hint to know which certificate it"] - #[doc = " should send to the server."] - #[doc = ""] - #[doc = " WARNING: This API is extremely dangerous and should not be used. If the"] - #[doc = " server's trust bundle is too large, then the TLS server will be unable to"] - #[doc = " form a ServerHello, and hence will be unusable. The definition of \"too large\""] - #[doc = " depends on the underlying SSL library being used and on the size of the CN"] - #[doc = " fields of the certificates in the trust bundle."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n Sets whether or not a TLS server should send a list of CA names in the\n ServerHello. This list of CA names is read from the server's trust bundle, so\n that the client can use this list as a hint to know which certificate it\n should send to the server.\n\n WARNING: This API is extremely dangerous and should not be used. If the\n server's trust bundle is too large, then the TLS server will be unable to\n form a ServerHello, and hence will be unusable. The definition of \"too large\"\n depends on the underlying SSL library being used and on the size of the CN\n fields of the certificates in the trust bundle."] pub fn grpc_tls_credentials_options_set_send_client_ca_list( options: *mut grpc_tls_credentials_options, send_client_ca_list: bool, ); } -#[doc = " EXPERIMENTAL API - Subject to change"] -#[doc = ""] -#[doc = " The read-only request information exposed in a verification call."] -#[doc = " Callers should not directly manage the ownership of it. We will make sure it"] -#[doc = " is always available inside verify() or cancel() call, and will destroy the"] -#[doc = " object at the end of custom verification."] +#[doc = " EXPERIMENTAL API - Subject to change\n\n The read-only request information exposed in a verification call.\n Callers should not directly manage the ownership of it. We will make sure it\n is always available inside verify() or cancel() call, and will destroy the\n object at the end of custom verification."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_tls_custom_verification_check_request { @@ -3393,13 +2522,7 @@ pub struct grpc_tls_custom_verification_check_request_peer_info_san_names { pub ip_names: *mut *mut ::std::os::raw::c_char, pub ip_names_size: usize, } -#[doc = " EXPERIMENTAL API - Subject to change"] -#[doc = ""] -#[doc = " A callback function provided by gRPC as a parameter of the |verify| function"] -#[doc = " in grpc_tls_certificate_verifier_external. If |verify| is expected to be run"] -#[doc = " asynchronously, the implementer of |verify| will need to invoke this callback"] -#[doc = " with |callback_arg| and proper verification status at the end to bring the"] -#[doc = " control back to gRPC C core."] +#[doc = " EXPERIMENTAL API - Subject to change\n\n A callback function provided by gRPC as a parameter of the |verify| function\n in grpc_tls_certificate_verifier_external. If |verify| is expected to be run\n asynchronously, the implementer of |verify| will need to invoke this callback\n with |callback_arg| and proper verification status at the end to bring the\n control back to gRPC C core."] pub type grpc_tls_on_custom_verification_check_done_cb = ::std::option::Option< unsafe extern "C" fn( request: *mut grpc_tls_custom_verification_check_request, @@ -3413,45 +2536,12 @@ pub type grpc_tls_on_custom_verification_check_done_cb = ::std::option::Option< pub struct grpc_tls_certificate_verifier { _unused: [u8; 0], } -#[doc = " EXPERIMENTAL API - Subject to change"] -#[doc = ""] -#[doc = " A struct containing all the necessary functions a custom external verifier"] -#[doc = " needs to implement to be able to be converted to an internal verifier."] +#[doc = " EXPERIMENTAL API - Subject to change\n\n A struct containing all the necessary functions a custom external verifier\n needs to implement to be able to be converted to an internal verifier."] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_tls_certificate_verifier_external { pub user_data: *mut ::std::os::raw::c_void, - #[doc = " A function pointer containing the verification logic that will be"] - #[doc = " performed after the TLS handshake is done. It could be processed"] - #[doc = " synchronously or asynchronously."] - #[doc = " - If expected to be processed synchronously, the implementer should"] - #[doc = " populate the verification result through |sync_status| and"] - #[doc = " |sync_error_details|, and then return true."] - #[doc = " - If expected to be processed asynchronously, the implementer should return"] - #[doc = " false immediately, and then in the asynchronous thread invoke |callback|"] - #[doc = " with the verification result. The implementer MUST NOT invoke the async"] - #[doc = " |callback| in the same thread before |verify| returns, otherwise it can"] - #[doc = " lead to deadlocks."] - #[doc = ""] - #[doc = " user_data: any argument that is passed in the user_data of"] - #[doc = " grpc_tls_certificate_verifier_external during construction time"] - #[doc = " can be retrieved later here."] - #[doc = " request: request information exposed to the function implementer."] - #[doc = " callback: the callback that the function implementer needs to invoke, if"] - #[doc = " return a non-zero value. It is usually invoked when the"] - #[doc = " asynchronous verification is done, and serves to bring the"] - #[doc = " control back to gRPC."] - #[doc = " callback_arg: A pointer to the internal ExternalVerifier instance. This is"] - #[doc = " mainly used as an argument in |callback|, if want to invoke"] - #[doc = " |callback| in async mode."] - #[doc = " sync_status: indicates if a connection should be allowed. This should only"] - #[doc = " be used if the verification check is done synchronously."] - #[doc = " sync_error_details: the error generated while verifying a connection. This"] - #[doc = " should only be used if the verification check is done"] - #[doc = " synchronously. the implementation must allocate the"] - #[doc = " error string via gpr_malloc() or gpr_strdup()."] - #[doc = " return: return 0 if |verify| is expected to be executed asynchronously,"] - #[doc = " otherwise return a non-zero value."] + #[doc = " A function pointer containing the verification logic that will be\n performed after the TLS handshake is done. It could be processed\n synchronously or asynchronously.\n - If expected to be processed synchronously, the implementer should\n populate the verification result through |sync_status| and\n |sync_error_details|, and then return true.\n - If expected to be processed asynchronously, the implementer should return\n false immediately, and then in the asynchronous thread invoke |callback|\n with the verification result. The implementer MUST NOT invoke the async\n |callback| in the same thread before |verify| returns, otherwise it can\n lead to deadlocks.\n\n user_data: any argument that is passed in the user_data of\n grpc_tls_certificate_verifier_external during construction time\n can be retrieved later here.\n request: request information exposed to the function implementer.\n callback: the callback that the function implementer needs to invoke, if\n return a non-zero value. It is usually invoked when the\n asynchronous verification is done, and serves to bring the\n control back to gRPC.\n callback_arg: A pointer to the internal ExternalVerifier instance. This is\n mainly used as an argument in |callback|, if want to invoke\n |callback| in async mode.\n sync_status: indicates if a connection should be allowed. This should only\n be used if the verification check is done synchronously.\n sync_error_details: the error generated while verifying a connection. This\n should only be used if the verification check is done\n synchronously. the implementation must allocate the\n error string via gpr_malloc() or gpr_strdup().\n return: return 0 if |verify| is expected to be executed asynchronously,\n otherwise return a non-zero value."] pub verify: ::std::option::Option< unsafe extern "C" fn( user_data: *mut ::std::os::raw::c_void, @@ -3462,113 +2552,51 @@ pub struct grpc_tls_certificate_verifier_external { sync_error_details: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int, >, - #[doc = " A function pointer that cleans up the caller-specified resources when the"] - #[doc = " verifier is still running but the whole connection got cancelled. This"] - #[doc = " could happen when the verifier is doing some async operations, and the"] - #[doc = " whole handshaker object got destroyed because of connection time limit is"] - #[doc = " reached, or any other reasons. In such cases, function implementers might"] - #[doc = " want to be notified, and properly clean up some resources."] - #[doc = ""] - #[doc = " user_data: any argument that is passed in the user_data of"] - #[doc = " grpc_tls_certificate_verifier_external during construction time"] - #[doc = " can be retrieved later here."] - #[doc = " request: request information exposed to the function implementer. It will"] - #[doc = " be the same request object that was passed to verify(), and it"] - #[doc = " tells the cancel() which request to cancel."] + #[doc = " A function pointer that cleans up the caller-specified resources when the\n verifier is still running but the whole connection got cancelled. This\n could happen when the verifier is doing some async operations, and the\n whole handshaker object got destroyed because of connection time limit is\n reached, or any other reasons. In such cases, function implementers might\n want to be notified, and properly clean up some resources.\n\n user_data: any argument that is passed in the user_data of\n grpc_tls_certificate_verifier_external during construction time\n can be retrieved later here.\n request: request information exposed to the function implementer. It will\n be the same request object that was passed to verify(), and it\n tells the cancel() which request to cancel."] pub cancel: ::std::option::Option< unsafe extern "C" fn( user_data: *mut ::std::os::raw::c_void, request: *mut grpc_tls_custom_verification_check_request, ), >, - #[doc = " A function pointer that does some additional destruction work when the"] - #[doc = " verifier is destroyed. This is used when the caller wants to associate some"] - #[doc = " objects to the lifetime of external_verifier, and destroy them when"] - #[doc = " external_verifier got destructed. For example, in C++, the class containing"] - #[doc = " user-specified callback functions should not be destroyed before"] - #[doc = " external_verifier, since external_verifier will invoke them while being"] - #[doc = " used."] - #[doc = " Note that the caller MUST delete the grpc_tls_certificate_verifier_external"] - #[doc = " object itself in this function, otherwise it will cause memory leaks. That"] - #[doc = " also means the user_data has to carries at least a self pointer, for the"] - #[doc = " callers to later delete it in destruct()."] - #[doc = ""] - #[doc = " user_data: any argument that is passed in the user_data of"] - #[doc = " grpc_tls_certificate_verifier_external during construction time"] - #[doc = " can be retrieved later here."] + #[doc = " A function pointer that does some additional destruction work when the\n verifier is destroyed. This is used when the caller wants to associate some\n objects to the lifetime of external_verifier, and destroy them when\n external_verifier got destructed. For example, in C++, the class containing\n user-specified callback functions should not be destroyed before\n external_verifier, since external_verifier will invoke them while being\n used.\n Note that the caller MUST delete the grpc_tls_certificate_verifier_external\n object itself in this function, otherwise it will cause memory leaks. That\n also means the user_data has to carries at least a self pointer, for the\n callers to later delete it in destruct().\n\n user_data: any argument that is passed in the user_data of\n grpc_tls_certificate_verifier_external during construction time\n can be retrieved later here."] pub destruct: ::std::option::Option, } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " Converts an external verifier to an internal verifier."] - #[doc = " Note that we will not take the ownership of the external_verifier. Callers"] - #[doc = " will need to delete external_verifier in its own destruct function."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n Converts an external verifier to an internal verifier.\n Note that we will not take the ownership of the external_verifier. Callers\n will need to delete external_verifier in its own destruct function."] pub fn grpc_tls_certificate_verifier_external_create( external_verifier: *mut grpc_tls_certificate_verifier_external, ) -> *mut grpc_tls_certificate_verifier; } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " Factory function for an internal verifier that won't perform any"] - #[doc = " post-handshake verification. Note: using this solely without any other"] - #[doc = " authentication mechanisms on the peer identity will leave your applications"] - #[doc = " to the MITM(Man-In-The-Middle) attacks. Users should avoid doing so in"] - #[doc = " production environments."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n Factory function for an internal verifier that won't perform any\n post-handshake verification. Note: using this solely without any other\n authentication mechanisms on the peer identity will leave your applications\n to the MITM(Man-In-The-Middle) attacks. Users should avoid doing so in\n production environments."] pub fn grpc_tls_certificate_verifier_no_op_create() -> *mut grpc_tls_certificate_verifier; } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " Factory function for an internal verifier that will do the default hostname"] - #[doc = " check."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n Factory function for an internal verifier that will do the default hostname\n check."] pub fn grpc_tls_certificate_verifier_host_name_create() -> *mut grpc_tls_certificate_verifier; } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " Releases a grpc_tls_certificate_verifier object. The creator of the"] - #[doc = " grpc_tls_certificate_verifier object is responsible for its release."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n Releases a grpc_tls_certificate_verifier object. The creator of the\n grpc_tls_certificate_verifier object is responsible for its release."] pub fn grpc_tls_certificate_verifier_release(verifier: *mut grpc_tls_certificate_verifier); } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " Sets the verifier in options. The |options| will implicitly take a new ref to"] - #[doc = " the |verifier|. If not set on the client side, we will verify server's"] - #[doc = " certificates, and check the default hostname. If not set on the server side,"] - #[doc = " we will verify client's certificates."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n Sets the verifier in options. The |options| will implicitly take a new ref to\n the |verifier|. If not set on the client side, we will verify server's\n certificates, and check the default hostname. If not set on the server side,\n we will verify client's certificates."] pub fn grpc_tls_credentials_options_set_certificate_verifier( options: *mut grpc_tls_credentials_options, verifier: *mut grpc_tls_certificate_verifier, ); } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " Sets the options of whether to check the hostname of the peer on a per-call"] - #[doc = " basis. This is usually used in a combination with virtual hosting at the"] - #[doc = " client side, where each individual call on a channel can have a different"] - #[doc = " host associated with it."] - #[doc = " This check is intended to verify that the host specified for the individual"] - #[doc = " call is covered by the cert that the peer presented."] - #[doc = " The default is a non-zero value, which indicates performing such checks."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n Sets the options of whether to check the hostname of the peer on a per-call\n basis. This is usually used in a combination with virtual hosting at the\n client side, where each individual call on a channel can have a different\n host associated with it.\n This check is intended to verify that the host specified for the individual\n call is covered by the cert that the peer presented.\n The default is a non-zero value, which indicates performing such checks."] pub fn grpc_tls_credentials_options_set_check_call_host( options: *mut grpc_tls_credentials_options, check_call_host: ::std::os::raw::c_int, ); } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " Performs the verification logic of an internal verifier."] - #[doc = " This is typically used when composing the internal verifiers as part of the"] - #[doc = " custom verification."] - #[doc = " If |grpc_tls_certificate_verifier_verify| returns true, inspect the"] - #[doc = " verification result through request->status and request->error_details."] - #[doc = " Otherwise, inspect through the parameter of |callback|."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n Performs the verification logic of an internal verifier.\n This is typically used when composing the internal verifiers as part of the\n custom verification.\n If |grpc_tls_certificate_verifier_verify| returns true, inspect the\n verification result through request->status and request->error_details.\n Otherwise, inspect through the parameter of |callback|."] pub fn grpc_tls_certificate_verifier_verify( verifier: *mut grpc_tls_certificate_verifier, request: *mut grpc_tls_custom_verification_check_request, @@ -3579,75 +2607,40 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " Performs the cancellation logic of an internal verifier."] - #[doc = " This is typically used when composing the internal verifiers as part of the"] - #[doc = " custom verification."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n Performs the cancellation logic of an internal verifier.\n This is typically used when composing the internal verifiers as part of the\n custom verification."] pub fn grpc_tls_certificate_verifier_cancel( verifier: *mut grpc_tls_certificate_verifier, request: *mut grpc_tls_custom_verification_check_request, ); } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " Creates a TLS channel credential object based on the"] - #[doc = " grpc_tls_credentials_options specified by callers. The"] - #[doc = " grpc_channel_credentials will take the ownership of the |options|. The"] - #[doc = " security level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n Creates a TLS channel credential object based on the\n grpc_tls_credentials_options specified by callers. The\n grpc_channel_credentials will take the ownership of the |options|. The\n security level of the resulting connection is GRPC_PRIVACY_AND_INTEGRITY."] pub fn grpc_tls_credentials_create( options: *mut grpc_tls_credentials_options, ) -> *mut grpc_channel_credentials; } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " Creates a TLS server credential object based on the"] - #[doc = " grpc_tls_credentials_options specified by callers. The"] - #[doc = " grpc_server_credentials will take the ownership of the |options|."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n Creates a TLS server credential object based on the\n grpc_tls_credentials_options specified by callers. The\n grpc_server_credentials will take the ownership of the |options|."] pub fn grpc_tls_server_credentials_create( options: *mut grpc_tls_credentials_options, ) -> *mut grpc_server_credentials; } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " This method creates an insecure channel credentials object."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n This method creates an insecure channel credentials object."] pub fn grpc_insecure_credentials_create() -> *mut grpc_channel_credentials; } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " This method creates an insecure server credentials object."] + #[doc = " EXPERIMENTAL API - Subject to change\n\n This method creates an insecure server credentials object."] pub fn grpc_insecure_server_credentials_create() -> *mut grpc_server_credentials; } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " This method creates an xDS channel credentials object."] - #[doc = ""] - #[doc = " Creating a channel with credentials of this type indicates that the channel"] - #[doc = " should get credentials configuration from the xDS control plane."] - #[doc = ""] - #[doc = " \\a fallback_credentials are used if the channel target does not have the"] - #[doc = " 'xds:///' scheme or if the xDS control plane does not provide information on"] - #[doc = " how to fetch credentials dynamically. Does NOT take ownership of the \\a"] - #[doc = " fallback_credentials. (Internally takes a ref to the object.)"] + #[doc = " EXPERIMENTAL API - Subject to change\n\n This method creates an xDS channel credentials object.\n\n Creating a channel with credentials of this type indicates that the channel\n should get credentials configuration from the xDS control plane.\n\n \\a fallback_credentials are used if the channel target does not have the\n 'xds:///' scheme or if the xDS control plane does not provide information on\n how to fetch credentials dynamically. Does NOT take ownership of the \\a\n fallback_credentials. (Internally takes a ref to the object.)"] pub fn grpc_xds_credentials_create( fallback_credentials: *mut grpc_channel_credentials, ) -> *mut grpc_channel_credentials; } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change"] - #[doc = ""] - #[doc = " This method creates an xDS server credentials object."] - #[doc = ""] - #[doc = " \\a fallback_credentials are used if the xDS control plane does not provide"] - #[doc = " information on how to fetch credentials dynamically."] - #[doc = ""] - #[doc = " Does NOT take ownership of the \\a fallback_credentials. (Internally takes"] - #[doc = " a ref to the object.)"] + #[doc = " EXPERIMENTAL API - Subject to change\n\n This method creates an xDS server credentials object.\n\n \\a fallback_credentials are used if the xDS control plane does not provide\n information on how to fetch credentials dynamically.\n\n Does NOT take ownership of the \\a fallback_credentials. (Internally takes\n a ref to the object.)"] pub fn grpc_xds_server_credentials_create( fallback_credentials: *mut grpc_server_credentials, ) -> *mut grpc_server_credentials; @@ -3658,15 +2651,7 @@ pub struct grpc_authorization_policy_provider { _unused: [u8; 0], } extern "C" { - #[doc = " EXPERIMENTAL - Subject to change."] - #[doc = " Creates a grpc_authorization_policy_provider using gRPC authorization policy"] - #[doc = " from static string."] - #[doc = " - authz_policy is the input gRPC authorization policy."] - #[doc = " - code is the error status code on failure. On success, it equals"] - #[doc = " GRPC_STATUS_OK."] - #[doc = " - error_details contains details about the error if any. If the"] - #[doc = " initialization is successful, it will be null. Caller must use gpr_free to"] - #[doc = " destroy this string."] + #[doc = " EXPERIMENTAL - Subject to change.\n Creates a grpc_authorization_policy_provider using gRPC authorization policy\n from static string.\n - authz_policy is the input gRPC authorization policy.\n - code is the error status code on failure. On success, it equals\n GRPC_STATUS_OK.\n - error_details contains details about the error if any. If the\n initialization is successful, it will be null. Caller must use gpr_free to\n destroy this string."] pub fn grpc_authorization_policy_provider_static_data_create( authz_policy: *const ::std::os::raw::c_char, code: *mut grpc_status_code::Type, @@ -3674,17 +2659,7 @@ extern "C" { ) -> *mut grpc_authorization_policy_provider; } extern "C" { - #[doc = " EXPERIMENTAL - Subject to change."] - #[doc = " Creates a grpc_authorization_policy_provider by watching for gRPC"] - #[doc = " authorization policy changes in filesystem."] - #[doc = " - authz_policy is the file path of gRPC authorization policy."] - #[doc = " - refresh_interval_sec is the amount of time the internal thread would wait"] - #[doc = " before checking for file updates."] - #[doc = " - code is the error status code on failure. On success, it equals"] - #[doc = " GRPC_STATUS_OK."] - #[doc = " - error_details contains details about the error if any. If the"] - #[doc = " initialization is successful, it will be null. Caller must use gpr_free to"] - #[doc = " destroy this string."] + #[doc = " EXPERIMENTAL - Subject to change.\n Creates a grpc_authorization_policy_provider by watching for gRPC\n authorization policy changes in filesystem.\n - authz_policy is the file path of gRPC authorization policy.\n - refresh_interval_sec is the amount of time the internal thread would wait\n before checking for file updates.\n - code is the error status code on failure. On success, it equals\n GRPC_STATUS_OK.\n - error_details contains details about the error if any. If the\n initialization is successful, it will be null. Caller must use gpr_free to\n destroy this string."] pub fn grpc_authorization_policy_provider_file_watcher_create( authz_policy_path: *const ::std::os::raw::c_char, refresh_interval_sec: ::std::os::raw::c_uint, @@ -3693,31 +2668,20 @@ extern "C" { ) -> *mut grpc_authorization_policy_provider; } extern "C" { - #[doc = " EXPERIMENTAL - Subject to change."] - #[doc = " Releases grpc_authorization_policy_provider object. The creator of"] - #[doc = " grpc_authorization_policy_provider is responsible for its release."] + #[doc = " EXPERIMENTAL - Subject to change.\n Releases grpc_authorization_policy_provider object. The creator of\n grpc_authorization_policy_provider is responsible for its release."] pub fn grpc_authorization_policy_provider_release( provider: *mut grpc_authorization_policy_provider, ); } extern "C" { - #[doc = " EXPERIMENTAL API - Subject to change."] - #[doc = " Configures a grpc_tls_credentials_options object with tls session key"] - #[doc = " logging capability. TLS channels using these credentials have tls session"] - #[doc = " key logging enabled."] - #[doc = " - options is the grpc_tls_credentials_options object"] - #[doc = " - path is a string pointing to the location where TLS session keys would be"] - #[doc = " stored."] + #[doc = " EXPERIMENTAL API - Subject to change.\n Configures a grpc_tls_credentials_options object with tls session key\n logging capability. TLS channels using these credentials have tls session\n key logging enabled.\n - options is the grpc_tls_credentials_options object\n - path is a string pointing to the location where TLS session keys would be\n stored."] pub fn grpc_tls_credentials_options_set_tls_session_key_log_file_path( options: *mut grpc_tls_credentials_options, path: *const ::std::os::raw::c_char, ); } extern "C" { - #[doc = " malloc."] - #[doc = " If size==0, always returns NULL. Otherwise this function never returns NULL."] - #[doc = " The pointer returned is suitably aligned for any kind of variable it could"] - #[doc = " contain."] + #[doc = " malloc.\n If size==0, always returns NULL. Otherwise this function never returns NULL.\n The pointer returned is suitably aligned for any kind of variable it could\n contain."] pub fn gpr_malloc(size: usize) -> *mut ::std::os::raw::c_void; } extern "C" { @@ -3733,8 +2697,7 @@ extern "C" { pub fn gpr_realloc(p: *mut ::std::os::raw::c_void, size: usize) -> *mut ::std::os::raw::c_void; } extern "C" { - #[doc = " aligned malloc, never returns NULL, will align to alignment, which"] - #[doc = " must be a power of 2."] + #[doc = " aligned malloc, never returns NULL, will align to alignment, which\n must be a power of 2."] pub fn gpr_malloc_aligned(size: usize, alignment: usize) -> *mut ::std::os::raw::c_void; } extern "C" { @@ -3742,20 +2705,15 @@ extern "C" { pub fn gpr_free_aligned(ptr: *mut ::std::os::raw::c_void); } extern "C" { - #[doc = " Return the number of CPU cores on the current system. Will return 0 if"] - #[doc = "the information is not available."] + #[doc = " Return the number of CPU cores on the current system. Will return 0 if\nthe information is not available."] pub fn gpr_cpu_num_cores() -> ::std::os::raw::c_uint; } extern "C" { - #[doc = " Return the CPU on which the current thread is executing; N.B. This should"] - #[doc = "be considered advisory only - it is possible that the thread is switched"] - #[doc = "to a different CPU at any time. Returns a value in range"] - #[doc = "[0, gpr_cpu_num_cores() - 1]"] + #[doc = " Return the CPU on which the current thread is executing; N.B. This should\nbe considered advisory only - it is possible that the thread is switched\nto a different CPU at any time. Returns a value in range\n[0, gpr_cpu_num_cores() - 1]"] pub fn gpr_cpu_current_cpu() -> ::std::os::raw::c_uint; } #[repr(u32)] -#[doc = " The severity of a log message - use the #defines below when calling into"] -#[doc = "gpr_log to additionally supply file and line data"] +#[doc = " The severity of a log message - use the #defines below when calling into\ngpr_log to additionally supply file and line data"] #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)] pub enum gpr_log_severity { GPR_LOG_SEVERITY_DEBUG = 0, @@ -3767,8 +2725,7 @@ extern "C" { pub fn gpr_log_severity_string(severity: gpr_log_severity) -> *const ::std::os::raw::c_char; } extern "C" { - #[doc = " Log a message. It's advised to use GPR_xxx above to generate the context"] - #[doc = " for each message"] + #[doc = " Log a message. It's advised to use GPR_xxx above to generate the context\n for each message"] pub fn gpr_log( file: *const ::std::os::raw::c_char, line: ::std::os::raw::c_int, @@ -3795,8 +2752,7 @@ extern "C" { extern "C" { pub fn gpr_log_verbosity_init(); } -#[doc = " Log overrides: applications can use this API to intercept logging calls"] -#[doc = "and use their own implementations"] +#[doc = " Log overrides: applications can use this API to intercept logging calls\nand use their own implementations"] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct gpr_log_func_args { @@ -3814,28 +2770,18 @@ extern "C" { filename: *const ::std::os::raw::c_char, line: ::std::os::raw::c_int, message: *const ::std::os::raw::c_char, - ); + ) -> !; } extern "C" { - #[doc = " Returns a string allocated with gpr_malloc that contains a UTF-8"] - #[doc = " formatted error message, corresponding to the error messageid."] - #[doc = " Use in conjunction with GetLastError() et al."] + #[doc = " Returns a string allocated with gpr_malloc that contains a UTF-8\n formatted error message, corresponding to the error messageid.\n Use in conjunction with GetLastError() et al."] pub fn gpr_format_message(messageid: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " Returns a copy of src that can be passed to gpr_free()."] - #[doc = "If allocation fails or if src is NULL, returns NULL."] + #[doc = " Returns a copy of src that can be passed to gpr_free().\nIf allocation fails or if src is NULL, returns NULL."] pub fn gpr_strdup(src: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; } extern "C" { - #[doc = " printf to a newly-allocated string. The set of supported formats may vary"] - #[doc = "between platforms."] - #[doc = ""] - #[doc = "On success, returns the number of bytes printed (excluding the final '\\0'),"] - #[doc = "and *strp points to a string which must later be destroyed with gpr_free()."] - #[doc = ""] - #[doc = "On error, returns -1 and sets *strp to NULL. If the format string is bad,"] - #[doc = "the result is undefined."] + #[doc = " printf to a newly-allocated string. The set of supported formats may vary\nbetween platforms.\n\nOn success, returns the number of bytes printed (excluding the final '\\0'),\nand *strp points to a string which must later be destroyed with gpr_free().\n\nOn error, returns -1 and sets *strp to NULL. If the format string is bad,\nthe result is undefined."] pub fn gpr_asprintf( strp: *mut *mut ::std::os::raw::c_char, format: *const ::std::os::raw::c_char, @@ -4226,10 +3172,7 @@ extern "C" { ) -> grpc_call_error; } extern "C" { - #[doc = " Kick call's completion queue, it should be called after there is an event"] - #[doc = "ready to poll."] - #[doc = "THREAD SAFETY: grpcwrap_call_kick_completion_queue is thread-safe"] - #[doc = "because it does not change the call's state."] + #[doc = " Kick call's completion queue, it should be called after there is an event\nready to poll.\nTHREAD SAFETY: grpcwrap_call_kick_completion_queue is thread-safe\nbecause it does not change the call's state."] pub fn grpcwrap_call_kick_completion_queue( call: *mut grpc_call, tag: *mut ::std::os::raw::c_void, diff --git a/grpc-sys/build.rs b/grpc-sys/build.rs index 832a3a384..ea780e20c 100644 --- a/grpc-sys/build.rs +++ b/grpc-sys/build.rs @@ -300,7 +300,7 @@ fn build_grpc(cc: &mut cc::Build, library: &str) { fn figure_systemd_path(build_dir: &str) { let path = format!("{build_dir}/CMakeCache.txt"); - let f = BufReader::new(std::fs::File::open(&path).unwrap()); + let f = BufReader::new(std::fs::File::open(path).unwrap()); let mut libdir: Option = None; let mut libname: Option = None; for l in f.lines() { @@ -444,7 +444,6 @@ fn bindgen_grpc(file_path: &Path) { .clang_arg("-xc++") .clang_arg("-I./grpc/include") .clang_arg("-std=c++11") - .rustfmt_bindings(true) .impl_debug(true) .size_t_is_usize(true) .disable_header_comment() diff --git a/grpc-sys/src/lib.rs b/grpc-sys/src/lib.rs index dc0699c06..6e263cd7c 100644 --- a/grpc-sys/src/lib.rs +++ b/grpc-sys/src/lib.rs @@ -10,4 +10,3 @@ mod bindings { mod grpc_wrap; pub use bindings::*; -pub use grpc_wrap::*; diff --git a/health/Cargo.toml b/health/Cargo.toml index 959b58e8e..f26bccfcf 100644 --- a/health/Cargo.toml +++ b/health/Cargo.toml @@ -22,7 +22,7 @@ prost-codec = ["grpcio/prost-codec", "prost"] futures-executor = "0.3" futures-util = { version = "0.3", default-features = false, features = ["std"] } grpcio = { path = "..", version = "0.13.0", default-features = false } -prost = { version = "0.11", optional = true } +prost = { version = "0.12", optional = true } protobuf = { version = "2", optional = true } protobufv3 = { package = "protobuf", version = "3.2", optional = true } log = "0.4" diff --git a/health/src/proto.rs b/health/src/proto.rs index b6daec5b9..4863f7dfa 100644 --- a/health/src/proto.rs +++ b/health/src/proto.rs @@ -22,7 +22,8 @@ mod protobuf_v3 { #[cfg(feature = "protobuf-codec")] mod reexports { pub use super::protobuf::health::*; - pub use super::protobuf::health_grpc::*; + // Following is included in health import above. + // pub use super::protobuf::health_grpc::*; } #[cfg(feature = "protobufv3-codec")] mod reexports { diff --git a/health/src/proto/prost/grpc.health.v1.rs b/health/src/proto/prost/grpc.health.v1.rs index 5eb4e7fdc..222daa769 100644 --- a/health/src/proto/prost/grpc.health.v1.rs +++ b/health/src/proto/prost/grpc.health.v1.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct HealthCheckRequest { diff --git a/health/src/proto/protobuf_v3/health.rs b/health/src/proto/protobuf_v3/health.rs index 73036bf1d..8282afdf4 100644 --- a/health/src/proto/protobuf_v3/health.rs +++ b/health/src/proto/protobuf_v3/health.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit +// This file is generated by rust-protobuf 3.4.0. Do not edit // @generated // https://github.com/rust-lang/rust-clippy/issues/702 @@ -22,10 +22,10 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_2_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_4_0; -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.health.v1.HealthCheckRequest) +#[derive(PartialEq,Clone,Default,Debug)] pub struct HealthCheckRequest { // message fields // @@protoc_insertion_point(field:grpc.health.v1.HealthCheckRequest.service) @@ -146,8 +146,8 @@ impl ::protobufv3::reflect::ProtobufValue for HealthCheckRequest { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.health.v1.HealthCheckResponse) +#[derive(PartialEq,Clone,Default,Debug)] pub struct HealthCheckResponse { // message fields // @@protoc_insertion_point(field:grpc.health.v1.HealthCheckResponse.status) @@ -300,6 +300,16 @@ pub mod health_check_response { } } + fn from_str(str: &str) -> ::std::option::Option { + match str { + "Unknown" => ::std::option::Option::Some(ServingStatus::Unknown), + "Serving" => ::std::option::Option::Some(ServingStatus::Serving), + "NotServing" => ::std::option::Option::Some(ServingStatus::NotServing), + "ServiceUnknown" => ::std::option::Option::Some(ServingStatus::ServiceUnknown), + _ => ::std::option::Option::None + } + } + const VALUES: &'static [ServingStatus] = &[ ServingStatus::Unknown, ServingStatus::Serving, diff --git a/interop/Cargo.toml b/interop/Cargo.toml index 846cbef0b..d84786ad4 100644 --- a/interop/Cargo.toml +++ b/interop/Cargo.toml @@ -18,7 +18,7 @@ protobufv3 = { package = "protobuf", version = "3.2", optional = true } futures-executor = "0.3" futures-util = { version = "0.3", default-features = false, features = ["std"] } log = "0.4" -clap = "2.23" +clap = { version = "4.5", features = ["derive"] } futures-timer = "3.0" [[bin]] diff --git a/interop/src/bin/client.rs b/interop/src/bin/client.rs index 95c444b5d..b813928c3 100644 --- a/interop/src/bin/client.rs +++ b/interop/src/bin/client.rs @@ -7,67 +7,44 @@ extern crate interop; use crate::grpc::{ChannelBuilder, ChannelCredentialsBuilder, Environment}; use crate::grpc_proto::util; -use clap::{App, Arg}; +use clap::Parser; use std::sync::Arc; use interop::Client; +/// Interoperability Test Client +/// +/// ref https://github.com/grpc/grpc/blob/v1.3.x/doc/interop-test-descriptions.md. +#[derive(Parser)] +struct ClientCli { + /// The server host to connect to. For example, "localhost" or "127.0.0.1" + #[arg(long)] + host: Option, + /// The server host client pretend to connect. It's used for testing SSL/TLS to an arbitrary host. + #[arg(long)] + host_override: Option, + /// The server port to connect to. For example, 8080 + #[arg(long)] + port: Option, + /// The name of the test case to execute. For example, "empty_unary" + #[arg(long)] + case: Option, + /// Whether to use a plaintext or encrypted connection + #[arg(long)] + use_tls: Option, + /// Whether to replace platform root CAs with ca.pem as the CA root + #[arg(long)] + use_test_ca: Option, +} + fn main() { - let matches = App::new("Interoperability Test Client") - .about("ref https://github.com/grpc/grpc/blob/v1.3.x/doc/interop-test-descriptions.md") - .arg( - Arg::with_name("host") - .long("server_host") - .help("The server host to connect to. For example, \"localhost\" or \"127.0.0.1\"") - .takes_value(true), - ) - .arg( - Arg::with_name("host_override") - .long("server_host_override") - .help("The server host to connect to. For example, \"localhost\" or \"127.0.0.1\"") - .takes_value(true), - ) - .arg( - Arg::with_name("port") - .long("server_port") - .help("The server port to connect to. For example, \"8080\"") - .takes_value(true), - ) - .arg( - Arg::with_name("case") - .long("test_case") - .help("The name of the test case to execute. For example, \"empty_unary\"") - .takes_value(true), - ) - .arg( - Arg::with_name("use_tls") - .long("use_tls") - .help("Whether to use a plaintext or encrypted connection") - .takes_value(true), - ) - .arg( - Arg::with_name("use_test_ca") - .long("use_test_ca") - .help("Whether to replace platform root CAs with ca.pem as the CA root") - .takes_value(true), - ) - .get_matches(); - let host = matches.value_of("host").unwrap_or("127.0.0.1"); - let host_override = matches - .value_of("host_override") - .unwrap_or("foo.test.google.fr"); - let port = matches.value_of("port").unwrap_or("8080"); - let case = matches.value_of("case"); - let use_tls: bool = matches - .value_of("use_tls") - .unwrap_or("false") - .parse() - .unwrap(); - let use_test_ca: bool = matches - .value_of("use_test_ca") - .unwrap_or("false") - .parse() - .unwrap(); + let cli = ClientCli::parse(); + let host = cli.host.as_deref().unwrap_or("127.0.0.1"); + let host_override = cli.host_override.as_deref().unwrap_or("foo.test.google.fr"); + let port = cli.port.unwrap_or(8080); + let case = cli.case.as_deref(); + let use_tls = cli.use_tls.unwrap_or(false); + let use_test_ca = cli.use_test_ca.unwrap_or(false); let env = Arc::new(Environment::new(1)); let mut builder = ChannelBuilder::new(env).override_ssl_target(host_override.to_owned()); diff --git a/interop/src/bin/server.rs b/interop/src/bin/server.rs index e14ed6eb2..c92c33d3a 100644 --- a/interop/src/bin/server.rs +++ b/interop/src/bin/server.rs @@ -7,42 +7,34 @@ extern crate log; use std::sync::Arc; -use clap::{App, Arg}; +use clap::Parser; use futures_executor::block_on; use grpc::{Environment, ServerBuilder, ServerCredentials}; use grpc_proto::testing::test_grpc::create_test_service; use grpc_proto::util; use interop::InteropTestService; +/// Interoperability Test Server +/// +/// ref https://github.com/grpc/grpc/blob/v1.3.x/doc/interop-test-descriptions.md. +#[derive(Parser)] +struct ServerCli { + /// The server host to listen to. For example, "localhost" or "127.0.0.1" + #[arg(long)] + host: Option, + /// The port to listen on. For example, 8080 + #[arg(long)] + port: Option, + /// Whether to use a plaintext or encrypted connection + #[arg(long)] + use_tls: Option, +} + fn main() { - let matches = App::new("Interoperability Test Server") - .about("ref https://github.com/grpc/grpc/blob/v1.3.x/doc/interop-test-descriptions.md") - .arg( - Arg::with_name("host") - .long("host") - .help("The server host to listen to. For example, \"localhost\" or \"127.0.0.1\"") - .takes_value(true), - ) - .arg( - Arg::with_name("port") - .long("port") - .help("The port to listen on. For example, \"8080\"") - .takes_value(true), - ) - .arg( - Arg::with_name("use_tls") - .long("use_tls") - .help("Whether to use a plaintext or encrypted connection") - .takes_value(true), - ) - .get_matches(); - let host = matches.value_of("host").unwrap_or("127.0.0.1"); - let mut port: u16 = matches.value_of("port").unwrap_or("8080").parse().unwrap(); - let use_tls: bool = matches - .value_of("use_tls") - .unwrap_or("false") - .parse() - .unwrap(); + let cli = ServerCli::parse(); + let host = cli.host.as_deref().unwrap_or("127.0.0.1"); + let mut port: u16 = cli.port.unwrap_or(8080); + let use_tls: bool = cli.use_tls.unwrap_or(false); let env = Arc::new(Environment::new(2)); let service = create_test_service(InteropTestService); diff --git a/interop/src/client.rs b/interop/src/client.rs index 68ae4abdb..d462c8077 100644 --- a/interop/src/client.rs +++ b/interop/src/client.rs @@ -80,7 +80,7 @@ impl Client { pub async fn server_streaming(&self) -> grpcio::Result<()> { print!("testing server streaming ... "); - let sizes = vec![31415, 9, 2653, 58979]; + let sizes = [31415, 9, 2653, 58979]; let req = StreamingOutputCallRequest { response_parameters: sizes .iter() diff --git a/interop/src/server.rs b/interop/src/server.rs index ee7b0acc9..efd621889 100644 --- a/interop/src/server.rs +++ b/interop/src/server.rs @@ -167,7 +167,7 @@ impl TestService for InteropTestService { } let mut resp = StreamingOutputCallResponse::default(); - if let Some(param) = req.response_parameters.get(0) { + if let Some(param) = req.response_parameters.first() { resp.payload = Some(util::new_payload(param.size as usize)).into(); } // A workaround for timeout_on_sleeping_server test. diff --git a/proto/Cargo.toml b/proto/Cargo.toml index 8cd72d38e..576553230 100644 --- a/proto/Cargo.toml +++ b/proto/Cargo.toml @@ -20,13 +20,13 @@ prost-codec = ["prost-build", "prost-derive", "prost-types", "bytes", "lazy_stat [dependencies] grpcio = { path = "..", features = ["boringssl"], version = "0.13.0", default-features = false } bytes = { version = "1.0", optional = true } -prost = { version = "0.11", optional = true } -prost-derive = { version = "0.11", optional = true } -prost-types = { version = "0.11", optional = true } +prost = { version = "0.12", optional = true } +prost-derive = { version = "0.12", optional = true } +prost-types = { version = "0.12", optional = true } protobuf = { version = "2", optional = true } protobufv3 = { package = "protobuf", version = "3.2", optional = true } lazy_static = { version = "1.3", optional = true } [build-dependencies] -prost-build = { version = "0.11", optional = true } +prost-build = { version = "0.12", optional = true } walkdir = "2.2" diff --git a/proto/src/proto/prost/example/helloworld.rs b/proto/src/proto/prost/example/helloworld.rs index b3a98bf8f..fc7e1f4cb 100644 --- a/proto/src/proto/prost/example/helloworld.rs +++ b/proto/src/proto/prost/example/helloworld.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. /// The request message containing the user's name. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/proto/src/proto/prost/example/routeguide.rs b/proto/src/proto/prost/example/routeguide.rs index 2e47f20b7..87cf18213 100644 --- a/proto/src/proto/prost/example/routeguide.rs +++ b/proto/src/proto/prost/example/routeguide.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. /// Points are represented as latitude-longitude pairs in the E7 representation /// (degrees multiplied by 10**7 and rounded to the nearest integer). /// Latitudes should be in the range +/- 90 degrees and longitude should be in diff --git a/proto/src/proto/prost/google/rpc/google.rpc.rs b/proto/src/proto/prost/google/rpc/google.rpc.rs index bb201435e..52666607c 100644 --- a/proto/src/proto/prost/google/rpc/google.rpc.rs +++ b/proto/src/proto/prost/google/rpc/google.rpc.rs @@ -1,6 +1,7 @@ +// This file is @generated by prost-build. /// The `Status` type defines a logical error model that is suitable for different /// programming environments, including REST APIs and RPC APIs. It is used by -/// \[gRPC\](). The error model is designed to be: +/// [gRPC](). The error model is designed to be: /// /// - Simple to use and understand for most users /// - Flexible enough to meet unexpected needs @@ -9,7 +10,7 @@ /// /// The `Status` message contains three pieces of data: error code, error message, /// and error details. The error code should be an enum value of -/// \[google.rpc.Code][google.rpc.Code\], but it may accept additional error codes if needed. The +/// [google.rpc.Code][google.rpc.Code], but it may accept additional error codes if needed. The /// error message should be a developer-facing English message that helps /// developers *understand* and *resolve* the error. If a localized user-facing /// error message is needed, put the localized message in the error details or @@ -53,12 +54,12 @@ #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Status { - /// The status code, which should be an enum value of \[google.rpc.Code][google.rpc.Code\]. + /// The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. #[prost(int32, tag = "1")] pub code: i32, /// A developer-facing error message, which should be in English. Any /// user-facing error message should be localized and sent in the - /// \[google.rpc.Status.details][google.rpc.Status.details\] field, or localized by the client. + /// [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. #[prost(string, tag = "2")] pub message: ::prost::alloc::string::String, /// A list of messages that carry the error details. There will be a diff --git a/proto/src/proto/prost/testing/grpc.testing.rs b/proto/src/proto/prost/testing/grpc.testing.rs index 5ad020b64..592f90f40 100644 --- a/proto/src/proto/prost/testing/grpc.testing.rs +++ b/proto/src/proto/prost/testing/grpc.testing.rs @@ -1,3 +1,4 @@ +// This file is @generated by prost-build. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ByteBufferParams { @@ -193,7 +194,7 @@ pub struct ClientConfig { #[prost(int32, tag = "4")] pub outstanding_rpcs_per_channel: i32, /// Number of independent client channels to create. - /// i-th channel will connect to server_target[i % server_targets.size()] + /// i-th channel will connect to server_target\[i % server_targets.size()\] #[prost(int32, tag = "5")] pub client_channels: i32, /// Only for async client. Number of threads to use to start/manage RPCs. diff --git a/proto/src/proto/protobuf_v3/example/helloworld.rs b/proto/src/proto/protobuf_v3/example/helloworld.rs index f5fd1867f..9665850f4 100644 --- a/proto/src/proto/protobuf_v3/example/helloworld.rs +++ b/proto/src/proto/protobuf_v3/example/helloworld.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit +// This file is generated by rust-protobuf 3.4.0. Do not edit // @generated // https://github.com/rust-lang/rust-clippy/issues/702 @@ -22,10 +22,10 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_2_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_4_0; -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:helloworld.HelloRequest) +#[derive(PartialEq,Clone,Default,Debug)] pub struct HelloRequest { // message fields // @@protoc_insertion_point(field:helloworld.HelloRequest.name) @@ -146,8 +146,8 @@ impl ::protobufv3::reflect::ProtobufValue for HelloRequest { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:helloworld.HelloReply) +#[derive(PartialEq,Clone,Default,Debug)] pub struct HelloReply { // message fields // @@protoc_insertion_point(field:helloworld.HelloReply.message) diff --git a/proto/src/proto/protobuf_v3/example/route_guide.rs b/proto/src/proto/protobuf_v3/example/route_guide.rs index 1c9bea184..6404cb545 100644 --- a/proto/src/proto/protobuf_v3/example/route_guide.rs +++ b/proto/src/proto/protobuf_v3/example/route_guide.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit +// This file is generated by rust-protobuf 3.4.0. Do not edit // @generated // https://github.com/rust-lang/rust-clippy/issues/702 @@ -22,10 +22,10 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_2_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_4_0; -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:routeguide.Point) +#[derive(PartialEq,Clone,Default,Debug)] pub struct Point { // message fields // @@protoc_insertion_point(field:routeguide.Point.latitude) @@ -164,8 +164,8 @@ impl ::protobufv3::reflect::ProtobufValue for Point { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:routeguide.Rectangle) +#[derive(PartialEq,Clone,Default,Debug)] pub struct Rectangle { // message fields // @@protoc_insertion_point(field:routeguide.Rectangle.lo) @@ -306,8 +306,8 @@ impl ::protobufv3::reflect::ProtobufValue for Rectangle { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:routeguide.Feature) +#[derive(PartialEq,Clone,Default,Debug)] pub struct Feature { // message fields // @@protoc_insertion_point(field:routeguide.Feature.name) @@ -447,8 +447,8 @@ impl ::protobufv3::reflect::ProtobufValue for Feature { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:routeguide.RouteNote) +#[derive(PartialEq,Clone,Default,Debug)] pub struct RouteNote { // message fields // @@protoc_insertion_point(field:routeguide.RouteNote.location) @@ -588,8 +588,8 @@ impl ::protobufv3::reflect::ProtobufValue for RouteNote { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:routeguide.RouteSummary) +#[derive(PartialEq,Clone,Default,Debug)] pub struct RouteSummary { // message fields // @@protoc_insertion_point(field:routeguide.RouteSummary.point_count) diff --git a/proto/src/proto/protobuf_v3/google/rpc/status.rs b/proto/src/proto/protobuf_v3/google/rpc/status.rs index e452321f5..410fde5b5 100644 --- a/proto/src/proto/protobuf_v3/google/rpc/status.rs +++ b/proto/src/proto/protobuf_v3/google/rpc/status.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit +// This file is generated by rust-protobuf 3.4.0. Do not edit // @generated // https://github.com/rust-lang/rust-clippy/issues/702 @@ -22,10 +22,10 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_2_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_4_0; -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:google.rpc.Status) +#[derive(PartialEq,Clone,Default,Debug)] pub struct Status { // message fields // @@protoc_insertion_point(field:google.rpc.Status.code) diff --git a/proto/src/proto/protobuf_v3/testing/control.rs b/proto/src/proto/protobuf_v3/testing/control.rs index 27225d4c4..d9acda06f 100644 --- a/proto/src/proto/protobuf_v3/testing/control.rs +++ b/proto/src/proto/protobuf_v3/testing/control.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit +// This file is generated by rust-protobuf 3.4.0. Do not edit // @generated // https://github.com/rust-lang/rust-clippy/issues/702 @@ -22,10 +22,10 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_2_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_4_0; -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.PoissonParams) +#[derive(PartialEq,Clone,Default,Debug)] pub struct PoissonParams { // message fields // @@protoc_insertion_point(field:grpc.testing.PoissonParams.offered_load) @@ -146,8 +146,8 @@ impl ::protobufv3::reflect::ProtobufValue for PoissonParams { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.ClosedLoopParams) +#[derive(PartialEq,Clone,Default,Debug)] pub struct ClosedLoopParams { // special fields // @@protoc_insertion_point(special_field:grpc.testing.ClosedLoopParams.special_fields) @@ -249,8 +249,8 @@ impl ::protobufv3::reflect::ProtobufValue for ClosedLoopParams { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.LoadParams) +#[derive(PartialEq,Clone,Default,Debug)] pub struct LoadParams { // message oneof groups pub load: ::std::option::Option, @@ -528,8 +528,8 @@ pub mod load_params { } } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.SecurityParams) +#[derive(PartialEq,Clone,Default,Debug)] pub struct SecurityParams { // message fields // @@protoc_insertion_point(field:grpc.testing.SecurityParams.use_test_ca) @@ -686,8 +686,8 @@ impl ::protobufv3::reflect::ProtobufValue for SecurityParams { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.ChannelArg) +#[derive(PartialEq,Clone,Default,Debug)] pub struct ChannelArg { // message fields // @@protoc_insertion_point(field:grpc.testing.ChannelArg.name) @@ -956,8 +956,8 @@ pub mod channel_arg { } } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.ClientConfig) +#[derive(PartialEq,Clone,Default,Debug)] pub struct ClientConfig { // message fields // @@protoc_insertion_point(field:grpc.testing.ClientConfig.server_targets) @@ -1356,8 +1356,8 @@ impl ::protobufv3::reflect::ProtobufValue for ClientConfig { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.ClientStatus) +#[derive(PartialEq,Clone,Default,Debug)] pub struct ClientStatus { // message fields // @@protoc_insertion_point(field:grpc.testing.ClientStatus.stats) @@ -1479,8 +1479,8 @@ impl ::protobufv3::reflect::ProtobufValue for ClientStatus { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.Mark) +#[derive(PartialEq,Clone,Default,Debug)] pub struct Mark { // message fields // @@protoc_insertion_point(field:grpc.testing.Mark.reset) @@ -1601,8 +1601,8 @@ impl ::protobufv3::reflect::ProtobufValue for Mark { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.ClientArgs) +#[derive(PartialEq,Clone,Default,Debug)] pub struct ClientArgs { // message oneof groups pub argtype: ::std::option::Option, @@ -1880,8 +1880,8 @@ pub mod client_args { } } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.ServerConfig) +#[derive(PartialEq,Clone,Default,Debug)] pub struct ServerConfig { // message fields // @@protoc_insertion_point(field:grpc.testing.ServerConfig.server_type) @@ -2188,8 +2188,8 @@ impl ::protobufv3::reflect::ProtobufValue for ServerConfig { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.ServerArgs) +#[derive(PartialEq,Clone,Default,Debug)] pub struct ServerArgs { // message oneof groups pub argtype: ::std::option::Option, @@ -2467,8 +2467,8 @@ pub mod server_args { } } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.ServerStatus) +#[derive(PartialEq,Clone,Default,Debug)] pub struct ServerStatus { // message fields // @@protoc_insertion_point(field:grpc.testing.ServerStatus.stats) @@ -2626,8 +2626,8 @@ impl ::protobufv3::reflect::ProtobufValue for ServerStatus { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.CoreRequest) +#[derive(PartialEq,Clone,Default,Debug)] pub struct CoreRequest { // special fields // @@protoc_insertion_point(special_field:grpc.testing.CoreRequest.special_fields) @@ -2729,8 +2729,8 @@ impl ::protobufv3::reflect::ProtobufValue for CoreRequest { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.CoreResponse) +#[derive(PartialEq,Clone,Default,Debug)] pub struct CoreResponse { // message fields // @@protoc_insertion_point(field:grpc.testing.CoreResponse.cores) @@ -2851,8 +2851,8 @@ impl ::protobufv3::reflect::ProtobufValue for CoreResponse { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.Void) +#[derive(PartialEq,Clone,Default,Debug)] pub struct Void { // special fields // @@protoc_insertion_point(special_field:grpc.testing.Void.special_fields) @@ -2954,8 +2954,8 @@ impl ::protobufv3::reflect::ProtobufValue for Void { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.Scenario) +#[derive(PartialEq,Clone,Default,Debug)] pub struct Scenario { // message fields // @@protoc_insertion_point(field:grpc.testing.Scenario.name) @@ -3204,8 +3204,8 @@ impl ::protobufv3::reflect::ProtobufValue for Scenario { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.Scenarios) +#[derive(PartialEq,Clone,Default,Debug)] pub struct Scenarios { // message fields // @@protoc_insertion_point(field:grpc.testing.Scenarios.scenarios) @@ -3327,8 +3327,8 @@ impl ::protobufv3::reflect::ProtobufValue for Scenarios { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.ScenarioResultSummary) +#[derive(PartialEq,Clone,Default,Debug)] pub struct ScenarioResultSummary { // message fields // @@protoc_insertion_point(field:grpc.testing.ScenarioResultSummary.qps) @@ -3755,8 +3755,8 @@ impl ::protobufv3::reflect::ProtobufValue for ScenarioResultSummary { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.ScenarioResult) +#[derive(PartialEq,Clone,Default,Debug)] pub struct ScenarioResult { // message fields // @@protoc_insertion_point(field:grpc.testing.ScenarioResult.scenario) @@ -4059,6 +4059,15 @@ impl ::protobufv3::Enum for ClientType { } } + fn from_str(str: &str) -> ::std::option::Option { + match str { + "SYNC_CLIENT" => ::std::option::Option::Some(ClientType::SYNC_CLIENT), + "ASYNC_CLIENT" => ::std::option::Option::Some(ClientType::ASYNC_CLIENT), + "OTHER_CLIENT" => ::std::option::Option::Some(ClientType::OTHER_CLIENT), + _ => ::std::option::Option::None + } + } + const VALUES: &'static [ClientType] = &[ ClientType::SYNC_CLIENT, ClientType::ASYNC_CLIENT, @@ -4120,6 +4129,16 @@ impl ::protobufv3::Enum for ServerType { } } + fn from_str(str: &str) -> ::std::option::Option { + match str { + "SYNC_SERVER" => ::std::option::Option::Some(ServerType::SYNC_SERVER), + "ASYNC_SERVER" => ::std::option::Option::Some(ServerType::ASYNC_SERVER), + "ASYNC_GENERIC_SERVER" => ::std::option::Option::Some(ServerType::ASYNC_GENERIC_SERVER), + "OTHER_SERVER" => ::std::option::Option::Some(ServerType::OTHER_SERVER), + _ => ::std::option::Option::None + } + } + const VALUES: &'static [ServerType] = &[ ServerType::SYNC_SERVER, ServerType::ASYNC_SERVER, @@ -4185,6 +4204,17 @@ impl ::protobufv3::Enum for RpcType { } } + fn from_str(str: &str) -> ::std::option::Option { + match str { + "UNARY" => ::std::option::Option::Some(RpcType::UNARY), + "STREAMING" => ::std::option::Option::Some(RpcType::STREAMING), + "STREAMING_FROM_CLIENT" => ::std::option::Option::Some(RpcType::STREAMING_FROM_CLIENT), + "STREAMING_FROM_SERVER" => ::std::option::Option::Some(RpcType::STREAMING_FROM_SERVER), + "STREAMING_BOTH_WAYS" => ::std::option::Option::Some(RpcType::STREAMING_BOTH_WAYS), + _ => ::std::option::Option::None + } + } + const VALUES: &'static [RpcType] = &[ RpcType::UNARY, RpcType::STREAMING, diff --git a/proto/src/proto/protobuf_v3/testing/empty.rs b/proto/src/proto/protobuf_v3/testing/empty.rs index c3c7dac94..fc2070d4b 100644 --- a/proto/src/proto/protobuf_v3/testing/empty.rs +++ b/proto/src/proto/protobuf_v3/testing/empty.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit +// This file is generated by rust-protobuf 3.4.0. Do not edit // @generated // https://github.com/rust-lang/rust-clippy/issues/702 @@ -22,10 +22,10 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_2_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_4_0; -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.Empty) +#[derive(PartialEq,Clone,Default,Debug)] pub struct Empty { // special fields // @@protoc_insertion_point(special_field:grpc.testing.Empty.special_fields) diff --git a/proto/src/proto/protobuf_v3/testing/messages.rs b/proto/src/proto/protobuf_v3/testing/messages.rs index b08e89a4b..8c3559aaf 100644 --- a/proto/src/proto/protobuf_v3/testing/messages.rs +++ b/proto/src/proto/protobuf_v3/testing/messages.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit +// This file is generated by rust-protobuf 3.4.0. Do not edit // @generated // https://github.com/rust-lang/rust-clippy/issues/702 @@ -22,10 +22,10 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_2_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_4_0; -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.BoolValue) +#[derive(PartialEq,Clone,Default,Debug)] pub struct BoolValue { // message fields // @@protoc_insertion_point(field:grpc.testing.BoolValue.value) @@ -146,8 +146,8 @@ impl ::protobufv3::reflect::ProtobufValue for BoolValue { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.Payload) +#[derive(PartialEq,Clone,Default,Debug)] pub struct Payload { // message fields // @@protoc_insertion_point(field:grpc.testing.Payload.type) @@ -286,8 +286,8 @@ impl ::protobufv3::reflect::ProtobufValue for Payload { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.EchoStatus) +#[derive(PartialEq,Clone,Default,Debug)] pub struct EchoStatus { // message fields // @@protoc_insertion_point(field:grpc.testing.EchoStatus.code) @@ -426,8 +426,8 @@ impl ::protobufv3::reflect::ProtobufValue for EchoStatus { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.SimpleRequest) +#[derive(PartialEq,Clone,Default,Debug)] pub struct SimpleRequest { // message fields // @@protoc_insertion_point(field:grpc.testing.SimpleRequest.response_type) @@ -678,8 +678,8 @@ impl ::protobufv3::reflect::ProtobufValue for SimpleRequest { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.SimpleResponse) +#[derive(PartialEq,Clone,Default,Debug)] pub struct SimpleResponse { // message fields // @@protoc_insertion_point(field:grpc.testing.SimpleResponse.payload) @@ -837,8 +837,8 @@ impl ::protobufv3::reflect::ProtobufValue for SimpleResponse { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.StreamingInputCallRequest) +#[derive(PartialEq,Clone,Default,Debug)] pub struct StreamingInputCallRequest { // message fields // @@protoc_insertion_point(field:grpc.testing.StreamingInputCallRequest.payload) @@ -979,8 +979,8 @@ impl ::protobufv3::reflect::ProtobufValue for StreamingInputCallRequest { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.StreamingInputCallResponse) +#[derive(PartialEq,Clone,Default,Debug)] pub struct StreamingInputCallResponse { // message fields // @@protoc_insertion_point(field:grpc.testing.StreamingInputCallResponse.aggregated_payload_size) @@ -1101,8 +1101,8 @@ impl ::protobufv3::reflect::ProtobufValue for StreamingInputCallResponse { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.ResponseParameters) +#[derive(PartialEq,Clone,Default,Debug)] pub struct ResponseParameters { // message fields // @@protoc_insertion_point(field:grpc.testing.ResponseParameters.size) @@ -1260,8 +1260,8 @@ impl ::protobufv3::reflect::ProtobufValue for ResponseParameters { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.StreamingOutputCallRequest) +#[derive(PartialEq,Clone,Default,Debug)] pub struct StreamingOutputCallRequest { // message fields // @@protoc_insertion_point(field:grpc.testing.StreamingOutputCallRequest.response_type) @@ -1439,8 +1439,8 @@ impl ::protobufv3::reflect::ProtobufValue for StreamingOutputCallRequest { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.StreamingOutputCallResponse) +#[derive(PartialEq,Clone,Default,Debug)] pub struct StreamingOutputCallResponse { // message fields // @@protoc_insertion_point(field:grpc.testing.StreamingOutputCallResponse.payload) @@ -1562,8 +1562,8 @@ impl ::protobufv3::reflect::ProtobufValue for StreamingOutputCallResponse { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.ReconnectParams) +#[derive(PartialEq,Clone,Default,Debug)] pub struct ReconnectParams { // message fields // @@protoc_insertion_point(field:grpc.testing.ReconnectParams.max_reconnect_backoff_ms) @@ -1684,8 +1684,8 @@ impl ::protobufv3::reflect::ProtobufValue for ReconnectParams { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.ReconnectInfo) +#[derive(PartialEq,Clone,Default,Debug)] pub struct ReconnectInfo { // message fields // @@protoc_insertion_point(field:grpc.testing.ReconnectInfo.passed) @@ -1848,6 +1848,13 @@ impl ::protobufv3::Enum for PayloadType { } } + fn from_str(str: &str) -> ::std::option::Option { + match str { + "COMPRESSABLE" => ::std::option::Option::Some(PayloadType::COMPRESSABLE), + _ => ::std::option::Option::None + } + } + const VALUES: &'static [PayloadType] = &[ PayloadType::COMPRESSABLE, ]; diff --git a/proto/src/proto/protobuf_v3/testing/payloads.rs b/proto/src/proto/protobuf_v3/testing/payloads.rs index cefff4fe7..915cda7f4 100644 --- a/proto/src/proto/protobuf_v3/testing/payloads.rs +++ b/proto/src/proto/protobuf_v3/testing/payloads.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit +// This file is generated by rust-protobuf 3.4.0. Do not edit // @generated // https://github.com/rust-lang/rust-clippy/issues/702 @@ -22,10 +22,10 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_2_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_4_0; -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.ByteBufferParams) +#[derive(PartialEq,Clone,Default,Debug)] pub struct ByteBufferParams { // message fields // @@protoc_insertion_point(field:grpc.testing.ByteBufferParams.req_size) @@ -164,8 +164,8 @@ impl ::protobufv3::reflect::ProtobufValue for ByteBufferParams { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.SimpleProtoParams) +#[derive(PartialEq,Clone,Default,Debug)] pub struct SimpleProtoParams { // message fields // @@protoc_insertion_point(field:grpc.testing.SimpleProtoParams.req_size) @@ -304,8 +304,8 @@ impl ::protobufv3::reflect::ProtobufValue for SimpleProtoParams { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.ComplexProtoParams) +#[derive(PartialEq,Clone,Default,Debug)] pub struct ComplexProtoParams { // special fields // @@protoc_insertion_point(special_field:grpc.testing.ComplexProtoParams.special_fields) @@ -407,8 +407,8 @@ impl ::protobufv3::reflect::ProtobufValue for ComplexProtoParams { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.PayloadConfig) +#[derive(PartialEq,Clone,Default,Debug)] pub struct PayloadConfig { // message oneof groups pub payload: ::std::option::Option, diff --git a/proto/src/proto/protobuf_v3/testing/services.rs b/proto/src/proto/protobuf_v3/testing/services.rs index 538c3c655..8259d703e 100644 --- a/proto/src/proto/protobuf_v3/testing/services.rs +++ b/proto/src/proto/protobuf_v3/testing/services.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit +// This file is generated by rust-protobuf 3.4.0. Do not edit // @generated // https://github.com/rust-lang/rust-clippy/issues/702 @@ -22,7 +22,7 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_2_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_4_0; static file_descriptor_proto_data: &'static [u8] = b"\ \n\x1bgrpc/testing/services.proto\x12\x0cgrpc.testing\x1a\x1bgrpc/testin\ diff --git a/proto/src/proto/protobuf_v3/testing/stats.rs b/proto/src/proto/protobuf_v3/testing/stats.rs index b85df900a..bd5782f49 100644 --- a/proto/src/proto/protobuf_v3/testing/stats.rs +++ b/proto/src/proto/protobuf_v3/testing/stats.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit +// This file is generated by rust-protobuf 3.4.0. Do not edit // @generated // https://github.com/rust-lang/rust-clippy/issues/702 @@ -22,10 +22,10 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_2_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_4_0; -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.ServerStats) +#[derive(PartialEq,Clone,Default,Debug)] pub struct ServerStats { // message fields // @@protoc_insertion_point(field:grpc.testing.ServerStats.time_elapsed) @@ -236,8 +236,8 @@ impl ::protobufv3::reflect::ProtobufValue for ServerStats { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.HistogramParams) +#[derive(PartialEq,Clone,Default,Debug)] pub struct HistogramParams { // message fields // @@protoc_insertion_point(field:grpc.testing.HistogramParams.resolution) @@ -376,8 +376,8 @@ impl ::protobufv3::reflect::ProtobufValue for HistogramParams { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.HistogramData) +#[derive(PartialEq,Clone,Default,Debug)] pub struct HistogramData { // message fields // @@protoc_insertion_point(field:grpc.testing.HistogramData.bucket) @@ -591,8 +591,8 @@ impl ::protobufv3::reflect::ProtobufValue for HistogramData { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.RequestResultCount) +#[derive(PartialEq,Clone,Default,Debug)] pub struct RequestResultCount { // message fields // @@protoc_insertion_point(field:grpc.testing.RequestResultCount.status_code) @@ -731,8 +731,8 @@ impl ::protobufv3::reflect::ProtobufValue for RequestResultCount { type RuntimeType = ::protobufv3::reflect::rt::RuntimeTypeMessage; } -#[derive(PartialEq,Clone,Default,Debug)] // @@protoc_insertion_point(message:grpc.testing.ClientStats) +#[derive(PartialEq,Clone,Default,Debug)] pub struct ClientStats { // message fields // @@protoc_insertion_point(field:grpc.testing.ClientStats.latencies) diff --git a/proto/src/proto/protobuf_v3/testing/test.rs b/proto/src/proto/protobuf_v3/testing/test.rs index 18c7d39a5..c51ca595d 100644 --- a/proto/src/proto/protobuf_v3/testing/test.rs +++ b/proto/src/proto/protobuf_v3/testing/test.rs @@ -1,4 +1,4 @@ -// This file is generated by rust-protobuf 3.2.0. Do not edit +// This file is generated by rust-protobuf 3.4.0. Do not edit // @generated // https://github.com/rust-lang/rust-clippy/issues/702 @@ -22,7 +22,7 @@ /// Generated files are compatible only with the same version /// of protobuf runtime. -const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_2_0; +const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_4_0; static file_descriptor_proto_data: &'static [u8] = b"\ \n\x17grpc/testing/test.proto\x12\x0cgrpc.testing\x1a\x18grpc/testing/em\ diff --git a/src/buf.rs b/src/buf.rs index 7b5f4d31f..9f247b3f0 100644 --- a/src/buf.rs +++ b/src/buf.rs @@ -262,7 +262,7 @@ impl<'a> From<&'a GrpcSlice> for GrpcByteBuffer { /// Create a buffer from the given single slice. /// /// A buffer, which length is 1, is allocated for the slice. - #[allow(clippy::cast_ref_to_mut)] + #[allow(invalid_reference_casting)] fn from(s: &'a GrpcSlice) -> GrpcByteBuffer { unsafe { // hack: buffer_create accepts an mutable pointer to indicate it mutate diff --git a/src/channel.rs b/src/channel.rs index 057b614f1..298334ee9 100644 --- a/src/channel.rs +++ b/src/channel.rs @@ -635,6 +635,7 @@ impl Channel { /// The given grpc_channel must correspond to an instantiated grpc core /// channel. Takes exclusive ownership of the channel and will close it after /// use. + #[allow(clippy::arc_with_non_send_sync)] pub unsafe fn new( cq: CompletionQueue, env: Arc, diff --git a/src/server.rs b/src/server.rs index 042217e58..6915ed1a9 100644 --- a/src/server.rs +++ b/src/server.rs @@ -407,6 +407,7 @@ impl Server { } /// Start the server. + #[allow(clippy::arc_with_non_send_sync)] pub fn start(&mut self) { unsafe { grpc_sys::grpc_server_start(self.core.server); diff --git a/tests-and-examples/Cargo.toml b/tests-and-examples/Cargo.toml index ed53a5528..5063599e1 100644 --- a/tests-and-examples/Cargo.toml +++ b/tests-and-examples/Cargo.toml @@ -20,7 +20,7 @@ futures-util = { version = "0.3", features = ["sink"] } futures-timer = "3.0" protobuf = { version = "2", optional = true } protobufv3 = { package = "protobuf", version = "3.2", optional = true } -prost = { version = "0.11", optional = true } +prost = { version = "0.12", optional = true } bytes = { version = "1.0", optional = true } log = "0.4" grpcio = { path = "..", default-features = false, features = ["boringssl"] } @@ -31,7 +31,7 @@ serde_json = "1.0" serde = "1.0" serde_derive = "1.0" grpcio-proto = { path = "../proto", default-features = false } -rand = "0.7" +rand = "0.8" slog = "2.0" slog-async = "2.1" slog-stdlog = "4.0" diff --git a/tests-and-examples/examples/route_guide/client.rs b/tests-and-examples/examples/route_guide/client.rs index 0c616f3e0..a1b7336a2 100644 --- a/tests-and-examples/examples/route_guide/client.rs +++ b/tests-and-examples/examples/route_guide/client.rs @@ -94,7 +94,7 @@ async fn record_route(client: &RouteGuideClient) -> Result<()> { let point = f.location.0.clone().unwrap().as_ref().clone(); info!("Visiting {}", util::format_point(&point)); sink.send((point, WriteFlags::default())).await?; - thread::sleep(Duration::from_millis(rng.gen_range(500, 1500))); + thread::sleep(Duration::from_millis(rng.gen_range(500..1500))); } // flush sink.close().await?; diff --git a/xtask/Cargo.toml b/xtask/Cargo.toml index 571c77095..f98c8fece 100644 --- a/xtask/Cargo.toml +++ b/xtask/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -prost-build = "0.11" +prost-build = "0.12" # Use an old enough version to make sure generated code with TiKV's fork. # TODO: use latest one when TiKV's fork is updated protoc-rust = "=2.8"