From 842a2e51f9f4687440a9fe2e9e133a527aedb14e Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Tue, 17 Nov 2020 21:04:10 +0800 Subject: [PATCH 1/7] codec: check serialization result length grpc c core can only handle message that is not larger than 4GiB. Signed-off-by: Jay Lee --- benchmark/src/bench.rs | 5 +++-- src/call/client.rs | 4 ++-- src/call/mod.rs | 2 +- src/call/server.rs | 19 ++++++++++++++----- src/codec.rs | 28 +++++++++++++++++++++------- src/error.rs | 13 +++++++++---- 6 files changed, 50 insertions(+), 21 deletions(-) diff --git a/benchmark/src/bench.rs b/benchmark/src/bench.rs index 07c3e4e36..f4d2b25cf 100644 --- a/benchmark/src/bench.rs +++ b/benchmark/src/bench.rs @@ -100,8 +100,9 @@ impl Generic { #[inline] #[allow(clippy::ptr_arg)] -pub fn bin_ser(t: &Vec, buf: &mut Vec) { - buf.extend_from_slice(t) +pub fn bin_ser(t: &Vec, buf: &mut Vec) -> grpc::Result<()> { + buf.extend_from_slice(t); + Ok(()) } #[inline] diff --git a/src/call/client.rs b/src/call/client.rs index 0dad49095..fdcad6dd0 100644 --- a/src/call/client.rs +++ b/src/call/client.rs @@ -103,7 +103,7 @@ impl Call { ) -> Result> { let call = channel.create_call(method, &opt)?; let mut payload = vec![]; - (method.req_ser())(req, &mut payload); + (method.req_ser())(req, &mut payload)?; let cq_f = check_run(BatchType::CheckRead, |ctx, tag| unsafe { grpc_sys::grpcwrap_call_start_unary( call.call, @@ -157,7 +157,7 @@ impl Call { ) -> Result> { let call = channel.create_call(method, &opt)?; let mut payload = vec![]; - (method.req_ser())(req, &mut payload); + (method.req_ser())(req, &mut payload)?; let cq_f = check_run(BatchType::Finish, |ctx, tag| unsafe { grpc_sys::grpcwrap_call_start_server_streaming( call.call, diff --git a/src/call/mod.rs b/src/call/mod.rs index 3f952ca5b..c974ede25 100644 --- a/src/call/mod.rs +++ b/src/call/mod.rs @@ -657,7 +657,7 @@ impl SinkBase { } self.buf.clear(); - ser(t, &mut self.buf); + ser(t, &mut self.buf)?; if flags.get_buffer_hint() && self.send_metadata { // temporary fix: buffer hint with send meta will not send out any metadata. flags = flags.buffer_hint(false); diff --git a/src/call/server.rs b/src/call/server.rs index f04c795db..7e94d19b8 100644 --- a/src/call/server.rs +++ b/src/call/server.rs @@ -330,11 +330,20 @@ macro_rules! impl_unary_sink { } fn complete(mut self, status: RpcStatus, t: Option) -> $rt { - let data = t.as_ref().map(|t| { - let mut buf = vec![]; - (self.ser)(t, &mut buf); - buf - }); + let data = match t { + Some(t) => { + let mut buf = vec![]; + match (self.ser)(&t, &mut buf) { + Ok(()) => Some(buf), + Err(e) => return $rt { + call: self.call.take().unwrap(), + cq_f: None, + err: Some(e), + } + } + }, + None => None, + }; let write_flags = self.write_flags; let res = self.call.as_mut().unwrap().call(|c| { diff --git a/src/codec.rs b/src/codec.rs index 4a844893f..895217d34 100644 --- a/src/codec.rs +++ b/src/codec.rs @@ -4,7 +4,7 @@ use crate::call::MessageReader; use crate::error::Result; pub type DeserializeFn = fn(MessageReader) -> Result; -pub type SerializeFn = fn(&T, &mut Vec); +pub type SerializeFn = fn(&T, &mut Vec) -> Result<()>; /// Defines how to serialize and deserialize between the specialized type and byte slice. pub struct Marshaller { @@ -29,11 +29,18 @@ pub mod pb_codec { use protobuf::{CodedInputStream, Message}; use super::MessageReader; - use crate::error::Result; + use crate::error::{Error, Result}; #[inline] - pub fn ser(t: &T, buf: &mut Vec) { - t.write_to_vec(buf).unwrap() + pub fn ser(t: &T, buf: &mut Vec) -> Result<()> { + t.write_to_vec(buf)?; + if buf.len() <= u32::MAX as usize { + Ok(()) + } else { + Err(Error::Codec( + format!("message is too large: {} > u32::MAX", buf.len()).into(), + )) + } } #[inline] @@ -51,11 +58,18 @@ pub mod pr_codec { use prost::Message; use super::MessageReader; - use crate::error::Result; + use crate::error::{Error, Result}; #[inline] - pub fn ser(msg: &M, buf: &mut B) { - msg.encode(buf).expect("Writing message to buffer failed"); + pub fn ser(msg: &M, buf: &mut Vec) -> Result<()> { + msg.encode(buf)?; + if buf.len() <= u32::MAX as usize { + Ok(()) + } else { + Err(Error::Codec( + format!("message is too large: {} > u32::MAX", size).into(), + )) + } } #[inline] diff --git a/src/error.rs b/src/error.rs index f12ffa4db..a2397d455 100644 --- a/src/error.rs +++ b/src/error.rs @@ -5,8 +5,6 @@ use std::{error, fmt, result}; use crate::call::RpcStatus; use crate::grpc_sys::grpc_call_error; -#[cfg(feature = "prost-codec")] -use prost::DecodeError; #[cfg(feature = "protobuf-codec")] use protobuf::ProtobufError; @@ -64,8 +62,15 @@ impl From for Error { } #[cfg(feature = "prost-codec")] -impl From for Error { - fn from(e: DecodeError) -> Error { +impl From for Error { + fn from(e: prost::DecodeError) -> Error { + Error::Codec(Box::new(e)) + } +} + +#[cfg(feature = "prost-codec")] +impl From for Error { + fn from(e: prost::EncodeError) -> Error { Error::Codec(Box::new(e)) } } From bdaa6d1f46411d3d1e797a0f0a15e0d9aa0576c7 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Tue, 17 Nov 2020 21:27:35 +0800 Subject: [PATCH 2/7] make clippy happy Signed-off-by: Jay Lee --- src/codec.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/codec.rs b/src/codec.rs index 895217d34..12e621ba8 100644 --- a/src/codec.rs +++ b/src/codec.rs @@ -54,7 +54,6 @@ pub mod pb_codec { #[cfg(feature = "prost-codec")] pub mod pr_codec { - use bytes::buf::BufMut; use prost::Message; use super::MessageReader; @@ -67,7 +66,7 @@ pub mod pr_codec { Ok(()) } else { Err(Error::Codec( - format!("message is too large: {} > u32::MAX", size).into(), + format!("message is too large: {} > u32::MAX", buf.len()).into(), )) } } From 166a842b081feb46301bb6eba32481f27205949e Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Tue, 24 Nov 2020 14:57:46 +0800 Subject: [PATCH 3/7] address comment Signed-off-by: Jay Lee --- src/codec.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/codec.rs b/src/codec.rs index 12e621ba8..2f143406b 100644 --- a/src/codec.rs +++ b/src/codec.rs @@ -6,6 +6,10 @@ use crate::error::Result; pub type DeserializeFn = fn(MessageReader) -> Result; pub type SerializeFn = fn(&T, &mut Vec) -> Result<()>; +/// According to https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md, grpc uses +/// a four bytes to describe the length of a message, so it should not exceed u32::MAX. +const MAX_MESSAGE_SIZE: usize = u32::MAX as usize; + /// Defines how to serialize and deserialize between the specialized type and byte slice. pub struct Marshaller { // Use function pointer here to simplify the signature. @@ -28,17 +32,17 @@ pub struct Marshaller { pub mod pb_codec { use protobuf::{CodedInputStream, Message}; - use super::MessageReader; + use super::{MessageReader, MAX_MESSAGE_SIZE}; use crate::error::{Error, Result}; #[inline] pub fn ser(t: &T, buf: &mut Vec) -> Result<()> { t.write_to_vec(buf)?; - if buf.len() <= u32::MAX as usize { + if buf.len() <= MAX_MESSAGE_SIZE as usize { Ok(()) } else { Err(Error::Codec( - format!("message is too large: {} > u32::MAX", buf.len()).into(), + format!("message is too large: {} > {}", buf.len(), MAX_MESSAGE_SIZE).into(), )) } } @@ -56,17 +60,17 @@ pub mod pb_codec { pub mod pr_codec { use prost::Message; - use super::MessageReader; + use super::{MessageReader, MAX_MESSAGE_SIZE}; use crate::error::{Error, Result}; #[inline] pub fn ser(msg: &M, buf: &mut Vec) -> Result<()> { msg.encode(buf)?; - if buf.len() <= u32::MAX as usize { + if buf.len() <= MAX_MESSAGE_SIZE as usize { Ok(()) } else { Err(Error::Codec( - format!("message is too large: {} > u32::MAX", buf.len()).into(), + format!("message is too large: {} > {}", buf.len(), MAX_MESSAGE_SIZE).into(), )) } } From aaf972b33b9f6145a166d50126c2ad04334bc437 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Tue, 24 Nov 2020 15:05:05 +0800 Subject: [PATCH 4/7] remove binding tests Signed-off-by: Jay Lee --- .github/workflows/ci.yml | 6 ++++-- .travis.yml | 6 ++++-- grpc-sys/build.rs | 4 ++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3adde77e7..400006b10 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,7 @@ env: RUST_BACKTRACE: 1 RUSTFLAGS: "--deny=warnings" GRPC_VERSION: 1.26.0 + TEST_BIND: 1 jobs: Linux-Format-PKG-Test: @@ -37,7 +38,8 @@ jobs: - uses: actions/checkout@v2 - run: which go && go version && which cargo && cargo version && clang --version && openssl version - run: scripts/reset-submodule.cmd - - run: scripts/generate-bindings.sh && git diff --exit-code HEAD + - run: env TEST_BIND=0 scripts/generate-bindings.sh && git diff --exit-code HEAD + - run: scripts/generate-bindings.sh - run: cargo build --no-default-features - run: cargo build --no-default-features --features protobuf-codec - run: cargo build --no-default-features --features prost-codec @@ -103,4 +105,4 @@ jobs: - run: go version ; cargo version ; cmake --version - run: scripts/reset-submodule.cmd - run: cargo build - - run: cargo test --all \ No newline at end of file + - run: cargo test --all diff --git a/.travis.yml b/.travis.yml index c4b034877..54caf169f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ env: global: - RUST_BACKTRACE=1 - RUSTFLAGS="--deny=warnings" + - TEST_BIND=1 install: - if ! which go 2>/dev/null; then @@ -72,12 +73,13 @@ jobs: - which go && go version - if [[ $TRAVIS_OS_NAME == "linux" ]] && [[ $TRAVIS_RUST_VERSION == "stable" ]]; then rustup component add rustfmt && cargo fmt --all -- --check; - scripts/generate-bindings.sh && git diff --exit-code HEAD; + env TEST_BIND=0 scripts/generate-bindings.sh && git diff --exit-code HEAD; fi + - ./scripts/generate-bindings.sh - cargo build --no-default-features - cargo build --no-default-features --features protobuf-codec - cargo build --no-default-features --features prost-codec - cargo build - cargo test --all - cargo test --features "openssl" --all - - cargo test --features "openssl-vendored" --all \ No newline at end of file + - cargo test --features "openssl-vendored" --all diff --git a/grpc-sys/build.rs b/grpc-sys/build.rs index eb6138144..20f6e3c39 100644 --- a/grpc-sys/build.rs +++ b/grpc-sys/build.rs @@ -299,6 +299,9 @@ fn bindgen_grpc(mut config: bindgen::Builder, file_path: &PathBuf) { config = config.header(path); } + println!("cargo:rerun-if-env-changed=TEST_BIND"); + let gen_tests = env::var("TEST_BIND").map_or(false, |s| s == "1"); + let cfg = config .header("grpc_wrap.cc") .clang_arg("-xc++") @@ -323,6 +326,7 @@ fn bindgen_grpc(mut config: bindgen::Builder, file_path: &PathBuf) { .blacklist_type(r"gpr_cv") .blacklist_type(r"gpr_once") .constified_enum_module(r"grpc_status_code") + .layout_tests(gen_tests) .default_enum_style(bindgen::EnumVariation::Rust { non_exhaustive: false, }); From 5d339e62d4509b63c79610008ffa599a1d386cf6 Mon Sep 17 00:00:00 2001 From: Jay Date: Tue, 24 Nov 2020 15:29:48 +0800 Subject: [PATCH 5/7] generate bindings for x86_64 Signed-off-by: Jay --- .../x86_64-unknown-linux-gnu-bindings.rs | 2989 +---------------- 1 file changed, 8 insertions(+), 2981 deletions(-) diff --git a/grpc-sys/bindings/x86_64-unknown-linux-gnu-bindings.rs b/grpc-sys/bindings/x86_64-unknown-linux-gnu-bindings.rs index 3cbc42181..97faae9cd 100644 --- a/grpc-sys/bindings/x86_64-unknown-linux-gnu-bindings.rs +++ b/grpc-sys/bindings/x86_64-unknown-linux-gnu-bindings.rs @@ -204,53 +204,6 @@ pub struct grpc_compression_options_grpc_compression_options_default_level { pub is_set: ::std::os::raw::c_int, pub level: grpc_compression_level, } -#[test] -fn bindgen_test_layout_grpc_compression_options_grpc_compression_options_default_level() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(grpc_compression_options_grpc_compression_options_default_level) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(grpc_compression_options_grpc_compression_options_default_level) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::( - ))) - .is_set as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_compression_options_grpc_compression_options_default_level), - "::", - stringify!(is_set) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::( - ))) - .level as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(grpc_compression_options_grpc_compression_options_default_level), - "::", - stringify!(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."] @@ -260,108 +213,6 @@ pub struct grpc_compression_options_grpc_compression_options_default_algorithm { pub is_set: ::std::os::raw::c_int, pub algorithm: grpc_compression_algorithm, } -#[test] -fn bindgen_test_layout_grpc_compression_options_grpc_compression_options_default_algorithm() { - assert_eq!( - ::std::mem::size_of::( - ), - 8usize, - concat!( - "Size of: ", - stringify!(grpc_compression_options_grpc_compression_options_default_algorithm) - ) - ); - assert_eq!( - ::std::mem::align_of::( - ), - 4usize, - concat!( - "Alignment of ", - stringify!(grpc_compression_options_grpc_compression_options_default_algorithm) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::< - grpc_compression_options_grpc_compression_options_default_algorithm, - >())) - .is_set as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_compression_options_grpc_compression_options_default_algorithm), - "::", - stringify!(is_set) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::< - grpc_compression_options_grpc_compression_options_default_algorithm, - >())) - .algorithm as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(grpc_compression_options_grpc_compression_options_default_algorithm), - "::", - stringify!(algorithm) - ) - ); -} -#[test] -fn bindgen_test_layout_grpc_compression_options() { - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(grpc_compression_options)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(grpc_compression_options)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).enabled_algorithms_bitset - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_compression_options), - "::", - stringify!(enabled_algorithms_bitset) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).default_level as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(grpc_compression_options), - "::", - stringify!(default_level) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).default_algorithm as *const _ - as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(grpc_compression_options), - "::", - stringify!(default_algorithm) - ) - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_slice_refcount { @@ -395,177 +246,17 @@ pub struct grpc_slice_grpc_slice_data_grpc_slice_refcounted { pub length: usize, pub bytes: *mut u8, } -#[test] -fn bindgen_test_layout_grpc_slice_grpc_slice_data_grpc_slice_refcounted() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(grpc_slice_grpc_slice_data_grpc_slice_refcounted) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_slice_grpc_slice_data_grpc_slice_refcounted) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).length - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_grpc_slice_data_grpc_slice_refcounted), - "::", - stringify!(length) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).bytes - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_grpc_slice_data_grpc_slice_refcounted), - "::", - stringify!(bytes) - ) - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_slice_grpc_slice_data_grpc_slice_inlined { pub length: u8, pub bytes: [u8; 23usize], } -#[test] -fn bindgen_test_layout_grpc_slice_grpc_slice_data_grpc_slice_inlined() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!( - "Size of: ", - stringify!(grpc_slice_grpc_slice_data_grpc_slice_inlined) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!( - "Alignment of ", - stringify!(grpc_slice_grpc_slice_data_grpc_slice_inlined) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).length - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_grpc_slice_data_grpc_slice_inlined), - "::", - stringify!(length) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).bytes - as *const _ as usize - }, - 1usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_grpc_slice_data_grpc_slice_inlined), - "::", - stringify!(bytes) - ) - ); -} -#[test] -fn bindgen_test_layout_grpc_slice_grpc_slice_data() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(grpc_slice_grpc_slice_data)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_slice_grpc_slice_data)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).refcounted as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_grpc_slice_data), - "::", - stringify!(refcounted) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).inlined as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_grpc_slice_data), - "::", - stringify!(inlined) - ) - ); -} impl ::std::fmt::Debug for grpc_slice_grpc_slice_data { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { write!(f, "grpc_slice_grpc_slice_data {{ union }}") } } -#[test] -fn bindgen_test_layout_grpc_slice() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(grpc_slice)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_slice)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).refcount as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice), - "::", - stringify!(refcount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice), - "::", - stringify!(data) - ) - ); -} impl ::std::fmt::Debug for grpc_slice { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { write!( @@ -595,82 +286,9 @@ pub struct grpc_slice_buffer { #[doc = " inlined elements to avoid allocations"] pub inlined: [grpc_slice; 8usize], } -#[test] -fn bindgen_test_layout_grpc_slice_buffer() { - assert_eq!( - ::std::mem::size_of::(), - 296usize, - concat!("Size of: ", stringify!(grpc_slice_buffer)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_slice_buffer)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).base_slices as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_buffer), - "::", - stringify!(base_slices) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).slices as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_buffer), - "::", - stringify!(slices) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).count as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_buffer), - "::", - stringify!(count) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).capacity as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_buffer), - "::", - stringify!(capacity) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).length as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_buffer), - "::", - stringify!(length) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).inlined as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_buffer), - "::", - stringify!(inlined) - ) - ); -} impl ::std::fmt::Debug for grpc_slice_buffer { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write ! ( f , "grpc_slice_buffer {{ base_slices: {:?}, slices: {:?}, count: {:?}, capacity: {:?}, length: {:?}, inlined: {:?} }}" , self . base_slices , self . slices , self . count , self . capacity , self . length , self . inlined ) + write ! (f , "grpc_slice_buffer {{ base_slices: {:?}, slices: {:?}, count: {:?}, capacity: {:?}, length: {:?}, inlined: {:?} }}" , self . base_slices , self . slices , self . count , self . capacity , self . length , self . inlined) } } #[repr(u32)] @@ -700,49 +318,6 @@ pub struct gpr_timespec { #[doc = "this is a relative time measure)"] pub clock_type: gpr_clock_type, } -#[test] -fn bindgen_test_layout_gpr_timespec() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(gpr_timespec)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(gpr_timespec)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_sec as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(gpr_timespec), - "::", - stringify!(tv_sec) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_nsec as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(gpr_timespec), - "::", - stringify!(tv_nsec) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).clock_type as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(gpr_timespec), - "::", - stringify!(clock_type) - ) - ); -} pub type gpr_atm = isize; extern "C" { #[doc = " Adds \\a delta to \\a *value, clamping the result to the range specified"] @@ -759,85 +334,16 @@ extern "C" { pub struct gpr_event { pub state: gpr_atm, } -#[test] -fn bindgen_test_layout_gpr_event() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(gpr_event)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(gpr_event)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).state as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(gpr_event), - "::", - stringify!(state) - ) - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct gpr_refcount { pub count: gpr_atm, } -#[test] -fn bindgen_test_layout_gpr_refcount() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(gpr_refcount)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(gpr_refcount)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).count as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(gpr_refcount), - "::", - stringify!(count) - ) - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct gpr_stats_counter { pub value: gpr_atm, } -#[test] -fn bindgen_test_layout_gpr_stats_counter() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(gpr_stats_counter)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(gpr_stats_counter)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).value as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(gpr_stats_counter), - "::", - stringify!(value) - ) - ); -} extern "C" { #[doc = " Initialize *ev."] pub fn gpr_event_init(ev: *mut gpr_event); @@ -1298,189 +804,22 @@ pub union grpc_byte_buffer_grpc_byte_buffer_data { pub struct grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1 { pub reserved: [*mut ::std::os::raw::c_void; 8usize], } -#[test] -fn bindgen_test_layout_grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!( - "Size of: ", - stringify!(grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .reserved as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1), - "::", - stringify!(reserved) - ) - ); -} #[repr(C)] #[derive(Copy, Clone)] pub struct grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer { pub compression: grpc_compression_algorithm, pub slice_buffer: grpc_slice_buffer, } -#[test] -fn bindgen_test_layout_grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer() { - assert_eq!( - ::std::mem::size_of::(), - 304usize, - concat!( - "Size of: ", - stringify!(grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::( - ))) - .compression as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer), - "::", - stringify!(compression) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::( - ))) - .slice_buffer as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer), - "::", - stringify!(slice_buffer) - ) - ); -} impl ::std::fmt::Debug for grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write ! ( f , "grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer {{ compression: {:?}, slice_buffer: {:?} }}" , self . compression , self . slice_buffer ) + write ! (f , "grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer {{ compression: {:?}, slice_buffer: {:?} }}" , self . compression , self . slice_buffer) } } -#[test] -fn bindgen_test_layout_grpc_byte_buffer_grpc_byte_buffer_data() { - assert_eq!( - ::std::mem::size_of::(), - 304usize, - concat!( - "Size of: ", - stringify!(grpc_byte_buffer_grpc_byte_buffer_data) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_byte_buffer_grpc_byte_buffer_data) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).reserved as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer_grpc_byte_buffer_data), - "::", - stringify!(reserved) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).raw as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer_grpc_byte_buffer_data), - "::", - stringify!(raw) - ) - ); -} impl ::std::fmt::Debug for grpc_byte_buffer_grpc_byte_buffer_data { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { write!(f, "grpc_byte_buffer_grpc_byte_buffer_data {{ union }}") } } -#[test] -fn bindgen_test_layout_grpc_byte_buffer() { - assert_eq!( - ::std::mem::size_of::(), - 320usize, - concat!("Size of: ", stringify!(grpc_byte_buffer)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_byte_buffer)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer), - "::", - stringify!(reserved) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer), - "::", - stringify!(data) - ) - ); -} impl ::std::fmt::Debug for grpc_byte_buffer { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { write!( @@ -1547,49 +886,6 @@ pub struct grpc_arg_pointer_vtable { ) -> ::std::os::raw::c_int, >, } -#[test] -fn bindgen_test_layout_grpc_arg_pointer_vtable() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(grpc_arg_pointer_vtable)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_arg_pointer_vtable)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).copy as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_arg_pointer_vtable), - "::", - stringify!(copy) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).destroy as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_arg_pointer_vtable), - "::", - stringify!(destroy) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).cmp as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_arg_pointer_vtable), - "::", - stringify!(cmp) - ) - ); -} #[doc = " A single argument... each argument has a key and a value"] #[doc = ""] #[doc = "A note on naming keys:"] @@ -1623,142 +919,11 @@ pub struct grpc_arg_grpc_arg_value_grpc_arg_pointer { pub p: *mut ::std::os::raw::c_void, pub vtable: *const grpc_arg_pointer_vtable, } -#[test] -fn bindgen_test_layout_grpc_arg_grpc_arg_value_grpc_arg_pointer() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(grpc_arg_grpc_arg_value_grpc_arg_pointer) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_arg_grpc_arg_value_grpc_arg_pointer) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).p as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_arg_grpc_arg_value_grpc_arg_pointer), - "::", - stringify!(p) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).vtable as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_arg_grpc_arg_value_grpc_arg_pointer), - "::", - stringify!(vtable) - ) - ); -} -#[test] -fn bindgen_test_layout_grpc_arg_grpc_arg_value() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(grpc_arg_grpc_arg_value)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_arg_grpc_arg_value)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).string as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_arg_grpc_arg_value), - "::", - stringify!(string) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).integer as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_arg_grpc_arg_value), - "::", - stringify!(integer) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).pointer as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_arg_grpc_arg_value), - "::", - stringify!(pointer) - ) - ); -} impl ::std::fmt::Debug for grpc_arg_grpc_arg_value { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { write!(f, "grpc_arg_grpc_arg_value {{ union }}") } } -#[test] -fn bindgen_test_layout_grpc_arg() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(grpc_arg)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_arg)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_arg), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).key as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_arg), - "::", - stringify!(key) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).value as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_arg), - "::", - stringify!(value) - ) - ); -} impl ::std::fmt::Debug for grpc_arg { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { write!( @@ -1790,39 +955,6 @@ pub struct grpc_channel_args { pub num_args: usize, pub args: *mut grpc_arg, } -#[test] -fn bindgen_test_layout_grpc_channel_args() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(grpc_channel_args)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_channel_args)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).num_args as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_channel_args), - "::", - stringify!(num_args) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).args as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_channel_args), - "::", - stringify!(args) - ) - ); -} #[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."] @@ -1884,84 +1016,6 @@ pub struct grpc_metadata { pub struct grpc_metadata__bindgen_ty_1 { pub obfuscated: [*mut ::std::os::raw::c_void; 4usize], } -#[test] -fn bindgen_test_layout_grpc_metadata__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(grpc_metadata__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_metadata__bindgen_ty_1)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).obfuscated as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata__bindgen_ty_1), - "::", - stringify!(obfuscated) - ) - ); -} -#[test] -fn bindgen_test_layout_grpc_metadata() { - assert_eq!( - ::std::mem::size_of::(), - 104usize, - concat!("Size of: ", stringify!(grpc_metadata)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_metadata)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).key as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata), - "::", - stringify!(key) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).value as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata), - "::", - stringify!(value) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).internal_data as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata), - "::", - stringify!(internal_data) - ) - ); -} impl ::std::fmt::Debug for grpc_metadata { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { write!( @@ -2001,49 +1055,6 @@ pub struct grpc_event { #[doc = "values, tag is uninitialized."] pub tag: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_grpc_event() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(grpc_event)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_event)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_event), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).success as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(grpc_event), - "::", - stringify!(success) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tag as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_event), - "::", - stringify!(tag) - ) - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_metadata_array { @@ -2051,49 +1062,6 @@ pub struct grpc_metadata_array { pub capacity: usize, pub metadata: *mut grpc_metadata, } -#[test] -fn bindgen_test_layout_grpc_metadata_array() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(grpc_metadata_array)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_metadata_array)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).count as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata_array), - "::", - stringify!(count) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).capacity as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata_array), - "::", - stringify!(capacity) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).metadata as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata_array), - "::", - stringify!(metadata) - ) - ); -} #[repr(C)] #[derive(Copy, Clone)] pub struct grpc_call_details { @@ -2103,72 +1071,9 @@ pub struct grpc_call_details { pub flags: u32, pub reserved: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_grpc_call_details() { - assert_eq!( - ::std::mem::size_of::(), - 96usize, - concat!("Size of: ", stringify!(grpc_call_details)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_call_details)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).method as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_call_details), - "::", - stringify!(method) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).host as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(grpc_call_details), - "::", - stringify!(host) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).deadline as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(grpc_call_details), - "::", - stringify!(deadline) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(grpc_call_details), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(grpc_call_details), - "::", - stringify!(reserved) - ) - ); -} impl ::std::fmt::Debug for grpc_call_details { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write ! ( f , "grpc_call_details {{ method: {:?}, host: {:?}, deadline: {:?}, flags: {:?}, reserved: {:?} }}" , self . method , self . host , self . deadline , self . flags , self . reserved ) + write ! (f , "grpc_call_details {{ method: {:?}, host: {:?}, deadline: {:?}, flags: {:?}, reserved: {:?} }}" , self . method , self . host , self . deadline , self . flags , self . reserved) } } #[repr(u32)] @@ -2247,35 +1152,6 @@ pub union grpc_op_grpc_op_data { pub struct grpc_op_grpc_op_data__bindgen_ty_1 { pub reserved: [*mut ::std::os::raw::c_void; 8usize], } -#[test] -fn bindgen_test_layout_grpc_op_grpc_op_data__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(grpc_op_grpc_op_data__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_op_grpc_op_data__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).reserved as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data__bindgen_ty_1), - "::", - stringify!(reserved) - ) - ); -} #[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 , } @@ -2288,72 +1164,6 @@ pub struct grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initi pub is_set: u8, pub level: grpc_compression_level, } -#[test] -fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level( -) { - assert_eq ! ( :: std :: mem :: size_of :: < grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level > ( ) , 8usize , concat ! ( "Size of: " , stringify ! ( grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level ) ) ); - assert_eq ! ( :: std :: mem :: align_of :: < grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level ) ) ); - assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level > ( ) ) ) . is_set as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level ) , "::" , stringify ! ( is_set ) ) ); - assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level > ( ) ) ) . level as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level ) , "::" , stringify ! ( level ) ) ); -} -#[test] -fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_send_initial_metadata() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!( - "Size of: ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_initial_metadata) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_initial_metadata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).count - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_initial_metadata), - "::", - stringify!(count) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).metadata - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_initial_metadata), - "::", - stringify!(metadata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .maybe_compression_level as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_initial_metadata), - "::", - stringify!(maybe_compression_level) - ) - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_op_grpc_op_data_grpc_op_send_message { @@ -2363,38 +1173,6 @@ pub struct grpc_op_grpc_op_data_grpc_op_send_message { #[doc = " grpc_byte_buffer_destroy() on this object however."] pub send_message: *mut grpc_byte_buffer, } -#[test] -fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_send_message() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_message) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_message) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).send_message - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_message), - "::", - stringify!(send_message) - ) - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_op_grpc_op_data_grpc_op_send_status_from_server { @@ -2405,77 +1183,6 @@ pub struct grpc_op_grpc_op_data_grpc_op_send_status_from_server { #[doc = " pointer will not be retained past the start_batch call"] pub status_details: *mut grpc_slice, } -#[test] -fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_send_status_from_server() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!( - "Size of: ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_status_from_server) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_status_from_server) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .trailing_metadata_count as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_status_from_server), - "::", - stringify!(trailing_metadata_count) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .trailing_metadata as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_status_from_server), - "::", - stringify!(trailing_metadata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).status - as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_status_from_server), - "::", - stringify!(status) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .status_details as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_status_from_server), - "::", - stringify!(status_details) - ) - ); -} #[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)."] @@ -2486,38 +1193,6 @@ fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_send_status_from_server() { pub struct grpc_op_grpc_op_data_grpc_op_recv_initial_metadata { pub recv_initial_metadata: *mut grpc_metadata_array, } -#[test] -fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_recv_initial_metadata() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_initial_metadata) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_initial_metadata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .recv_initial_metadata as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_initial_metadata), - "::", - stringify!(recv_initial_metadata) - ) - ); -} #[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"] @@ -2527,38 +1202,6 @@ fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_recv_initial_metadata() { pub struct grpc_op_grpc_op_data_grpc_op_recv_message { pub recv_message: *mut *mut grpc_byte_buffer, } -#[test] -fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_recv_message() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_message) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_message) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).recv_message - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_message), - "::", - stringify!(recv_message) - ) - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_op_grpc_op_data_grpc_op_recv_status_on_client { @@ -2575,286 +1218,18 @@ pub struct grpc_op_grpc_op_data_grpc_op_recv_status_on_client { #[doc = " for freeing the data by using gpr_free()."] pub error_string: *mut *const ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_recv_status_on_client() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!( - "Size of: ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_status_on_client) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_status_on_client) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .trailing_metadata as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_status_on_client), - "::", - stringify!(trailing_metadata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).status - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_status_on_client), - "::", - stringify!(status) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .status_details as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_status_on_client), - "::", - stringify!(status_details) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .error_string as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_status_on_client), - "::", - stringify!(error_string) - ) - ); -} #[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 in any way (seen as a"] - #[doc = "cancellation on the server), or 0 if the call succeeded"] - pub cancelled: *mut ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_recv_close_on_server() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_close_on_server) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_close_on_server) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).cancelled - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_close_on_server), - "::", - stringify!(cancelled) - ) - ); -} -#[test] -fn bindgen_test_layout_grpc_op_grpc_op_data() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(grpc_op_grpc_op_data)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_op_grpc_op_data)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data), - "::", - stringify!(reserved) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).send_initial_metadata as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data), - "::", - stringify!(send_initial_metadata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).send_message as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data), - "::", - stringify!(send_message) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).send_status_from_server as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data), - "::", - stringify!(send_status_from_server) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).recv_initial_metadata as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data), - "::", - stringify!(recv_initial_metadata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).recv_message as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data), - "::", - stringify!(recv_message) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).recv_status_on_client as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data), - "::", - stringify!(recv_status_on_client) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).recv_close_on_server as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data), - "::", - stringify!(recv_close_on_server) - ) - ); + #[doc = "cancellation on the server), or 0 if the call succeeded"] + pub cancelled: *mut ::std::os::raw::c_int, } impl ::std::fmt::Debug for grpc_op_grpc_op_data { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { write!(f, "grpc_op_grpc_op_data {{ union }}") } } -#[test] -fn bindgen_test_layout_grpc_op() { - assert_eq!( - ::std::mem::size_of::(), - 80usize, - concat!("Size of: ", stringify!(grpc_op)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_op)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).op as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op), - "::", - stringify!(op) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(grpc_op), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_op), - "::", - stringify!(reserved) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_op), - "::", - stringify!(data) - ) - ); -} impl ::std::fmt::Debug for grpc_op { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { write!( @@ -2875,43 +1250,6 @@ pub struct grpc_channel_info { #[doc = " service config used by the channel in JSON form."] pub service_config_json: *mut *mut ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_grpc_channel_info() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(grpc_channel_info)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_channel_info)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).lb_policy_name as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_channel_info), - "::", - stringify!(lb_policy_name) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).service_config_json as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_channel_info), - "::", - stringify!(service_config_json) - ) - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_resource_quota { @@ -2978,77 +1316,6 @@ pub struct grpc_experimental_completion_queue_functor { pub internal_success: ::std::os::raw::c_int, pub internal_next: *mut grpc_experimental_completion_queue_functor, } -#[test] -fn bindgen_test_layout_grpc_experimental_completion_queue_functor() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!( - "Size of: ", - stringify!(grpc_experimental_completion_queue_functor) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_experimental_completion_queue_functor) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).functor_run - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_experimental_completion_queue_functor), - "::", - stringify!(functor_run) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).inlineable - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_experimental_completion_queue_functor), - "::", - stringify!(inlineable) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).internal_success - as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(grpc_experimental_completion_queue_functor), - "::", - stringify!(internal_success) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).internal_next - as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_experimental_completion_queue_functor), - "::", - stringify!(internal_next) - ) - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_completion_queue_attributes { @@ -3062,74 +1329,6 @@ pub struct grpc_completion_queue_attributes { #[doc = " shutdown is complete"] pub cq_shutdown_cb: *mut grpc_experimental_completion_queue_functor, } -#[test] -fn bindgen_test_layout_grpc_completion_queue_attributes() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(grpc_completion_queue_attributes)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_completion_queue_attributes) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).version as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_completion_queue_attributes), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).cq_completion_type - as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(grpc_completion_queue_attributes), - "::", - stringify!(cq_completion_type) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).cq_polling_type as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_completion_queue_attributes), - "::", - stringify!(cq_polling_type) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).cq_shutdown_cb as *const _ - as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_completion_queue_attributes), - "::", - stringify!(cq_shutdown_cb) - ) - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_completion_queue_factory { @@ -4154,53 +2353,6 @@ pub struct grpc_auth_property_iterator { pub index: usize, pub name: *const ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_grpc_auth_property_iterator() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(grpc_auth_property_iterator)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_auth_property_iterator)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ctx as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_property_iterator), - "::", - stringify!(ctx) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).index as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_property_iterator), - "::", - stringify!(index) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).name as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_property_iterator), - "::", - stringify!(name) - ) - ); -} #[doc = " value, if not NULL, is guaranteed to be NULL terminated."] #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -4209,49 +2361,6 @@ pub struct grpc_auth_property { pub value: *mut ::std::os::raw::c_char, pub value_length: usize, } -#[test] -fn bindgen_test_layout_grpc_auth_property() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(grpc_auth_property)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_auth_property)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_property), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).value as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_property), - "::", - stringify!(value) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).value_length as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_property), - "::", - stringify!(value_length) - ) - ); -} extern "C" { #[doc = " Returns NULL when the iterator is at the end."] pub fn grpc_auth_property_iterator_next( @@ -4392,43 +2501,6 @@ pub struct grpc_ssl_pem_key_cert_pair { #[doc = "the client's certificate chain."] pub cert_chain: *const ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_grpc_ssl_pem_key_cert_pair() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(grpc_ssl_pem_key_cert_pair)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_ssl_pem_key_cert_pair)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).private_key as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_ssl_pem_key_cert_pair), - "::", - stringify!(private_key) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).cert_chain as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_ssl_pem_key_cert_pair), - "::", - stringify!(cert_chain) - ) - ); -} #[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"] @@ -4457,58 +2529,6 @@ pub struct verify_peer_options { pub verify_peer_destruct: ::std::option::Option, } -#[test] -fn bindgen_test_layout_verify_peer_options() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(verify_peer_options)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(verify_peer_options)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).verify_peer_callback as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(verify_peer_options), - "::", - stringify!(verify_peer_callback) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).verify_peer_callback_userdata - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(verify_peer_options), - "::", - stringify!(verify_peer_callback_userdata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).verify_peer_destruct as *const _ - as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(verify_peer_options), - "::", - stringify!(verify_peer_destruct) - ) - ); -} #[doc = " Object that holds additional peer-verification options on a secure"] #[doc = "channel."] #[repr(C)] @@ -4535,58 +2555,6 @@ pub struct grpc_ssl_verify_peer_options { pub verify_peer_destruct: ::std::option::Option, } -#[test] -fn bindgen_test_layout_grpc_ssl_verify_peer_options() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(grpc_ssl_verify_peer_options)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_ssl_verify_peer_options)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).verify_peer_callback - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_ssl_verify_peer_options), - "::", - stringify!(verify_peer_callback) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).verify_peer_callback_userdata - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_ssl_verify_peer_options), - "::", - stringify!(verify_peer_callback_userdata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).verify_peer_destruct - as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_ssl_verify_peer_options), - "::", - stringify!(verify_peer_destruct) - ) - ); -} 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"] @@ -4728,133 +2696,6 @@ pub struct grpc_sts_credentials_options { pub actor_token_path: *const ::std::os::raw::c_char, pub actor_token_type: *const ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_grpc_sts_credentials_options() { - assert_eq!( - ::std::mem::size_of::(), - 72usize, - concat!("Size of: ", stringify!(grpc_sts_credentials_options)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_sts_credentials_options)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).token_exchange_service_uri - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_sts_credentials_options), - "::", - stringify!(token_exchange_service_uri) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).resource as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_sts_credentials_options), - "::", - stringify!(resource) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).audience as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_sts_credentials_options), - "::", - stringify!(audience) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).scope as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(grpc_sts_credentials_options), - "::", - stringify!(scope) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).requested_token_type - as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(grpc_sts_credentials_options), - "::", - stringify!(requested_token_type) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).subject_token_path as *const _ - as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(grpc_sts_credentials_options), - "::", - stringify!(subject_token_path) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).subject_token_type as *const _ - as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(grpc_sts_credentials_options), - "::", - stringify!(subject_token_type) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).actor_token_path as *const _ - as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(grpc_sts_credentials_options), - "::", - stringify!(actor_token_path) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).actor_token_type as *const _ - as usize - }, - 64usize, - concat!( - "Offset of field: ", - stringify!(grpc_sts_credentials_options), - "::", - stringify!(actor_token_type) - ) - ); -} 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."] @@ -4901,68 +2742,6 @@ pub struct grpc_auth_metadata_context { #[doc = " Reserved for future use."] pub reserved: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_grpc_auth_metadata_context() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(grpc_auth_metadata_context)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_auth_metadata_context)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).service_url as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_metadata_context), - "::", - stringify!(service_url) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).method_name as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_metadata_context), - "::", - stringify!(method_name) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).channel_auth_context as *const _ - as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_metadata_context), - "::", - stringify!(channel_auth_context) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).reserved as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_metadata_context), - "::", - stringify!(reserved) - ) - ); -} #[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."] @@ -5008,72 +2787,6 @@ pub struct grpc_metadata_credentials_plugin { #[doc = " Type of credentials that this plugin is implementing."] pub type_: *const ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_grpc_metadata_credentials_plugin() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(grpc_metadata_credentials_plugin)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_metadata_credentials_plugin) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).get_metadata as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata_credentials_plugin), - "::", - stringify!(get_metadata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).destroy as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata_credentials_plugin), - "::", - stringify!(destroy) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).state as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata_credentials_plugin), - "::", - stringify!(state) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).type_ as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata_credentials_plugin), - "::", - stringify!(type_) - ) - ); -} extern "C" { #[doc = " Creates a credentials object from a plugin."] pub fn grpc_metadata_credentials_create_from_plugin( @@ -5281,55 +2994,6 @@ pub struct grpc_auth_metadata_processor { pub destroy: ::std::option::Option, pub state: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_grpc_auth_metadata_processor() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(grpc_auth_metadata_processor)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_auth_metadata_processor)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).process as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_metadata_processor), - "::", - stringify!(process) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).destroy as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_metadata_processor), - "::", - stringify!(destroy) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).state as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_metadata_processor), - "::", - stringify!(state) - ) - ); -} extern "C" { pub fn grpc_server_credentials_set_auth_metadata_processor( creds: *mut grpc_server_credentials, @@ -5556,119 +3220,6 @@ pub struct grpc_tls_credential_reload_arg { pub destroy_context: ::std::option::Option, } -#[test] -fn bindgen_test_layout_grpc_tls_credential_reload_arg() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(grpc_tls_credential_reload_arg)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_tls_credential_reload_arg)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).cb as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_credential_reload_arg), - "::", - stringify!(cb) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).cb_user_data as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_credential_reload_arg), - "::", - stringify!(cb_user_data) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).key_materials_config - as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_credential_reload_arg), - "::", - stringify!(key_materials_config) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).status as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_credential_reload_arg), - "::", - stringify!(status) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).error_details as *const _ - as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_credential_reload_arg), - "::", - stringify!(error_details) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).config as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_credential_reload_arg), - "::", - stringify!(config) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).context as *const _ as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_credential_reload_arg), - "::", - stringify!(context) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).destroy_context as *const _ - as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_credential_reload_arg), - "::", - stringify!(destroy_context) - ) - ); -} extern "C" { #[doc = " Create a grpc_tls_credential_reload_config instance."] #[doc = "- config_user_data is config-specific, read-only user data"] @@ -5750,155 +3301,6 @@ pub struct grpc_tls_server_authorization_check_arg { pub destroy_context: ::std::option::Option, } -#[test] -fn bindgen_test_layout_grpc_tls_server_authorization_check_arg() { - assert_eq!( - ::std::mem::size_of::(), - 80usize, - concat!( - "Size of: ", - stringify!(grpc_tls_server_authorization_check_arg) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_tls_server_authorization_check_arg) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).cb as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_server_authorization_check_arg), - "::", - stringify!(cb) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).cb_user_data - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_server_authorization_check_arg), - "::", - stringify!(cb_user_data) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).success as *const _ - as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_server_authorization_check_arg), - "::", - stringify!(success) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).target_name - as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_server_authorization_check_arg), - "::", - stringify!(target_name) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).peer_cert - as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_server_authorization_check_arg), - "::", - stringify!(peer_cert) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).status as *const _ - as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_server_authorization_check_arg), - "::", - stringify!(status) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).error_details - as *const _ as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_server_authorization_check_arg), - "::", - stringify!(error_details) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).config as *const _ - as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_server_authorization_check_arg), - "::", - stringify!(config) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).context as *const _ - as usize - }, - 64usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_server_authorization_check_arg), - "::", - stringify!(context) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).destroy_context - as *const _ as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_server_authorization_check_arg), - "::", - stringify!(destroy_context) - ) - ); -} extern "C" { #[doc = " Create a grpc_tls_server_authorization_check_config instance."] #[doc = "- config_user_data is config-specific, read-only user data"] @@ -6018,59 +3420,6 @@ pub struct gpr_log_func_args { pub severity: gpr_log_severity, pub message: *const ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_gpr_log_func_args() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(gpr_log_func_args)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(gpr_log_func_args)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).file as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(gpr_log_func_args), - "::", - stringify!(file) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).line as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(gpr_log_func_args), - "::", - stringify!(line) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).severity as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(gpr_log_func_args), - "::", - stringify!(severity) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).message as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(gpr_log_func_args), - "::", - stringify!(message) - ) - ); -} pub type gpr_log_func = ::std::option::Option; extern "C" { pub fn gpr_set_log_function(func: gpr_log_func); @@ -6162,38 +3511,6 @@ pub union grpc_byte_buffer_reader_grpc_byte_buffer_reader_current { pub index: ::std::os::raw::c_uint, _bindgen_union_align: u32, } -#[test] -fn bindgen_test_layout_grpc_byte_buffer_reader_grpc_byte_buffer_reader_current() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!( - "Size of: ", - stringify!(grpc_byte_buffer_reader_grpc_byte_buffer_reader_current) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(grpc_byte_buffer_reader_grpc_byte_buffer_reader_current) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .index as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer_reader_grpc_byte_buffer_reader_current), - "::", - stringify!(index) - ) - ); -} impl ::std::fmt::Debug for grpc_byte_buffer_reader_grpc_byte_buffer_reader_current { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { write!( @@ -6202,53 +3519,6 @@ impl ::std::fmt::Debug for grpc_byte_buffer_reader_grpc_byte_buffer_reader_curre ) } } -#[test] -fn bindgen_test_layout_grpc_byte_buffer_reader() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(grpc_byte_buffer_reader)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_byte_buffer_reader)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).buffer_in as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer_reader), - "::", - stringify!(buffer_in) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).buffer_out as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer_reader), - "::", - stringify!(buffer_out) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).current as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer_reader), - "::", - stringify!(current) - ) - ); -} impl ::std::fmt::Debug for grpc_byte_buffer_reader { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { write!( @@ -6274,38 +3544,6 @@ pub struct grpcwrap_batch_context { pub struct grpcwrap_batch_context__bindgen_ty_1 { pub trailing_metadata: grpc_metadata_array, } -#[test] -fn bindgen_test_layout_grpcwrap_batch_context__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!( - "Size of: ", - stringify!(grpcwrap_batch_context__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpcwrap_batch_context__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).trailing_metadata - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_batch_context__bindgen_ty_1), - "::", - stringify!(trailing_metadata) - ) - ); -} #[repr(C)] #[derive(Copy, Clone)] pub struct grpcwrap_batch_context__bindgen_ty_2 { @@ -6313,174 +3551,14 @@ pub struct grpcwrap_batch_context__bindgen_ty_2 { pub status: grpc_status_code::Type, pub status_details: grpc_slice, } -#[test] -fn bindgen_test_layout_grpcwrap_batch_context__bindgen_ty_2() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!( - "Size of: ", - stringify!(grpcwrap_batch_context__bindgen_ty_2) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpcwrap_batch_context__bindgen_ty_2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).trailing_metadata - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_batch_context__bindgen_ty_2), - "::", - stringify!(trailing_metadata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).status as *const _ - as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_batch_context__bindgen_ty_2), - "::", - stringify!(status) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).status_details - as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_batch_context__bindgen_ty_2), - "::", - stringify!(status_details) - ) - ); -} impl ::std::fmt::Debug for grpcwrap_batch_context__bindgen_ty_2 { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write ! ( f , "grpcwrap_batch_context__bindgen_ty_2 {{ trailing_metadata: {:?}, status: {:?}, status_details: {:?} }}" , self . trailing_metadata , self . status , self . status_details ) + write ! (f , "grpcwrap_batch_context__bindgen_ty_2 {{ trailing_metadata: {:?}, status: {:?}, status_details: {:?} }}" , self . trailing_metadata , self . status , self . status_details) } } -#[test] -fn bindgen_test_layout_grpcwrap_batch_context() { - assert_eq!( - ::std::mem::size_of::(), - 160usize, - concat!("Size of: ", stringify!(grpcwrap_batch_context)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpcwrap_batch_context)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).send_initial_metadata as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_batch_context), - "::", - stringify!(send_initial_metadata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).send_message as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_batch_context), - "::", - stringify!(send_message) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).send_status_from_server as *const _ - as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_batch_context), - "::", - stringify!(send_status_from_server) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).recv_initial_metadata as *const _ - as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_batch_context), - "::", - stringify!(recv_initial_metadata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).recv_message as *const _ as usize - }, - 80usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_batch_context), - "::", - stringify!(recv_message) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).recv_status_on_client as *const _ - as usize - }, - 88usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_batch_context), - "::", - stringify!(recv_status_on_client) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).recv_close_on_server_cancelled - as *const _ as usize - }, - 152usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_batch_context), - "::", - stringify!(recv_close_on_server_cancelled) - ) - ); -} impl ::std::fmt::Debug for grpcwrap_batch_context { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write ! ( f , "grpcwrap_batch_context {{ send_initial_metadata: {:?}, send_message: {:?}, send_status_from_server: {:?}, recv_initial_metadata: {:?}, recv_message: {:?}, recv_status_on_client: {:?}, recv_close_on_server_cancelled: {:?} }}" , self . send_initial_metadata , self . send_message , self . send_status_from_server , self . recv_initial_metadata , self . recv_message , self . recv_status_on_client , self . recv_close_on_server_cancelled ) + write ! (f , "grpcwrap_batch_context {{ send_initial_metadata: {:?}, send_message: {:?}, send_status_from_server: {:?}, recv_initial_metadata: {:?}, recv_message: {:?}, recv_status_on_client: {:?}, recv_close_on_server_cancelled: {:?} }}" , self . send_initial_metadata , self . send_message , self . send_status_from_server , self . recv_initial_metadata , self . recv_message , self . recv_status_on_client , self . recv_close_on_server_cancelled) } } extern "C" { @@ -6493,60 +3571,9 @@ pub struct grpcwrap_request_call_context { pub call_details: grpc_call_details, pub request_metadata: grpc_metadata_array, } -#[test] -fn bindgen_test_layout_grpcwrap_request_call_context() { - assert_eq!( - ::std::mem::size_of::(), - 128usize, - concat!("Size of: ", stringify!(grpcwrap_request_call_context)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpcwrap_request_call_context)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).call as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_request_call_context), - "::", - stringify!(call) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).call_details as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_request_call_context), - "::", - stringify!(call_details) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).request_metadata as *const _ - as usize - }, - 104usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_request_call_context), - "::", - stringify!(request_metadata) - ) - ); -} impl ::std::fmt::Debug for grpcwrap_request_call_context { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write ! ( f , "grpcwrap_request_call_context {{ call: {:?}, call_details: {:?}, request_metadata: {:?} }}" , self . call , self . call_details , self . request_metadata ) + write ! (f , "grpcwrap_request_call_context {{ call: {:?}, call_details: {:?}, request_metadata: {:?} }}" , self . call , self . call_details , self . request_metadata) } } extern "C" { From a083fca3ab85eab5355d8bbff6501825dfa8e682 Mon Sep 17 00:00:00 2001 From: Jay Date: Tue, 24 Nov 2020 16:47:24 +0800 Subject: [PATCH 6/7] generate bindings for aarch64 Signed-off-by: Jay --- .../aarch64-unknown-linux-gnu-bindings.rs | 2989 +---------------- 1 file changed, 8 insertions(+), 2981 deletions(-) diff --git a/grpc-sys/bindings/aarch64-unknown-linux-gnu-bindings.rs b/grpc-sys/bindings/aarch64-unknown-linux-gnu-bindings.rs index 3cbc42181..97faae9cd 100644 --- a/grpc-sys/bindings/aarch64-unknown-linux-gnu-bindings.rs +++ b/grpc-sys/bindings/aarch64-unknown-linux-gnu-bindings.rs @@ -204,53 +204,6 @@ pub struct grpc_compression_options_grpc_compression_options_default_level { pub is_set: ::std::os::raw::c_int, pub level: grpc_compression_level, } -#[test] -fn bindgen_test_layout_grpc_compression_options_grpc_compression_options_default_level() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(grpc_compression_options_grpc_compression_options_default_level) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(grpc_compression_options_grpc_compression_options_default_level) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::( - ))) - .is_set as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_compression_options_grpc_compression_options_default_level), - "::", - stringify!(is_set) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::( - ))) - .level as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(grpc_compression_options_grpc_compression_options_default_level), - "::", - stringify!(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."] @@ -260,108 +213,6 @@ pub struct grpc_compression_options_grpc_compression_options_default_algorithm { pub is_set: ::std::os::raw::c_int, pub algorithm: grpc_compression_algorithm, } -#[test] -fn bindgen_test_layout_grpc_compression_options_grpc_compression_options_default_algorithm() { - assert_eq!( - ::std::mem::size_of::( - ), - 8usize, - concat!( - "Size of: ", - stringify!(grpc_compression_options_grpc_compression_options_default_algorithm) - ) - ); - assert_eq!( - ::std::mem::align_of::( - ), - 4usize, - concat!( - "Alignment of ", - stringify!(grpc_compression_options_grpc_compression_options_default_algorithm) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::< - grpc_compression_options_grpc_compression_options_default_algorithm, - >())) - .is_set as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_compression_options_grpc_compression_options_default_algorithm), - "::", - stringify!(is_set) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::< - grpc_compression_options_grpc_compression_options_default_algorithm, - >())) - .algorithm as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(grpc_compression_options_grpc_compression_options_default_algorithm), - "::", - stringify!(algorithm) - ) - ); -} -#[test] -fn bindgen_test_layout_grpc_compression_options() { - assert_eq!( - ::std::mem::size_of::(), - 20usize, - concat!("Size of: ", stringify!(grpc_compression_options)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(grpc_compression_options)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).enabled_algorithms_bitset - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_compression_options), - "::", - stringify!(enabled_algorithms_bitset) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).default_level as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(grpc_compression_options), - "::", - stringify!(default_level) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).default_algorithm as *const _ - as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(grpc_compression_options), - "::", - stringify!(default_algorithm) - ) - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_slice_refcount { @@ -395,177 +246,17 @@ pub struct grpc_slice_grpc_slice_data_grpc_slice_refcounted { pub length: usize, pub bytes: *mut u8, } -#[test] -fn bindgen_test_layout_grpc_slice_grpc_slice_data_grpc_slice_refcounted() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(grpc_slice_grpc_slice_data_grpc_slice_refcounted) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_slice_grpc_slice_data_grpc_slice_refcounted) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).length - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_grpc_slice_data_grpc_slice_refcounted), - "::", - stringify!(length) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).bytes - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_grpc_slice_data_grpc_slice_refcounted), - "::", - stringify!(bytes) - ) - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_slice_grpc_slice_data_grpc_slice_inlined { pub length: u8, pub bytes: [u8; 23usize], } -#[test] -fn bindgen_test_layout_grpc_slice_grpc_slice_data_grpc_slice_inlined() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!( - "Size of: ", - stringify!(grpc_slice_grpc_slice_data_grpc_slice_inlined) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 1usize, - concat!( - "Alignment of ", - stringify!(grpc_slice_grpc_slice_data_grpc_slice_inlined) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).length - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_grpc_slice_data_grpc_slice_inlined), - "::", - stringify!(length) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).bytes - as *const _ as usize - }, - 1usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_grpc_slice_data_grpc_slice_inlined), - "::", - stringify!(bytes) - ) - ); -} -#[test] -fn bindgen_test_layout_grpc_slice_grpc_slice_data() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(grpc_slice_grpc_slice_data)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_slice_grpc_slice_data)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).refcounted as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_grpc_slice_data), - "::", - stringify!(refcounted) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).inlined as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_grpc_slice_data), - "::", - stringify!(inlined) - ) - ); -} impl ::std::fmt::Debug for grpc_slice_grpc_slice_data { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { write!(f, "grpc_slice_grpc_slice_data {{ union }}") } } -#[test] -fn bindgen_test_layout_grpc_slice() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(grpc_slice)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_slice)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).refcount as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice), - "::", - stringify!(refcount) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice), - "::", - stringify!(data) - ) - ); -} impl ::std::fmt::Debug for grpc_slice { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { write!( @@ -595,82 +286,9 @@ pub struct grpc_slice_buffer { #[doc = " inlined elements to avoid allocations"] pub inlined: [grpc_slice; 8usize], } -#[test] -fn bindgen_test_layout_grpc_slice_buffer() { - assert_eq!( - ::std::mem::size_of::(), - 296usize, - concat!("Size of: ", stringify!(grpc_slice_buffer)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_slice_buffer)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).base_slices as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_buffer), - "::", - stringify!(base_slices) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).slices as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_buffer), - "::", - stringify!(slices) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).count as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_buffer), - "::", - stringify!(count) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).capacity as *const _ as usize }, - 24usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_buffer), - "::", - stringify!(capacity) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).length as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_buffer), - "::", - stringify!(length) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).inlined as *const _ as usize }, - 40usize, - concat!( - "Offset of field: ", - stringify!(grpc_slice_buffer), - "::", - stringify!(inlined) - ) - ); -} impl ::std::fmt::Debug for grpc_slice_buffer { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write ! ( f , "grpc_slice_buffer {{ base_slices: {:?}, slices: {:?}, count: {:?}, capacity: {:?}, length: {:?}, inlined: {:?} }}" , self . base_slices , self . slices , self . count , self . capacity , self . length , self . inlined ) + write ! (f , "grpc_slice_buffer {{ base_slices: {:?}, slices: {:?}, count: {:?}, capacity: {:?}, length: {:?}, inlined: {:?} }}" , self . base_slices , self . slices , self . count , self . capacity , self . length , self . inlined) } } #[repr(u32)] @@ -700,49 +318,6 @@ pub struct gpr_timespec { #[doc = "this is a relative time measure)"] pub clock_type: gpr_clock_type, } -#[test] -fn bindgen_test_layout_gpr_timespec() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(gpr_timespec)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(gpr_timespec)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_sec as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(gpr_timespec), - "::", - stringify!(tv_sec) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_nsec as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(gpr_timespec), - "::", - stringify!(tv_nsec) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).clock_type as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(gpr_timespec), - "::", - stringify!(clock_type) - ) - ); -} pub type gpr_atm = isize; extern "C" { #[doc = " Adds \\a delta to \\a *value, clamping the result to the range specified"] @@ -759,85 +334,16 @@ extern "C" { pub struct gpr_event { pub state: gpr_atm, } -#[test] -fn bindgen_test_layout_gpr_event() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(gpr_event)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(gpr_event)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).state as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(gpr_event), - "::", - stringify!(state) - ) - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct gpr_refcount { pub count: gpr_atm, } -#[test] -fn bindgen_test_layout_gpr_refcount() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(gpr_refcount)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(gpr_refcount)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).count as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(gpr_refcount), - "::", - stringify!(count) - ) - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct gpr_stats_counter { pub value: gpr_atm, } -#[test] -fn bindgen_test_layout_gpr_stats_counter() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(gpr_stats_counter)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(gpr_stats_counter)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).value as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(gpr_stats_counter), - "::", - stringify!(value) - ) - ); -} extern "C" { #[doc = " Initialize *ev."] pub fn gpr_event_init(ev: *mut gpr_event); @@ -1298,189 +804,22 @@ pub union grpc_byte_buffer_grpc_byte_buffer_data { pub struct grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1 { pub reserved: [*mut ::std::os::raw::c_void; 8usize], } -#[test] -fn bindgen_test_layout_grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!( - "Size of: ", - stringify!(grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .reserved as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer_grpc_byte_buffer_data__bindgen_ty_1), - "::", - stringify!(reserved) - ) - ); -} #[repr(C)] #[derive(Copy, Clone)] pub struct grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer { pub compression: grpc_compression_algorithm, pub slice_buffer: grpc_slice_buffer, } -#[test] -fn bindgen_test_layout_grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer() { - assert_eq!( - ::std::mem::size_of::(), - 304usize, - concat!( - "Size of: ", - stringify!(grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::( - ))) - .compression as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer), - "::", - stringify!(compression) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::( - ))) - .slice_buffer as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer), - "::", - stringify!(slice_buffer) - ) - ); -} impl ::std::fmt::Debug for grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write ! ( f , "grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer {{ compression: {:?}, slice_buffer: {:?} }}" , self . compression , self . slice_buffer ) + write ! (f , "grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer {{ compression: {:?}, slice_buffer: {:?} }}" , self . compression , self . slice_buffer) } } -#[test] -fn bindgen_test_layout_grpc_byte_buffer_grpc_byte_buffer_data() { - assert_eq!( - ::std::mem::size_of::(), - 304usize, - concat!( - "Size of: ", - stringify!(grpc_byte_buffer_grpc_byte_buffer_data) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_byte_buffer_grpc_byte_buffer_data) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).reserved as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer_grpc_byte_buffer_data), - "::", - stringify!(reserved) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).raw as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer_grpc_byte_buffer_data), - "::", - stringify!(raw) - ) - ); -} impl ::std::fmt::Debug for grpc_byte_buffer_grpc_byte_buffer_data { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { write!(f, "grpc_byte_buffer_grpc_byte_buffer_data {{ union }}") } } -#[test] -fn bindgen_test_layout_grpc_byte_buffer() { - assert_eq!( - ::std::mem::size_of::(), - 320usize, - concat!("Size of: ", stringify!(grpc_byte_buffer)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_byte_buffer)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer), - "::", - stringify!(reserved) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer), - "::", - stringify!(data) - ) - ); -} impl ::std::fmt::Debug for grpc_byte_buffer { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { write!( @@ -1547,49 +886,6 @@ pub struct grpc_arg_pointer_vtable { ) -> ::std::os::raw::c_int, >, } -#[test] -fn bindgen_test_layout_grpc_arg_pointer_vtable() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(grpc_arg_pointer_vtable)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_arg_pointer_vtable)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).copy as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_arg_pointer_vtable), - "::", - stringify!(copy) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).destroy as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_arg_pointer_vtable), - "::", - stringify!(destroy) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).cmp as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_arg_pointer_vtable), - "::", - stringify!(cmp) - ) - ); -} #[doc = " A single argument... each argument has a key and a value"] #[doc = ""] #[doc = "A note on naming keys:"] @@ -1623,142 +919,11 @@ pub struct grpc_arg_grpc_arg_value_grpc_arg_pointer { pub p: *mut ::std::os::raw::c_void, pub vtable: *const grpc_arg_pointer_vtable, } -#[test] -fn bindgen_test_layout_grpc_arg_grpc_arg_value_grpc_arg_pointer() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!( - "Size of: ", - stringify!(grpc_arg_grpc_arg_value_grpc_arg_pointer) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_arg_grpc_arg_value_grpc_arg_pointer) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).p as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_arg_grpc_arg_value_grpc_arg_pointer), - "::", - stringify!(p) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).vtable as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_arg_grpc_arg_value_grpc_arg_pointer), - "::", - stringify!(vtable) - ) - ); -} -#[test] -fn bindgen_test_layout_grpc_arg_grpc_arg_value() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(grpc_arg_grpc_arg_value)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_arg_grpc_arg_value)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).string as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_arg_grpc_arg_value), - "::", - stringify!(string) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).integer as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_arg_grpc_arg_value), - "::", - stringify!(integer) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).pointer as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_arg_grpc_arg_value), - "::", - stringify!(pointer) - ) - ); -} impl ::std::fmt::Debug for grpc_arg_grpc_arg_value { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { write!(f, "grpc_arg_grpc_arg_value {{ union }}") } } -#[test] -fn bindgen_test_layout_grpc_arg() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(grpc_arg)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_arg)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_arg), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).key as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_arg), - "::", - stringify!(key) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).value as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_arg), - "::", - stringify!(value) - ) - ); -} impl ::std::fmt::Debug for grpc_arg { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { write!( @@ -1790,39 +955,6 @@ pub struct grpc_channel_args { pub num_args: usize, pub args: *mut grpc_arg, } -#[test] -fn bindgen_test_layout_grpc_channel_args() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(grpc_channel_args)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_channel_args)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).num_args as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_channel_args), - "::", - stringify!(num_args) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).args as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_channel_args), - "::", - stringify!(args) - ) - ); -} #[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."] @@ -1884,84 +1016,6 @@ pub struct grpc_metadata { pub struct grpc_metadata__bindgen_ty_1 { pub obfuscated: [*mut ::std::os::raw::c_void; 4usize], } -#[test] -fn bindgen_test_layout_grpc_metadata__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(grpc_metadata__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_metadata__bindgen_ty_1)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).obfuscated as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata__bindgen_ty_1), - "::", - stringify!(obfuscated) - ) - ); -} -#[test] -fn bindgen_test_layout_grpc_metadata() { - assert_eq!( - ::std::mem::size_of::(), - 104usize, - concat!("Size of: ", stringify!(grpc_metadata)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_metadata)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).key as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata), - "::", - stringify!(key) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).value as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata), - "::", - stringify!(value) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).internal_data as *const _ as usize }, - 72usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata), - "::", - stringify!(internal_data) - ) - ); -} impl ::std::fmt::Debug for grpc_metadata { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { write!( @@ -2001,49 +1055,6 @@ pub struct grpc_event { #[doc = "values, tag is uninitialized."] pub tag: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_grpc_event() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(grpc_event)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_event)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).type_ as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_event), - "::", - stringify!(type_) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).success as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(grpc_event), - "::", - stringify!(success) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tag as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_event), - "::", - stringify!(tag) - ) - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_metadata_array { @@ -2051,49 +1062,6 @@ pub struct grpc_metadata_array { pub capacity: usize, pub metadata: *mut grpc_metadata, } -#[test] -fn bindgen_test_layout_grpc_metadata_array() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(grpc_metadata_array)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_metadata_array)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).count as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata_array), - "::", - stringify!(count) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).capacity as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata_array), - "::", - stringify!(capacity) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).metadata as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata_array), - "::", - stringify!(metadata) - ) - ); -} #[repr(C)] #[derive(Copy, Clone)] pub struct grpc_call_details { @@ -2103,72 +1071,9 @@ pub struct grpc_call_details { pub flags: u32, pub reserved: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_grpc_call_details() { - assert_eq!( - ::std::mem::size_of::(), - 96usize, - concat!("Size of: ", stringify!(grpc_call_details)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_call_details)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).method as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_call_details), - "::", - stringify!(method) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).host as *const _ as usize }, - 32usize, - concat!( - "Offset of field: ", - stringify!(grpc_call_details), - "::", - stringify!(host) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).deadline as *const _ as usize }, - 64usize, - concat!( - "Offset of field: ", - stringify!(grpc_call_details), - "::", - stringify!(deadline) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 80usize, - concat!( - "Offset of field: ", - stringify!(grpc_call_details), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved as *const _ as usize }, - 88usize, - concat!( - "Offset of field: ", - stringify!(grpc_call_details), - "::", - stringify!(reserved) - ) - ); -} impl ::std::fmt::Debug for grpc_call_details { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write ! ( f , "grpc_call_details {{ method: {:?}, host: {:?}, deadline: {:?}, flags: {:?}, reserved: {:?} }}" , self . method , self . host , self . deadline , self . flags , self . reserved ) + write ! (f , "grpc_call_details {{ method: {:?}, host: {:?}, deadline: {:?}, flags: {:?}, reserved: {:?} }}" , self . method , self . host , self . deadline , self . flags , self . reserved) } } #[repr(u32)] @@ -2247,35 +1152,6 @@ pub union grpc_op_grpc_op_data { pub struct grpc_op_grpc_op_data__bindgen_ty_1 { pub reserved: [*mut ::std::os::raw::c_void; 8usize], } -#[test] -fn bindgen_test_layout_grpc_op_grpc_op_data__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(grpc_op_grpc_op_data__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_op_grpc_op_data__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).reserved as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data__bindgen_ty_1), - "::", - stringify!(reserved) - ) - ); -} #[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 , } @@ -2288,72 +1164,6 @@ pub struct grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initi pub is_set: u8, pub level: grpc_compression_level, } -#[test] -fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level( -) { - assert_eq ! ( :: std :: mem :: size_of :: < grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level > ( ) , 8usize , concat ! ( "Size of: " , stringify ! ( grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level ) ) ); - assert_eq ! ( :: std :: mem :: align_of :: < grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level > ( ) , 4usize , concat ! ( "Alignment of " , stringify ! ( grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level ) ) ); - assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level > ( ) ) ) . is_set as * const _ as usize } , 0usize , concat ! ( "Offset of field: " , stringify ! ( grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level ) , "::" , stringify ! ( is_set ) ) ); - assert_eq ! ( unsafe { & ( * ( :: std :: ptr :: null :: < grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level > ( ) ) ) . level as * const _ as usize } , 4usize , concat ! ( "Offset of field: " , stringify ! ( grpc_op_grpc_op_data_grpc_op_send_initial_metadata_grpc_op_send_initial_metadata_maybe_compression_level ) , "::" , stringify ! ( level ) ) ); -} -#[test] -fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_send_initial_metadata() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!( - "Size of: ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_initial_metadata) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_initial_metadata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).count - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_initial_metadata), - "::", - stringify!(count) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).metadata - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_initial_metadata), - "::", - stringify!(metadata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .maybe_compression_level as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_initial_metadata), - "::", - stringify!(maybe_compression_level) - ) - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_op_grpc_op_data_grpc_op_send_message { @@ -2363,38 +1173,6 @@ pub struct grpc_op_grpc_op_data_grpc_op_send_message { #[doc = " grpc_byte_buffer_destroy() on this object however."] pub send_message: *mut grpc_byte_buffer, } -#[test] -fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_send_message() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_message) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_message) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).send_message - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_message), - "::", - stringify!(send_message) - ) - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_op_grpc_op_data_grpc_op_send_status_from_server { @@ -2405,77 +1183,6 @@ pub struct grpc_op_grpc_op_data_grpc_op_send_status_from_server { #[doc = " pointer will not be retained past the start_batch call"] pub status_details: *mut grpc_slice, } -#[test] -fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_send_status_from_server() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!( - "Size of: ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_status_from_server) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_status_from_server) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .trailing_metadata_count as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_status_from_server), - "::", - stringify!(trailing_metadata_count) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .trailing_metadata as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_status_from_server), - "::", - stringify!(trailing_metadata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).status - as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_status_from_server), - "::", - stringify!(status) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .status_details as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_send_status_from_server), - "::", - stringify!(status_details) - ) - ); -} #[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)."] @@ -2486,38 +1193,6 @@ fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_send_status_from_server() { pub struct grpc_op_grpc_op_data_grpc_op_recv_initial_metadata { pub recv_initial_metadata: *mut grpc_metadata_array, } -#[test] -fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_recv_initial_metadata() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_initial_metadata) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_initial_metadata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .recv_initial_metadata as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_initial_metadata), - "::", - stringify!(recv_initial_metadata) - ) - ); -} #[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"] @@ -2527,38 +1202,6 @@ fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_recv_initial_metadata() { pub struct grpc_op_grpc_op_data_grpc_op_recv_message { pub recv_message: *mut *mut grpc_byte_buffer, } -#[test] -fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_recv_message() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_message) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_message) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).recv_message - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_message), - "::", - stringify!(recv_message) - ) - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_op_grpc_op_data_grpc_op_recv_status_on_client { @@ -2575,286 +1218,18 @@ pub struct grpc_op_grpc_op_data_grpc_op_recv_status_on_client { #[doc = " for freeing the data by using gpr_free()."] pub error_string: *mut *const ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_recv_status_on_client() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!( - "Size of: ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_status_on_client) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_status_on_client) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .trailing_metadata as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_status_on_client), - "::", - stringify!(trailing_metadata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).status - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_status_on_client), - "::", - stringify!(status) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .status_details as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_status_on_client), - "::", - stringify!(status_details) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .error_string as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_status_on_client), - "::", - stringify!(error_string) - ) - ); -} #[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 in any way (seen as a"] - #[doc = "cancellation on the server), or 0 if the call succeeded"] - pub cancelled: *mut ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_grpc_op_grpc_op_data_grpc_op_recv_close_on_server() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!( - "Size of: ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_close_on_server) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_close_on_server) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).cancelled - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data_grpc_op_recv_close_on_server), - "::", - stringify!(cancelled) - ) - ); -} -#[test] -fn bindgen_test_layout_grpc_op_grpc_op_data() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(grpc_op_grpc_op_data)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_op_grpc_op_data)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data), - "::", - stringify!(reserved) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).send_initial_metadata as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data), - "::", - stringify!(send_initial_metadata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).send_message as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data), - "::", - stringify!(send_message) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).send_status_from_server as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data), - "::", - stringify!(send_status_from_server) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).recv_initial_metadata as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data), - "::", - stringify!(recv_initial_metadata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).recv_message as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data), - "::", - stringify!(recv_message) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).recv_status_on_client as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data), - "::", - stringify!(recv_status_on_client) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).recv_close_on_server as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op_grpc_op_data), - "::", - stringify!(recv_close_on_server) - ) - ); + #[doc = "cancellation on the server), or 0 if the call succeeded"] + pub cancelled: *mut ::std::os::raw::c_int, } impl ::std::fmt::Debug for grpc_op_grpc_op_data { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { write!(f, "grpc_op_grpc_op_data {{ union }}") } } -#[test] -fn bindgen_test_layout_grpc_op() { - assert_eq!( - ::std::mem::size_of::(), - 80usize, - concat!("Size of: ", stringify!(grpc_op)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_op)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).op as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_op), - "::", - stringify!(op) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).flags as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(grpc_op), - "::", - stringify!(flags) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).reserved as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_op), - "::", - stringify!(reserved) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).data as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_op), - "::", - stringify!(data) - ) - ); -} impl ::std::fmt::Debug for grpc_op { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { write!( @@ -2875,43 +1250,6 @@ pub struct grpc_channel_info { #[doc = " service config used by the channel in JSON form."] pub service_config_json: *mut *mut ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_grpc_channel_info() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(grpc_channel_info)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_channel_info)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).lb_policy_name as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_channel_info), - "::", - stringify!(lb_policy_name) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).service_config_json as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_channel_info), - "::", - stringify!(service_config_json) - ) - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_resource_quota { @@ -2978,77 +1316,6 @@ pub struct grpc_experimental_completion_queue_functor { pub internal_success: ::std::os::raw::c_int, pub internal_next: *mut grpc_experimental_completion_queue_functor, } -#[test] -fn bindgen_test_layout_grpc_experimental_completion_queue_functor() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!( - "Size of: ", - stringify!(grpc_experimental_completion_queue_functor) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_experimental_completion_queue_functor) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).functor_run - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_experimental_completion_queue_functor), - "::", - stringify!(functor_run) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).inlineable - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_experimental_completion_queue_functor), - "::", - stringify!(inlineable) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).internal_success - as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(grpc_experimental_completion_queue_functor), - "::", - stringify!(internal_success) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).internal_next - as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_experimental_completion_queue_functor), - "::", - stringify!(internal_next) - ) - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_completion_queue_attributes { @@ -3062,74 +1329,6 @@ pub struct grpc_completion_queue_attributes { #[doc = " shutdown is complete"] pub cq_shutdown_cb: *mut grpc_experimental_completion_queue_functor, } -#[test] -fn bindgen_test_layout_grpc_completion_queue_attributes() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(grpc_completion_queue_attributes)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_completion_queue_attributes) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).version as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_completion_queue_attributes), - "::", - stringify!(version) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).cq_completion_type - as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(grpc_completion_queue_attributes), - "::", - stringify!(cq_completion_type) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).cq_polling_type as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_completion_queue_attributes), - "::", - stringify!(cq_polling_type) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).cq_shutdown_cb as *const _ - as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_completion_queue_attributes), - "::", - stringify!(cq_shutdown_cb) - ) - ); -} #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct grpc_completion_queue_factory { @@ -4154,53 +2353,6 @@ pub struct grpc_auth_property_iterator { pub index: usize, pub name: *const ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_grpc_auth_property_iterator() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(grpc_auth_property_iterator)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_auth_property_iterator)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).ctx as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_property_iterator), - "::", - stringify!(ctx) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).index as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_property_iterator), - "::", - stringify!(index) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).name as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_property_iterator), - "::", - stringify!(name) - ) - ); -} #[doc = " value, if not NULL, is guaranteed to be NULL terminated."] #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -4209,49 +2361,6 @@ pub struct grpc_auth_property { pub value: *mut ::std::os::raw::c_char, pub value_length: usize, } -#[test] -fn bindgen_test_layout_grpc_auth_property() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(grpc_auth_property)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_auth_property)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).name as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_property), - "::", - stringify!(name) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).value as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_property), - "::", - stringify!(value) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).value_length as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_property), - "::", - stringify!(value_length) - ) - ); -} extern "C" { #[doc = " Returns NULL when the iterator is at the end."] pub fn grpc_auth_property_iterator_next( @@ -4392,43 +2501,6 @@ pub struct grpc_ssl_pem_key_cert_pair { #[doc = "the client's certificate chain."] pub cert_chain: *const ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_grpc_ssl_pem_key_cert_pair() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(grpc_ssl_pem_key_cert_pair)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_ssl_pem_key_cert_pair)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).private_key as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_ssl_pem_key_cert_pair), - "::", - stringify!(private_key) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).cert_chain as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_ssl_pem_key_cert_pair), - "::", - stringify!(cert_chain) - ) - ); -} #[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"] @@ -4457,58 +2529,6 @@ pub struct verify_peer_options { pub verify_peer_destruct: ::std::option::Option, } -#[test] -fn bindgen_test_layout_verify_peer_options() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(verify_peer_options)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(verify_peer_options)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).verify_peer_callback as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(verify_peer_options), - "::", - stringify!(verify_peer_callback) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).verify_peer_callback_userdata - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(verify_peer_options), - "::", - stringify!(verify_peer_callback_userdata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).verify_peer_destruct as *const _ - as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(verify_peer_options), - "::", - stringify!(verify_peer_destruct) - ) - ); -} #[doc = " Object that holds additional peer-verification options on a secure"] #[doc = "channel."] #[repr(C)] @@ -4535,58 +2555,6 @@ pub struct grpc_ssl_verify_peer_options { pub verify_peer_destruct: ::std::option::Option, } -#[test] -fn bindgen_test_layout_grpc_ssl_verify_peer_options() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(grpc_ssl_verify_peer_options)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_ssl_verify_peer_options)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).verify_peer_callback - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_ssl_verify_peer_options), - "::", - stringify!(verify_peer_callback) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).verify_peer_callback_userdata - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_ssl_verify_peer_options), - "::", - stringify!(verify_peer_callback_userdata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).verify_peer_destruct - as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_ssl_verify_peer_options), - "::", - stringify!(verify_peer_destruct) - ) - ); -} 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"] @@ -4728,133 +2696,6 @@ pub struct grpc_sts_credentials_options { pub actor_token_path: *const ::std::os::raw::c_char, pub actor_token_type: *const ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_grpc_sts_credentials_options() { - assert_eq!( - ::std::mem::size_of::(), - 72usize, - concat!("Size of: ", stringify!(grpc_sts_credentials_options)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_sts_credentials_options)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).token_exchange_service_uri - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_sts_credentials_options), - "::", - stringify!(token_exchange_service_uri) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).resource as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_sts_credentials_options), - "::", - stringify!(resource) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).audience as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_sts_credentials_options), - "::", - stringify!(audience) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).scope as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(grpc_sts_credentials_options), - "::", - stringify!(scope) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).requested_token_type - as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(grpc_sts_credentials_options), - "::", - stringify!(requested_token_type) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).subject_token_path as *const _ - as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(grpc_sts_credentials_options), - "::", - stringify!(subject_token_path) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).subject_token_type as *const _ - as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(grpc_sts_credentials_options), - "::", - stringify!(subject_token_type) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).actor_token_path as *const _ - as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(grpc_sts_credentials_options), - "::", - stringify!(actor_token_path) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).actor_token_type as *const _ - as usize - }, - 64usize, - concat!( - "Offset of field: ", - stringify!(grpc_sts_credentials_options), - "::", - stringify!(actor_token_type) - ) - ); -} 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."] @@ -4901,68 +2742,6 @@ pub struct grpc_auth_metadata_context { #[doc = " Reserved for future use."] pub reserved: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_grpc_auth_metadata_context() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(grpc_auth_metadata_context)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_auth_metadata_context)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).service_url as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_metadata_context), - "::", - stringify!(service_url) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).method_name as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_metadata_context), - "::", - stringify!(method_name) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).channel_auth_context as *const _ - as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_metadata_context), - "::", - stringify!(channel_auth_context) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).reserved as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_metadata_context), - "::", - stringify!(reserved) - ) - ); -} #[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."] @@ -5008,72 +2787,6 @@ pub struct grpc_metadata_credentials_plugin { #[doc = " Type of credentials that this plugin is implementing."] pub type_: *const ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_grpc_metadata_credentials_plugin() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(grpc_metadata_credentials_plugin)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_metadata_credentials_plugin) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).get_metadata as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata_credentials_plugin), - "::", - stringify!(get_metadata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).destroy as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata_credentials_plugin), - "::", - stringify!(destroy) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).state as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata_credentials_plugin), - "::", - stringify!(state) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).type_ as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(grpc_metadata_credentials_plugin), - "::", - stringify!(type_) - ) - ); -} extern "C" { #[doc = " Creates a credentials object from a plugin."] pub fn grpc_metadata_credentials_create_from_plugin( @@ -5281,55 +2994,6 @@ pub struct grpc_auth_metadata_processor { pub destroy: ::std::option::Option, pub state: *mut ::std::os::raw::c_void, } -#[test] -fn bindgen_test_layout_grpc_auth_metadata_processor() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(grpc_auth_metadata_processor)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_auth_metadata_processor)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).process as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_metadata_processor), - "::", - stringify!(process) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).destroy as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_metadata_processor), - "::", - stringify!(destroy) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).state as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_auth_metadata_processor), - "::", - stringify!(state) - ) - ); -} extern "C" { pub fn grpc_server_credentials_set_auth_metadata_processor( creds: *mut grpc_server_credentials, @@ -5556,119 +3220,6 @@ pub struct grpc_tls_credential_reload_arg { pub destroy_context: ::std::option::Option, } -#[test] -fn bindgen_test_layout_grpc_tls_credential_reload_arg() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!("Size of: ", stringify!(grpc_tls_credential_reload_arg)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_tls_credential_reload_arg)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).cb as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_credential_reload_arg), - "::", - stringify!(cb) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).cb_user_data as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_credential_reload_arg), - "::", - stringify!(cb_user_data) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).key_materials_config - as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_credential_reload_arg), - "::", - stringify!(key_materials_config) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).status as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_credential_reload_arg), - "::", - stringify!(status) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).error_details as *const _ - as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_credential_reload_arg), - "::", - stringify!(error_details) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).config as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_credential_reload_arg), - "::", - stringify!(config) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).context as *const _ as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_credential_reload_arg), - "::", - stringify!(context) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).destroy_context as *const _ - as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_credential_reload_arg), - "::", - stringify!(destroy_context) - ) - ); -} extern "C" { #[doc = " Create a grpc_tls_credential_reload_config instance."] #[doc = "- config_user_data is config-specific, read-only user data"] @@ -5750,155 +3301,6 @@ pub struct grpc_tls_server_authorization_check_arg { pub destroy_context: ::std::option::Option, } -#[test] -fn bindgen_test_layout_grpc_tls_server_authorization_check_arg() { - assert_eq!( - ::std::mem::size_of::(), - 80usize, - concat!( - "Size of: ", - stringify!(grpc_tls_server_authorization_check_arg) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpc_tls_server_authorization_check_arg) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).cb as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_server_authorization_check_arg), - "::", - stringify!(cb) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).cb_user_data - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_server_authorization_check_arg), - "::", - stringify!(cb_user_data) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).success as *const _ - as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_server_authorization_check_arg), - "::", - stringify!(success) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).target_name - as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_server_authorization_check_arg), - "::", - stringify!(target_name) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).peer_cert - as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_server_authorization_check_arg), - "::", - stringify!(peer_cert) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).status as *const _ - as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_server_authorization_check_arg), - "::", - stringify!(status) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).error_details - as *const _ as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_server_authorization_check_arg), - "::", - stringify!(error_details) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).config as *const _ - as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_server_authorization_check_arg), - "::", - stringify!(config) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).context as *const _ - as usize - }, - 64usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_server_authorization_check_arg), - "::", - stringify!(context) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).destroy_context - as *const _ as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(grpc_tls_server_authorization_check_arg), - "::", - stringify!(destroy_context) - ) - ); -} extern "C" { #[doc = " Create a grpc_tls_server_authorization_check_config instance."] #[doc = "- config_user_data is config-specific, read-only user data"] @@ -6018,59 +3420,6 @@ pub struct gpr_log_func_args { pub severity: gpr_log_severity, pub message: *const ::std::os::raw::c_char, } -#[test] -fn bindgen_test_layout_gpr_log_func_args() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(gpr_log_func_args)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(gpr_log_func_args)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).file as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(gpr_log_func_args), - "::", - stringify!(file) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).line as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(gpr_log_func_args), - "::", - stringify!(line) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).severity as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(gpr_log_func_args), - "::", - stringify!(severity) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).message as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(gpr_log_func_args), - "::", - stringify!(message) - ) - ); -} pub type gpr_log_func = ::std::option::Option; extern "C" { pub fn gpr_set_log_function(func: gpr_log_func); @@ -6162,38 +3511,6 @@ pub union grpc_byte_buffer_reader_grpc_byte_buffer_reader_current { pub index: ::std::os::raw::c_uint, _bindgen_union_align: u32, } -#[test] -fn bindgen_test_layout_grpc_byte_buffer_reader_grpc_byte_buffer_reader_current() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!( - "Size of: ", - stringify!(grpc_byte_buffer_reader_grpc_byte_buffer_reader_current) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!( - "Alignment of ", - stringify!(grpc_byte_buffer_reader_grpc_byte_buffer_reader_current) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .index as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer_reader_grpc_byte_buffer_reader_current), - "::", - stringify!(index) - ) - ); -} impl ::std::fmt::Debug for grpc_byte_buffer_reader_grpc_byte_buffer_reader_current { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { write!( @@ -6202,53 +3519,6 @@ impl ::std::fmt::Debug for grpc_byte_buffer_reader_grpc_byte_buffer_reader_curre ) } } -#[test] -fn bindgen_test_layout_grpc_byte_buffer_reader() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(grpc_byte_buffer_reader)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpc_byte_buffer_reader)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).buffer_in as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer_reader), - "::", - stringify!(buffer_in) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).buffer_out as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer_reader), - "::", - stringify!(buffer_out) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).current as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(grpc_byte_buffer_reader), - "::", - stringify!(current) - ) - ); -} impl ::std::fmt::Debug for grpc_byte_buffer_reader { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { write!( @@ -6274,38 +3544,6 @@ pub struct grpcwrap_batch_context { pub struct grpcwrap_batch_context__bindgen_ty_1 { pub trailing_metadata: grpc_metadata_array, } -#[test] -fn bindgen_test_layout_grpcwrap_batch_context__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!( - "Size of: ", - stringify!(grpcwrap_batch_context__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpcwrap_batch_context__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).trailing_metadata - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_batch_context__bindgen_ty_1), - "::", - stringify!(trailing_metadata) - ) - ); -} #[repr(C)] #[derive(Copy, Clone)] pub struct grpcwrap_batch_context__bindgen_ty_2 { @@ -6313,174 +3551,14 @@ pub struct grpcwrap_batch_context__bindgen_ty_2 { pub status: grpc_status_code::Type, pub status_details: grpc_slice, } -#[test] -fn bindgen_test_layout_grpcwrap_batch_context__bindgen_ty_2() { - assert_eq!( - ::std::mem::size_of::(), - 64usize, - concat!( - "Size of: ", - stringify!(grpcwrap_batch_context__bindgen_ty_2) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(grpcwrap_batch_context__bindgen_ty_2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).trailing_metadata - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_batch_context__bindgen_ty_2), - "::", - stringify!(trailing_metadata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).status as *const _ - as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_batch_context__bindgen_ty_2), - "::", - stringify!(status) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).status_details - as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_batch_context__bindgen_ty_2), - "::", - stringify!(status_details) - ) - ); -} impl ::std::fmt::Debug for grpcwrap_batch_context__bindgen_ty_2 { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write ! ( f , "grpcwrap_batch_context__bindgen_ty_2 {{ trailing_metadata: {:?}, status: {:?}, status_details: {:?} }}" , self . trailing_metadata , self . status , self . status_details ) + write ! (f , "grpcwrap_batch_context__bindgen_ty_2 {{ trailing_metadata: {:?}, status: {:?}, status_details: {:?} }}" , self . trailing_metadata , self . status , self . status_details) } } -#[test] -fn bindgen_test_layout_grpcwrap_batch_context() { - assert_eq!( - ::std::mem::size_of::(), - 160usize, - concat!("Size of: ", stringify!(grpcwrap_batch_context)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpcwrap_batch_context)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).send_initial_metadata as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_batch_context), - "::", - stringify!(send_initial_metadata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).send_message as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_batch_context), - "::", - stringify!(send_message) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).send_status_from_server as *const _ - as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_batch_context), - "::", - stringify!(send_status_from_server) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).recv_initial_metadata as *const _ - as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_batch_context), - "::", - stringify!(recv_initial_metadata) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).recv_message as *const _ as usize - }, - 80usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_batch_context), - "::", - stringify!(recv_message) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).recv_status_on_client as *const _ - as usize - }, - 88usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_batch_context), - "::", - stringify!(recv_status_on_client) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).recv_close_on_server_cancelled - as *const _ as usize - }, - 152usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_batch_context), - "::", - stringify!(recv_close_on_server_cancelled) - ) - ); -} impl ::std::fmt::Debug for grpcwrap_batch_context { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write ! ( f , "grpcwrap_batch_context {{ send_initial_metadata: {:?}, send_message: {:?}, send_status_from_server: {:?}, recv_initial_metadata: {:?}, recv_message: {:?}, recv_status_on_client: {:?}, recv_close_on_server_cancelled: {:?} }}" , self . send_initial_metadata , self . send_message , self . send_status_from_server , self . recv_initial_metadata , self . recv_message , self . recv_status_on_client , self . recv_close_on_server_cancelled ) + write ! (f , "grpcwrap_batch_context {{ send_initial_metadata: {:?}, send_message: {:?}, send_status_from_server: {:?}, recv_initial_metadata: {:?}, recv_message: {:?}, recv_status_on_client: {:?}, recv_close_on_server_cancelled: {:?} }}" , self . send_initial_metadata , self . send_message , self . send_status_from_server , self . recv_initial_metadata , self . recv_message , self . recv_status_on_client , self . recv_close_on_server_cancelled) } } extern "C" { @@ -6493,60 +3571,9 @@ pub struct grpcwrap_request_call_context { pub call_details: grpc_call_details, pub request_metadata: grpc_metadata_array, } -#[test] -fn bindgen_test_layout_grpcwrap_request_call_context() { - assert_eq!( - ::std::mem::size_of::(), - 128usize, - concat!("Size of: ", stringify!(grpcwrap_request_call_context)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(grpcwrap_request_call_context)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).call as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_request_call_context), - "::", - stringify!(call) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).call_details as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_request_call_context), - "::", - stringify!(call_details) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).request_metadata as *const _ - as usize - }, - 104usize, - concat!( - "Offset of field: ", - stringify!(grpcwrap_request_call_context), - "::", - stringify!(request_metadata) - ) - ); -} impl ::std::fmt::Debug for grpcwrap_request_call_context { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { - write ! ( f , "grpcwrap_request_call_context {{ call: {:?}, call_details: {:?}, request_metadata: {:?} }}" , self . call , self . call_details , self . request_metadata ) + write ! (f , "grpcwrap_request_call_context {{ call: {:?}, call_details: {:?}, request_metadata: {:?} }}" , self . call , self . call_details , self . request_metadata) } } extern "C" { From 1b25b2ef322edf6d9a2707c9308a6cf233667504 Mon Sep 17 00:00:00 2001 From: Jay Lee Date: Tue, 24 Nov 2020 16:50:56 +0800 Subject: [PATCH 7/7] make size limit public Signed-off-by: Jay Lee --- src/codec.rs | 2 +- src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/codec.rs b/src/codec.rs index 2f143406b..efc65039d 100644 --- a/src/codec.rs +++ b/src/codec.rs @@ -8,7 +8,7 @@ pub type SerializeFn = fn(&T, &mut Vec) -> Result<()>; /// According to https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md, grpc uses /// a four bytes to describe the length of a message, so it should not exceed u32::MAX. -const MAX_MESSAGE_SIZE: usize = u32::MAX as usize; +pub const MAX_MESSAGE_SIZE: usize = u32::MAX as usize; /// Defines how to serialize and deserialize between the specialized type and byte slice. pub struct Marshaller { diff --git a/src/lib.rs b/src/lib.rs index f482977ec..08fd86eb9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -67,7 +67,7 @@ pub use crate::codec::pb_codec::{de as pb_de, ser as pb_ser}; pub use crate::codec::pr_codec::{de as pr_de, ser as pr_ser}; pub use crate::auth_context::{AuthContext, AuthProperty, AuthPropertyIter}; -pub use crate::codec::Marshaller; +pub use crate::codec::{Marshaller, MAX_MESSAGE_SIZE}; pub use crate::env::{EnvBuilder, Environment}; pub use crate::error::{Error, Result}; pub use crate::log_util::redirect_log;