[INFO] fetching crate mountpoint-s3-crt-sys 0.3.0... [INFO] documenting mountpoint-s3-crt-sys-0.3.0 against 1.73.0 for beta-1.74-rustdoc-1 [INFO] extracting crate mountpoint-s3-crt-sys 0.3.0 into /workspace/builds/worker-3-tc1/source [INFO] validating manifest of crates.io crate mountpoint-s3-crt-sys 0.3.0 on toolchain 1.73.0 [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+1.73.0" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] started tweaking crates.io crate mountpoint-s3-crt-sys 0.3.0 [INFO] finished tweaking crates.io crate mountpoint-s3-crt-sys 0.3.0 [INFO] tweaked toml for crates.io crate mountpoint-s3-crt-sys 0.3.0 written to /workspace/builds/worker-3-tc1/source/Cargo.toml [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+1.73.0" "generate-lockfile" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Updating crates.io index [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+1.73.0" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Downloading crates ... [INFO] [stderr] Downloaded smallstr v0.3.0 [INFO] [stderr] Downloaded rustflags v0.1.4 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:023092b8bfa974c7f3e45c5ce651cc8dd3afd5e76915d5995b8dacd3032bf956" "/opt/rustwide/cargo-home/bin/cargo" "+1.73.0" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] cb8488d1739a7a55d2c2c20724bbfda422f3133e3c906285bac6da6c242d7248 [INFO] running `Command { std: "docker" "start" "-a" "cb8488d1739a7a55d2c2c20724bbfda422f3133e3c906285bac6da6c242d7248", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "cb8488d1739a7a55d2c2c20724bbfda422f3133e3c906285bac6da6c242d7248", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "cb8488d1739a7a55d2c2c20724bbfda422f3133e3c906285bac6da6c242d7248", kill_on_drop: false }` [INFO] [stdout] cb8488d1739a7a55d2c2c20724bbfda422f3133e3c906285bac6da6c242d7248 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=warn" "-e" "RUSTDOCFLAGS=--cap-lints=warn" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:023092b8bfa974c7f3e45c5ce651cc8dd3afd5e76915d5995b8dacd3032bf956" "/opt/rustwide/cargo-home/bin/cargo" "+1.73.0" "doc" "--frozen" "--no-deps" "--document-private-items" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 7b9bb256e3777efdfee0d1844f9b29631ae32c5c186b611d68b9872ffc4e8f53 [INFO] running `Command { std: "docker" "start" "-a" "7b9bb256e3777efdfee0d1844f9b29631ae32c5c186b611d68b9872ffc4e8f53", kill_on_drop: false }` [INFO] [stderr] Compiling glob v0.3.1 [INFO] [stderr] Compiling proc-macro2 v1.0.69 [INFO] [stderr] Compiling memchr v2.6.4 [INFO] [stderr] Compiling minimal-lexical v0.2.1 [INFO] [stderr] Compiling regex-syntax v0.8.2 [INFO] [stderr] Compiling bindgen v0.66.1 [INFO] [stderr] Compiling rustc-hash v1.1.0 [INFO] [stderr] Compiling peeking_take_while v0.1.2 [INFO] [stderr] Compiling libloading v0.7.4 [INFO] [stderr] Compiling lazycell v1.3.0 [INFO] [stderr] Compiling shlex v1.2.0 [INFO] [stderr] Compiling rustflags v0.1.4 [INFO] [stderr] Compiling cmake v0.1.50 [INFO] [stderr] Checking smallstr v0.3.0 [INFO] [stderr] Compiling clang-sys v1.6.1 [INFO] [stderr] Compiling nom v7.1.3 [INFO] [stderr] Compiling quote v1.0.33 [INFO] [stderr] Compiling syn v2.0.38 [INFO] [stderr] Compiling regex-automata v0.4.3 [INFO] [stderr] Compiling cexpr v0.6.0 [INFO] [stderr] Compiling regex v1.10.2 [INFO] [stderr] Compiling mountpoint-s3-crt-sys v0.3.0 (/opt/rustwide/workdir) [INFO] [stderr] Documenting mountpoint-s3-crt-sys v0.3.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unclosed HTML tag `void` [INFO] [stdout] --> /opt/rustwide/target/debug/build/mountpoint-s3-crt-sys-f5c1badc4e97417b/out/bindings.rs:5:353503 [INFO] [stdout] | [INFO] [stdout] 5 | ...s_future_void { _unused : [u8 ; 0] , } extern "C" { # [doc = " aws_future"] pub fn aws_future_void_new (alloc : * mut aws_alloca... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(rustdoc::invalid_html_tags)]` on by default [INFO] [stdout] help: try marking as source code [INFO] [stdout] | [INFO] [stdout] 5 | # [repr (C)] # [derive (Copy , Clone , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd)] pub struct __BindgenBitfieldUnit < Storage > { storage : Storage , } impl < Storage > __BindgenBitfieldUnit < Storage > { # [inline] pub const fn new (storage : Storage) -> Self { Self { storage } } } impl < Storage > __BindgenBitfieldUnit < Storage > where Storage : AsRef < [u8] > + AsMut < [u8] >, { # [inline] pub fn get_bit (& self , index : usize) -> bool { debug_assert ! (index / 8 < self . storage . as_ref () . len ()) ; let byte_index = index / 8 ; let byte = self . storage . as_ref () [byte_index] ; let bit_index = if cfg ! (target_endian = "big") { 7 - (index % 8) } else { index % 8 } ; let mask = 1 << bit_index ; byte & mask == mask } # [inline] pub fn set_bit (& mut self , index : usize , val : bool) { debug_assert ! (index / 8 < self . storage . as_ref () . len ()) ; let byte_index = index / 8 ; let byte = & mut self . storage . as_mut () [byte_index] ; let bit_index = if cfg ! (target_endian = "big") { 7 - (index % 8) } else { index % 8 } ; let mask = 1 << bit_index ; if val { * byte |= mask ; } else { * byte &= ! mask ; } } # [inline] pub fn get (& self , bit_offset : usize , bit_width : u8) -> u64 { debug_assert ! (bit_width <= 64) ; debug_assert ! (bit_offset / 8 < self . storage . as_ref () . len ()) ; debug_assert ! ((bit_offset + (bit_width as usize)) / 8 <= self . storage . as_ref () . len ()) ; let mut val = 0 ; for i in 0 .. (bit_width as usize) { if self . get_bit (i + bit_offset) { let index = if cfg ! (target_endian = "big") { bit_width as usize - 1 - i } else { i } ; val |= 1 << index ; } } val } # [inline] pub fn set (& mut self , bit_offset : usize , bit_width : u8 , val : u64) { debug_assert ! (bit_width <= 64) ; debug_assert ! (bit_offset / 8 < self . storage . as_ref () . len ()) ; debug_assert ! ((bit_offset + (bit_width as usize)) / 8 <= self . storage . as_ref () . len ()) ; for i in 0 .. (bit_width as usize) { let mask = 1 << i ; let val_bit_is_set = val & mask == mask ; let index = if cfg ! (target_endian = "big") { bit_width as usize - 1 - i } else { i } ; self . set_bit (index + bit_offset , val_bit_is_set) ; } } } pub const PRInSTR : & [u8 ; 5] = b"%.*s\0" ; pub const AWS_PACKAGE_SLOTS : i32 = 16 ; pub const AWS_C_COMMON_PACKAGE_ID : i32 = 0 ; pub const AWS_OP_SUCCESS : i32 = 0 ; pub const AWS_OP_ERR : i32 = - 1 ; pub const AWS_ERROR_ENUM_STRIDE_BITS : i32 = 10 ; pub const AWS_ERROR_ENUM_STRIDE : i32 = 1024 ; pub const SIZE_BITS : i32 = 64 ; pub const AWS_C_IO_PACKAGE_ID : i32 = 1 ; pub const AWS_THREAD_NAME_RECOMMENDED_STRLEN : i32 = 15 ; pub const AWS_THREAD_ONCE_STATIC_INIT : i32 = 0 ; pub const AWS_LOG_LEVEL_NONE : i32 = 0 ; pub const AWS_LOG_LEVEL_FATAL : i32 = 1 ; pub const AWS_LOG_LEVEL_ERROR : i32 = 2 ; pub const AWS_LOG_LEVEL_WARN : i32 = 3 ; pub const AWS_LOG_LEVEL_INFO : i32 = 4 ; pub const AWS_LOG_LEVEL_DEBUG : i32 = 5 ; pub const AWS_LOG_LEVEL_TRACE : i32 = 6 ; pub const AWS_C_SDKUTILS_PACKAGE_ID : i32 = 15 ; pub const AWS_C_AUTH_PACKAGE_ID : i32 = 6 ; pub const AWS_C_HTTP_PACKAGE_ID : i32 = 2 ; pub const AWS_HTTP2_DEFAULT_MAX_CLOSED_STREAMS : i32 = 32 ; pub const AWS_HTTP2_PING_DATA_SIZE : i32 = 8 ; pub const AWS_HTTP2_SETTINGS_COUNT : i32 = 6 ; pub const AWS_C_S3_PACKAGE_ID : i32 = 14 ; pub const AWS_S3_CLIENT_VERSION : & [u8 ; 6] = b"0.1.x\0" ; pub const AWS_CACHE_LINE : _bindgen_ty_18 = _bindgen_ty_18 :: AWS_CACHE_LINE ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_18 { AWS_CACHE_LINE = 64 , } pub type va_list = __builtin_va_list ; pub type __gnuc_va_list = __builtin_va_list ; extern "C" { pub fn aws_fatal_assert (cond_str : * const :: libc :: c_char , file : * const :: libc :: c_char , line : :: libc :: c_int) -> ! ; } pub type pthread_once_t = :: libc :: c_int ; # [doc = " @deprecated Use int64_t instead for offsets in public APIs."] pub type aws_off_t = i64 ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_allocator { pub mem_acquire : :: std :: option :: Option < unsafe extern "C" fn (allocator : * mut aws_allocator , size : usize) -> * mut :: libc :: c_void > , pub mem_release : :: std :: option :: Option < unsafe extern "C" fn (allocator : * mut aws_allocator , ptr : * mut :: libc :: c_void) > , pub mem_realloc : :: std :: option :: Option < unsafe extern "C" fn (allocator : * mut aws_allocator , oldptr : * mut :: libc :: c_void , oldsize : usize , newsize : usize) -> * mut :: libc :: c_void > , pub mem_calloc : :: std :: option :: Option < unsafe extern "C" fn (allocator : * mut aws_allocator , num : usize , size : usize) -> * mut :: libc :: c_void > , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_allocator () { const UNINIT : :: std :: mem :: MaybeUninit < aws_allocator > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_allocator > () , 40usize , concat ! ("Size of: " , stringify ! (aws_allocator))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_allocator > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . mem_acquire) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_allocator) , "::" , stringify ! (mem_acquire))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . mem_release) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_allocator) , "::" , stringify ! (mem_release))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . mem_realloc) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_allocator) , "::" , stringify ! (mem_realloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . mem_calloc) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_allocator) , "::" , stringify ! (mem_calloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_allocator) , "::" , stringify ! (impl_))) ; } impl Default for aws_allocator { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Inexpensive (constant time) check of data-structure invariants."] pub fn aws_allocator_is_valid (alloc : * const aws_allocator) -> bool ; } extern "C" { pub fn aws_default_allocator () -> * mut aws_allocator ; } extern "C" { # [doc = " Returns at least `size` of memory ready for usage. In versions v0.6.8 and prior, this function was allowed to return\n NULL. In later versions, if allocator->mem_acquire() returns NULL, this function will assert and exit. To handle\n conditions where OOM is not a fatal error, allocator->mem_acquire() is responsible for finding/reclaiming/running a\n GC etc...before returning."] pub fn aws_mem_acquire (allocator : * mut aws_allocator , size : usize) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Allocates a block of memory for an array of num elements, each of them size bytes long, and initializes all its bits\n to zero. In versions v0.6.8 and prior, this function was allowed to return NULL.\n In later versions, if allocator->mem_calloc() returns NULL, this function will assert and exit. To handle\n conditions where OOM is not a fatal error, allocator->mem_calloc() is responsible for finding/reclaiming/running a\n GC etc...before returning."] pub fn aws_mem_calloc (allocator : * mut aws_allocator , num : usize , size : usize) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Allocates many chunks of bytes into a single block. Expects to be called with alternating void ** (dest), size_t\n (size). The first void ** will be set to the root of the allocation. Alignment is assumed to be sizeof(intmax_t).\n\n This is useful for allocating structs using the pimpl pattern, as you may allocate the public object and impl object\n in the same contiguous block of memory.\n\n Returns a pointer to the allocation.\n\n In versions v0.6.8 and prior, this function was allowed to return\n NULL. In later versions, if allocator->mem_acquire() returns NULL, this function will assert and exit. To handle\n conditions where OOM is not a fatal error, allocator->mem_acquire() is responsible for finding/reclaiming/running a\n GC etc...before returning."] pub fn aws_mem_acquire_many (allocator : * mut aws_allocator , count : usize , ...) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Releases ptr back to whatever allocated it.\n Nothing happens if ptr is NULL."] pub fn aws_mem_release (allocator : * mut aws_allocator , ptr : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Attempts to adjust the size of the pointed-to memory buffer from oldsize to\n newsize. The pointer (*ptr) may be changed if the memory needs to be\n reallocated.\n\n In versions v0.6.8 and prior, this function was allowed to return\n NULL. In later versions, if allocator->mem_realloc() returns NULL, this function will assert and exit. To handle\n conditions where OOM is not a fatal error, allocator->mem_realloc() is responsible for finding/reclaiming/running a\n GC etc...before returning."] pub fn aws_mem_realloc (allocator : * mut aws_allocator , ptr : * mut * mut :: libc :: c_void , oldsize : usize , newsize : usize) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_mem_trace_level { AWS_MEMTRACE_NONE = 0 , AWS_MEMTRACE_BYTES = 1 , AWS_MEMTRACE_STACKS = 2 , } extern "C" { pub fn aws_mem_tracer_new (allocator : * mut aws_allocator , deprecated : * mut aws_allocator , level : aws_mem_trace_level , frames_per_stack : usize) -> * mut aws_allocator ; } extern "C" { pub fn aws_mem_tracer_destroy (trace_allocator : * mut aws_allocator) -> * mut aws_allocator ; } extern "C" { pub fn aws_mem_tracer_dump (trace_allocator : * mut aws_allocator) ; } extern "C" { pub fn aws_mem_tracer_bytes (trace_allocator : * mut aws_allocator) -> usize ; } extern "C" { pub fn aws_mem_tracer_count (trace_allocator : * mut aws_allocator) -> usize ; } extern "C" { pub fn aws_small_block_allocator_new (allocator : * mut aws_allocator , multi_threaded : bool) -> * mut aws_allocator ; } extern "C" { pub fn aws_small_block_allocator_destroy (sba_allocator : * mut aws_allocator) ; } extern "C" { pub fn aws_small_block_allocator_bytes_active (sba_allocator : * mut aws_allocator) -> usize ; } extern "C" { pub fn aws_small_block_allocator_bytes_reserved (sba_allocator : * mut aws_allocator) -> usize ; } extern "C" { pub fn aws_small_block_allocator_page_size (sba_allocator : * mut aws_allocator) -> usize ; } extern "C" { pub fn aws_small_block_allocator_page_size_available (sba_allocator : * mut aws_allocator) -> usize ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_error_info { pub error_code : :: libc :: c_int , pub literal_name : * const :: libc :: c_char , pub error_str : * const :: libc :: c_char , pub lib_name : * const :: libc :: c_char , pub formatted_name : * const :: libc :: c_char , } # [test] fn bindgen_test_layout_aws_error_info () { const UNINIT : :: std :: mem :: MaybeUninit < aws_error_info > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_error_info > () , 40usize , concat ! ("Size of: " , stringify ! (aws_error_info))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_error_info > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_error_info))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_code) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_error_info) , "::" , stringify ! (error_code))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . literal_name) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_error_info) , "::" , stringify ! (literal_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_str) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_error_info) , "::" , stringify ! (error_str))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . lib_name) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_error_info) , "::" , stringify ! (lib_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . formatted_name) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_error_info) , "::" , stringify ! (formatted_name))) ; } impl Default for aws_error_info { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_error_info_list { pub error_list : * const aws_error_info , pub count : u16 , } # [test] fn bindgen_test_layout_aws_error_info_list () { const UNINIT : :: std :: mem :: MaybeUninit < aws_error_info_list > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_error_info_list > () , 16usize , concat ! ("Size of: " , stringify ! (aws_error_info_list))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_error_info_list > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_error_info_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_list) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_error_info_list) , "::" , stringify ! (error_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . count) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_error_info_list) , "::" , stringify ! (count))) ; } impl Default for aws_error_info_list { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_error_handler_fn = :: std :: option :: Option < unsafe extern "C" fn (err : :: libc :: c_int , ctx : * mut :: libc :: c_void) > ; extern "C" { pub fn aws_last_error () -> :: libc :: c_int ; } extern "C" { pub fn aws_error_str (err : :: libc :: c_int) -> * const :: libc :: c_char ; } extern "C" { pub fn aws_error_name (err : :: libc :: c_int) -> * const :: libc :: c_char ; } extern "C" { pub fn aws_error_lib_name (err : :: libc :: c_int) -> * const :: libc :: c_char ; } extern "C" { pub fn aws_error_debug_str (err : :: libc :: c_int) -> * const :: libc :: c_char ; } extern "C" { pub fn aws_raise_error_private (err : :: libc :: c_int) ; } extern "C" { pub fn aws_raise_error (err : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { pub fn aws_reset_error () ; } extern "C" { pub fn aws_restore_error (err : :: libc :: c_int) ; } extern "C" { pub fn aws_set_global_error_handler_fn (handler : aws_error_handler_fn , ctx : * mut :: libc :: c_void) -> aws_error_handler_fn ; } extern "C" { pub fn aws_set_thread_local_error_handler_fn (handler : aws_error_handler_fn , ctx : * mut :: libc :: c_void) -> aws_error_handler_fn ; } extern "C" { # [doc = " TODO: this needs to be a private function (wait till we have the cmake story\n better before moving it though). It should be external for the purpose of\n other libs we own, but customers should not be able to hit it without going\n out of their way to do so."] pub fn aws_register_error_info (error_info : * const aws_error_info_list) ; } extern "C" { pub fn aws_unregister_error_info (error_info : * const aws_error_info_list) ; } extern "C" { # [doc = " Convert a c library io error into an aws error, and raise it.\n If no conversion is found, AWS_ERROR_SYS_CALL_FAILURE is raised.\n Always returns AWS_OP_ERR."] pub fn aws_translate_and_raise_io_error (error_no : :: libc :: c_int) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_common_error { AWS_ERROR_SUCCESS = 0 , AWS_ERROR_OOM = 1 , AWS_ERROR_NO_SPACE = 2 , AWS_ERROR_UNKNOWN = 3 , AWS_ERROR_SHORT_BUFFER = 4 , AWS_ERROR_OVERFLOW_DETECTED = 5 , AWS_ERROR_UNSUPPORTED_OPERATION = 6 , AWS_ERROR_INVALID_BUFFER_SIZE = 7 , AWS_ERROR_INVALID_HEX_STR = 8 , AWS_ERROR_INVALID_BASE64_STR = 9 , AWS_ERROR_INVALID_INDEX = 10 , AWS_ERROR_THREAD_INVALID_SETTINGS = 11 , AWS_ERROR_THREAD_INSUFFICIENT_RESOURCE = 12 , AWS_ERROR_THREAD_NO_PERMISSIONS = 13 , AWS_ERROR_THREAD_NOT_JOINABLE = 14 , AWS_ERROR_THREAD_NO_SUCH_THREAD_ID = 15 , AWS_ERROR_THREAD_DEADLOCK_DETECTED = 16 , AWS_ERROR_MUTEX_NOT_INIT = 17 , AWS_ERROR_MUTEX_TIMEOUT = 18 , AWS_ERROR_MUTEX_CALLER_NOT_OWNER = 19 , AWS_ERROR_MUTEX_FAILED = 20 , AWS_ERROR_COND_VARIABLE_INIT_FAILED = 21 , AWS_ERROR_COND_VARIABLE_TIMED_OUT = 22 , AWS_ERROR_COND_VARIABLE_ERROR_UNKNOWN = 23 , AWS_ERROR_CLOCK_FAILURE = 24 , AWS_ERROR_LIST_EMPTY = 25 , AWS_ERROR_DEST_COPY_TOO_SMALL = 26 , AWS_ERROR_LIST_EXCEEDS_MAX_SIZE = 27 , AWS_ERROR_LIST_STATIC_MODE_CANT_SHRINK = 28 , AWS_ERROR_PRIORITY_QUEUE_FULL = 29 , AWS_ERROR_PRIORITY_QUEUE_EMPTY = 30 , AWS_ERROR_PRIORITY_QUEUE_BAD_NODE = 31 , AWS_ERROR_HASHTBL_ITEM_NOT_FOUND = 32 , AWS_ERROR_INVALID_DATE_STR = 33 , AWS_ERROR_INVALID_ARGUMENT = 34 , AWS_ERROR_RANDOM_GEN_FAILED = 35 , AWS_ERROR_MALFORMED_INPUT_STRING = 36 , AWS_ERROR_UNIMPLEMENTED = 37 , AWS_ERROR_INVALID_STATE = 38 , AWS_ERROR_ENVIRONMENT_GET = 39 , AWS_ERROR_ENVIRONMENT_SET = 40 , AWS_ERROR_ENVIRONMENT_UNSET = 41 , AWS_ERROR_STREAM_UNSEEKABLE = 42 , AWS_ERROR_NO_PERMISSION = 43 , AWS_ERROR_FILE_INVALID_PATH = 44 , AWS_ERROR_MAX_FDS_EXCEEDED = 45 , AWS_ERROR_SYS_CALL_FAILURE = 46 , AWS_ERROR_C_STRING_BUFFER_NOT_NULL_TERMINATED = 47 , AWS_ERROR_STRING_MATCH_NOT_FOUND = 48 , AWS_ERROR_DIVIDE_BY_ZERO = 49 , AWS_ERROR_INVALID_FILE_HANDLE = 50 , AWS_ERROR_OPERATION_INTERUPTED = 51 , AWS_ERROR_DIRECTORY_NOT_EMPTY = 52 , AWS_ERROR_PLATFORM_NOT_SUPPORTED = 53 , AWS_ERROR_INVALID_UTF8 = 54 , AWS_ERROR_GET_HOME_DIRECTORY_FAILED = 55 , AWS_ERROR_INVALID_XML = 56 , AWS_ERROR_END_COMMON_RANGE = 1023 , } extern "C" { # [doc = " Returns whether each byte is zero."] pub fn aws_is_mem_zeroed (buf : * const :: libc :: c_void , bufsize : usize) -> bool ; } extern "C" { # [doc = " Securely zeroes a memory buffer. This function will attempt to ensure that\n the compiler will not optimize away this zeroing operation."] pub fn aws_secure_zero (pBuf : * mut :: libc :: c_void , bufsize : usize) ; } extern "C" { # [doc = " Initializes internal data structures used by aws-c-common.\n Must be called before using any functionality in aws-c-common."] pub fn aws_common_library_init (allocator : * mut aws_allocator) ; } extern "C" { # [doc = " Shuts down the internal data structures used by aws-c-common."] pub fn aws_common_library_clean_up () ; } extern "C" { pub fn aws_common_fatal_assert_library_initialized () ; } extern "C" { # [doc = " Multiplies a * b. If the result overflows, returns 2^64 - 1."] pub fn aws_mul_u64_saturating (a : u64 , b : u64) -> u64 ; } extern "C" { # [doc = " If a * b overflows, returns AWS_OP_ERR; otherwise multiplies\n a * b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_mul_u64_checked (a : u64 , b : u64 , r : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Multiplies a * b. If the result overflows, returns 2^32 - 1."] pub fn aws_mul_u32_saturating (a : u32 , b : u32) -> u32 ; } extern "C" { # [doc = " If a * b overflows, returns AWS_OP_ERR; otherwise multiplies\n a * b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_mul_u32_checked (a : u32 , b : u32 , r : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Adds a + b. If the result overflows returns 2^64 - 1."] pub fn aws_add_u64_saturating (a : u64 , b : u64) -> u64 ; } extern "C" { # [doc = " If a + b overflows, returns AWS_OP_ERR; otherwise adds\n a + b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_add_u64_checked (a : u64 , b : u64 , r : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Adds a + b. If the result overflows returns 2^32 - 1."] pub fn aws_add_u32_saturating (a : u32 , b : u32) -> u32 ; } extern "C" { # [doc = " If a + b overflows, returns AWS_OP_ERR; otherwise adds\n a + b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_add_u32_checked (a : u32 , b : u32 , r : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Subtracts a - b. If the result overflows returns 0."] pub fn aws_sub_u64_saturating (a : u64 , b : u64) -> u64 ; } extern "C" { # [doc = " If a - b overflows, returns AWS_OP_ERR; otherwise subtracts\n a - b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_sub_u64_checked (a : u64 , b : u64 , r : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Subtracts a - b. If the result overflows returns 0."] pub fn aws_sub_u32_saturating (a : u32 , b : u32) -> u32 ; } extern "C" { # [doc = " If a - b overflows, returns AWS_OP_ERR; otherwise subtracts\n a - b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_sub_u32_checked (a : u32 , b : u32 , r : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Multiplies a * b. If the result overflows, returns SIZE_MAX."] pub fn aws_mul_size_saturating (a : usize , b : usize) -> usize ; } extern "C" { # [doc = " Multiplies a * b and returns the result in *r. If the result\n overflows, returns AWS_OP_ERR; otherwise returns AWS_OP_SUCCESS."] pub fn aws_mul_size_checked (a : usize , b : usize , r : * mut usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Adds a + b. If the result overflows returns SIZE_MAX."] pub fn aws_add_size_saturating (a : usize , b : usize) -> usize ; } extern "C" { # [doc = " Adds a + b and returns the result in *r. If the result\n overflows, returns AWS_OP_ERR; otherwise returns AWS_OP_SUCCESS."] pub fn aws_add_size_checked (a : usize , b : usize , r : * mut usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Adds [num] arguments (expected to be of size_t), and returns the result in *r.\n If the result overflows, returns AWS_OP_ERR; otherwise returns AWS_OP_SUCCESS."] pub fn aws_add_size_checked_varargs (num : usize , r : * mut usize , ...) -> :: libc :: c_int ; } extern "C" { # [doc = " Subtracts a - b. If the result overflows returns 0."] pub fn aws_sub_size_saturating (a : usize , b : usize) -> usize ; } extern "C" { # [doc = " If a - b overflows, returns AWS_OP_ERR; otherwise subtracts\n a - b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_sub_size_checked (a : usize , b : usize , r : * mut usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Function to check if x is power of 2"] pub fn aws_is_power_of_two (x : usize) -> bool ; } extern "C" { # [doc = " Function to find the smallest result that is power of 2 >= n. Returns AWS_OP_ERR if this cannot\n be done without overflow"] pub fn aws_round_up_to_power_of_two (n : usize , result : * mut usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Counts the number of leading 0 bits in an integer. 0 will return the size of the integer in bits."] pub fn aws_clz_u32 (n : u32) -> usize ; } extern "C" { pub fn aws_clz_i32 (n : i32) -> usize ; } extern "C" { pub fn aws_clz_u64 (n : u64) -> usize ; } extern "C" { pub fn aws_clz_i64 (n : i64) -> usize ; } extern "C" { pub fn aws_clz_size (n : usize) -> usize ; } extern "C" { # [doc = " Counts the number of trailing 0 bits in an integer. 0 will return the size of the integer in bits."] pub fn aws_ctz_u32 (n : u32) -> usize ; } extern "C" { pub fn aws_ctz_i32 (n : i32) -> usize ; } extern "C" { pub fn aws_ctz_u64 (n : u64) -> usize ; } extern "C" { pub fn aws_ctz_i64 (n : i64) -> usize ; } extern "C" { pub fn aws_ctz_size (n : usize) -> usize ; } extern "C" { pub fn aws_min_u8 (a : u8 , b : u8) -> u8 ; } extern "C" { pub fn aws_max_u8 (a : u8 , b : u8) -> u8 ; } extern "C" { pub fn aws_min_i8 (a : i8 , b : i8) -> i8 ; } extern "C" { pub fn aws_max_i8 (a : i8 , b : i8) -> i8 ; } extern "C" { pub fn aws_min_u16 (a : u16 , b : u16) -> u16 ; } extern "C" { pub fn aws_max_u16 (a : u16 , b : u16) -> u16 ; } extern "C" { pub fn aws_min_i16 (a : i16 , b : i16) -> i16 ; } extern "C" { pub fn aws_max_i16 (a : i16 , b : i16) -> i16 ; } extern "C" { pub fn aws_min_u32 (a : u32 , b : u32) -> u32 ; } extern "C" { pub fn aws_max_u32 (a : u32 , b : u32) -> u32 ; } extern "C" { pub fn aws_min_i32 (a : i32 , b : i32) -> i32 ; } extern "C" { pub fn aws_max_i32 (a : i32 , b : i32) -> i32 ; } extern "C" { pub fn aws_min_u64 (a : u64 , b : u64) -> u64 ; } extern "C" { pub fn aws_max_u64 (a : u64 , b : u64) -> u64 ; } extern "C" { pub fn aws_min_i64 (a : i64 , b : i64) -> i64 ; } extern "C" { pub fn aws_max_i64 (a : i64 , b : i64) -> i64 ; } extern "C" { pub fn aws_min_size (a : usize , b : usize) -> usize ; } extern "C" { pub fn aws_max_size (a : usize , b : usize) -> usize ; } extern "C" { pub fn aws_min_int (a : :: libc :: c_int , b : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { pub fn aws_max_int (a : :: libc :: c_int , b : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { pub fn aws_min_float (a : f32 , b : f32) -> f32 ; } extern "C" { pub fn aws_max_float (a : f32 , b : f32) -> f32 ; } extern "C" { pub fn aws_min_double (a : f64 , b : f64) -> f64 ; } extern "C" { pub fn aws_max_double (a : f64 , b : f64) -> f64 ; } pub const AWS_ARRAY_LIST_DEBUG_FILL : _bindgen_ty_19 = _bindgen_ty_19 :: AWS_ARRAY_LIST_DEBUG_FILL ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_19 { AWS_ARRAY_LIST_DEBUG_FILL = 221 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_array_list { pub alloc : * mut aws_allocator , pub current_size : usize , pub length : usize , pub item_size : usize , pub data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_array_list () { const UNINIT : :: std :: mem :: MaybeUninit < aws_array_list > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_array_list > () , 40usize , concat ! ("Size of: " , stringify ! (aws_array_list))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_array_list > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_array_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_array_list) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . current_size) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_array_list) , "::" , stringify ! (current_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . length) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_array_list) , "::" , stringify ! (length))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . item_size) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_array_list) , "::" , stringify ! (item_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . data) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_array_list) , "::" , stringify ! (data))) ; } impl Default for aws_array_list { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Prototype for a comparator function for sorting elements.\n\n a and b should be cast to pointers to the element type held in the list\n before being dereferenced. The function should compare the elements and\n return a positive number if a > b, zero if a = b, and a negative number\n if a < b."] pub type aws_array_list_comparator_fn = :: std :: option :: Option < unsafe extern "C" fn (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> :: libc :: c_int > ; extern "C" { # [doc = " Initializes an array list with an array of size initial_item_allocation * item_size. In this mode, the array size\n will grow by a factor of 2 upon insertion if space is not available. initial_item_allocation is the number of\n elements you want space allocated for. item_size is the size of each element in bytes. Mixing items types is not\n supported by this API."] pub fn aws_array_list_init_dynamic (list : * mut aws_array_list , alloc : * mut aws_allocator , initial_item_allocation : usize , item_size : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Initializes an array list with a preallocated array of void *. item_count is the number of elements in the array,\n and item_size is the size in bytes of each element. Mixing items types is not supported\n by this API. Once this list is full, new items will be rejected."] pub fn aws_array_list_init_static (list : * mut aws_array_list , raw_array : * mut :: libc :: c_void , item_count : usize , item_size : usize) ; } extern "C" { # [doc = " Initializes an array list with a preallocated array of *already-initialized* elements. item_count is the number of\n elements in the array, and item_size is the size in bytes of each element.\n\n Once initialized, nothing further can be added to the list, since it will be full and cannot resize.\n\n Primary use case is to treat an already-initialized C array as an array list."] pub fn aws_array_list_init_static_from_initialized (list : * mut aws_array_list , raw_array : * mut :: libc :: c_void , item_count : usize , item_size : usize) ; } extern "C" { # [doc = " Set of properties of a valid aws_array_list."] pub fn aws_array_list_is_valid (list : * const aws_array_list) -> bool ; } extern "C" { # [doc = " Deallocates any memory that was allocated for this list, and resets list for reuse or deletion."] pub fn aws_array_list_clean_up (list : * mut aws_array_list) ; } extern "C" { # [doc = " Erases and then deallocates any memory that was allocated for this list, and resets list for reuse or deletion."] pub fn aws_array_list_clean_up_secure (list : * mut aws_array_list) ; } extern "C" { # [doc = " Pushes the memory pointed to by val onto the end of internal list"] pub fn aws_array_list_push_back (list : * mut aws_array_list , val : * const :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the element at the front of the list if it exists. If list is empty, AWS_ERROR_LIST_EMPTY will be raised"] pub fn aws_array_list_front (list : * const aws_array_list , val : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Pushes the memory pointed to by val onto the front of internal list.\n This call results in shifting all of the elements in the list. Avoid this call unless that\n is intended behavior."] pub fn aws_array_list_push_front (list : * mut aws_array_list , val : * const :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Deletes the element at the front of the list if it exists. If list is empty, AWS_ERROR_LIST_EMPTY will be raised.\n This call results in shifting all of the elements at the end of the array to the front. Avoid this call unless that\n is intended behavior."] pub fn aws_array_list_pop_front (list : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Delete N elements from the front of the list.\n Remaining elements are shifted to the front of the list.\n If the list has less than N elements, the list is cleared.\n This call is more efficient than calling aws_array_list_pop_front() N times."] pub fn aws_array_list_pop_front_n (list : * mut aws_array_list , n : usize) ; } extern "C" { # [doc = " Deletes the element this index in the list if it exists.\n If element does not exist, AWS_ERROR_INVALID_INDEX will be raised.\n This call results in shifting all remaining elements towards the front.\n Avoid this call unless that is intended behavior."] pub fn aws_array_list_erase (list : * mut aws_array_list , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the element at the end of the list if it exists. If list is empty, AWS_ERROR_LIST_EMPTY will be raised."] pub fn aws_array_list_back (list : * const aws_array_list , val : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Deletes the element at the end of the list if it exists. If list is empty, AWS_ERROR_LIST_EMPTY will be raised."] pub fn aws_array_list_pop_back (list : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Clears all elements in the array and resets length to zero. Size does not change in this operation."] pub fn aws_array_list_clear (list : * mut aws_array_list) ; } extern "C" { # [doc = " If in dynamic mode, shrinks the allocated array size to the minimum amount necessary to store its elements."] pub fn aws_array_list_shrink_to_fit (list : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the elements from from to to. If to is in static mode, it must at least be the same length as from. Any data\n in to will be overwritten in this copy."] pub fn aws_array_list_copy (from : * const aws_array_list , to : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Swap contents between two dynamic lists. Both lists must use the same allocator."] pub fn aws_array_list_swap_contents (list_a : * mut aws_array_list , list_b : * mut aws_array_list) ; } extern "C" { # [doc = " Returns the number of elements that can fit in the internal array. If list is initialized in dynamic mode,\n the capacity changes over time."] pub fn aws_array_list_capacity (list : * const aws_array_list) -> usize ; } extern "C" { # [doc = " Returns the number of elements in the internal array."] pub fn aws_array_list_length (list : * const aws_array_list) -> usize ; } extern "C" { # [doc = " Copies the memory at index to val. If element does not exist, AWS_ERROR_INVALID_INDEX will be raised."] pub fn aws_array_list_get_at (list : * const aws_array_list , val : * mut :: libc :: c_void , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the memory address of the element at index to *val. If element does not exist, AWS_ERROR_INVALID_INDEX will be\n raised."] pub fn aws_array_list_get_at_ptr (list : * const aws_array_list , val : * mut * mut :: libc :: c_void , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Ensures that the array list has enough capacity to store a value at the specified index. If there is not already\n enough capacity, and the list is in dynamic mode, this function will attempt to allocate more memory, expanding the\n list. In static mode, if 'index' is beyond the maximum index, AWS_ERROR_INVALID_INDEX will be raised."] pub fn aws_array_list_ensure_capacity (list : * mut aws_array_list , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the the memory pointed to by val into the array at index. If in dynamic mode, the size will grow by a factor\n of two when the array is full. In static mode, AWS_ERROR_INVALID_INDEX will be raised if the index is past the bounds\n of the array."] pub fn aws_array_list_set_at (list : * mut aws_array_list , val : * const :: libc :: c_void , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Swap elements at the specified indices, which must be within the bounds of the array."] pub fn aws_array_list_swap (list : * mut aws_array_list , a : usize , b : usize) ; } extern "C" { # [doc = " Sort elements in the list in-place according to the comparator function."] pub fn aws_array_list_sort (list : * mut aws_array_list , compare_fn : aws_array_list_comparator_fn) ; } extern "C" { # [doc = " Returns 1 if machine is big endian, 0 if little endian.\n If you compile with even -O1 optimization, this check is completely optimized\n out at compile time and code which calls \"if (aws_is_big_endian())\" will do\n the right thing without branching."] pub fn aws_is_big_endian () -> :: libc :: c_int ; } extern "C" { # [doc = " Convert 64 bit integer from host to network byte order."] pub fn aws_hton64 (x : u64) -> u64 ; } extern "C" { # [doc = " Convert 64 bit integer from network to host byte order."] pub fn aws_ntoh64 (x : u64) -> u64 ; } extern "C" { # [doc = " Convert 32 bit integer from host to network byte order."] pub fn aws_hton32 (x : u32) -> u32 ; } extern "C" { # [doc = " Convert 32 bit float from host to network byte order."] pub fn aws_htonf32 (x : f32) -> f32 ; } extern "C" { # [doc = " Convert 64 bit double from host to network byte order."] pub fn aws_htonf64 (x : f64) -> f64 ; } extern "C" { # [doc = " Convert 32 bit integer from network to host byte order."] pub fn aws_ntoh32 (x : u32) -> u32 ; } extern "C" { # [doc = " Convert 32 bit float from network to host byte order."] pub fn aws_ntohf32 (x : f32) -> f32 ; } extern "C" { # [doc = " Convert 32 bit float from network to host byte order."] pub fn aws_ntohf64 (x : f64) -> f64 ; } extern "C" { # [doc = " Convert 16 bit integer from host to network byte order."] pub fn aws_hton16 (x : u16) -> u16 ; } extern "C" { # [doc = " Convert 16 bit integer from network to host byte order."] pub fn aws_ntoh16 (x : u16) -> u16 ; } # [doc = " Represents a length-delimited binary string or buffer. If byte buffer points\n to constant memory or memory that should otherwise not be freed by this\n struct, set allocator to NULL and free function will be a no-op.\n\n This structure used to define the output for all functions that write to a buffer.\n\n Note that this structure allocates memory at the buffer pointer only. The\n struct itself does not get dynamically allocated and must be either\n maintained or copied to avoid losing access to the memory."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_byte_buf { pub len : usize , pub buffer : * mut u8 , pub capacity : usize , pub allocator : * mut aws_allocator , } # [test] fn bindgen_test_layout_aws_byte_buf () { const UNINIT : :: std :: mem :: MaybeUninit < aws_byte_buf > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_byte_buf > () , 32usize , concat ! ("Size of: " , stringify ! (aws_byte_buf))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_byte_buf > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_byte_buf))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . len) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_byte_buf) , "::" , stringify ! (len))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . buffer) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_byte_buf) , "::" , stringify ! (buffer))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . capacity) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_byte_buf) , "::" , stringify ! (capacity))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_byte_buf) , "::" , stringify ! (allocator))) ; } impl Default for aws_byte_buf { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Represents a movable pointer within a larger binary string or buffer.\n\n This structure is used to define buffers for reading."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_byte_cursor { pub len : usize , pub ptr : * mut u8 , } # [test] fn bindgen_test_layout_aws_byte_cursor () { const UNINIT : :: std :: mem :: MaybeUninit < aws_byte_cursor > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_byte_cursor > () , 16usize , concat ! ("Size of: " , stringify ! (aws_byte_cursor))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_byte_cursor > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_byte_cursor))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . len) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_byte_cursor) , "::" , stringify ! (len))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ptr) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_byte_cursor) , "::" , stringify ! (ptr))) ; } impl Default for aws_byte_cursor { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Signature for function argument to trim APIs"] pub type aws_byte_predicate_fn = :: std :: option :: Option < unsafe extern "C" fn (value : u8) -> bool > ; extern "C" { # [doc = " Compare two arrays.\n Return whether their contents are equivalent.\n NULL may be passed as the array pointer if its length is declared to be 0."] pub fn aws_array_eq (array_a : * const :: libc :: c_void , len_a : usize , array_b : * const :: libc :: c_void , len_b : usize) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of two arrays.\n Return whether their contents are equivalent.\n NULL may be passed as the array pointer if its length is declared to be 0.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_array_eq_ignore_case (array_a : * const :: libc :: c_void , len_a : usize , array_b : * const :: libc :: c_void , len_b : usize) -> bool ; } extern "C" { # [doc = " Compare an array and a null-terminated string.\n Returns true if their contents are equivalent.\n The array should NOT contain a null-terminator, or the comparison will always return false.\n NULL may be passed as the array pointer if its length is declared to be 0."] pub fn aws_array_eq_c_str (array : * const :: libc :: c_void , array_len : usize , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of an array and a null-terminated string.\n Return whether their contents are equivalent.\n The array should NOT contain a null-terminator, or the comparison will always return false.\n NULL may be passed as the array pointer if its length is declared to be 0.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_array_eq_c_str_ignore_case (array : * const :: libc :: c_void , array_len : usize , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { pub fn aws_byte_buf_init (buf : * mut aws_byte_buf , allocator : * mut aws_allocator , capacity : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Initializes an aws_byte_buf structure base on another valid one.\n Requires: *src and *allocator are valid objects.\n Ensures: *dest is a valid aws_byte_buf with a new backing array dest->buffer\n which is a copy of the elements from src->buffer."] pub fn aws_byte_buf_init_copy (dest : * mut aws_byte_buf , allocator : * mut aws_allocator , src : * const aws_byte_buf) -> :: libc :: c_int ; } extern "C" { # [doc = " Reads 'filename' into 'out_buf'. If successful, 'out_buf' is allocated and filled with the data;\n It is your responsibility to call 'aws_byte_buf_clean_up()' on it. Otherwise, 'out_buf' remains\n unused. In the very unfortunate case where some API needs to treat out_buf as a c_string, a null terminator\n is appended, but is not included as part of the length field."] pub fn aws_byte_buf_init_from_file (out_buf : * mut aws_byte_buf , alloc : * mut aws_allocator , filename : * const :: libc :: c_char) -> :: libc :: c_int ; } extern "C" { # [doc = " Evaluates the set of properties that define the shape of all valid aws_byte_buf structures.\n It is also a cheap check, in the sense it run in constant time (i.e., no loops or recursion)."] pub fn aws_byte_buf_is_valid (buf : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Evaluates the set of properties that define the shape of all valid aws_byte_cursor structures.\n It is also a cheap check, in the sense it runs in constant time (i.e., no loops or recursion)."] pub fn aws_byte_cursor_is_valid (cursor : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Copies src buffer into dest and sets the correct len and capacity.\n A new memory zone is allocated for dest->buffer. When dest is no longer needed it will have to be cleaned-up using\n aws_byte_buf_clean_up(dest).\n Dest capacity and len will be equal to the src len. Allocator of the dest will be identical with parameter allocator.\n If src buffer is null the dest will have a null buffer with a len and a capacity of 0\n Returns AWS_OP_SUCCESS in case of success or AWS_OP_ERR when memory can't be allocated."] pub fn aws_byte_buf_init_copy_from_cursor (dest : * mut aws_byte_buf , allocator : * mut aws_allocator , src : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Init buffer with contents of multiple cursors, and update cursors to reference the memory stored in the buffer.\n Each cursor arg must be an `struct aws_byte_cursor *`. NULL must be passed as the final arg.\n NOTE: Do not append/grow/resize buffers initialized this way, or the cursors will end up referencing invalid memory.\n Returns AWS_OP_SUCCESS in case of success.\n AWS_OP_ERR is returned if memory can't be allocated or the total cursor length exceeds SIZE_MAX."] pub fn aws_byte_buf_init_cache_and_update_cursors (dest : * mut aws_byte_buf , allocator : * mut aws_allocator , ...) -> :: libc :: c_int ; } extern "C" { pub fn aws_byte_buf_clean_up (buf : * mut aws_byte_buf) ; } extern "C" { # [doc = " Equivalent to calling aws_byte_buf_secure_zero and then aws_byte_buf_clean_up\n on the buffer."] pub fn aws_byte_buf_clean_up_secure (buf : * mut aws_byte_buf) ; } extern "C" { # [doc = " Resets the len of the buffer to 0, but does not free the memory. The buffer can then be reused.\n Optionally zeroes the contents, if the \"zero_contents\" flag is true."] pub fn aws_byte_buf_reset (buf : * mut aws_byte_buf , zero_contents : bool) ; } extern "C" { # [doc = " Sets all bytes of buffer to zero and resets len to zero."] pub fn aws_byte_buf_secure_zero (buf : * mut aws_byte_buf) ; } extern "C" { # [doc = " Compare two aws_byte_buf structures.\n Return whether their contents are equivalent."] pub fn aws_byte_buf_eq (a : * const aws_byte_buf , b : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of two aws_byte_buf structures.\n Return whether their contents are equivalent.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_buf_eq_ignore_case (a : * const aws_byte_buf , b : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Compare an aws_byte_buf and a null-terminated string.\n Returns true if their contents are equivalent.\n The buffer should NOT contain a null-terminator, or the comparison will always return false."] pub fn aws_byte_buf_eq_c_str (buf : * const aws_byte_buf , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of an aws_byte_buf and a null-terminated string.\n Return whether their contents are equivalent.\n The buffer should NOT contain a null-terminator, or the comparison will always return false.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_buf_eq_c_str_ignore_case (buf : * const aws_byte_buf , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " No copies, no buffer allocations. Iterates over input_str, and returns the\n next substring between split_on instances relative to previous substr.\n Behaves similar to strtok with substr being used as state for next split.\n\n Returns true each time substr is set and false when there is no more splits\n (substr is set to empty in that case).\n\n Example usage.\n struct aws_byte_cursor substr = {0};\n while (aws_byte_cursor_next_split(&input_str, ';', &substr)) {\n // ...use substr...\n }\n\n Note: It is the user's responsibility zero-initialize substr before the first call.\n\n Edge case rules are as follows:\n empty input will have single empty split. ex. \"\" splits into \"\"\n if input starts with split_on then first split is empty. ex \";A\" splits into \"\", \"A\"\n adjacent split tokens result in empty split. ex \"A;;B\" splits into \"A\", \"\", \"B\"\n If the input ends with split_on, last split is empty. ex. \"A;\" splits into \"A\", \"\"\n\n It is the user's responsibility to make sure the input buffer stays in memory\n long enough to use the results."] pub fn aws_byte_cursor_next_split (input_str : * const aws_byte_cursor , split_on : :: libc :: c_char , substr : * mut aws_byte_cursor) -> bool ; } extern "C" { # [doc = " No copies, no buffer allocations. Fills in output with a list of\n aws_byte_cursor instances where buffer is an offset into the input_str and\n len is the length of that string in the original buffer.\n\n Edge case rules are as follows:\n if the input begins with split_on, an empty cursor will be the first entry in\n output. if the input has two adjacent split_on tokens, an empty cursor will\n be inserted into the output. if the input ends with split_on, an empty cursor\n will be appended to the output.\n\n It is the user's responsibility to properly initialize output. Recommended number of preallocated elements from\n output is your most likely guess for the upper bound of the number of elements resulting from the split.\n\n The type that will be stored in output is struct aws_byte_cursor (you'll need\n this for the item size param).\n\n It is the user's responsibility to make sure the input buffer stays in memory\n long enough to use the results."] pub fn aws_byte_cursor_split_on_char (input_str : * const aws_byte_cursor , split_on : :: libc :: c_char , output : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " No copies, no buffer allocations. Fills in output with a list of aws_byte_cursor instances where buffer is\n an offset into the input_str and len is the length of that string in the original buffer. N is the max number of\n splits, if this value is zero, it will add all splits to the output.\n\n Edge case rules are as follows:\n if the input begins with split_on, an empty cursor will be the first entry in output\n if the input has two adjacent split_on tokens, an empty cursor will be inserted into the output.\n if the input ends with split_on, an empty cursor will be appended to the output.\n\n It is the user's responsibility to properly initialize output. Recommended number of preallocated elements from\n output is your most likely guess for the upper bound of the number of elements resulting from the split.\n\n If the output array is not large enough, input_str will be updated to point to the first character after the last\n processed split_on instance.\n\n The type that will be stored in output is struct aws_byte_cursor (you'll need this for the item size param).\n\n It is the user's responsibility to make sure the input buffer stays in memory long enough to use the results."] pub fn aws_byte_cursor_split_on_char_n (input_str : * const aws_byte_cursor , split_on : :: libc :: c_char , n : usize , output : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Search for an exact byte match inside a cursor. The first match will be returned. Returns AWS_OP_SUCCESS\n on successful match and first_find will be set to the offset in input_str, and length will be the remaining length\n from input_str past the returned offset. If the match was not found, AWS_OP_ERR will be returned and\n AWS_ERROR_STRING_MATCH_NOT_FOUND will be raised."] pub fn aws_byte_cursor_find_exact (input_str : * const aws_byte_cursor , to_find : * const aws_byte_cursor , first_find : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Shrinks a byte cursor from the right for as long as the supplied predicate is true"] pub fn aws_byte_cursor_right_trim_pred (source : * const aws_byte_cursor , predicate : aws_byte_predicate_fn) -> aws_byte_cursor ; } extern "C" { # [doc = " Shrinks a byte cursor from the left for as long as the supplied predicate is true"] pub fn aws_byte_cursor_left_trim_pred (source : * const aws_byte_cursor , predicate : aws_byte_predicate_fn) -> aws_byte_cursor ; } extern "C" { # [doc = " Shrinks a byte cursor from both sides for as long as the supplied predicate is true"] pub fn aws_byte_cursor_trim_pred (source : * const aws_byte_cursor , predicate : aws_byte_predicate_fn) -> aws_byte_cursor ; } extern "C" { # [doc = " Returns true if the byte cursor's range of bytes all satisfy the predicate"] pub fn aws_byte_cursor_satisfies_pred (source : * const aws_byte_cursor , predicate : aws_byte_predicate_fn) -> bool ; } extern "C" { # [doc = " Copies from to to. If to is too small, AWS_ERROR_DEST_COPY_TOO_SMALL will be\n returned. dest->len will contain the amount of data actually copied to dest.\n\n from and to may be the same buffer, permitting copying a buffer into itself."] pub fn aws_byte_buf_append (to : * mut aws_byte_buf , from : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies from to to while converting bytes via the passed in lookup table.\n If to is too small, AWS_ERROR_DEST_COPY_TOO_SMALL will be\n returned. to->len will contain its original size plus the amount of data actually copied to to.\n\n from and to should not be the same buffer (overlap is not handled)\n lookup_table must be at least 256 bytes"] pub fn aws_byte_buf_append_with_lookup (to : * mut aws_byte_buf , from : * const aws_byte_cursor , lookup_table : * const u8) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies from to to. If to is too small, the buffer will be grown appropriately and\n the old contents copied to, before the new contents are appended.\n\n If the grow fails (overflow or OOM), then an error will be returned.\n\n from and to may be the same buffer, permitting copying a buffer into itself."] pub fn aws_byte_buf_append_dynamic (to : * mut aws_byte_buf , from : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies `from` to `to`. If `to` is too small, the buffer will be grown appropriately and\n the old contents copied over, before the new contents are appended.\n\n If the grow fails (overflow or OOM), then an error will be returned.\n\n If the buffer is grown, the old buffer will be securely cleared before getting freed.\n\n `from` and `to` may be the same buffer, permitting copying a buffer into itself."] pub fn aws_byte_buf_append_dynamic_secure (to : * mut aws_byte_buf , from : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies a single byte into `to`. If `to` is too small, the buffer will be grown appropriately and\n the old contents copied over, before the byte is appended.\n\n If the grow fails (overflow or OOM), then an error will be returned."] pub fn aws_byte_buf_append_byte_dynamic (buffer : * mut aws_byte_buf , value : u8) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies a single byte into `to`. If `to` is too small, the buffer will be grown appropriately and\n the old contents copied over, before the byte is appended.\n\n If the grow fails (overflow or OOM), then an error will be returned.\n\n If the buffer is grown, the old buffer will be securely cleared before getting freed."] pub fn aws_byte_buf_append_byte_dynamic_secure (buffer : * mut aws_byte_buf , value : u8) -> :: libc :: c_int ; } extern "C" { # [doc = " Copy contents of cursor to buffer, then update cursor to reference the memory stored in the buffer.\n If buffer is too small, AWS_ERROR_DEST_COPY_TOO_SMALL will be returned.\n\n The cursor is permitted to reference memory from earlier in the buffer."] pub fn aws_byte_buf_append_and_update (to : * mut aws_byte_buf , from_and_update : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Appends '\\0' at the end of the buffer."] pub fn aws_byte_buf_append_null_terminator (buf : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { # [doc = " Attempts to increase the capacity of a buffer to the requested capacity\n\n If the the buffer's capacity is currently larger than the request capacity, the\n function does nothing (no shrink is performed)."] pub fn aws_byte_buf_reserve (buffer : * mut aws_byte_buf , requested_capacity : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Convenience function that attempts to increase the capacity of a buffer relative to the current\n length.\n\n aws_byte_buf_reserve_relative(buf, x) ~~ aws_byte_buf_reserve(buf, buf->len + x)\n"] pub fn aws_byte_buf_reserve_relative (buffer : * mut aws_byte_buf , additional_length : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Concatenates a variable number of struct aws_byte_buf * into destination.\n Number of args must be greater than 1. If dest is too small,\n AWS_ERROR_DEST_COPY_TOO_SMALL will be returned. dest->len will contain the\n amount of data actually copied to dest."] pub fn aws_byte_buf_cat (dest : * mut aws_byte_buf , number_of_args : usize , ...) -> :: libc :: c_int ; } extern "C" { # [doc = " Compare two aws_byte_cursor structures.\n Return whether their contents are equivalent."] pub fn aws_byte_cursor_eq (a : * const aws_byte_cursor , b : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of two aws_byte_cursor structures.\n Return whether their contents are equivalent.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_cursor_eq_ignore_case (a : * const aws_byte_cursor , b : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Compare an aws_byte_cursor and an aws_byte_buf.\n Return whether their contents are equivalent."] pub fn aws_byte_cursor_eq_byte_buf (a : * const aws_byte_cursor , b : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of an aws_byte_cursor and an aws_byte_buf.\n Return whether their contents are equivalent.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_cursor_eq_byte_buf_ignore_case (a : * const aws_byte_cursor , b : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Compare an aws_byte_cursor and a null-terminated string.\n Returns true if their contents are equivalent.\n The cursor should NOT contain a null-terminator, or the comparison will always return false."] pub fn aws_byte_cursor_eq_c_str (cursor : * const aws_byte_cursor , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of an aws_byte_cursor and a null-terminated string.\n Return whether their contents are equivalent.\n The cursor should NOT contain a null-terminator, or the comparison will always return false.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_cursor_eq_c_str_ignore_case (cursor : * const aws_byte_cursor , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Return true if the input starts with the prefix (exact byte comparison)."] pub fn aws_byte_cursor_starts_with (input : * const aws_byte_cursor , prefix : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Return true if the input starts with the prefix (case-insensitive).\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_cursor_starts_with_ignore_case (input : * const aws_byte_cursor , prefix : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Case-insensitive hash function for array containing ASCII or UTF-8 text."] pub fn aws_hash_array_ignore_case (array : * const :: libc :: c_void , len : usize) -> u64 ; } extern "C" { # [doc = " Case-insensitive hash function for aws_byte_cursors stored in an aws_hash_table.\n For case-sensitive hashing, use aws_hash_byte_cursor_ptr()."] pub fn aws_hash_byte_cursor_ptr_ignore_case (item : * const :: libc :: c_void) -> u64 ; } extern "C" { # [doc = " Returns a lookup table for bytes that is the identity transformation with the exception\n of uppercase ascii characters getting replaced with lowercase characters. Used in\n caseless comparisons."] pub fn aws_lookup_table_to_lower_get () -> * const u8 ; } extern "C" { # [doc = " Returns lookup table to go from ASCII/UTF-8 hex character to a number (0-15).\n Non-hex characters map to 255.\n Valid examples:\n '0' -> 0\n 'F' -> 15\n 'f' -> 15\n Invalid examples:\n ' ' -> 255\n 'Z' -> 255\n '\\0' -> 255"] pub fn aws_lookup_table_hex_to_num_get () -> * const u8 ; } extern "C" { # [doc = " Lexical (byte value) comparison of two byte cursors"] pub fn aws_byte_cursor_compare_lexical (lhs : * const aws_byte_cursor , rhs : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Lexical (byte value) comparison of two byte cursors where the raw values are sent through a lookup table first"] pub fn aws_byte_cursor_compare_lookup (lhs : * const aws_byte_cursor , rhs : * const aws_byte_cursor , lookup_table : * const u8) -> :: libc :: c_int ; } extern "C" { # [doc = " For creating a byte buffer from a null-terminated string literal."] pub fn aws_byte_buf_from_c_str (c_str : * const :: libc :: c_char) -> aws_byte_buf ; } extern "C" { pub fn aws_byte_buf_from_array (bytes : * const :: libc :: c_void , len : usize) -> aws_byte_buf ; } extern "C" { pub fn aws_byte_buf_from_empty_array (bytes : * const :: libc :: c_void , capacity : usize) -> aws_byte_buf ; } extern "C" { pub fn aws_byte_cursor_from_buf (buf : * const aws_byte_buf) -> aws_byte_cursor ; } extern "C" { pub fn aws_byte_cursor_from_c_str (c_str : * const :: libc :: c_char) -> aws_byte_cursor ; } extern "C" { pub fn aws_byte_cursor_from_array (bytes : * const :: libc :: c_void , len : usize) -> aws_byte_cursor ; } extern "C" { # [doc = " Tests if the given aws_byte_cursor has at least len bytes remaining. If so,\n *buf is advanced by len bytes (incrementing ->ptr and decrementing ->len),\n and an aws_byte_cursor referring to the first len bytes of the original *buf\n is returned. Otherwise, an aws_byte_cursor with ->ptr = NULL, ->len = 0 is\n returned.\n\n Note that if len is above (SIZE_MAX / 2), this function will also treat it as\n a buffer overflow, and return NULL without changing *buf."] pub fn aws_byte_cursor_advance (cursor : * mut aws_byte_cursor , len : usize) -> aws_byte_cursor ; } extern "C" { # [doc = " Behaves identically to aws_byte_cursor_advance, but avoids speculative\n execution potentially reading out-of-bounds pointers (by returning an\n empty ptr in such speculated paths).\n\n This should generally be done when using an untrusted or\n data-dependent value for 'len', to avoid speculating into a path where\n cursor->ptr points outside the true ptr length."] pub fn aws_byte_cursor_advance_nospec (cursor : * mut aws_byte_cursor , len : usize) -> aws_byte_cursor ; } extern "C" { # [doc = " Reads specified length of data from byte cursor and copies it to the\n destination array.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read (cur : * mut aws_byte_cursor , dest : * mut :: libc :: c_void , len : usize) -> bool ; } extern "C" { # [doc = " Reads as many bytes from cursor as size of buffer, and copies them to buffer.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_and_fill_buffer (cur : * mut aws_byte_cursor , dest : * mut aws_byte_buf) -> bool ; } extern "C" { # [doc = " Reads a single byte from cursor, placing it in *var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_u8 (cur : * mut aws_byte_cursor , var : * mut u8) -> bool ; } extern "C" { # [doc = " Reads a 16-bit value in network byte order from cur, and places it in host\n byte order into var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_be16 (cur : * mut aws_byte_cursor , var : * mut u16) -> bool ; } extern "C" { # [doc = " Reads an unsigned 24-bit value (3 bytes) in network byte order from cur,\n and places it in host byte order into 32-bit var.\n Ex: if cur's next 3 bytes are {0xAA, 0xBB, 0xCC}, then var becomes 0x00AABBCC.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_be24 (cur : * mut aws_byte_cursor , var : * mut u32) -> bool ; } extern "C" { # [doc = " Reads a 32-bit value in network byte order from cur, and places it in host\n byte order into var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_be32 (cur : * mut aws_byte_cursor , var : * mut u32) -> bool ; } extern "C" { # [doc = " Reads a 64-bit value in network byte order from cur, and places it in host\n byte order into var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_be64 (cur : * mut aws_byte_cursor , var : * mut u64) -> bool ; } extern "C" { # [doc = " Reads a 32-bit value in network byte order from cur, and places it in host\n byte order into var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_float_be32 (cur : * mut aws_byte_cursor , var : * mut f32) -> bool ; } extern "C" { # [doc = " Reads a 64-bit value in network byte order from cur, and places it in host\n byte order into var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_float_be64 (cur : * mut aws_byte_cursor , var : * mut f64) -> bool ; } extern "C" { # [doc = " Reads 2 hex characters from ASCII/UTF-8 text to produce an 8-bit number.\n Accepts both lowercase 'a'-'f' and uppercase 'A'-'F'.\n For example: \"0F\" produces 15.\n\n On success, returns true and advances the cursor by 2.\n If there is insufficient space in the cursor or an invalid character\n is encountered, returns false, leaving the cursor unchanged."] pub fn aws_byte_cursor_read_hex_u8 (cur : * mut aws_byte_cursor , var : * mut u8) -> bool ; } extern "C" { # [doc = " Appends a sub-buffer to the specified buffer.\n\n If the buffer has at least `len' bytes remaining (buffer->capacity - buffer->len >= len),\n then buffer->len is incremented by len, and an aws_byte_buf is assigned to *output corresponding\n to the last len bytes of the input buffer. The aws_byte_buf at *output will have a null\n allocator, a zero initial length, and a capacity of 'len'. The function then returns true.\n\n If there is insufficient space, then this function nulls all fields in *output and returns\n false."] pub fn aws_byte_buf_advance (buffer : * mut aws_byte_buf , output : * mut aws_byte_buf , len : usize) -> bool ; } extern "C" { # [doc = " Write specified number of bytes from array to byte buffer.\n\n On success, returns true and updates the buffer length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write (buf : * mut aws_byte_buf , src : * const u8 , len : usize) -> bool ; } extern "C" { # [doc = " Copies all bytes from buffer to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_from_whole_buffer (buf : * mut aws_byte_buf , src : aws_byte_buf) -> bool ; } extern "C" { # [doc = " Copies all bytes from buffer to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_from_whole_cursor (buf : * mut aws_byte_buf , src : aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Without increasing buf's capacity, write as much as possible from advancing_cursor into buf.\n\n buf's len is updated accordingly.\n advancing_cursor is advanced so it contains the remaining unwritten parts.\n Returns the section of advancing_cursor which was written.\n\n This function cannot fail. If buf is full (len == capacity) or advancing_len has 0 length,\n then buf and advancing_cursor are not altered and a cursor with 0 length is returned.\n\n Example: Given a buf with 2 bytes of space available and advancing_cursor with contents \"abc\".\n \"ab\" will be written to buf and buf->len will increase 2 and become equal to buf->capacity.\n advancing_cursor will advance so its contents become the unwritten \"c\".\n The returned cursor's contents will be the \"ab\" from the original advancing_cursor."] pub fn aws_byte_buf_write_to_capacity (buf : * mut aws_byte_buf , advancing_cursor : * mut aws_byte_cursor) -> aws_byte_cursor ; } extern "C" { # [doc = " Copies one byte to buffer.\n\n On success, returns true and updates the cursor /length\naccordingly.\n\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_u8 (buf : * mut aws_byte_buf , c : u8) -> bool ; } extern "C" { # [doc = " Writes one byte repeatedly to buffer (like memset)\n\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_u8_n (buf : * mut aws_byte_buf , c : u8 , count : usize) -> bool ; } extern "C" { # [doc = " Writes a 16-bit integer in network byte order (big endian) to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_be16 (buf : * mut aws_byte_buf , x : u16) -> bool ; } extern "C" { # [doc = " Writes low 24-bits (3 bytes) of an unsigned integer in network byte order (big endian) to buffer.\n Ex: If x is 0x00AABBCC then {0xAA, 0xBB, 0xCC} is written to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, or x's value cannot fit in 3 bytes,\n returns false, leaving the buffer unchanged."] pub fn aws_byte_buf_write_be24 (buf : * mut aws_byte_buf , x : u32) -> bool ; } extern "C" { # [doc = " Writes a 32-bit integer in network byte order (big endian) to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_be32 (buf : * mut aws_byte_buf , x : u32) -> bool ; } extern "C" { # [doc = " Writes a 32-bit float in network byte order (big endian) to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_float_be32 (buf : * mut aws_byte_buf , x : f32) -> bool ; } extern "C" { # [doc = " Writes a 64-bit integer in network byte order (big endian) to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_be64 (buf : * mut aws_byte_buf , x : u64) -> bool ; } extern "C" { # [doc = " Writes a 64-bit float in network byte order (big endian) to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_float_be64 (buf : * mut aws_byte_buf , x : f64) -> bool ; } extern "C" { # [doc = " Like isalnum(), but ignores C locale.\n Returns true if ch has the value of ASCII/UTF-8: 'a'-'z', 'A'-'Z', or '0'-'9'."] pub fn aws_isalnum (ch : u8) -> bool ; } extern "C" { # [doc = " Like isalpha(), but ignores C locale.\n Returns true if ch has the value of ASCII/UTF-8: 'a'-'z' or 'A'-'Z'."] pub fn aws_isalpha (ch : u8) -> bool ; } extern "C" { # [doc = " Like isdigit().\n Returns true if ch has the value of ASCII/UTF-8: '0'-'9'.\n\n Note: C's built-in isdigit() is also supposed to ignore the C locale,\n but cppreference.com claims \"some implementations (e.g. Microsoft in 1252 codepage)\n may classify additional single-byte characters as digits\""] pub fn aws_isdigit (ch : u8) -> bool ; } extern "C" { # [doc = " Like isxdigit().\n Returns true if ch has the value of ASCII/UTF-8: '0'-'9', 'a'-'f', or 'A'-'F'.\n\n Note: C's built-in isxdigit() is also supposed to ignore the C locale,\n but cppreference.com claims \"some implementations (e.g. Microsoft in 1252 codepage)\n may classify additional single-byte characters as digits\""] pub fn aws_isxdigit (ch : u8) -> bool ; } extern "C" { # [doc = " Like isspace(), but ignores C locale.\n Return true if ch has the value of ASCII/UTF-8: space (0x20), form feed (0x0C),\n line feed (0x0A), carriage return (0x0D), horizontal tab (0x09), or vertical tab (0x0B)."] pub fn aws_isspace (ch : u8) -> bool ; } extern "C" { # [doc = " Read entire cursor as ASCII/UTF-8 unsigned base-10 number.\n Stricter than strtoull(), which allows whitespace and inputs that start with \"0x\"\n\n Examples:\n \"0\" -> 0\n \"123\" -> 123\n \"00004\" -> 4 // leading zeros ok\n\n Rejects things like:\n \"-1\" // negative numbers not allowed\n \"1,000\" // only characters 0-9 allowed\n \"\" // blank string not allowed\n \" 0 \" // whitespace not allowed\n \"0x0\" // hex not allowed\n \"FF\" // hex not allowed\n \"999999999999999999999999999999999999999999\" // larger than max u64"] pub fn aws_byte_cursor_utf8_parse_u64 (cursor : aws_byte_cursor , dst : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Read entire cursor as ASCII/UTF-8 unsigned base-16 number with NO \"0x\" prefix.\n\n Examples:\n \"F\" -> 15\n \"000000ff\" -> 255 // leading zeros ok\n \"Ff\" -> 255 // mixed case ok\n \"123\" -> 291\n \"FFFFFFFFFFFFFFFF\" -> 18446744073709551616 // max u64\n\n Rejects things like:\n \"0x0\" // 0x prefix not allowed\n \"\" // blank string not allowed\n \" F \" // whitespace not allowed\n \"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\" // larger than max u64"] pub fn aws_byte_cursor_utf8_parse_u64_hex (cursor : aws_byte_cursor , dst : * mut u64) -> :: libc :: c_int ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_linked_list_node { pub next : * mut aws_linked_list_node , pub prev : * mut aws_linked_list_node , } # [test] fn bindgen_test_layout_aws_linked_list_node () { const UNINIT : :: std :: mem :: MaybeUninit < aws_linked_list_node > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_linked_list_node > () , 16usize , concat ! ("Size of: " , stringify ! (aws_linked_list_node))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_linked_list_node > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_linked_list_node))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . next) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_linked_list_node) , "::" , stringify ! (next))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . prev) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_linked_list_node) , "::" , stringify ! (prev))) ; } impl Default for aws_linked_list_node { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_linked_list { pub head : aws_linked_list_node , pub tail : aws_linked_list_node , } # [test] fn bindgen_test_layout_aws_linked_list () { const UNINIT : :: std :: mem :: MaybeUninit < aws_linked_list > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_linked_list > () , 32usize , concat ! ("Size of: " , stringify ! (aws_linked_list))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_linked_list > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_linked_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . head) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_linked_list) , "::" , stringify ! (head))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tail) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_linked_list) , "::" , stringify ! (tail))) ; } impl Default for aws_linked_list { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Set node's next and prev pointers to NULL."] pub fn aws_linked_list_node_reset (node : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Tests if the list is empty."] pub fn aws_linked_list_empty (list : * const aws_linked_list) -> bool ; } extern "C" { # [doc = " Checks that a linked list is valid."] pub fn aws_linked_list_is_valid (list : * const aws_linked_list) -> bool ; } extern "C" { # [doc = " Checks that the prev of the next pointer of a node points to the\n node. As this checks whether the [next] connection of a node is\n bidirectional, it returns false if used for the list tail."] pub fn aws_linked_list_node_next_is_valid (node : * const aws_linked_list_node) -> bool ; } extern "C" { # [doc = " Checks that the next of the prev pointer of a node points to the\n node. Similarly to the above, this returns false if used for the\n head of a list."] pub fn aws_linked_list_node_prev_is_valid (node : * const aws_linked_list_node) -> bool ; } extern "C" { # [doc = " Checks that a linked list satisfies double linked list connectivity\n constraints. This check is O(n) as it traverses the whole linked\n list to ensure that tail is reachable from head (and vice versa)\n and that every connection is bidirectional.\n\n Note: This check *cannot* go into an infinite loop, because we\n ensure that the connection to the next node is\n bidirectional. Therefore, if a node's [a] a.next is a previous node\n [b] in the list, b.prev != &a and so this check would fail, thus\n terminating the loop."] pub fn aws_linked_list_is_valid_deep (list : * const aws_linked_list) -> bool ; } extern "C" { # [doc = " Initializes the list. List will be empty after this call."] pub fn aws_linked_list_init (list : * mut aws_linked_list) ; } extern "C" { # [doc = " Returns an iteration pointer for the first element in the list."] pub fn aws_linked_list_begin (list : * const aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Returns an iteration pointer for one past the last element in the list."] pub fn aws_linked_list_end (list : * const aws_linked_list) -> * const aws_linked_list_node ; } extern "C" { # [doc = " Returns a pointer for the last element in the list.\n Used to begin iterating the list in reverse. Ex:\n for (i = aws_linked_list_rbegin(list); i != aws_linked_list_rend(list); i = aws_linked_list_prev(i)) {...}"] pub fn aws_linked_list_rbegin (list : * const aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Returns the pointer to one before the first element in the list.\n Used to end iterating the list in reverse."] pub fn aws_linked_list_rend (list : * const aws_linked_list) -> * const aws_linked_list_node ; } extern "C" { # [doc = " Returns the next element in the list."] pub fn aws_linked_list_next (node : * const aws_linked_list_node) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Returns the previous element in the list."] pub fn aws_linked_list_prev (node : * const aws_linked_list_node) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Inserts to_add immediately after after."] pub fn aws_linked_list_insert_after (after : * mut aws_linked_list_node , to_add : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Swaps the order two nodes in the linked list."] pub fn aws_linked_list_swap_nodes (a : * mut aws_linked_list_node , b : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Inserts to_add immediately before before."] pub fn aws_linked_list_insert_before (before : * mut aws_linked_list_node , to_add : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Removes the specified node from the list (prev/next point to each other) and\n returns the next node in the list."] pub fn aws_linked_list_remove (node : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Append new_node."] pub fn aws_linked_list_push_back (list : * mut aws_linked_list , node : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Returns the element in the back of the list."] pub fn aws_linked_list_back (list : * const aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Returns the element in the back of the list and removes it"] pub fn aws_linked_list_pop_back (list : * mut aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Prepend new_node."] pub fn aws_linked_list_push_front (list : * mut aws_linked_list , node : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Returns the element in the front of the list."] pub fn aws_linked_list_front (list : * const aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Returns the element in the front of the list and removes it"] pub fn aws_linked_list_pop_front (list : * mut aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { pub fn aws_linked_list_swap_contents (a : * mut aws_linked_list , b : * mut aws_linked_list) ; } extern "C" { # [doc = " Remove all nodes from one list, and add them to the back of another.\n\n Example: if dst={1,2} and src={3,4}, they become dst={1,2,3,4} and src={}"] pub fn aws_linked_list_move_all_back (dst : * mut aws_linked_list , src : * mut aws_linked_list) ; } extern "C" { # [doc = " Remove all nodes from one list, and add them to the front of another.\n\n Example: if dst={2,1} and src={4,3}, they become dst={4,3,2,1} and src={}"] pub fn aws_linked_list_move_all_front (dst : * mut aws_linked_list , src : * mut aws_linked_list) ; } # [repr (C)] # [derive (Copy , Clone)] pub struct aws_io_handle { pub data : aws_io_handle__bindgen_ty_1 , pub additional_data : * mut :: libc :: c_void , } # [repr (C)] # [derive (Copy , Clone)] pub union aws_io_handle__bindgen_ty_1 { pub fd : :: libc :: c_int , pub handle : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_io_handle__bindgen_ty_1 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_io_handle__bindgen_ty_1 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_io_handle__bindgen_ty_1 > () , 8usize , concat ! ("Size of: " , stringify ! (aws_io_handle__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_io_handle__bindgen_ty_1 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_io_handle__bindgen_ty_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . fd) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_io_handle__bindgen_ty_1) , "::" , stringify ! (fd))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . handle) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_io_handle__bindgen_ty_1) , "::" , stringify ! (handle))) ; } impl Default for aws_io_handle__bindgen_ty_1 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [test] fn bindgen_test_layout_aws_io_handle () { const UNINIT : :: std :: mem :: MaybeUninit < aws_io_handle > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_io_handle > () , 16usize , concat ! ("Size of: " , stringify ! (aws_io_handle))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_io_handle > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_io_handle))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . data) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_io_handle) , "::" , stringify ! (data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . additional_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_io_handle) , "::" , stringify ! (additional_data))) ; } impl Default for aws_io_handle { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_io_message_type { AWS_IO_MESSAGE_APPLICATION_DATA = 0 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_channel { _unused : [u8 ; 0] , } pub type aws_channel_on_message_write_completed_fn = :: std :: option :: Option < unsafe extern "C" fn (channel : * mut aws_channel , message : * mut aws_io_message , err_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_io_message { # [doc = " Allocator used for the message and message data. If this is null, the message belongs to a pool or some other\n message manager."] pub allocator : * mut aws_allocator , # [doc = " Buffer containing the data for message"] pub message_data : aws_byte_buf , # [doc = " type of the message. This is used for framework control messages. Currently the only type is\n AWS_IO_MESSAGE_APPLICATION_DATA"] pub message_type : aws_io_message_type , # [doc = " Conveys information about the contents of message_data (e.g. cast the ptr to some type). If 0, it's just opaque\n data."] pub message_tag : :: libc :: c_int , # [doc = " In order to avoid excess allocations/copies, on a partial read or write, the copy mark is set to indicate how\n much of this message has already been processed or copied."] pub copy_mark : usize , # [doc = " The channel that the message is bound to."] pub owning_channel : * mut aws_channel , # [doc = " Invoked by the channel once the entire message has been written to the data sink."] pub on_completion : aws_channel_on_message_write_completed_fn , # [doc = " arbitrary user data for the on_completion callback"] pub user_data : * mut :: libc :: c_void , # [doc = " it's incredibly likely something is going to need to queue this,\n go ahead and make sure the list info is part of the original allocation."] pub queueing_handle : aws_linked_list_node , } # [test] fn bindgen_test_layout_aws_io_message () { const UNINIT : :: std :: mem :: MaybeUninit < aws_io_message > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_io_message > () , 96usize , concat ! ("Size of: " , stringify ! (aws_io_message))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_io_message > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_io_message))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . message_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (message_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . message_type) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (message_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . message_tag) as usize - ptr as usize } , 44usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (message_tag))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . copy_mark) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (copy_mark))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . owning_channel) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (owning_channel))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_completion) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (on_completion))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . queueing_handle) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (queueing_handle))) ; } impl Default for aws_io_message { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_io_clock_fn = :: std :: option :: Option < unsafe extern "C" fn (timestamp : * mut u64) -> :: libc :: c_int > ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_io_errors { AWS_IO_CHANNEL_ERROR_ERROR_CANT_ACCEPT_INPUT = 1024 , AWS_IO_CHANNEL_UNKNOWN_MESSAGE_TYPE = 1025 , AWS_IO_CHANNEL_READ_WOULD_EXCEED_WINDOW = 1026 , AWS_IO_EVENT_LOOP_ALREADY_ASSIGNED = 1027 , AWS_IO_EVENT_LOOP_SHUTDOWN = 1028 , AWS_IO_TLS_ERROR_NEGOTIATION_FAILURE = 1029 , AWS_IO_TLS_ERROR_NOT_NEGOTIATED = 1030 , AWS_IO_TLS_ERROR_WRITE_FAILURE = 1031 , AWS_IO_TLS_ERROR_ALERT_RECEIVED = 1032 , AWS_IO_TLS_CTX_ERROR = 1033 , AWS_IO_TLS_VERSION_UNSUPPORTED = 1034 , AWS_IO_TLS_CIPHER_PREF_UNSUPPORTED = 1035 , AWS_IO_MISSING_ALPN_MESSAGE = 1036 , AWS_IO_UNHANDLED_ALPN_PROTOCOL_MESSAGE = 1037 , AWS_IO_FILE_VALIDATION_FAILURE = 1038 , AWS_ERROR_IO_EVENT_LOOP_THREAD_ONLY = 1039 , AWS_ERROR_IO_ALREADY_SUBSCRIBED = 1040 , AWS_ERROR_IO_NOT_SUBSCRIBED = 1041 , AWS_ERROR_IO_OPERATION_CANCELLED = 1042 , AWS_IO_READ_WOULD_BLOCK = 1043 , AWS_IO_BROKEN_PIPE = 1044 , AWS_IO_SOCKET_UNSUPPORTED_ADDRESS_FAMILY = 1045 , AWS_IO_SOCKET_INVALID_OPERATION_FOR_TYPE = 1046 , AWS_IO_SOCKET_CONNECTION_REFUSED = 1047 , AWS_IO_SOCKET_TIMEOUT = 1048 , AWS_IO_SOCKET_NO_ROUTE_TO_HOST = 1049 , AWS_IO_SOCKET_NETWORK_DOWN = 1050 , AWS_IO_SOCKET_CLOSED = 1051 , AWS_IO_SOCKET_NOT_CONNECTED = 1052 , AWS_IO_SOCKET_INVALID_OPTIONS = 1053 , AWS_IO_SOCKET_ADDRESS_IN_USE = 1054 , AWS_IO_SOCKET_INVALID_ADDRESS = 1055 , AWS_IO_SOCKET_ILLEGAL_OPERATION_FOR_STATE = 1056 , AWS_IO_SOCKET_CONNECT_ABORTED = 1057 , AWS_IO_DNS_QUERY_FAILED = 1058 , AWS_IO_DNS_INVALID_NAME = 1059 , AWS_IO_DNS_NO_ADDRESS_FOR_HOST = 1060 , AWS_IO_DNS_HOST_REMOVED_FROM_CACHE = 1061 , AWS_IO_STREAM_INVALID_SEEK_POSITION = 1062 , AWS_IO_STREAM_READ_FAILED = 1063 , DEPRECATED_AWS_IO_INVALID_FILE_HANDLE = 1064 , AWS_IO_SHARED_LIBRARY_LOAD_FAILURE = 1065 , AWS_IO_SHARED_LIBRARY_FIND_SYMBOL_FAILURE = 1066 , AWS_IO_TLS_NEGOTIATION_TIMEOUT = 1067 , AWS_IO_TLS_ALERT_NOT_GRACEFUL = 1068 , AWS_IO_MAX_RETRIES_EXCEEDED = 1069 , AWS_IO_RETRY_PERMISSION_DENIED = 1070 , AWS_IO_TLS_DIGEST_ALGORITHM_UNSUPPORTED = 1071 , AWS_IO_TLS_SIGNATURE_ALGORITHM_UNSUPPORTED = 1072 , AWS_ERROR_PKCS11_VERSION_UNSUPPORTED = 1073 , AWS_ERROR_PKCS11_TOKEN_NOT_FOUND = 1074 , AWS_ERROR_PKCS11_KEY_NOT_FOUND = 1075 , AWS_ERROR_PKCS11_KEY_TYPE_UNSUPPORTED = 1076 , AWS_ERROR_PKCS11_UNKNOWN_CRYPTOKI_RETURN_VALUE = 1077 , AWS_ERROR_PKCS11_CKR_CANCEL = 1078 , AWS_ERROR_PKCS11_CKR_HOST_MEMORY = 1079 , AWS_ERROR_PKCS11_CKR_SLOT_ID_INVALID = 1080 , AWS_ERROR_PKCS11_CKR_GENERAL_ERROR = 1081 , AWS_ERROR_PKCS11_CKR_FUNCTION_FAILED = 1082 , AWS_ERROR_PKCS11_CKR_ARGUMENTS_BAD = 1083 , AWS_ERROR_PKCS11_CKR_NO_EVENT = 1084 , AWS_ERROR_PKCS11_CKR_NEED_TO_CREATE_THREADS = 1085 , AWS_ERROR_PKCS11_CKR_CANT_LOCK = 1086 , AWS_ERROR_PKCS11_CKR_ATTRIBUTE_READ_ONLY = 1087 , AWS_ERROR_PKCS11_CKR_ATTRIBUTE_SENSITIVE = 1088 , AWS_ERROR_PKCS11_CKR_ATTRIBUTE_TYPE_INVALID = 1089 , AWS_ERROR_PKCS11_CKR_ATTRIBUTE_VALUE_INVALID = 1090 , AWS_ERROR_PKCS11_CKR_ACTION_PROHIBITED = 1091 , AWS_ERROR_PKCS11_CKR_DATA_INVALID = 1092 , AWS_ERROR_PKCS11_CKR_DATA_LEN_RANGE = 1093 , AWS_ERROR_PKCS11_CKR_DEVICE_ERROR = 1094 , AWS_ERROR_PKCS11_CKR_DEVICE_MEMORY = 1095 , AWS_ERROR_PKCS11_CKR_DEVICE_REMOVED = 1096 , AWS_ERROR_PKCS11_CKR_ENCRYPTED_DATA_INVALID = 1097 , AWS_ERROR_PKCS11_CKR_ENCRYPTED_DATA_LEN_RANGE = 1098 , AWS_ERROR_PKCS11_CKR_FUNCTION_CANCELED = 1099 , AWS_ERROR_PKCS11_CKR_FUNCTION_NOT_PARALLEL = 1100 , AWS_ERROR_PKCS11_CKR_FUNCTION_NOT_SUPPORTED = 1101 , AWS_ERROR_PKCS11_CKR_KEY_HANDLE_INVALID = 1102 , AWS_ERROR_PKCS11_CKR_KEY_SIZE_RANGE = 1103 , AWS_ERROR_PKCS11_CKR_KEY_TYPE_INCONSISTENT = 1104 , AWS_ERROR_PKCS11_CKR_KEY_NOT_NEEDED = 1105 , AWS_ERROR_PKCS11_CKR_KEY_CHANGED = 1106 , AWS_ERROR_PKCS11_CKR_KEY_NEEDED = 1107 , AWS_ERROR_PKCS11_CKR_KEY_INDIGESTIBLE = 1108 , AWS_ERROR_PKCS11_CKR_KEY_FUNCTION_NOT_PERMITTED = 1109 , AWS_ERROR_PKCS11_CKR_KEY_NOT_WRAPPABLE = 1110 , AWS_ERROR_PKCS11_CKR_KEY_UNEXTRACTABLE = 1111 , AWS_ERROR_PKCS11_CKR_MECHANISM_INVALID = 1112 , AWS_ERROR_PKCS11_CKR_MECHANISM_PARAM_INVALID = 1113 , AWS_ERROR_PKCS11_CKR_OBJECT_HANDLE_INVALID = 1114 , AWS_ERROR_PKCS11_CKR_OPERATION_ACTIVE = 1115 , AWS_ERROR_PKCS11_CKR_OPERATION_NOT_INITIALIZED = 1116 , AWS_ERROR_PKCS11_CKR_PIN_INCORRECT = 1117 , AWS_ERROR_PKCS11_CKR_PIN_INVALID = 1118 , AWS_ERROR_PKCS11_CKR_PIN_LEN_RANGE = 1119 , AWS_ERROR_PKCS11_CKR_PIN_EXPIRED = 1120 , AWS_ERROR_PKCS11_CKR_PIN_LOCKED = 1121 , AWS_ERROR_PKCS11_CKR_SESSION_CLOSED = 1122 , AWS_ERROR_PKCS11_CKR_SESSION_COUNT = 1123 , AWS_ERROR_PKCS11_CKR_SESSION_HANDLE_INVALID = 1124 , AWS_ERROR_PKCS11_CKR_SESSION_PARALLEL_NOT_SUPPORTED = 1125 , AWS_ERROR_PKCS11_CKR_SESSION_READ_ONLY = 1126 , AWS_ERROR_PKCS11_CKR_SESSION_EXISTS = 1127 , AWS_ERROR_PKCS11_CKR_SESSION_READ_ONLY_EXISTS = 1128 , AWS_ERROR_PKCS11_CKR_SESSION_READ_WRITE_SO_EXISTS = 1129 , AWS_ERROR_PKCS11_CKR_SIGNATURE_INVALID = 1130 , AWS_ERROR_PKCS11_CKR_SIGNATURE_LEN_RANGE = 1131 , AWS_ERROR_PKCS11_CKR_TEMPLATE_INCOMPLETE = 1132 , AWS_ERROR_PKCS11_CKR_TEMPLATE_INCONSISTENT = 1133 , AWS_ERROR_PKCS11_CKR_TOKEN_NOT_PRESENT = 1134 , AWS_ERROR_PKCS11_CKR_TOKEN_NOT_RECOGNIZED = 1135 , AWS_ERROR_PKCS11_CKR_TOKEN_WRITE_PROTECTED = 1136 , AWS_ERROR_PKCS11_CKR_UNWRAPPING_KEY_HANDLE_INVALID = 1137 , AWS_ERROR_PKCS11_CKR_UNWRAPPING_KEY_SIZE_RANGE = 1138 , AWS_ERROR_PKCS11_CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT = 1139 , AWS_ERROR_PKCS11_CKR_USER_ALREADY_LOGGED_IN = 1140 , AWS_ERROR_PKCS11_CKR_USER_NOT_LOGGED_IN = 1141 , AWS_ERROR_PKCS11_CKR_USER_PIN_NOT_INITIALIZED = 1142 , AWS_ERROR_PKCS11_CKR_USER_TYPE_INVALID = 1143 , AWS_ERROR_PKCS11_CKR_USER_ANOTHER_ALREADY_LOGGED_IN = 1144 , AWS_ERROR_PKCS11_CKR_USER_TOO_MANY_TYPES = 1145 , AWS_ERROR_PKCS11_CKR_WRAPPED_KEY_INVALID = 1146 , AWS_ERROR_PKCS11_CKR_WRAPPED_KEY_LEN_RANGE = 1147 , AWS_ERROR_PKCS11_CKR_WRAPPING_KEY_HANDLE_INVALID = 1148 , AWS_ERROR_PKCS11_CKR_WRAPPING_KEY_SIZE_RANGE = 1149 , AWS_ERROR_PKCS11_CKR_WRAPPING_KEY_TYPE_INCONSISTENT = 1150 , AWS_ERROR_PKCS11_CKR_RANDOM_SEED_NOT_SUPPORTED = 1151 , AWS_ERROR_PKCS11_CKR_RANDOM_NO_RNG = 1152 , AWS_ERROR_PKCS11_CKR_DOMAIN_PARAMS_INVALID = 1153 , AWS_ERROR_PKCS11_CKR_CURVE_NOT_SUPPORTED = 1154 , AWS_ERROR_PKCS11_CKR_BUFFER_TOO_SMALL = 1155 , AWS_ERROR_PKCS11_CKR_SAVED_STATE_INVALID = 1156 , AWS_ERROR_PKCS11_CKR_INFORMATION_SENSITIVE = 1157 , AWS_ERROR_PKCS11_CKR_STATE_UNSAVEABLE = 1158 , AWS_ERROR_PKCS11_CKR_CRYPTOKI_NOT_INITIALIZED = 1159 , AWS_ERROR_PKCS11_CKR_CRYPTOKI_ALREADY_INITIALIZED = 1160 , AWS_ERROR_PKCS11_CKR_MUTEX_BAD = 1161 , AWS_ERROR_PKCS11_CKR_MUTEX_NOT_LOCKED = 1162 , AWS_ERROR_PKCS11_CKR_NEW_PIN_MODE = 1163 , AWS_ERROR_PKCS11_CKR_NEXT_OTP = 1164 , AWS_ERROR_PKCS11_CKR_EXCEEDED_MAX_ITERATIONS = 1165 , AWS_ERROR_PKCS11_CKR_FIPS_SELF_TEST_FAILED = 1166 , AWS_ERROR_PKCS11_CKR_LIBRARY_LOAD_FAILED = 1167 , AWS_ERROR_PKCS11_CKR_PIN_TOO_WEAK = 1168 , AWS_ERROR_PKCS11_CKR_PUBLIC_KEY_INVALID = 1169 , AWS_ERROR_PKCS11_CKR_FUNCTION_REJECTED = 1170 , AWS_ERROR_IO_PINNED_EVENT_LOOP_MISMATCH = 1171 , AWS_ERROR_PKCS11_ENCODING_ERROR = 1172 , AWS_IO_TLS_ERROR_DEFAULT_TRUST_STORE_NOT_FOUND = 1173 , AWS_IO_STREAM_SEEK_FAILED = 1174 , AWS_IO_STREAM_GET_LENGTH_FAILED = 1175 , AWS_IO_STREAM_SEEK_UNSUPPORTED = 1176 , AWS_IO_STREAM_GET_LENGTH_UNSUPPORTED = 1177 , AWS_IO_TLS_ERROR_READ_FAILURE = 1178 , AWS_IO_ERROR_END_RANGE = 2047 , AWS_IO_INVALID_FILE_HANDLE = 50 , } extern "C" { # [doc = " Initializes internal datastructures used by aws-c-io.\n Must be called before using any functionality in aws-c-io."] pub fn aws_io_library_init (allocator : * mut aws_allocator) ; } extern "C" { # [doc = " Shuts down the internal datastructures used by aws-c-io."] pub fn aws_io_library_clean_up () ; } extern "C" { pub fn aws_io_fatal_assert_library_initialized () ; } # [doc = " struct aws_atomic_var represents an atomic variable - a value which can hold an integer or pointer\n that can be manipulated atomically. struct aws_atomic_vars should normally only be manipulated\n with atomics methods defined in this header."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_atomic_var { pub value : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_atomic_var () { const UNINIT : :: std :: mem :: MaybeUninit < aws_atomic_var > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_atomic_var > () , 8usize , concat ! ("Size of: " , stringify ! (aws_atomic_var))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_atomic_var > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_atomic_var))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_atomic_var) , "::" , stringify ! (value))) ; } impl Default for aws_atomic_var { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_memory_order { # [doc = " No particular ordering constraints are guaranteed relative to other\n operations at all; we merely ensure that the operation itself is atomic."] aws_memory_order_relaxed = 0 , # [doc = " Specifies acquire ordering. No reads or writes on the current thread can be\n reordered to happen before this operation. This is typically paired with a release\n ordering; any writes that happened on the releasing operation will be visible\n after the paired acquire operation.\n\n Acquire ordering is only meaningful on load or load-store operations."] aws_memory_order_acquire = 2 , # [doc = " Specifies release order. No reads or writes can be reordered to come after this\n operation. Typically paired with an acquire operation.\n\n Release ordering is only meaningful on store or load-store operations."] aws_memory_order_release = 3 , # [doc = " Specifies acquire-release order; if this operation acts as a load, it acts as an\n acquire operation; if it acts as a store, it acts as a release operation; if it's\n a load-store, it does both."] aws_memory_order_acq_rel = 4 , # [doc = " Specifies acquire-release order; if this operation acts as a load, it acts as an\n acquire operation; if it acts as a store, it acts as a release operation; if it's\n a load-store, it does both."] aws_memory_order_seq_cst = 5 , } extern "C" { # [doc = " Initializes an atomic variable with an integer value. This operation should be done before any\n other operations on this atomic variable, and must be done before attempting any parallel operations.\n\n This operation does not imply a barrier. Ensure that you use an acquire-release barrier (or stronger)\n when communicating the fact that initialization is complete to the other thread. Launching the thread\n implies a sufficiently strong barrier."] pub fn aws_atomic_init_int (var : * mut aws_atomic_var , n : usize) ; } extern "C" { # [doc = " Initializes an atomic variable with a pointer value. This operation should be done before any\n other operations on this atomic variable, and must be done before attempting any parallel operations.\n\n This operation does not imply a barrier. Ensure that you use an acquire-release barrier (or stronger)\n when communicating the fact that initialization is complete to the other thread. Launching the thread\n implies a sufficiently strong barrier."] pub fn aws_atomic_init_ptr (var : * mut aws_atomic_var , p : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Reads an atomic var as an integer, using the specified ordering, and returns the result."] pub fn aws_atomic_load_int_explicit (var : * const aws_atomic_var , memory_order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Reads an atomic var as an integer, using sequentially consistent ordering, and returns the result."] pub fn aws_atomic_load_int (var : * const aws_atomic_var) -> usize ; } extern "C" { # [doc = " Reads an atomic var as a pointer, using the specified ordering, and returns the result."] pub fn aws_atomic_load_ptr_explicit (var : * const aws_atomic_var , memory_order : aws_memory_order) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Reads an atomic var as a pointer, using sequentially consistent ordering, and returns the result."] pub fn aws_atomic_load_ptr (var : * const aws_atomic_var) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Stores an integer into an atomic var, using the specified ordering."] pub fn aws_atomic_store_int_explicit (var : * mut aws_atomic_var , n : usize , memory_order : aws_memory_order) ; } extern "C" { # [doc = " Stores an integer into an atomic var, using sequentially consistent ordering."] pub fn aws_atomic_store_int (var : * mut aws_atomic_var , n : usize) ; } extern "C" { # [doc = " Stores a pointer into an atomic var, using the specified ordering."] pub fn aws_atomic_store_ptr_explicit (var : * mut aws_atomic_var , p : * mut :: libc :: c_void , memory_order : aws_memory_order) ; } extern "C" { # [doc = " Stores a pointer into an atomic var, using sequentially consistent ordering."] pub fn aws_atomic_store_ptr (var : * mut aws_atomic_var , p : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Exchanges an integer with the value in an atomic_var, using the specified ordering.\n Returns the value that was previously in the atomic_var."] pub fn aws_atomic_exchange_int_explicit (var : * mut aws_atomic_var , n : usize , memory_order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Exchanges an integer with the value in an atomic_var, using sequentially consistent ordering.\n Returns the value that was previously in the atomic_var."] pub fn aws_atomic_exchange_int (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Exchanges a pointer with the value in an atomic_var, using the specified ordering.\n Returns the value that was previously in the atomic_var."] pub fn aws_atomic_exchange_ptr_explicit (var : * mut aws_atomic_var , p : * mut :: libc :: c_void , memory_order : aws_memory_order) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Exchanges an integer with the value in an atomic_var, using sequentially consistent ordering.\n Returns the value that was previously in the atomic_var."] pub fn aws_atomic_exchange_ptr (var : * mut aws_atomic_var , p : * mut :: libc :: c_void) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Atomically compares *var to *expected; if they are equal, atomically sets *var = desired. Otherwise, *expected is set\n to the value in *var. On success, the memory ordering used was order_success; otherwise, it was order_failure.\n order_failure must be no stronger than order_success, and must not be release or acq_rel.\n Returns true if the compare was successful and the variable updated to desired."] pub fn aws_atomic_compare_exchange_int_explicit (var : * mut aws_atomic_var , expected : * mut usize , desired : usize , order_success : aws_memory_order , order_failure : aws_memory_order) -> bool ; } extern "C" { # [doc = " Atomically compares *var to *expected; if they are equal, atomically sets *var = desired. Otherwise, *expected is set\n to the value in *var. Uses sequentially consistent memory ordering, regardless of success or failure.\n Returns true if the compare was successful and the variable updated to desired."] pub fn aws_atomic_compare_exchange_int (var : * mut aws_atomic_var , expected : * mut usize , desired : usize) -> bool ; } extern "C" { # [doc = " Atomically compares *var to *expected; if they are equal, atomically sets *var = desired. Otherwise, *expected is set\n to the value in *var. On success, the memory ordering used was order_success; otherwise, it was order_failure.\n order_failure must be no stronger than order_success, and must not be release or acq_rel.\n Returns true if the compare was successful and the variable updated to desired."] pub fn aws_atomic_compare_exchange_ptr_explicit (var : * mut aws_atomic_var , expected : * mut * mut :: libc :: c_void , desired : * mut :: libc :: c_void , order_success : aws_memory_order , order_failure : aws_memory_order) -> bool ; } extern "C" { # [doc = " Atomically compares *var to *expected; if they are equal, atomically sets *var = desired. Otherwise, *expected is set\n to the value in *var. Uses sequentially consistent memory ordering, regardless of success or failure.\n Returns true if the compare was successful and the variable updated to desired."] pub fn aws_atomic_compare_exchange_ptr (var : * mut aws_atomic_var , expected : * mut * mut :: libc :: c_void , desired : * mut :: libc :: c_void) -> bool ; } extern "C" { # [doc = " Atomically adds n to *var, and returns the previous value of *var."] pub fn aws_atomic_fetch_add_explicit (var : * mut aws_atomic_var , n : usize , order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Atomically subtracts n from *var, and returns the previous value of *var."] pub fn aws_atomic_fetch_sub_explicit (var : * mut aws_atomic_var , n : usize , order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Atomically ORs n with *var, and returns the previous value of *var."] pub fn aws_atomic_fetch_or_explicit (var : * mut aws_atomic_var , n : usize , order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Atomically ANDs n with *var, and returns the previous value of *var."] pub fn aws_atomic_fetch_and_explicit (var : * mut aws_atomic_var , n : usize , order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Atomically XORs n with *var, and returns the previous value of *var."] pub fn aws_atomic_fetch_xor_explicit (var : * mut aws_atomic_var , n : usize , order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Atomically adds n to *var, and returns the previous value of *var.\n Uses sequentially consistent ordering."] pub fn aws_atomic_fetch_add (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Atomically subtracts n from *var, and returns the previous value of *var.\n Uses sequentially consistent ordering."] pub fn aws_atomic_fetch_sub (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Atomically ands n into *var, and returns the previous value of *var.\n Uses sequentially consistent ordering."] pub fn aws_atomic_fetch_and (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Atomically ors n into *var, and returns the previous value of *var.\n Uses sequentially consistent ordering."] pub fn aws_atomic_fetch_or (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Atomically xors n into *var, and returns the previous value of *var.\n Uses sequentially consistent ordering."] pub fn aws_atomic_fetch_xor (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Provides the same reordering guarantees as an atomic operation with the specified memory order, without\n needing to actually perform an atomic operation."] pub fn aws_atomic_thread_fence (order : aws_memory_order) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_string { pub allocator : * mut aws_allocator , pub len : usize , pub bytes : [u8 ; 1usize] , } # [test] fn bindgen_test_layout_aws_string () { const UNINIT : :: std :: mem :: MaybeUninit < aws_string > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_string > () , 24usize , concat ! ("Size of: " , stringify ! (aws_string))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_string > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_string))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_string) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . len) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_string) , "::" , stringify ! (len))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bytes) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_string) , "::" , stringify ! (bytes))) ; } impl Default for aws_string { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Returns true if bytes of string are the same, false otherwise."] pub fn aws_string_eq (a : * const aws_string , b : * const aws_string) -> bool ; } extern "C" { # [doc = " Returns true if bytes of string are equivalent, using a case-insensitive comparison."] pub fn aws_string_eq_ignore_case (a : * const aws_string , b : * const aws_string) -> bool ; } extern "C" { # [doc = " Returns true if bytes of string and cursor are the same, false otherwise."] pub fn aws_string_eq_byte_cursor (str_ : * const aws_string , cur : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Returns true if bytes of string and cursor are equivalent, using a case-insensitive comparison."] pub fn aws_string_eq_byte_cursor_ignore_case (str_ : * const aws_string , cur : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Returns true if bytes of string and buffer are the same, false otherwise."] pub fn aws_string_eq_byte_buf (str_ : * const aws_string , buf : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Returns true if bytes of string and buffer are equivalent, using a case-insensitive comparison."] pub fn aws_string_eq_byte_buf_ignore_case (str_ : * const aws_string , buf : * const aws_byte_buf) -> bool ; } extern "C" { pub fn aws_string_eq_c_str (str_ : * const aws_string , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Returns true if bytes of strings are equivalent, using a case-insensitive comparison."] pub fn aws_string_eq_c_str_ignore_case (str_ : * const aws_string , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Constructor functions which copy data from null-terminated C-string or array of bytes."] pub fn aws_string_new_from_c_str (allocator : * mut aws_allocator , c_str : * const :: libc :: c_char) -> * mut aws_string ; } extern "C" { # [doc = " Allocate a new string with the same contents as array."] pub fn aws_string_new_from_array (allocator : * mut aws_allocator , bytes : * const u8 , len : usize) -> * mut aws_string ; } extern "C" { # [doc = " Allocate a new string with the same contents as another string."] pub fn aws_string_new_from_string (allocator : * mut aws_allocator , str_ : * const aws_string) -> * mut aws_string ; } extern "C" { # [doc = " Allocate a new string with the same contents as cursor."] pub fn aws_string_new_from_cursor (allocator : * mut aws_allocator , cursor : * const aws_byte_cursor) -> * mut aws_string ; } extern "C" { # [doc = " Allocate a new string with the same contents as buf."] pub fn aws_string_new_from_buf (allocator : * mut aws_allocator , buf : * const aws_byte_buf) -> * mut aws_string ; } extern "C" { # [doc = " Deallocate string."] pub fn aws_string_destroy (str_ : * mut aws_string) ; } extern "C" { # [doc = " Zeroes out the data bytes of string and then deallocates the memory.\n Not safe to run on a string created with AWS_STATIC_STRING_FROM_LITERAL."] pub fn aws_string_destroy_secure (str_ : * mut aws_string) ; } extern "C" { # [doc = " Compares lexicographical ordering of two strings. This is a binary\n byte-by-byte comparison, treating bytes as unsigned integers. It is suitable\n for either textual or binary data and is unaware of unicode or any other byte\n encoding. If both strings are identical in the bytes of the shorter string,\n then the longer string is lexicographically after the shorter.\n\n Returns a positive number if string a > string b. (i.e., string a is\n lexicographically after string b.) Returns zero if string a = string b.\n Returns negative number if string a < string b."] pub fn aws_string_compare (a : * const aws_string , b : * const aws_string) -> :: libc :: c_int ; } extern "C" { # [doc = " A convenience function for sorting lists of (const struct aws_string *) elements. This can be used as a\n comparator for aws_array_list_sort. It is just a simple wrapper around aws_string_compare."] pub fn aws_array_list_comparator_string (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies all bytes from string to buf.\n\n On success, returns true and updates the buf pointer/length\n accordingly. If there is insufficient space in the buf, returns\n false, leaving the buf unchanged."] pub fn aws_byte_buf_write_from_whole_string (buf : * mut aws_byte_buf , src : * const aws_string) -> bool ; } extern "C" { # [doc = " Creates an aws_byte_cursor from an existing string."] pub fn aws_byte_cursor_from_string (src : * const aws_string) -> aws_byte_cursor ; } extern "C" { # [doc = " If the string was dynamically allocated, clones it. If the string was statically allocated (i.e. has no allocator),\n returns the original string."] pub fn aws_string_clone_or_reuse (allocator : * mut aws_allocator , str_ : * const aws_string) -> * mut aws_string ; } extern "C" { # [doc = " Computes the length of a c string in bytes assuming the character set is either ASCII or UTF-8. If no NULL character\n is found within max_read_len of str, AWS_ERROR_C_STRING_BUFFER_NOT_NULL_TERMINATED is raised. Otherwise, str_len\n will contain the string length minus the NULL character, and AWS_OP_SUCCESS will be returned."] pub fn aws_secure_strlen (str_ : * const :: libc :: c_char , max_read_len : usize , str_len : * mut usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Equivalent to str->bytes."] pub fn aws_string_bytes (str_ : * const aws_string) -> * const u8 ; } extern "C" { # [doc = " Equivalent to `(const char *)str->bytes`."] pub fn aws_string_c_str (str_ : * const aws_string) -> * const :: libc :: c_char ; } extern "C" { # [doc = " Evaluates the set of properties that define the shape of all valid aws_string structures.\n It is also a cheap check, in the sense it run in constant time (i.e., no loops or recursion)."] pub fn aws_string_is_valid (str_ : * const aws_string) -> bool ; } extern "C" { # [doc = " Best-effort checks aws_string invariants, when the str->len is unknown"] pub fn aws_c_string_is_valid (str_ : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Evaluates if a char is a white character."] pub fn aws_char_is_space (c : u8) -> bool ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_thread_detach_state { AWS_THREAD_NOT_CREATED = 1 , AWS_THREAD_JOINABLE = 2 , AWS_THREAD_JOIN_COMPLETED = 3 , AWS_THREAD_MANAGED = 4 , } # [repr (u32)] # [non_exhaustive] # [doc = " Specifies the join strategy used on an aws_thread, which in turn controls whether or not a thread participates\n in the managed thread system. The managed thread system provides logic to guarantee a join on all participating\n threads at the cost of laziness (the user cannot control when joins happen).\n\n Manual - thread does not participate in the managed thread system; any joins must be done by the user. This\n is the default. The user must call aws_thread_clean_up(), but only after any desired join operation has completed.\n Not doing so will cause the windows handle to leak.\n\n Managed - the managed thread system will automatically perform a join some time after the thread's run function\n has completed. It is an error to call aws_thread_join on a thread configured with the managed join strategy. The\n managed thread system will call aws_thread_clean_up() on the thread after the background join has completed.\n\n Additionally, an API exists, aws_thread_join_all_managed(), which blocks and returns when all outstanding threads\n with the managed strategy have fully joined. This API is useful for tests (rather than waiting for many individual\n signals) and program shutdown or DLL unload. This API is automatically invoked by the common library clean up\n function. If the common library clean up is called from a managed thread, this will cause deadlock.\n\n Lazy thread joining is done only when threads finish their run function or when the user calls\n aws_thread_join_all_managed(). This means it may be a long time between thread function completion and the join\n being applied, but the queue of unjoined threads is always one or fewer so there is no critical resource\n backlog.\n\n Currently, only event loop group async cleanup and host resolver threads participate in the managed thread system.\n Additionally, event loop threads will increment and decrement the pending join count (they are manually joined\n internally) in order to have an accurate view of internal thread usage and also to prevent failure to release\n an event loop group fully from allowing aws_thread_join_all_managed() from running to completion when its\n intent is such that it should block instead."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_thread_join_strategy { AWS_TJS_MANUAL = 0 , AWS_TJS_MANAGED = 1 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_thread_options { pub stack_size : usize , pub cpu_id : i32 , pub join_strategy : aws_thread_join_strategy , # [doc = " Thread name, for debugging purpose.\n The length should not exceed AWS_THREAD_NAME_RECOMMENDED_STRLEN(15)\n if you want it to display properly on all platforms."] pub name : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_thread_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_thread_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_thread_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_thread_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_thread_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_thread_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . stack_size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_thread_options) , "::" , stringify ! (stack_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cpu_id) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_thread_options) , "::" , stringify ! (cpu_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . join_strategy) as usize - ptr as usize } , 12usize , concat ! ("Offset of field: " , stringify ! (aws_thread_options) , "::" , stringify ! (join_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . name) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_thread_options) , "::" , stringify ! (name))) ; } impl Default for aws_thread_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_thread_once = pthread_once_t ; pub type aws_thread_id_t = pthread_t ; # [repr (C)] pub struct aws_thread { pub allocator : * mut aws_allocator , pub detach_state : aws_thread_detach_state , pub thread_id : aws_thread_id_t , } # [test] fn bindgen_test_layout_aws_thread () { const UNINIT : :: std :: mem :: MaybeUninit < aws_thread > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_thread > () , 24usize , concat ! ("Size of: " , stringify ! (aws_thread))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_thread > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_thread))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_thread) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . detach_state) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_thread) , "::" , stringify ! (detach_state))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . thread_id) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_thread) , "::" , stringify ! (thread_id))) ; } impl Default for aws_thread { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Returns an instance of system default thread options."] pub fn aws_default_thread_options () -> * const aws_thread_options ; } extern "C" { pub fn aws_thread_call_once (flag : * mut aws_thread_once , call_once : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: libc :: c_void) > , user_data : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Initializes a new platform specific thread object struct (not the os-level\n thread itself)."] pub fn aws_thread_init (thread : * mut aws_thread , allocator : * mut aws_allocator) -> :: libc :: c_int ; } extern "C" { # [doc = " Creates an OS level thread and associates it with func. context will be passed to func when it is executed.\n options will be applied to the thread if they are applicable for the platform.\n\n After launch, you may join on the thread. A successfully launched thread must have clean_up called on it in order\n to avoid a handle leak. If you do not join before calling clean_up, the thread will become detached.\n\n Managed threads must not have join or clean_up called on them by external code."] pub fn aws_thread_launch (thread : * mut aws_thread , func : :: std :: option :: Option < unsafe extern "C" fn (arg : * mut :: libc :: c_void) > , arg : * mut :: libc :: c_void , options : * const aws_thread_options) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the id of thread"] pub fn aws_thread_get_id (thread : * mut aws_thread) -> aws_thread_id_t ; } extern "C" { # [doc = " Gets the detach state of the thread. For example, is it safe to call join on\n this thread? Has it been detached()?"] pub fn aws_thread_get_detach_state (thread : * mut aws_thread) -> aws_thread_detach_state ; } extern "C" { # [doc = " Joins the calling thread to a thread instance. Returns when thread is\n finished. Calling this from the associated OS thread will cause a deadlock."] pub fn aws_thread_join (thread : * mut aws_thread) -> :: libc :: c_int ; } extern "C" { # [doc = " Blocking call that waits for all managed threads to complete their join call. This can only be called\n from the main thread or a non-managed thread.\n\n This gets called automatically from library cleanup.\n\n By default the wait is unbounded, but that default can be overridden via aws_thread_set_managed_join_timeout_ns()"] pub fn aws_thread_join_all_managed () -> :: libc :: c_int ; } extern "C" { # [doc = " Overrides how long, in nanoseconds, that aws_thread_join_all_managed will wait for threads to complete.\n A value of zero will result in an unbounded wait."] pub fn aws_thread_set_managed_join_timeout_ns (timeout_in_ns : u64) ; } extern "C" { # [doc = " Cleans up the thread handle. Don't call this on a managed thread. If you wish to join the thread, you must join\n before calling this function."] pub fn aws_thread_clean_up (thread : * mut aws_thread) ; } extern "C" { # [doc = " Returns the thread id of the calling thread."] pub fn aws_thread_current_thread_id () -> aws_thread_id_t ; } extern "C" { # [doc = " Compare thread ids."] pub fn aws_thread_thread_id_equal (t1 : aws_thread_id_t , t2 : aws_thread_id_t) -> bool ; } extern "C" { # [doc = " Sleeps the current thread by nanos."] pub fn aws_thread_current_sleep (nanos : u64) ; } pub type aws_thread_atexit_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; extern "C" { # [doc = " Adds a callback to the chain to be called when the current thread joins.\n Callbacks are called from the current thread, in the reverse order they\n were added, after the thread function returns.\n If not called from within an aws_thread, has no effect."] pub fn aws_thread_current_at_exit (callback : aws_thread_atexit_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Increments the count of unjoined threads in the managed thread system. Used by managed threads and\n event loop threads. Additional usage requires the user to join corresponding threads themselves and\n correctly increment/decrement even in the face of launch/join errors.\n\n aws_thread_join_all_managed() will not return until this count has gone to zero."] pub fn aws_thread_increment_unjoined_count () ; } extern "C" { # [doc = " Decrements the count of unjoined threads in the managed thread system. Used by managed threads and\n event loop threads. Additional usage requires the user to join corresponding threads themselves and\n correctly increment/decrement even in the face of launch/join errors.\n\n aws_thread_join_all_managed() will not return until this count has gone to zero."] pub fn aws_thread_decrement_unjoined_count () ; } extern "C" { # [doc = " Gets name of the current thread.\n Caller is responsible for destroying returned string.\n If thread does not have a name, AWS_OP_SUCCESS is returned and out_name is\n set to NULL.\n If underlying OS call fails, AWS_ERROR_SYS_CALL_FAILURE will be raised\n If OS does not support getting thread name, AWS_ERROR_PLATFORM_NOT_SUPPORTED\n will be raised"] pub fn aws_thread_current_name (allocator : * mut aws_allocator , out_name : * mut * mut aws_string) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets name of the thread.\n Caller is responsible for destroying returned string.\n If thread does not have a name, AWS_OP_SUCCESS is returned and out_name is\n set to NULL.\n If underlying OS call fails, AWS_ERROR_SYS_CALL_FAILURE will be raised\n If OS does not support getting thread name, AWS_ERROR_PLATFORM_NOT_SUPPORTED\n will be raised"] pub fn aws_thread_name (allocator : * mut aws_allocator , thread_id : aws_thread_id_t , out_name : * mut * mut aws_string) -> :: libc :: c_int ; } pub mod aws_log_level { # [doc = " Controls what log calls pass through the logger and what log calls get filtered out.\n If a log level has a value of X, then all log calls using a level <= X will appear, while\n those using a value > X will not occur.\n\n You can filter both dynamically (by setting the log level on the logger object) or statically\n (by defining AWS_STATIC_LOG_LEVEL to be an appropriate integer module-wide). Statically filtered\n log calls will be completely compiled out but require a rebuild if you want to get more detail\n about what's happening."] pub type Type = :: libc :: c_uint ; pub const AWS_LL_NONE : Type = 0 ; pub const AWS_LL_FATAL : Type = 1 ; pub const AWS_LL_ERROR : Type = 2 ; pub const AWS_LL_WARN : Type = 3 ; pub const AWS_LL_INFO : Type = 4 ; pub const AWS_LL_DEBUG : Type = 5 ; pub const AWS_LL_TRACE : Type = 6 ; pub const AWS_LL_COUNT : Type = 7 ; } # [doc = " Log subject is a way of designating the topic of logging.\n\n The general idea is to support a finer-grained approach to log level control. The primary use case\n is for situations that require more detailed logging within a specific domain, where enabling that detail\n globally leads to an untenable flood of information.\n\n For example, enable TRACE logging for tls-related log statements (handshake binary payloads), but\n only WARN logging everywhere else (because http payloads would blow up the log files).\n\n Log subject is an enum similar to aws error: each library has its own value-space and someone is\n responsible for registering the value <-> string connections."] pub type aws_log_subject_t = u32 ; pub const AWS_LOG_SUBJECT_STRIDE_BITS : _bindgen_ty_20 = _bindgen_ty_20 :: AWS_LOG_SUBJECT_STRIDE_BITS ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_20 { AWS_LOG_SUBJECT_STRIDE_BITS = 10 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_subject_info { pub subject_id : aws_log_subject_t , pub subject_name : * const :: libc :: c_char , pub subject_description : * const :: libc :: c_char , } # [test] fn bindgen_test_layout_aws_log_subject_info () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_subject_info > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_subject_info > () , 24usize , concat ! ("Size of: " , stringify ! (aws_log_subject_info))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_subject_info > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_subject_info))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subject_id) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_subject_info) , "::" , stringify ! (subject_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subject_name) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_subject_info) , "::" , stringify ! (subject_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subject_description) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_log_subject_info) , "::" , stringify ! (subject_description))) ; } impl Default for aws_log_subject_info { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_subject_info_list { pub subject_list : * mut aws_log_subject_info , pub count : usize , } # [test] fn bindgen_test_layout_aws_log_subject_info_list () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_subject_info_list > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_subject_info_list > () , 16usize , concat ! ("Size of: " , stringify ! (aws_log_subject_info_list))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_subject_info_list > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_subject_info_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subject_list) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_subject_info_list) , "::" , stringify ! (subject_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . count) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_subject_info_list) , "::" , stringify ! (count))) ; } impl Default for aws_log_subject_info_list { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_common_log_subject { AWS_LS_COMMON_GENERAL = 0 , AWS_LS_COMMON_TASK_SCHEDULER = 1 , AWS_LS_COMMON_THREAD = 2 , AWS_LS_COMMON_MEMTRACE = 3 , AWS_LS_COMMON_XML_PARSER = 4 , AWS_LS_COMMON_IO = 5 , AWS_LS_COMMON_BUS = 6 , AWS_LS_COMMON_TEST = 7 , AWS_LS_COMMON_JSON_PARSER = 8 , AWS_LS_COMMON_LAST = 1023 , } # [doc = " We separate the log level function from the log call itself so that we can do the filter check in the macros (see\n below)\n\n By doing so, we make it so that the variadic format arguments are not even evaluated if the filter check does not\n succeed."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_logger_vtable { pub log : :: std :: option :: Option < unsafe extern "C" fn (logger : * mut aws_logger , log_level : aws_log_level :: Type , subject : aws_log_subject_t , format : * const :: libc :: c_char , ...) -> :: libc :: c_int > , pub get_log_level : :: std :: option :: Option < unsafe extern "C" fn (logger : * mut aws_logger , subject : aws_log_subject_t) -> aws_log_level :: Type > , pub clean_up : :: std :: option :: Option < unsafe extern "C" fn (logger : * mut aws_logger) > , pub set_log_level : :: std :: option :: Option < unsafe extern "C" fn (logger : * mut aws_logger , arg1 : aws_log_level :: Type) -> :: libc :: c_int > , } # [test] fn bindgen_test_layout_aws_logger_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_logger_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_logger_vtable > () , 32usize , concat ! ("Size of: " , stringify ! (aws_logger_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_logger_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_logger_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . log) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_logger_vtable) , "::" , stringify ! (log))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_log_level) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_logger_vtable) , "::" , stringify ! (get_log_level))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clean_up) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_logger_vtable) , "::" , stringify ! (clean_up))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . set_log_level) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_logger_vtable) , "::" , stringify ! (set_log_level))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_logger { pub vtable : * mut aws_logger_vtable , pub allocator : * mut aws_allocator , pub p_impl : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_logger () { const UNINIT : :: std :: mem :: MaybeUninit < aws_logger > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_logger > () , 24usize , concat ! ("Size of: " , stringify ! (aws_logger))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_logger > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_logger))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_logger) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_logger) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . p_impl) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_logger) , "::" , stringify ! (p_impl))) ; } impl Default for aws_logger { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_logger_pipeline { pub formatter : * mut aws_log_formatter , pub channel : * mut aws_log_channel , pub writer : * mut aws_log_writer , pub allocator : * mut aws_allocator , pub level : aws_atomic_var , } # [test] fn bindgen_test_layout_aws_logger_pipeline () { const UNINIT : :: std :: mem :: MaybeUninit < aws_logger_pipeline > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_logger_pipeline > () , 40usize , concat ! ("Size of: " , stringify ! (aws_logger_pipeline))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_logger_pipeline > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_logger_pipeline))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . formatter) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_logger_pipeline) , "::" , stringify ! (formatter))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . channel) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_logger_pipeline) , "::" , stringify ! (channel))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . writer) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_logger_pipeline) , "::" , stringify ! (writer))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_logger_pipeline) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . level) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_logger_pipeline) , "::" , stringify ! (level))) ; } impl Default for aws_logger_pipeline { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Options for aws_logger_init_standard().\n Set `filename` to open a file for logging and close it when the logger cleans up.\n Set `file` to use a file that is already open, such as `stderr` or `stdout`."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_logger_standard_options { pub level : aws_log_level :: Type , pub filename : * const :: libc :: c_char , pub file : * mut FILE , } # [test] fn bindgen_test_layout_aws_logger_standard_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_logger_standard_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_logger_standard_options > () , 24usize , concat ! ("Size of: " , stringify ! (aws_logger_standard_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_logger_standard_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_logger_standard_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . level) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_logger_standard_options) , "::" , stringify ! (level))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . filename) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_logger_standard_options) , "::" , stringify ! (filename))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . file) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_logger_standard_options) , "::" , stringify ! (file))) ; } impl Default for aws_logger_standard_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Sets the aws logger used globally across the process. Not thread-safe. Must only be called once."] pub fn aws_logger_set (logger : * mut aws_logger) ; } extern "C" { # [doc = " Gets the aws logger used globally across the process."] pub fn aws_logger_get () -> * mut aws_logger ; } extern "C" { # [doc = " Gets the aws logger used globally across the process if the logging level is at least the inputted level.\n\n @param subject log subject to perform the level check versus, not currently used\n @param level logging level to check against in order to return the logger\n @return the current logger if the current logging level is at or more detailed then the supplied logging level"] pub fn aws_logger_get_conditional (subject : aws_log_subject_t , level : aws_log_level :: Type) -> * mut aws_logger ; } extern "C" { # [doc = " Cleans up all resources used by the logger; simply invokes the clean_up v-function"] pub fn aws_logger_clean_up (logger : * mut aws_logger) ; } extern "C" { # [doc = " Sets the current logging level for the logger. Loggers are not require to support this.\n @param logger logger to set the log level for\n @param level new log level for the logger\n @return AWS_OP_SUCCESS if the level was successfully set, AWS_OP_ERR otherwise"] pub fn aws_logger_set_log_level (logger : * mut aws_logger , level : aws_log_level :: Type) -> :: libc :: c_int ; } extern "C" { # [doc = " Converts a log level to a c-string constant. Intended primarily to support building log lines that\n include the level in them, i.e.\n\n [ERROR] 10:34:54.642 01-31-19 - Json parse error...."] pub fn aws_log_level_to_string (log_level : aws_log_level :: Type , level_string : * mut * const :: libc :: c_char) -> :: libc :: c_int ; } extern "C" { # [doc = " Converts a c-string constant to a log level value. Uses case-insensitive comparison\n and simply iterates all possibilities until a match or nothing remains. If no match\n is found, AWS_OP_ERR is returned."] pub fn aws_string_to_log_level (level_string : * const :: libc :: c_char , log_level : * mut aws_log_level :: Type) -> :: libc :: c_int ; } extern "C" { # [doc = " Converts an aws_thread_id_t to a c-string. For portability, aws_thread_id_t\n must not be printed directly. Intended primarily to support building log\n lines that include the thread id in them. The parameter `buffer` must\n point-to a char buffer of length `bufsz == AWS_THREAD_ID_T_REPR_BUFSZ`. The\n thread id representation is returned in `buffer`."] pub fn aws_thread_id_t_to_string (thread_id : aws_thread_id_t , buffer : * mut :: libc :: c_char , bufsz : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Get subject name from log subject."] pub fn aws_log_subject_name (subject : aws_log_subject_t) -> * const :: libc :: c_char ; } extern "C" { # [doc = " Connects log subject strings with log subject integer values"] pub fn aws_register_log_subject_info_list (log_subject_list : * mut aws_log_subject_info_list) ; } extern "C" { # [doc = " Disconnects log subject strings with log subject integer values"] pub fn aws_unregister_log_subject_info_list (log_subject_list : * mut aws_log_subject_info_list) ; } extern "C" { pub fn aws_logger_init_standard (logger : * mut aws_logger , allocator : * mut aws_allocator , options : * mut aws_logger_standard_options) -> :: libc :: c_int ; } extern "C" { pub fn aws_logger_init_from_external (logger : * mut aws_logger , allocator : * mut aws_allocator , formatter : * mut aws_log_formatter , channel : * mut aws_log_channel , writer : * mut aws_log_writer , level : aws_log_level :: Type) -> :: libc :: c_int ; } extern "C" { pub static mut g_pipeline_logger_owned_vtable : aws_logger_vtable ; } extern "C" { pub fn aws_logger_init_noalloc (logger : * mut aws_logger , allocator : * mut aws_allocator , options : * mut aws_logger_standard_options) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_io_log_subject { AWS_LS_IO_GENERAL = 1024 , AWS_LS_IO_EVENT_LOOP = 1025 , AWS_LS_IO_SOCKET = 1026 , AWS_LS_IO_SOCKET_HANDLER = 1027 , AWS_LS_IO_TLS = 1028 , AWS_LS_IO_ALPN = 1029 , AWS_LS_IO_DNS = 1030 , AWS_LS_IO_PKI = 1031 , AWS_LS_IO_CHANNEL = 1032 , AWS_LS_IO_CHANNEL_BOOTSTRAP = 1033 , AWS_LS_IO_FILE_UTILS = 1034 , AWS_LS_IO_SHARED_LIBRARY = 1035 , AWS_LS_IO_EXPONENTIAL_BACKOFF_RETRY_STRATEGY = 1036 , AWS_LS_IO_STANDARD_RETRY_STRATEGY = 1037 , AWS_LS_IO_PKCS11 = 1038 , AWS_IO_LS_LAST = 2047 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_sdkutils_errors { AWS_ERROR_SDKUTILS_GENERAL = 15360 , AWS_ERROR_SDKUTILS_PARSE_FATAL = 15361 , AWS_ERROR_SDKUTILS_PARSE_RECOVERABLE = 15362 , AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_RULESET = 15363 , AWS_ERROR_SDKUTILS_ENDPOINTS_PARSE_FAILED = 15364 , AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_INIT_FAILED = 15365 , AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_FAILED = 15366 , AWS_ERROR_SDKUTILS_ENDPOINTS_EMPTY_RULESET = 15367 , AWS_ERROR_SDKUTILS_ENDPOINTS_RULESET_EXHAUSTED = 15368 , AWS_ERROR_SDKUTILS_PARTITIONS_UNSUPPORTED = 15369 , AWS_ERROR_SDKUTILS_PARTITIONS_PARSE_FAILED = 15370 , AWS_ERROR_SDKUTILS_END_RANGE = 16383 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_sdkutils_log_subject { AWS_LS_SDKUTILS_GENERAL = 15360 , AWS_LS_SDKUTILS_PROFILE = 15361 , AWS_LS_SDKUTILS_ENDPOINTS_PARSING = 15362 , AWS_LS_SDKUTILS_ENDPOINTS_RESOLVE = 15363 , AWS_LS_SDKUTILS_ENDPOINTS_GENERAL = 15364 , AWS_LS_SDKUTILS_PARTITIONS_PARSING = 15365 , AWS_LS_SDKUTILS_LAST = 16383 , } extern "C" { pub fn aws_sdkutils_library_init (allocator : * mut aws_allocator) ; } extern "C" { pub fn aws_sdkutils_library_clean_up () ; } # [repr (u32)] # [non_exhaustive] # [doc = " Auth-specific error codes"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_auth_errors { AWS_AUTH_PROFILE_PARSE_RECOVERABLE_ERROR = 15362 , AWS_AUTH_PROFILE_PARSE_FATAL_ERROR = 15361 , AWS_AUTH_SIGNING_UNSUPPORTED_ALGORITHM = 6144 , AWS_AUTH_SIGNING_MISMATCHED_CONFIGURATION = 6145 , AWS_AUTH_SIGNING_NO_CREDENTIALS = 6146 , AWS_AUTH_SIGNING_ILLEGAL_REQUEST_QUERY_PARAM = 6147 , AWS_AUTH_SIGNING_ILLEGAL_REQUEST_HEADER = 6148 , AWS_AUTH_SIGNING_INVALID_CONFIGURATION = 6149 , AWS_AUTH_CREDENTIALS_PROVIDER_INVALID_ENVIRONMENT = 6150 , AWS_AUTH_CREDENTIALS_PROVIDER_INVALID_DELEGATE = 6151 , AWS_AUTH_CREDENTIALS_PROVIDER_PROFILE_SOURCE_FAILURE = 6152 , AWS_AUTH_CREDENTIALS_PROVIDER_IMDS_SOURCE_FAILURE = 6153 , AWS_AUTH_CREDENTIALS_PROVIDER_STS_SOURCE_FAILURE = 6154 , AWS_AUTH_CREDENTIALS_PROVIDER_HTTP_STATUS_FAILURE = 6155 , AWS_AUTH_PROVIDER_PARSER_UNEXPECTED_RESPONSE = 6156 , AWS_AUTH_CREDENTIALS_PROVIDER_ECS_SOURCE_FAILURE = 6157 , AWS_AUTH_CREDENTIALS_PROVIDER_X509_SOURCE_FAILURE = 6158 , AWS_AUTH_CREDENTIALS_PROVIDER_PROCESS_SOURCE_FAILURE = 6159 , AWS_AUTH_CREDENTIALS_PROVIDER_STS_WEB_IDENTITY_SOURCE_FAILURE = 6160 , AWS_AUTH_SIGNING_UNSUPPORTED_SIGNATURE_TYPE = 6161 , AWS_AUTH_SIGNING_MISSING_PREVIOUS_SIGNATURE = 6162 , AWS_AUTH_SIGNING_INVALID_CREDENTIALS = 6163 , AWS_AUTH_CANONICAL_REQUEST_MISMATCH = 6164 , AWS_AUTH_SIGV4A_SIGNATURE_VALIDATION_FAILURE = 6165 , AWS_AUTH_CREDENTIALS_PROVIDER_COGNITO_SOURCE_FAILURE = 6166 , AWS_AUTH_CREDENTIALS_PROVIDER_DELEGATE_FAILURE = 6167 , AWS_AUTH_SSO_TOKEN_PROVIDER_SOURCE_FAILURE = 6168 , AWS_AUTH_SSO_TOKEN_INVALID = 6169 , AWS_AUTH_SSO_TOKEN_EXPIRED = 6170 , AWS_AUTH_CREDENTIALS_PROVIDER_SSO_SOURCE_FAILURE = 6171 , AWS_AUTH_ERROR_END_RANGE = 7167 , } # [repr (u32)] # [non_exhaustive] # [doc = " Auth-specific logging subjects"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_auth_log_subject { AWS_LS_AUTH_GENERAL = 6144 , AWS_LS_AUTH_PROFILE = 6145 , AWS_LS_AUTH_CREDENTIALS_PROVIDER = 6146 , AWS_LS_AUTH_SIGNING = 6147 , AWS_LS_IMDS_CLIENT = 6148 , AWS_LS_AUTH_LAST = 7167 , } extern "C" { # [doc = " Initializes internal datastructures used by aws-c-auth.\n Must be called before using any functionality in aws-c-auth.\n\n @param allocator memory allocator to use for any module-level memory allocation"] pub fn aws_auth_library_init (allocator : * mut aws_allocator) ; } extern "C" { # [doc = " Clean up internal datastructures used by aws-c-auth.\n Must not be called until application is done using functionality in aws-c-auth."] pub fn aws_auth_library_clean_up () ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_auth_http_system_vtable { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_ecc_key_pair { _unused : [u8 ; 0] , } extern "C" { pub static aws_sts_assume_role_default_duration_secs : u16 ; } pub type aws_on_get_credentials_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (credentials : * mut aws_credentials , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_credentials_provider_get_credentials_fn = :: std :: option :: Option < unsafe extern "C" fn (provider : * mut aws_credentials_provider , callback : aws_on_get_credentials_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; pub type aws_credentials_provider_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (provider : * mut aws_credentials_provider) > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_credentials_provider_vtable { pub get_credentials : aws_credentials_provider_get_credentials_fn , pub destroy : aws_credentials_provider_destroy_fn , } # [test] fn bindgen_test_layout_aws_credentials_provider_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_credentials) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_vtable) , "::" , stringify ! (get_credentials))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_vtable) , "::" , stringify ! (destroy))) ; } pub type aws_credentials_provider_shutdown_completed_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_shutdown_options { pub shutdown_callback : aws_credentials_provider_shutdown_completed_fn , pub shutdown_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_credentials_provider_shutdown_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_shutdown_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_shutdown_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_shutdown_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_shutdown_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_shutdown_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_user_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_shutdown_options) , "::" , stringify ! (shutdown_user_data))) ; } impl Default for aws_credentials_provider_shutdown_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " A baseclass for credentials providers. A credentials provider is an object that has an asynchronous\n query function for retrieving AWS credentials.\n\n Ref-counted. Thread-safe."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider { pub vtable : * mut aws_credentials_provider_vtable , pub allocator : * mut aws_allocator , pub shutdown_options : aws_credentials_provider_shutdown_options , pub impl_ : * mut :: libc :: c_void , pub ref_count : aws_atomic_var , } # [test] fn bindgen_test_layout_aws_credentials_provider () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider > () , 48usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider) , "::" , stringify ! (ref_count))) ; } impl Default for aws_credentials_provider { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for a provider that returns a fixed set of credentials"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_static_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub access_key_id : aws_byte_cursor , pub secret_access_key : aws_byte_cursor , pub session_token : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_credentials_provider_static_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_static_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_static_options > () , 64usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_static_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_static_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_static_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_static_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . access_key_id) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_static_options) , "::" , stringify ! (access_key_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . secret_access_key) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_static_options) , "::" , stringify ! (secret_access_key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . session_token) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_static_options) , "::" , stringify ! (session_token))) ; } impl Default for aws_credentials_provider_static_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for a provider that returns credentials based on environment variable values"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_environment_options { pub shutdown_options : aws_credentials_provider_shutdown_options , } # [test] fn bindgen_test_layout_aws_credentials_provider_environment_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_environment_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_environment_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_environment_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_environment_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_environment_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_environment_options) , "::" , stringify ! (shutdown_options))) ; } impl Default for aws_credentials_provider_environment_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for a provider that sources credentials from the aws config and credentials files\n (by default ~/.aws/config and ~/.aws/credentials)"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_profile_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub profile_name_override : aws_byte_cursor , pub config_file_name_override : aws_byte_cursor , pub credentials_file_name_override : aws_byte_cursor , # [doc = " (Optional)\n Use a cached merged profile collection. A merge collection has both config file\n (~/.aws/config) and credentials file based profile collection (~/.aws/credentials) using\n `aws_profile_collection_new_from_merge`.\n If this option is provided, `config_file_name_override` and `credentials_file_name_override` will be ignored."] pub profile_collection_cached : * mut aws_profile_collection , pub bootstrap : * mut aws_client_bootstrap , pub tls_ctx : * mut aws_tls_ctx , pub function_table : * mut aws_auth_http_system_vtable , } # [test] fn bindgen_test_layout_aws_credentials_provider_profile_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_profile_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_profile_options > () , 96usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_profile_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_profile_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_profile_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_name_override) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (profile_name_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_file_name_override) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (config_file_name_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . credentials_file_name_override) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (credentials_file_name_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_collection_cached) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (profile_collection_cached))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (function_table))) ; } impl Default for aws_credentials_provider_profile_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for a provider that functions as a caching decorator. Credentials sourced through this\n provider will be cached within it until their expiration time. When the cached credentials expire, new\n credentials will be fetched when next queried."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_cached_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub source : * mut aws_credentials_provider , pub refresh_time_in_milliseconds : u64 , pub high_res_clock_fn : aws_io_clock_fn , pub system_clock_fn : aws_io_clock_fn , } # [test] fn bindgen_test_layout_aws_credentials_provider_cached_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_cached_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_cached_options > () , 48usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_cached_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_cached_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_cached_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cached_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . source) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cached_options) , "::" , stringify ! (source))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . refresh_time_in_milliseconds) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cached_options) , "::" , stringify ! (refresh_time_in_milliseconds))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . high_res_clock_fn) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cached_options) , "::" , stringify ! (high_res_clock_fn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . system_clock_fn) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cached_options) , "::" , stringify ! (system_clock_fn))) ; } impl Default for aws_credentials_provider_cached_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for a provider that queries, in order, a list of providers. This provider uses the\n first set of credentials successfully queried. Providers are queried one at a time; a provider is not queried\n until the preceding provider has failed to source credentials."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_chain_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub providers : * mut * mut aws_credentials_provider , pub provider_count : usize , } # [test] fn bindgen_test_layout_aws_credentials_provider_chain_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_chain_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_chain_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_chain_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_chain_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_chain_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . providers) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_options) , "::" , stringify ! (providers))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . provider_count) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_options) , "::" , stringify ! (provider_count))) ; } impl Default for aws_credentials_provider_chain_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_imds_protocol_version { # [doc = " Defaults to IMDS_PROTOCOL_V2. It can be set to either one and IMDS Client\n will figure out (by looking at response code) which protocol an instance\n is using. But a more clear setting will reduce unnecessary network request."] IMDS_PROTOCOL_V2 = 0 , # [doc = " Defaults to IMDS_PROTOCOL_V2. It can be set to either one and IMDS Client\n will figure out (by looking at response code) which protocol an instance\n is using. But a more clear setting will reduce unnecessary network request."] IMDS_PROTOCOL_V1 = 1 , } # [doc = " Configuration options for the provider that sources credentials from ec2 instance metadata"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_imds_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , pub imds_version : aws_imds_protocol_version , pub function_table : * mut aws_auth_http_system_vtable , } # [test] fn bindgen_test_layout_aws_credentials_provider_imds_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_imds_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_imds_options > () , 40usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_imds_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_imds_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_imds_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_imds_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_imds_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . imds_version) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_imds_options) , "::" , stringify ! (imds_version))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_imds_options) , "::" , stringify ! (function_table))) ; } impl Default for aws_credentials_provider_imds_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_ecs_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , pub host : aws_byte_cursor , pub path_and_query : aws_byte_cursor , pub auth_token : aws_byte_cursor , pub tls_ctx : * mut aws_tls_ctx , pub function_table : * mut aws_auth_http_system_vtable , pub port : u16 , } # [test] fn bindgen_test_layout_aws_credentials_provider_ecs_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_ecs_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_ecs_options > () , 96usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_ecs_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_ecs_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_ecs_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . path_and_query) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (path_and_query))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . auth_token) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (auth_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (function_table))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (port))) ; } impl Default for aws_credentials_provider_ecs_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for the X509 credentials provider\n\n The x509 credentials provider sources temporary credentials from AWS IoT Core using TLS mutual authentication.\n See details: https://docs.aws.amazon.com/iot/latest/developerguide/authorizing-direct-aws.html\n An end to end demo with detailed steps can be found here:\n https://aws.amazon.com/blogs/security/how-to-eliminate-the-need-for-hardcoded-aws-credentials-in-devices-by-using-the-aws-iot-credentials-provider/"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_x509_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , pub tls_connection_options : * const aws_tls_connection_options , pub thing_name : aws_byte_cursor , pub role_alias : aws_byte_cursor , # [doc = " Per-account X509 credentials sourcing endpoint."] pub endpoint : aws_byte_cursor , # [doc = " (Optional) Http proxy configuration for the http request that fetches credentials"] pub proxy_options : * const aws_http_proxy_options , pub function_table : * mut aws_auth_http_system_vtable , } # [test] fn bindgen_test_layout_aws_credentials_provider_x509_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_x509_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_x509_options > () , 96usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_x509_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_x509_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_x509_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_connection_options) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (tls_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . thing_name) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (thing_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . role_alias) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (role_alias))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoint) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (endpoint))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_options) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (function_table))) ; } impl Default for aws_credentials_provider_x509_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for the STS web identity provider\n\n Sts with web identity credentials provider sources a set of temporary security credentials for users who have been\n authenticated in a mobile or web application with a web identity provider.\n Example providers include Amazon Cognito, Login with Amazon, Facebook, Google, or any OpenID Connect-compatible\n identity provider like Elastic Kubernetes Service\n https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html\n The required parameters used in the request (region, roleArn, sessionName, tokenFilePath) are automatically resolved\n by SDK from envrionment variables or config file.\n---------------------------------------------------------------------------------\n| Parameter | Environment Variable Name | Config File Property Name |\n----------------------------------------------------------------------------------\n| region | AWS_DEFAULT_REGION | region |\n| role_arn | AWS_ROLE_ARN | role_arn |\n| role_session_name | AWS_ROLE_SESSION_NAME | role_session_name |\n| token_file_path | AWS_WEB_IDENTITY_TOKEN_FILE | web_identity_token_file |\n|--------------------------------------------------------------------------------|"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_sts_web_identity_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , # [doc = " (Optional)\n Use a cached config profile collection. You can also pass a merged collection."] pub config_profile_collection_cached : * mut aws_profile_collection , pub tls_ctx : * mut aws_tls_ctx , pub function_table : * mut aws_auth_http_system_vtable , pub profile_name_override : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_credentials_provider_sts_web_identity_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_sts_web_identity_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_sts_web_identity_options > () , 64usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_sts_web_identity_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_sts_web_identity_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_sts_web_identity_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_profile_collection_cached) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (config_profile_collection_cached))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (function_table))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_name_override) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (profile_name_override))) ; } impl Default for aws_credentials_provider_sts_web_identity_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_sso_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub profile_name_override : aws_byte_cursor , pub config_file_name_override : aws_byte_cursor , # [doc = " (Optional)\n Use a cached config profile collection. You can also pass a merged collection.\n config_file_name_override will be ignored if this option is provided."] pub config_file_cached : * mut aws_profile_collection , pub bootstrap : * mut aws_client_bootstrap , pub tls_ctx : * mut aws_tls_ctx , pub function_table : * mut aws_auth_http_system_vtable , pub system_clock_fn : aws_io_clock_fn , } # [test] fn bindgen_test_layout_aws_credentials_provider_sso_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_sso_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_sso_options > () , 88usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_sso_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_sso_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_sso_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_name_override) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (profile_name_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_file_name_override) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (config_file_name_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_file_cached) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (config_file_cached))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (function_table))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . system_clock_fn) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (system_clock_fn))) ; } impl Default for aws_credentials_provider_sso_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for the STS credentials provider"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_sts_options { pub bootstrap : * mut aws_client_bootstrap , pub tls_ctx : * mut aws_tls_ctx , pub creds_provider : * mut aws_credentials_provider , pub role_arn : aws_byte_cursor , pub session_name : aws_byte_cursor , pub duration_seconds : u16 , # [doc = " (Optional) Http proxy configuration for the AssumeRole http request that fetches credentials"] pub http_proxy_options : * const aws_http_proxy_options , pub shutdown_options : aws_credentials_provider_shutdown_options , pub function_table : * mut aws_auth_http_system_vtable , pub system_clock_fn : aws_io_clock_fn , } # [test] fn bindgen_test_layout_aws_credentials_provider_sts_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_sts_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_sts_options > () , 104usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_sts_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_sts_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_sts_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . creds_provider) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (creds_provider))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . role_arn) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (role_arn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . session_name) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (session_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . duration_seconds) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (duration_seconds))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http_proxy_options) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (http_proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (function_table))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . system_clock_fn) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (system_clock_fn))) ; } impl Default for aws_credentials_provider_sts_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for the process credentials provider\n\n The process credentials provider sources credentials from running a command or process.\n The command to run is sourced from a profile in the AWS config file, using the standard\n profile selection rules. The profile key the command is read from is \"credential_process.\"\n E.g.:\n [default]\n credential_process=/opt/amazon/bin/my-credential-fetcher --argsA=abc\n On successfully running the command, the output should be a json data with the following\n format:\n {\n\"Version\": 1,\n\"AccessKeyId\": \"accesskey\",\n\"SecretAccessKey\": \"secretAccessKey\"\n\"SessionToken\": \"....\",\n\"Expiration\": \"2019-05-29T00:21:43Z\"\n}\n Version here identifies the command output format version."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_process_options { pub shutdown_options : aws_credentials_provider_shutdown_options , # [doc = " In which profile name to look for credential_process,\n if not provided, we will try environment variable: AWS_PROFILE."] pub profile_to_use : aws_byte_cursor , # [doc = " (Optional)\n Use a cached config profile collection. You can also pass a merged collection."] pub config_profile_collection_cached : * mut aws_profile_collection , } # [test] fn bindgen_test_layout_aws_credentials_provider_process_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_process_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_process_options > () , 40usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_process_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_process_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_process_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_process_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_to_use) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_process_options) , "::" , stringify ! (profile_to_use))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_profile_collection_cached) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_process_options) , "::" , stringify ! (config_profile_collection_cached))) ; } impl Default for aws_credentials_provider_process_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for the default credentials provider chain."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_chain_default_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , pub tls_ctx : * mut aws_tls_ctx , # [doc = " (Optional)\n Use a cached merged profile collection. A merge collection has both config file\n (~/.aws/config) and credentials file based profile collection (~/.aws/credentials) using\n `aws_profile_collection_new_from_merge`.\n If this option is provided, `config_file_name_override` and `credentials_file_name_override` will be ignored."] pub profile_collection_cached : * mut aws_profile_collection , pub profile_name_override : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_credentials_provider_chain_default_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_chain_default_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_chain_default_options > () , 56usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_chain_default_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_chain_default_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_chain_default_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_default_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_default_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_default_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_collection_cached) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_default_options) , "::" , stringify ! (profile_collection_cached))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_name_override) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_default_options) , "::" , stringify ! (profile_name_override))) ; } impl Default for aws_credentials_provider_chain_default_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_credentials_provider_delegate_get_credentials_fn = :: std :: option :: Option < unsafe extern "C" fn (delegate_user_data : * mut :: libc :: c_void , callback : aws_on_get_credentials_callback_fn , callback_user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Configuration options for the delegate credentials provider."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_delegate_options { pub shutdown_options : aws_credentials_provider_shutdown_options , # [doc = " Delegated get_credentials() callback."] pub get_credentials : aws_credentials_provider_delegate_get_credentials_fn , # [doc = " User data for delegated callbacks."] pub delegate_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_credentials_provider_delegate_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_delegate_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_delegate_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_delegate_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_delegate_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_delegate_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_delegate_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_credentials) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_delegate_options) , "::" , stringify ! (get_credentials))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . delegate_user_data) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_delegate_options) , "::" , stringify ! (delegate_user_data))) ; } impl Default for aws_credentials_provider_delegate_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " A (string) pair defining an identity provider and a valid login token sourced from it."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_cognito_identity_provider_token_pair { # [doc = " Name of an identity provider"] pub identity_provider_name : aws_byte_cursor , # [doc = " Valid login token source from the identity provider"] pub identity_provider_token : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_cognito_identity_provider_token_pair () { const UNINIT : :: std :: mem :: MaybeUninit < aws_cognito_identity_provider_token_pair > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_cognito_identity_provider_token_pair > () , 32usize , concat ! ("Size of: " , stringify ! (aws_cognito_identity_provider_token_pair))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_cognito_identity_provider_token_pair > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_cognito_identity_provider_token_pair))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . identity_provider_name) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_cognito_identity_provider_token_pair) , "::" , stringify ! (identity_provider_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . identity_provider_token) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_cognito_identity_provider_token_pair) , "::" , stringify ! (identity_provider_token))) ; } impl Default for aws_cognito_identity_provider_token_pair { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options needed to create a Cognito-based Credentials Provider"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_cognito_options { pub shutdown_options : aws_credentials_provider_shutdown_options , # [doc = " Cognito service regional endpoint to source credentials from."] pub endpoint : aws_byte_cursor , # [doc = " Cognito identity to fetch credentials relative to."] pub identity : aws_byte_cursor , # [doc = " Optional set of identity provider token pairs to allow for authenticated identity access."] pub logins : * mut aws_cognito_identity_provider_token_pair , pub login_count : usize , # [doc = " Optional ARN of the role to be assumed when multiple roles were received in the token from the identity provider."] pub custom_role_arn : * mut aws_byte_cursor , pub bootstrap : * mut aws_client_bootstrap , pub tls_ctx : * mut aws_tls_ctx , # [doc = " (Optional) Http proxy configuration for the http request that fetches credentials"] pub http_proxy_options : * const aws_http_proxy_options , pub function_table : * mut aws_auth_http_system_vtable , } # [test] fn bindgen_test_layout_aws_credentials_provider_cognito_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_cognito_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_cognito_options > () , 104usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_cognito_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_cognito_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_cognito_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoint) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (endpoint))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . identity) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (identity))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . logins) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (logins))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . login_count) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (login_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . custom_role_arn) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (custom_role_arn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http_proxy_options) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (http_proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (function_table))) ; } impl Default for aws_credentials_provider_cognito_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Creates a new set of aws credentials\n\n @param allocator memory allocator to use\n @param access_key_id_cursor value for the aws access key id field\n @param secret_access_key_cursor value for the secret access key field\n @param session_token_cursor (optional) security token associated with the credentials\n @param expiration_timepoint_seconds timepoint, in seconds since epoch, that the credentials will no longer\n be valid past. For credentials that do not expire, use UINT64_MAX\n\n @return a valid credentials object, or NULL"] pub fn aws_credentials_new (allocator : * mut aws_allocator , access_key_id_cursor : aws_byte_cursor , secret_access_key_cursor : aws_byte_cursor , session_token_cursor : aws_byte_cursor , expiration_timepoint_seconds : u64) -> * mut aws_credentials ; } extern "C" { # [doc = " Creates a new set of aws anonymous credentials.\n Use Anonymous credentials, when you want to skip the signing process.\n\n @param allocator memory allocator to use\n\n @return a valid credentials object, or NULL"] pub fn aws_credentials_new_anonymous (allocator : * mut aws_allocator) -> * mut aws_credentials ; } extern "C" { # [doc = " Creates a new set of AWS credentials\n\n @param allocator memory allocator to use\n @param access_key_id value for the aws access key id field\n @param secret_access_key value for the secret access key field\n @param session_token (optional) security token associated with the credentials\n @param expiration_timepoint_seconds timepoint, in seconds since epoch, that the credentials will no longer\n be valid past. For credentials that do not expire, use UINT64_MAX\n\n @return a valid credentials object, or NULL"] pub fn aws_credentials_new_from_string (allocator : * mut aws_allocator , access_key_id : * const aws_string , secret_access_key : * const aws_string , session_token : * const aws_string , expiration_timepoint_seconds : u64) -> * mut aws_credentials ; } extern "C" { # [doc = " Creates a set of AWS credentials that includes an ECC key pair. These credentials do not have a value for\n the secret access key; the ecc key takes over that field's role in sigv4a signing.\n\n @param allocator memory allocator to use for all memory allocation\n @param access_key_id access key id for the credential set\n @param ecc_key ecc key to use during signing when using these credentials\n @param session_token (optional) session token associated with the credentials\n @param expiration_timepoint_in_seconds (optional) if session-based, time at which these credentials expire\n @return a new pair of AWS credentials, or NULL"] pub fn aws_credentials_new_ecc (allocator : * mut aws_allocator , access_key_id : aws_byte_cursor , ecc_key : * mut aws_ecc_key_pair , session_token : aws_byte_cursor , expiration_timepoint_in_seconds : u64) -> * mut aws_credentials ; } extern "C" { pub fn aws_credentials_new_ecc_from_aws_credentials (allocator : * mut aws_allocator , credentials : * const aws_credentials) -> * mut aws_credentials ; } extern "C" { # [doc = " Add a reference to some credentials\n\n @param credentials credentials to increment the ref count on"] pub fn aws_credentials_acquire (credentials : * const aws_credentials) ; } extern "C" { # [doc = " Remove a reference to some credentials\n\n @param credentials credentials to decrement the ref count on"] pub fn aws_credentials_release (credentials : * const aws_credentials) ; } extern "C" { # [doc = " Get the AWS access key id from a set of credentials\n\n @param credentials credentials to get the access key id from\n @return a byte cursor to the access key id"] pub fn aws_credentials_get_access_key_id (credentials : * const aws_credentials) -> aws_byte_cursor ; } extern "C" { # [doc = " Get the AWS secret access key from a set of credentials\n\n @param credentials credentials to get the secret access key from\n @return a byte cursor to the secret access key"] pub fn aws_credentials_get_secret_access_key (credentials : * const aws_credentials) -> aws_byte_cursor ; } extern "C" { # [doc = " Get the AWS session token from a set of credentials\n\n @param credentials credentials to get the session token from\n @return a byte cursor to the session token or an empty byte cursor if there is no session token"] pub fn aws_credentials_get_session_token (credentials : * const aws_credentials) -> aws_byte_cursor ; } extern "C" { # [doc = " Get the expiration timepoint (in seconds since epoch) associated with a set of credentials\n\n @param credentials credentials to get the expiration timepoint for\n @return the time, in seconds since epoch, the credentials will expire; UINT64_MAX for credentials\n without a specific expiration time"] pub fn aws_credentials_get_expiration_timepoint_seconds (credentials : * const aws_credentials) -> u64 ; } extern "C" { # [doc = " Get the elliptic curve key associated with this set of credentials\n @param credentials credentials to get the the elliptic curve key for\n @return the elliptic curve key associated with the credentials, or NULL if no key is associated with\n these credentials"] pub fn aws_credentials_get_ecc_key_pair (credentials : * const aws_credentials) -> * mut aws_ecc_key_pair ; } extern "C" { # [doc = " If credentials are anonymous, then the signing process is skipped.\n\n @param credentials credentials to check\n\n @return true if the credentials are anonymous; false otherwise."] pub fn aws_credentials_is_anonymous (credentials : * const aws_credentials) -> bool ; } extern "C" { # [doc = " Derives an ecc key pair (based on the nist P256 curve) from the access key id and secret access key components\n of a set of AWS credentials using an internal key derivation specification. Used to perform sigv4a signing in\n the hybrid mode based on AWS credentials.\n\n @param allocator memory allocator to use for all memory allocation\n @param credentials AWS credentials to derive the ECC key from using the AWS sigv4a key deriviation specification\n @return a new ecc key pair or NULL on failure"] pub fn aws_ecc_key_pair_new_ecdsa_p256_key_from_aws_credentials (allocator : * mut aws_allocator , credentials : * const aws_credentials) -> * mut aws_ecc_key_pair ; } extern "C" { # [doc = " Release a reference to a credentials provider\n\n @param provider provider to decrement the ref count on"] pub fn aws_credentials_provider_release (provider : * mut aws_credentials_provider) -> * mut aws_credentials_provider ; } extern "C" { pub fn aws_credentials_provider_acquire (provider : * mut aws_credentials_provider) -> * mut aws_credentials_provider ; } extern "C" { pub fn aws_credentials_provider_get_credentials (provider : * mut aws_credentials_provider , callback : aws_on_get_credentials_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Creates a simple provider that just returns a fixed set of credentials\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_static (allocator : * mut aws_allocator , options : * const aws_credentials_provider_static_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a simple anonymous credentials provider\n\n @param allocator memory allocator to use for all memory allocation\n @param shutdown_options an optional shutdown callback that gets\n invoked when the resources used by the provider are no longer in use.\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_anonymous (allocator : * mut aws_allocator , shutdown_options : * const aws_credentials_provider_shutdown_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that returns credentials sourced from the environment variables:\n\n AWS_ACCESS_KEY_ID\n AWS_SECRET_ACCESS_KEY\n AWS_SESSION_TOKEN\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_environment (allocator : * mut aws_allocator , options : * const aws_credentials_provider_environment_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that functions as a caching decorating of another provider.\n\n For example, the default chain is implemented as:\n\n CachedProvider -> ProviderChain(EnvironmentProvider -> ProfileProvider -> ECS/EC2IMD etc...)\n\n A reference is taken on the target provider\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_cached (allocator : * mut aws_allocator , options : * const aws_credentials_provider_cached_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from key-value profiles loaded from the aws credentials\n file (\"~/.aws/credentials\" by default) and the aws config file (\"~/.aws/config\" by\n default)\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_profile (allocator : * mut aws_allocator , options : * const aws_credentials_provider_profile_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that assumes an IAM role via. STS AssumeRole() API. This provider will fetch new credentials\n upon each call to aws_credentials_provider_get_credentials().\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_sts (allocator : * mut aws_allocator , options : * const aws_credentials_provider_sts_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from an ordered sequence of providers, with the overall result\n being from the first provider to return a valid set of credentials\n\n References are taken on all supplied providers\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_chain (allocator : * mut aws_allocator , options : * const aws_credentials_provider_chain_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from the ec2 instance metadata service\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_imds (allocator : * mut aws_allocator , options : * const aws_credentials_provider_imds_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from the ecs role credentials service\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_ecs (allocator : * mut aws_allocator , options : * const aws_credentials_provider_ecs_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from IoT Core\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_x509 (allocator : * mut aws_allocator , options : * const aws_credentials_provider_x509_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from STS using AssumeRoleWithWebIdentity\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_sts_web_identity (allocator : * mut aws_allocator , options : * const aws_credentials_provider_sts_web_identity_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from SSO using a SSOToken.\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_sso (allocator : * mut aws_allocator , options : * const aws_credentials_provider_sso_options) -> * mut aws_credentials_provider ; } extern "C" { pub fn aws_credentials_provider_new_process (allocator : * mut aws_allocator , options : * const aws_credentials_provider_process_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Create a credentials provider depends on provided vtable to fetch the credentials.\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_delegate (allocator : * mut aws_allocator , options : * const aws_credentials_provider_delegate_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from the Cognito-Identity service via an\n invocation of the GetCredentialsForIdentity API call.\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_cognito (allocator : * mut aws_allocator , options : * const aws_credentials_provider_cognito_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a cognito-based provider that has a caching layer wrapped around it\n\n @param allocator memory allocator to use for all memory allocation\n @param options cognito-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_cognito_caching (allocator : * mut aws_allocator , options : * const aws_credentials_provider_cognito_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates the default provider chain used by most AWS SDKs.\n\n Generally:\n\n (1) Environment\n (2) Profile\n (3) STS web identity\n (4) (conditional, off by default) ECS\n (5) (conditional, on by default) EC2 Instance Metadata\n\n Support for environmental control of the default provider chain is not yet\n implemented.\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_chain_default (allocator : * mut aws_allocator , options : * const aws_credentials_provider_chain_default_options) -> * mut aws_credentials_provider ; } extern "C" { pub static mut g_aws_credentials_provider_http_function_table : * const aws_auth_http_system_vtable ; } pub const AWS_DATE_TIME_STR_MAX_LEN : _bindgen_ty_21 = _bindgen_ty_21 :: AWS_DATE_TIME_STR_MAX_LEN ; pub const AWS_DATE_TIME_STR_MAX_BASIC_LEN : _bindgen_ty_21 = _bindgen_ty_21 :: AWS_DATE_TIME_STR_MAX_BASIC_LEN ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_21 { AWS_DATE_TIME_STR_MAX_LEN = 100 , AWS_DATE_TIME_STR_MAX_BASIC_LEN = 20 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_date_format { AWS_DATE_FORMAT_RFC822 = 0 , AWS_DATE_FORMAT_ISO_8601 = 1 , AWS_DATE_FORMAT_ISO_8601_BASIC = 2 , AWS_DATE_FORMAT_AUTO_DETECT = 3 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_date_month { AWS_DATE_MONTH_JANUARY = 0 , AWS_DATE_MONTH_FEBRUARY = 1 , AWS_DATE_MONTH_MARCH = 2 , AWS_DATE_MONTH_APRIL = 3 , AWS_DATE_MONTH_MAY = 4 , AWS_DATE_MONTH_JUNE = 5 , AWS_DATE_MONTH_JULY = 6 , AWS_DATE_MONTH_AUGUST = 7 , AWS_DATE_MONTH_SEPTEMBER = 8 , AWS_DATE_MONTH_OCTOBER = 9 , AWS_DATE_MONTH_NOVEMBER = 10 , AWS_DATE_MONTH_DECEMBER = 11 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_date_day_of_week { AWS_DATE_DAY_OF_WEEK_SUNDAY = 0 , AWS_DATE_DAY_OF_WEEK_MONDAY = 1 , AWS_DATE_DAY_OF_WEEK_TUESDAY = 2 , AWS_DATE_DAY_OF_WEEK_WEDNESDAY = 3 , AWS_DATE_DAY_OF_WEEK_THURSDAY = 4 , AWS_DATE_DAY_OF_WEEK_FRIDAY = 5 , AWS_DATE_DAY_OF_WEEK_SATURDAY = 6 , } # [repr (C)] pub struct aws_date_time { pub timestamp : time_t , pub milliseconds : u16 , pub tz : [:: libc :: c_char ; 6usize] , pub gmt_time : tm , pub local_time : tm , pub utc_assumed : bool , } # [test] fn bindgen_test_layout_aws_date_time () { const UNINIT : :: std :: mem :: MaybeUninit < aws_date_time > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_date_time > () , 136usize , concat ! ("Size of: " , stringify ! (aws_date_time))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_date_time > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_date_time))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . timestamp) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (timestamp))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . milliseconds) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (milliseconds))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tz) as usize - ptr as usize } , 10usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (tz))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . gmt_time) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (gmt_time))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . local_time) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (local_time))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . utc_assumed) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (utc_assumed))) ; } impl Default for aws_date_time { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Initializes dt to be the current system time."] pub fn aws_date_time_init_now (dt : * mut aws_date_time) ; } extern "C" { # [doc = " Initializes dt to be the time represented in milliseconds since unix epoch."] pub fn aws_date_time_init_epoch_millis (dt : * mut aws_date_time , ms_since_epoch : u64) ; } extern "C" { # [doc = " Initializes dt to be the time represented in seconds.millis since unix epoch."] pub fn aws_date_time_init_epoch_secs (dt : * mut aws_date_time , sec_ms : f64) ; } extern "C" { # [doc = " Initializes dt to be the time represented by date_str in format 'fmt'. Returns AWS_OP_SUCCESS if the\n string was successfully parsed, returns AWS_OP_ERR if parsing failed.\n\n Notes for AWS_DATE_FORMAT_RFC822:\n If no time zone information is provided, it is assumed to be local time (please don't do this).\n\n If the time zone is something other than something indicating Universal Time (e.g. Z, UT, UTC, or GMT) or an offset\n from UTC (e.g. +0100, -0700), parsing will fail.\n\n Really, it's just better if you always use Universal Time."] pub fn aws_date_time_init_from_str (dt : * mut aws_date_time , date_str : * const aws_byte_buf , fmt : aws_date_format) -> :: libc :: c_int ; } extern "C" { # [doc = " aws_date_time_init variant that takes a byte_cursor rather than a byte_buf"] pub fn aws_date_time_init_from_str_cursor (dt : * mut aws_date_time , date_str_cursor : * const aws_byte_cursor , fmt : aws_date_format) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the current time as a formatted date string in local time into output_buf. If buffer is too small, it will\n return AWS_OP_ERR. A good size suggestion is AWS_DATE_TIME_STR_MAX_LEN bytes. AWS_DATE_FORMAT_AUTO_DETECT is not\n allowed."] pub fn aws_date_time_to_local_time_str (dt : * const aws_date_time , fmt : aws_date_format , output_buf : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the current time as a formatted date string in utc time into output_buf. If buffer is too small, it will\n return AWS_OP_ERR. A good size suggestion is AWS_DATE_TIME_STR_MAX_LEN bytes. AWS_DATE_FORMAT_AUTO_DETECT is not\n allowed."] pub fn aws_date_time_to_utc_time_str (dt : * const aws_date_time , fmt : aws_date_format , output_buf : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the current time as a formatted short date string in local time into output_buf. If buffer is too small, it\n will return AWS_OP_ERR. A good size suggestion is AWS_DATE_TIME_STR_MAX_LEN bytes. AWS_DATE_FORMAT_AUTO_DETECT is not\n allowed."] pub fn aws_date_time_to_local_time_short_str (dt : * const aws_date_time , fmt : aws_date_format , output_buf : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the current time as a formatted short date string in utc time into output_buf. If buffer is too small, it will\n return AWS_OP_ERR. A good size suggestion is AWS_DATE_TIME_STR_MAX_LEN bytes. AWS_DATE_FORMAT_AUTO_DETECT is not\n allowed."] pub fn aws_date_time_to_utc_time_short_str (dt : * const aws_date_time , fmt : aws_date_format , output_buf : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { pub fn aws_date_time_as_epoch_secs (dt : * const aws_date_time) -> f64 ; } extern "C" { pub fn aws_date_time_as_nanos (dt : * const aws_date_time) -> u64 ; } extern "C" { pub fn aws_date_time_as_millis (dt : * const aws_date_time) -> u64 ; } extern "C" { pub fn aws_date_time_year (dt : * const aws_date_time , local_time : bool) -> u16 ; } extern "C" { pub fn aws_date_time_month (dt : * const aws_date_time , local_time : bool) -> aws_date_month ; } extern "C" { pub fn aws_date_time_month_day (dt : * const aws_date_time , local_time : bool) -> u8 ; } extern "C" { pub fn aws_date_time_day_of_week (dt : * const aws_date_time , local_time : bool) -> aws_date_day_of_week ; } extern "C" { pub fn aws_date_time_hour (dt : * const aws_date_time , local_time : bool) -> u8 ; } extern "C" { pub fn aws_date_time_minute (dt : * const aws_date_time , local_time : bool) -> u8 ; } extern "C" { pub fn aws_date_time_second (dt : * const aws_date_time , local_time : bool) -> u8 ; } extern "C" { pub fn aws_date_time_dst (dt : * const aws_date_time , local_time : bool) -> bool ; } extern "C" { # [doc = " returns the difference of a and b (a - b) in seconds."] pub fn aws_date_time_diff (a : * const aws_date_time , b : * const aws_date_time) -> time_t ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_errors { AWS_ERROR_HTTP_UNKNOWN = 2048 , AWS_ERROR_HTTP_HEADER_NOT_FOUND = 2049 , AWS_ERROR_HTTP_INVALID_HEADER_FIELD = 2050 , AWS_ERROR_HTTP_INVALID_HEADER_NAME = 2051 , AWS_ERROR_HTTP_INVALID_HEADER_VALUE = 2052 , AWS_ERROR_HTTP_INVALID_METHOD = 2053 , AWS_ERROR_HTTP_INVALID_PATH = 2054 , AWS_ERROR_HTTP_INVALID_STATUS_CODE = 2055 , AWS_ERROR_HTTP_MISSING_BODY_STREAM = 2056 , AWS_ERROR_HTTP_INVALID_BODY_STREAM = 2057 , AWS_ERROR_HTTP_CONNECTION_CLOSED = 2058 , AWS_ERROR_HTTP_SWITCHED_PROTOCOLS = 2059 , AWS_ERROR_HTTP_UNSUPPORTED_PROTOCOL = 2060 , AWS_ERROR_HTTP_REACTION_REQUIRED = 2061 , AWS_ERROR_HTTP_DATA_NOT_AVAILABLE = 2062 , AWS_ERROR_HTTP_OUTGOING_STREAM_LENGTH_INCORRECT = 2063 , AWS_ERROR_HTTP_CALLBACK_FAILURE = 2064 , AWS_ERROR_HTTP_WEBSOCKET_UPGRADE_FAILURE = 2065 , AWS_ERROR_HTTP_WEBSOCKET_CLOSE_FRAME_SENT = 2066 , AWS_ERROR_HTTP_WEBSOCKET_IS_MIDCHANNEL_HANDLER = 2067 , AWS_ERROR_HTTP_CONNECTION_MANAGER_INVALID_STATE_FOR_ACQUIRE = 2068 , AWS_ERROR_HTTP_CONNECTION_MANAGER_VENDED_CONNECTION_UNDERFLOW = 2069 , AWS_ERROR_HTTP_SERVER_CLOSED = 2070 , AWS_ERROR_HTTP_PROXY_CONNECT_FAILED = 2071 , AWS_ERROR_HTTP_CONNECTION_MANAGER_SHUTTING_DOWN = 2072 , AWS_ERROR_HTTP_CHANNEL_THROUGHPUT_FAILURE = 2073 , AWS_ERROR_HTTP_PROTOCOL_ERROR = 2074 , AWS_ERROR_HTTP_STREAM_IDS_EXHAUSTED = 2075 , AWS_ERROR_HTTP_GOAWAY_RECEIVED = 2076 , AWS_ERROR_HTTP_RST_STREAM_RECEIVED = 2077 , AWS_ERROR_HTTP_RST_STREAM_SENT = 2078 , AWS_ERROR_HTTP_STREAM_NOT_ACTIVATED = 2079 , AWS_ERROR_HTTP_STREAM_HAS_COMPLETED = 2080 , AWS_ERROR_HTTP_PROXY_STRATEGY_NTLM_CHALLENGE_TOKEN_MISSING = 2081 , AWS_ERROR_HTTP_PROXY_STRATEGY_TOKEN_RETRIEVAL_FAILURE = 2082 , AWS_ERROR_HTTP_PROXY_CONNECT_FAILED_RETRYABLE = 2083 , AWS_ERROR_HTTP_PROTOCOL_SWITCH_FAILURE = 2084 , AWS_ERROR_HTTP_MAX_CONCURRENT_STREAMS_EXCEEDED = 2085 , AWS_ERROR_HTTP_STREAM_MANAGER_SHUTTING_DOWN = 2086 , AWS_ERROR_HTTP_STREAM_MANAGER_CONNECTION_ACQUIRE_FAILURE = 2087 , AWS_ERROR_HTTP_STREAM_MANAGER_UNEXPECTED_HTTP_VERSION = 2088 , AWS_ERROR_HTTP_WEBSOCKET_PROTOCOL_ERROR = 2089 , AWS_ERROR_HTTP_MANUAL_WRITE_NOT_ENABLED = 2090 , AWS_ERROR_HTTP_MANUAL_WRITE_HAS_COMPLETED = 2091 , AWS_ERROR_HTTP_END_RANGE = 3071 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http2_error_code { AWS_HTTP2_ERR_NO_ERROR = 0 , AWS_HTTP2_ERR_PROTOCOL_ERROR = 1 , AWS_HTTP2_ERR_INTERNAL_ERROR = 2 , AWS_HTTP2_ERR_FLOW_CONTROL_ERROR = 3 , AWS_HTTP2_ERR_SETTINGS_TIMEOUT = 4 , AWS_HTTP2_ERR_STREAM_CLOSED = 5 , AWS_HTTP2_ERR_FRAME_SIZE_ERROR = 6 , AWS_HTTP2_ERR_REFUSED_STREAM = 7 , AWS_HTTP2_ERR_CANCEL = 8 , AWS_HTTP2_ERR_COMPRESSION_ERROR = 9 , AWS_HTTP2_ERR_CONNECT_ERROR = 10 , AWS_HTTP2_ERR_ENHANCE_YOUR_CALM = 11 , AWS_HTTP2_ERR_INADEQUATE_SECURITY = 12 , AWS_HTTP2_ERR_HTTP_1_1_REQUIRED = 13 , AWS_HTTP2_ERR_COUNT = 14 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_log_subject { AWS_LS_HTTP_GENERAL = 2048 , AWS_LS_HTTP_CONNECTION = 2049 , AWS_LS_HTTP_ENCODER = 2050 , AWS_LS_HTTP_DECODER = 2051 , AWS_LS_HTTP_SERVER = 2052 , AWS_LS_HTTP_STREAM = 2053 , AWS_LS_HTTP_CONNECTION_MANAGER = 2054 , AWS_LS_HTTP_STREAM_MANAGER = 2055 , AWS_LS_HTTP_WEBSOCKET = 2056 , AWS_LS_HTTP_WEBSOCKET_SETUP = 2057 , AWS_LS_HTTP_PROXY_NEGOTIATION = 2058 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_version { AWS_HTTP_VERSION_UNKNOWN = 0 , AWS_HTTP_VERSION_1_0 = 1 , AWS_HTTP_VERSION_1_1 = 2 , AWS_HTTP_VERSION_2 = 3 , AWS_HTTP_VERSION_COUNT = 4 , } extern "C" { # [doc = " Initializes internal datastructures used by aws-c-http.\n Must be called before using any functionality in aws-c-http."] pub fn aws_http_library_init (alloc : * mut aws_allocator) ; } extern "C" { # [doc = " Clean up internal datastructures used by aws-c-http.\n Must not be called until application is done using functionality in aws-c-http."] pub fn aws_http_library_clean_up () ; } extern "C" { # [doc = " Returns the description of common status codes.\n Ex: 404 -> \"Not Found\"\n An empty string is returned if the status code is not recognized."] pub fn aws_http_status_text (status_code : :: libc :: c_int) -> * const :: libc :: c_char ; } extern "C" { # [doc = " Shortcuts for common HTTP request methods"] pub static aws_http_method_get : aws_byte_cursor ; } extern "C" { pub static aws_http_method_head : aws_byte_cursor ; } extern "C" { pub static aws_http_method_post : aws_byte_cursor ; } extern "C" { pub static aws_http_method_put : aws_byte_cursor ; } extern "C" { pub static aws_http_method_delete : aws_byte_cursor ; } extern "C" { pub static aws_http_method_connect : aws_byte_cursor ; } extern "C" { pub static aws_http_method_options : aws_byte_cursor ; } extern "C" { pub static aws_http_header_method : aws_byte_cursor ; } extern "C" { pub static aws_http_header_scheme : aws_byte_cursor ; } extern "C" { pub static aws_http_header_authority : aws_byte_cursor ; } extern "C" { pub static aws_http_header_path : aws_byte_cursor ; } extern "C" { pub static aws_http_header_status : aws_byte_cursor ; } extern "C" { pub static aws_http_scheme_http : aws_byte_cursor ; } extern "C" { pub static aws_http_scheme_https : aws_byte_cursor ; } # [doc = " An HTTP connection.\n This type is used by both server-side and client-side connections.\n This type is also used by all supported versions of HTTP."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_connection { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_connection_manager { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_socket_options { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_tls_connection_options { _unused : [u8 ; 0] , } pub type aws_http_connection_manager_on_connection_setup_fn = :: std :: option :: Option < unsafe extern "C" fn (connection : * mut aws_http_connection , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_http_connection_manager_shutdown_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [doc = " Metrics for logging and debugging purpose."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http_manager_metrics { # [doc = " The number of additional concurrent requests that can be supported by the HTTP manager without needing to\n establish additional connections to the target server.\n\n For connection manager, it equals to connections that's idle.\n For stream manager, it equals to the number of streams that are possible to be made without creating new\n connection, although the implementation can create new connection without fully filling it."] pub available_concurrency : usize , pub pending_concurrency_acquires : usize , pub leased_concurrency : usize , } # [test] fn bindgen_test_layout_aws_http_manager_metrics () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_manager_metrics > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_manager_metrics > () , 24usize , concat ! ("Size of: " , stringify ! (aws_http_manager_metrics))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_manager_metrics > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_manager_metrics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . available_concurrency) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_manager_metrics) , "::" , stringify ! (available_concurrency))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . pending_concurrency_acquires) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_manager_metrics) , "::" , stringify ! (pending_concurrency_acquires))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . leased_concurrency) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_manager_metrics) , "::" , stringify ! (leased_concurrency))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_connection_manager_options { pub bootstrap : * mut aws_client_bootstrap , pub initial_window_size : usize , pub socket_options : * const aws_socket_options , # [doc = " Options to create secure (HTTPS) connections.\n For secure connections, set \"h2\" in the ALPN string for HTTP/2, otherwise HTTP/1.1 is used.\n\n Leave NULL to create cleartext (HTTP) connections.\n For cleartext connections, use `http2_prior_knowledge` (RFC-7540 3.4)\n to control whether that are treated as HTTP/1.1 or HTTP/2."] pub tls_connection_options : * const aws_tls_connection_options , # [doc = " Specify whether you have prior knowledge that cleartext (HTTP) connections are HTTP/2 (RFC-7540 3.4).\n If false, then cleartext connections are treated as HTTP/1.1.\n It is illegal to set this true when secure connections are being used.\n Note that upgrading from HTTP/1.1 to HTTP/2 is not supported (RFC-7540 3.2)."] pub http2_prior_knowledge : bool , pub monitoring_options : * const aws_http_connection_monitoring_options , pub host : aws_byte_cursor , pub port : u16 , # [doc = " Optional.\n HTTP/2 specific configuration. Check `struct aws_http2_connection_options` for details of each config"] pub initial_settings_array : * const aws_http2_setting , pub num_initial_settings : usize , pub max_closed_streams : usize , pub http2_conn_manual_window_management : bool , pub proxy_options : * const aws_http_proxy_options , pub proxy_ev_settings : * const proxy_env_var_settings , pub max_connections : usize , pub shutdown_complete_user_data : * mut :: libc :: c_void , pub shutdown_complete_callback : aws_http_connection_manager_shutdown_complete_fn , # [doc = " If set to true, the read back pressure mechanism will be enabled."] pub enable_read_back_pressure : bool , # [doc = " If set to a non-zero value, then connections that stay in the pool longer than the specified\n timeout will be closed automatically."] pub max_connection_idle_in_milliseconds : u64 , } # [test] fn bindgen_test_layout_aws_http_connection_manager_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_connection_manager_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_connection_manager_options > () , 160usize , concat ! ("Size of: " , stringify ! (aws_http_connection_manager_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_connection_manager_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_connection_manager_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_window_size) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (initial_window_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . socket_options) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (socket_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_connection_options) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (tls_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http2_prior_knowledge) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (http2_prior_knowledge))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . monitoring_options) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (monitoring_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_settings_array) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (initial_settings_array))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_initial_settings) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (num_initial_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_closed_streams) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (max_closed_streams))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http2_conn_manual_window_management) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (http2_conn_manual_window_management))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_options) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_settings) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (proxy_ev_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_connections) as usize - ptr as usize } , 120usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (max_connections))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_complete_user_data) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (shutdown_complete_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_complete_callback) as usize - ptr as usize } , 136usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (shutdown_complete_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_back_pressure) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (enable_read_back_pressure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_connection_idle_in_milliseconds) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (max_connection_idle_in_milliseconds))) ; } impl Default for aws_http_connection_manager_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_http_connection_manager_acquire (manager : * mut aws_http_connection_manager) ; } extern "C" { pub fn aws_http_connection_manager_release (manager : * mut aws_http_connection_manager) ; } extern "C" { pub fn aws_http_connection_manager_new (allocator : * mut aws_allocator , options : * const aws_http_connection_manager_options) -> * mut aws_http_connection_manager ; } extern "C" { pub fn aws_http_connection_manager_acquire_connection (manager : * mut aws_http_connection_manager , callback : aws_http_connection_manager_on_connection_setup_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_http_connection_manager_release_connection (manager : * mut aws_http_connection_manager , connection : * mut aws_http_connection) -> :: libc :: c_int ; } extern "C" { # [doc = " Fetch the current manager metrics from connection manager."] pub fn aws_http_connection_manager_fetch_metrics (manager : * const aws_http_connection_manager , out_metrics : * mut aws_http_manager_metrics) ; } # [doc = " Invoked upon the acquisition, or failure to acquire a retry token. This function will always be invoked if and only\n if aws_retry_strategy_acquire_retry_token() returns AWS_OP_SUCCESS. It will never be invoked synchronously from\n aws_retry_strategy_acquire_retry_token(). Token will always be NULL if error_code is non-zero, and vice-versa. If\n token is non-null, it will have a reference count of 1, and you must call aws_retry_token_release() on it later. See\n the comments for aws_retry_strategy_on_retry_ready_fn for more info."] pub type aws_retry_strategy_on_retry_token_acquired_fn = :: std :: option :: Option < unsafe extern "C" fn (retry_strategy : * mut aws_retry_strategy , error_code : :: libc :: c_int , token : * mut aws_retry_token , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked after a successful call to aws_retry_strategy_schedule_retry(). This function will always be invoked if and\n only if aws_retry_strategy_schedule_retry() returns AWS_OP_SUCCESS. It will never be invoked synchronously from\n aws_retry_strategy_schedule_retry(). After attempting the operation, either call aws_retry_strategy_schedule_retry()\n with an aws_retry_error_type or call aws_retry_token_record_success() and then release the token via.\n aws_retry_token_release()."] pub type aws_retry_strategy_on_retry_ready_fn = :: std :: option :: Option < unsafe extern "C" fn (token : * mut aws_retry_token , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Optional function to supply your own generate random implementation"] pub type aws_generate_random_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) -> u64 > ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_retry_error_type { # [doc = " This is a connection level error such as a socket timeout, socket connect error, tls negotiation timeout etc...\n Typically these should never be applied for non-idempotent request types since in this scenario, it's impossible\n to know whether the operation had a side effect on the server."] AWS_RETRY_ERROR_TYPE_TRANSIENT = 0 , # [doc = " This is an error where the server explicitly told the client to back off, such as a 429 or 503 Http error."] AWS_RETRY_ERROR_TYPE_THROTTLING = 1 , # [doc = " This is a server error that isn't explicitly throttling but is considered by the client\n to be something that should be retried."] AWS_RETRY_ERROR_TYPE_SERVER_ERROR = 2 , # [doc = " Doesn't count against any budgets. This could be something like a 401 challenge in Http."] AWS_RETRY_ERROR_TYPE_CLIENT_ERROR = 3 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_retry_strategy_vtable { pub destroy : :: std :: option :: Option < unsafe extern "C" fn (retry_strategy : * mut aws_retry_strategy) > , pub acquire_token : :: std :: option :: Option < unsafe extern "C" fn (retry_strategy : * mut aws_retry_strategy , partition_id : * const aws_byte_cursor , on_acquired : aws_retry_strategy_on_retry_token_acquired_fn , user_data : * mut :: libc :: c_void , timeout_ms : u64) -> :: libc :: c_int > , pub schedule_retry : :: std :: option :: Option < unsafe extern "C" fn (token : * mut aws_retry_token , error_type : aws_retry_error_type , retry_ready : aws_retry_strategy_on_retry_ready_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > , pub record_success : :: std :: option :: Option < unsafe extern "C" fn (token : * mut aws_retry_token) -> :: libc :: c_int > , pub release_token : :: std :: option :: Option < unsafe extern "C" fn (token : * mut aws_retry_token) > , } # [test] fn bindgen_test_layout_aws_retry_strategy_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_retry_strategy_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_retry_strategy_vtable > () , 40usize , concat ! ("Size of: " , stringify ! (aws_retry_strategy_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_retry_strategy_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_retry_strategy_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . acquire_token) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy_vtable) , "::" , stringify ! (acquire_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . schedule_retry) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy_vtable) , "::" , stringify ! (schedule_retry))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . record_success) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy_vtable) , "::" , stringify ! (record_success))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . release_token) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy_vtable) , "::" , stringify ! (release_token))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_retry_strategy { pub allocator : * mut aws_allocator , pub vtable : * mut aws_retry_strategy_vtable , pub ref_count : aws_atomic_var , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_retry_strategy () { const UNINIT : :: std :: mem :: MaybeUninit < aws_retry_strategy > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_retry_strategy > () , 32usize , concat ! ("Size of: " , stringify ! (aws_retry_strategy))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_retry_strategy > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_retry_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy) , "::" , stringify ! (impl_))) ; } impl Default for aws_retry_strategy { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_retry_token { pub allocator : * mut aws_allocator , pub retry_strategy : * mut aws_retry_strategy , pub ref_count : aws_atomic_var , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_retry_token () { const UNINIT : :: std :: mem :: MaybeUninit < aws_retry_token > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_retry_token > () , 32usize , concat ! ("Size of: " , stringify ! (aws_retry_token))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_retry_token > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_retry_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_retry_token) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . retry_strategy) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_retry_token) , "::" , stringify ! (retry_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_retry_token) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_retry_token) , "::" , stringify ! (impl_))) ; } impl Default for aws_retry_token { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [doc = " Jitter mode for exponential backoff.\n\n For a great writeup on these options see:\n https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_exponential_backoff_jitter_mode { AWS_EXPONENTIAL_BACKOFF_JITTER_DEFAULT = 0 , AWS_EXPONENTIAL_BACKOFF_JITTER_NONE = 1 , AWS_EXPONENTIAL_BACKOFF_JITTER_FULL = 2 , AWS_EXPONENTIAL_BACKOFF_JITTER_DECORRELATED = 3 , } # [doc = " Options for exponential backoff retry strategy. el_group must be set, any other option, if set to 0 will signify\n \"use defaults\""] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_exponential_backoff_retry_options { # [doc = " Event loop group to use for scheduling tasks."] pub el_group : * mut aws_event_loop_group , # [doc = " Max retries to allow. The default value is 10"] pub max_retries : usize , # [doc = " Scaling factor to add for the backoff. Default is 25ms"] pub backoff_scale_factor_ms : u32 , # [doc = " Max retry backoff in seconds. Default is 20 seconds"] pub max_backoff_secs : u32 , # [doc = " Jitter mode to use, see comments for aws_exponential_backoff_jitter_mode.\n Default is AWS_EXPONENTIAL_BACKOFF_JITTER_DEFAULT"] pub jitter_mode : aws_exponential_backoff_jitter_mode , # [doc = " Deprecated. Use generate_random_impl instead\n By default this will be set to use aws_device_random. If you want something else, set it here."] pub generate_random : :: std :: option :: Option < unsafe extern "C" fn () -> u64 > , pub generate_random_impl : aws_generate_random_fn , # [doc = " Optional user data for the generate random generate_random_impl."] pub generate_random_user_data : * mut :: libc :: c_void , # [doc = " Optional shutdown callback that gets invoked, with appropriate user data,\n when the resources used by the retry_strategy are no longer in use."] pub shutdown_options : * const aws_shutdown_callback_options , } # [test] fn bindgen_test_layout_aws_exponential_backoff_retry_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_exponential_backoff_retry_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_exponential_backoff_retry_options > () , 64usize , concat ! ("Size of: " , stringify ! (aws_exponential_backoff_retry_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_exponential_backoff_retry_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_exponential_backoff_retry_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . el_group) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (el_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_retries) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (max_retries))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . backoff_scale_factor_ms) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (backoff_scale_factor_ms))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_backoff_secs) as usize - ptr as usize } , 20usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (max_backoff_secs))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . jitter_mode) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (jitter_mode))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . generate_random) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (generate_random))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . generate_random_impl) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (generate_random_impl))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . generate_random_user_data) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (generate_random_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (shutdown_options))) ; } impl Default for aws_exponential_backoff_retry_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_standard_retry_options { pub backoff_retry_options : aws_exponential_backoff_retry_options , # [doc = " capacity for partitions. Defaults to 500"] pub initial_bucket_capacity : usize , } # [test] fn bindgen_test_layout_aws_standard_retry_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_standard_retry_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_standard_retry_options > () , 72usize , concat ! ("Size of: " , stringify ! (aws_standard_retry_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_standard_retry_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_standard_retry_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . backoff_retry_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_standard_retry_options) , "::" , stringify ! (backoff_retry_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_bucket_capacity) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_standard_retry_options) , "::" , stringify ! (initial_bucket_capacity))) ; } impl Default for aws_standard_retry_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Acquire a reference count on retry_strategy."] pub fn aws_retry_strategy_acquire (retry_strategy : * mut aws_retry_strategy) ; } extern "C" { # [doc = " Releases a reference count on retry_strategy."] pub fn aws_retry_strategy_release (retry_strategy : * mut aws_retry_strategy) ; } extern "C" { # [doc = " Attempts to acquire a retry token for use with retries. On success, on_acquired will be invoked when a token is\n available, or an error will be returned if the timeout expires. partition_id identifies operations that should be\n grouped together. This allows for more sophisticated strategies such as AIMD and circuit breaker patterns. Pass NULL\n to use the global partition."] pub fn aws_retry_strategy_acquire_retry_token (retry_strategy : * mut aws_retry_strategy , partition_id : * const aws_byte_cursor , on_acquired : aws_retry_strategy_on_retry_token_acquired_fn , user_data : * mut :: libc :: c_void , timeout_ms : u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Schedules a retry based on the backoff and token based strategies. retry_ready is invoked when the retry is either\n ready for execution or if it has been canceled due to application shutdown.\n\n This function can return an error to reject the retry attempt if, for example, a circuit breaker has opened. If this\n occurs users should fail their calls back to their callers.\n\n error_type is used for book keeping. See the comments above for aws_retry_error_type."] pub fn aws_retry_strategy_schedule_retry (token : * mut aws_retry_token , error_type : aws_retry_error_type , retry_ready : aws_retry_strategy_on_retry_ready_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Records a successful retry. This is used for making future decisions to open up token buckets, AIMD breakers etc...\n some strategies such as exponential backoff will ignore this, but you should always call it after a successful\n operation or your system will never recover during an outage."] pub fn aws_retry_token_record_success (token : * mut aws_retry_token) -> :: libc :: c_int ; } extern "C" { # [doc = " Increments reference count for token. This should be called any time you seat the token to a pointer you own."] pub fn aws_retry_token_acquire (token : * mut aws_retry_token) ; } extern "C" { # [doc = " Releases the reference count for token. This should always be invoked after either calling\n aws_retry_strategy_schedule_retry() and failing, or after calling aws_retry_token_record_success()."] pub fn aws_retry_token_release (token : * mut aws_retry_token) ; } extern "C" { # [doc = " Creates a retry strategy using exponential backoff. This strategy does not perform any bookkeeping on error types and\n success. There is no circuit breaker functionality in here. See the comments above for\n aws_exponential_backoff_retry_options."] pub fn aws_retry_strategy_new_exponential_backoff (allocator : * mut aws_allocator , config : * const aws_exponential_backoff_retry_options) -> * mut aws_retry_strategy ; } extern "C" { # [doc = " This is a retry implementation that cuts off traffic if it's\n detected that an endpoint partition is having availability\n problems. This is necessary to keep from making outages worse\n by scheduling work that's unlikely to succeed yet increases\n load on an already ailing system.\n\n We do this by creating a bucket for each partition. A partition\n is an arbitrary specifier. It can be anything: a region, a service,\n a combination of region and service, a literal dns name.... doesn't matter.\n\n Each bucket has a budget for maximum allowed retries. Different types of events\n carry different weights. Things that indicate an unhealthy partition such as\n transient errors (timeouts, unhealthy connection etc...) cost more.\n A retry for any other reason (service sending a 5xx response code) cost a bit less.\n When a retry is attempted this capacity is leased out to the retry. On success it is\n released back to the capacity pool. On failure, it remains leased.\n Operations that succeed without a retry slowly restore the capacity pool.\n\n If a partition runs out of capacity it is assumed unhealthy and retries will be blocked\n until capacity returns to the pool. To prevent a partition from staying unhealthy after\n an outage has recovered, new requests that succeed without a retry will increase the capacity\n slowly ( a new request gets a payback lease of 1, but the lease is never actually deducted from the capacity pool)."] pub fn aws_retry_strategy_new_standard (allocator : * mut aws_allocator , config : * const aws_standard_retry_options) -> * mut aws_retry_strategy ; } pub type aws_imds_client_shutdown_completed_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [doc = " Optional callback and user data to be invoked when an imds client has fully shut down"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_imds_client_shutdown_options { pub shutdown_callback : aws_imds_client_shutdown_completed_fn , pub shutdown_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_imds_client_shutdown_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_imds_client_shutdown_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_imds_client_shutdown_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_imds_client_shutdown_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_imds_client_shutdown_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_imds_client_shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_shutdown_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_user_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_shutdown_options) , "::" , stringify ! (shutdown_user_data))) ; } impl Default for aws_imds_client_shutdown_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options when creating an imds client"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_imds_client_options { pub shutdown_options : aws_imds_client_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , pub retry_strategy : * mut aws_retry_strategy , pub imds_version : aws_imds_protocol_version , pub function_table : * mut aws_auth_http_system_vtable , } # [test] fn bindgen_test_layout_aws_imds_client_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_imds_client_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_imds_client_options > () , 48usize , concat ! ("Size of: " , stringify ! (aws_imds_client_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_imds_client_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_imds_client_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . retry_strategy) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_options) , "::" , stringify ! (retry_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . imds_version) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_options) , "::" , stringify ! (imds_version))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_options) , "::" , stringify ! (function_table))) ; } impl Default for aws_imds_client_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_imds_client_on_get_resource_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (resource : * const aws_byte_buf , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-categories.html"] # [repr (C)] pub struct aws_imds_iam_profile { pub last_updated : aws_date_time , pub instance_profile_arn : aws_byte_cursor , pub instance_profile_id : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_imds_iam_profile () { const UNINIT : :: std :: mem :: MaybeUninit < aws_imds_iam_profile > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_imds_iam_profile > () , 168usize , concat ! ("Size of: " , stringify ! (aws_imds_iam_profile))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_imds_iam_profile > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_imds_iam_profile))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . last_updated) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_imds_iam_profile) , "::" , stringify ! (last_updated))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . instance_profile_arn) as usize - ptr as usize } , 136usize , concat ! ("Offset of field: " , stringify ! (aws_imds_iam_profile) , "::" , stringify ! (instance_profile_arn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . instance_profile_id) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_imds_iam_profile) , "::" , stringify ! (instance_profile_id))) ; } impl Default for aws_imds_iam_profile { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Block of per-instance EC2-specific data\n\n https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-identity-documents.html"] # [repr (C)] pub struct aws_imds_instance_info { pub marketplace_product_codes : aws_array_list , pub availability_zone : aws_byte_cursor , pub private_ip : aws_byte_cursor , pub version : aws_byte_cursor , pub instance_id : aws_byte_cursor , pub billing_products : aws_array_list , pub instance_type : aws_byte_cursor , pub account_id : aws_byte_cursor , pub image_id : aws_byte_cursor , pub pending_time : aws_date_time , pub architecture : aws_byte_cursor , pub kernel_id : aws_byte_cursor , pub ramdisk_id : aws_byte_cursor , pub region : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_imds_instance_info () { const UNINIT : :: std :: mem :: MaybeUninit < aws_imds_instance_info > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_imds_instance_info > () , 392usize , concat ! ("Size of: " , stringify ! (aws_imds_instance_info))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_imds_instance_info > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_imds_instance_info))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . marketplace_product_codes) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (marketplace_product_codes))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . availability_zone) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (availability_zone))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . private_ip) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (private_ip))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . version) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (version))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . instance_id) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (instance_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . billing_products) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (billing_products))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . instance_type) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (instance_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . account_id) as usize - ptr as usize } , 160usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (account_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . image_id) as usize - ptr as usize } , 176usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (image_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . pending_time) as usize - ptr as usize } , 192usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (pending_time))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . architecture) as usize - ptr as usize } , 328usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (architecture))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . kernel_id) as usize - ptr as usize } , 344usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (kernel_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ramdisk_id) as usize - ptr as usize } , 360usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (ramdisk_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . region) as usize - ptr as usize } , 376usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (region))) ; } impl Default for aws_imds_instance_info { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_imds_client_on_get_array_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (array : * const aws_array_list , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_imds_client_on_get_credentials_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (credentials : * const aws_credentials , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_imds_client_on_get_iam_profile_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (iam_profile_info : * const aws_imds_iam_profile , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_imds_client_on_get_instance_info_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (instance_info : * const aws_imds_instance_info , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " AWS EC2 Metadata Client is used to retrieve AWS EC2 Instance Metadata info."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_imds_client { _unused : [u8 ; 0] , } extern "C" { # [doc = " Creates a new imds client\n\n @param allocator memory allocator to use for creation and queries\n @param options configuration options for the imds client\n\n @return a newly-constructed imds client, or NULL on failure"] pub fn aws_imds_client_new (allocator : * mut aws_allocator , options : * const aws_imds_client_options) -> * mut aws_imds_client ; } extern "C" { # [doc = " Increments the ref count on the client\n\n @param client imds client to acquire a reference to"] pub fn aws_imds_client_acquire (client : * mut aws_imds_client) ; } extern "C" { # [doc = " Decrements the ref count on the client\n\n @param client imds client to release a reference to"] pub fn aws_imds_client_release (client : * mut aws_imds_client) ; } extern "C" { # [doc = " Queries a generic resource (string) from the ec2 instance metadata document\n\n @param client imds client to use for the query\n @param resource_path path of the resource to query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_resource_async (client : * mut aws_imds_client , resource_path : aws_byte_cursor , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the ami id of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_ami_id (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the ami launch index of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_ami_launch_index (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the ami manifest path of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_ami_manifest_path (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the list of ancestor ami ids of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_ancestor_ami_ids (client : * mut aws_imds_client , callback : aws_imds_client_on_get_array_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the instance-action of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_instance_action (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the instance id of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_instance_id (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the instance type of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_instance_type (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the mac address of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_mac_address (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the private ip address of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_private_ip_address (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the availability zone of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_availability_zone (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the product codes of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_product_codes (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the public key of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_public_key (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the ramdisk id of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_ramdisk_id (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the reservation id of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_reservation_id (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the list of the security groups of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_security_groups (client : * mut aws_imds_client , callback : aws_imds_client_on_get_array_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the list of block device mappings of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_block_device_mapping (client : * mut aws_imds_client , callback : aws_imds_client_on_get_array_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the attached iam role of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_attached_iam_role (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets temporary credentials based on the attached iam role of the ec2 instance\n\n @param client imds client to use for the query\n @param iam_role_name iam role name to get temporary credentials through\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_credentials (client : * mut aws_imds_client , iam_role_name : aws_byte_cursor , callback : aws_imds_client_on_get_credentials_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the iam profile information of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_iam_profile (client : * mut aws_imds_client , callback : aws_imds_client_on_get_iam_profile_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the user data of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_user_data (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the signature of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_instance_signature (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the instance information data block of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_instance_info (client : * mut aws_imds_client , callback : aws_imds_client_on_get_instance_info_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " The entry point function to perform a CRC32 (Ethernet, gzip) computation.\n Selects a suitable implementation based on hardware capabilities.\n Pass 0 in the previousCrc32 parameter as an initial value unless continuing\n to update a running crc in a subsequent call."] pub fn aws_checksums_crc32 (input : * const u8 , length : :: libc :: c_int , previousCrc32 : u32) -> u32 ; } extern "C" { # [doc = " The entry point function to perform a Castagnoli CRC32c (iSCSI) computation.\n Selects a suitable implementation based on hardware capabilities.\n Pass 0 in the previousCrc32 parameter as an initial value unless continuing\n to update a running crc in a subsequent call."] pub fn aws_checksums_crc32c (input : * const u8 , length : :: libc :: c_int , previousCrc32 : u32) -> u32 ; } pub type aws_log_channel_send_fn = :: std :: option :: Option < unsafe extern "C" fn (channel : * mut aws_log_channel , output : * mut aws_string) -> :: libc :: c_int > ; pub type aws_log_channel_clean_up_fn = :: std :: option :: Option < unsafe extern "C" fn (channel : * mut aws_log_channel) > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_log_channel_vtable { pub send : aws_log_channel_send_fn , pub clean_up : aws_log_channel_clean_up_fn , } # [test] fn bindgen_test_layout_aws_log_channel_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_channel_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_channel_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_log_channel_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_channel_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_channel_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . send) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel_vtable) , "::" , stringify ! (send))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clean_up) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel_vtable) , "::" , stringify ! (clean_up))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_channel { pub vtable : * mut aws_log_channel_vtable , pub allocator : * mut aws_allocator , pub writer : * mut aws_log_writer , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_log_channel () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_channel > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_channel > () , 32usize , concat ! ("Size of: " , stringify ! (aws_log_channel))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_channel > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_channel))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . writer) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel) , "::" , stringify ! (writer))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel) , "::" , stringify ! (impl_))) ; } impl Default for aws_log_channel { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_log_channel_init_foreground (channel : * mut aws_log_channel , allocator : * mut aws_allocator , writer : * mut aws_log_writer) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_channel_init_background (channel : * mut aws_log_channel , allocator : * mut aws_allocator , writer : * mut aws_log_writer) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_channel_clean_up (channel : * mut aws_log_channel) ; } pub type aws_log_formatter_format_fn = :: std :: option :: Option < unsafe extern "C" fn (formatter : * mut aws_log_formatter , formatted_output : * mut * mut aws_string , level : aws_log_level :: Type , subject : aws_log_subject_t , format : * const :: libc :: c_char , args : * mut __va_list_tag) -> :: libc :: c_int > ; pub type aws_log_formatter_clean_up_fn = :: std :: option :: Option < unsafe extern "C" fn (logger : * mut aws_log_formatter) > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_log_formatter_vtable { pub format : aws_log_formatter_format_fn , pub clean_up : aws_log_formatter_clean_up_fn , } # [test] fn bindgen_test_layout_aws_log_formatter_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_formatter_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_formatter_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_log_formatter_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_formatter_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_formatter_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . format) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter_vtable) , "::" , stringify ! (format))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clean_up) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter_vtable) , "::" , stringify ! (clean_up))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_formatter { pub vtable : * mut aws_log_formatter_vtable , pub allocator : * mut aws_allocator , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_log_formatter () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_formatter > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_formatter > () , 24usize , concat ! ("Size of: " , stringify ! (aws_log_formatter))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_formatter > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_formatter))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter) , "::" , stringify ! (impl_))) ; } impl Default for aws_log_formatter { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_formatter_standard_options { pub date_format : aws_date_format , } # [test] fn bindgen_test_layout_aws_log_formatter_standard_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_formatter_standard_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_formatter_standard_options > () , 4usize , concat ! ("Size of: " , stringify ! (aws_log_formatter_standard_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_formatter_standard_options > () , 4usize , concat ! ("Alignment of " , stringify ! (aws_log_formatter_standard_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . date_format) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter_standard_options) , "::" , stringify ! (date_format))) ; } impl Default for aws_log_formatter_standard_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_logging_standard_formatting_data { pub log_line_buffer : * mut :: libc :: c_char , pub total_length : usize , pub level : aws_log_level :: Type , pub subject_name : * const :: libc :: c_char , pub format : * const :: libc :: c_char , pub date_format : aws_date_format , pub allocator : * mut aws_allocator , pub amount_written : usize , } # [test] fn bindgen_test_layout_aws_logging_standard_formatting_data () { const UNINIT : :: std :: mem :: MaybeUninit < aws_logging_standard_formatting_data > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_logging_standard_formatting_data > () , 64usize , concat ! ("Size of: " , stringify ! (aws_logging_standard_formatting_data))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_logging_standard_formatting_data > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_logging_standard_formatting_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . log_line_buffer) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (log_line_buffer))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . total_length) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (total_length))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . level) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (level))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subject_name) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (subject_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . format) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (format))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . date_format) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (date_format))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . amount_written) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (amount_written))) ; } impl Default for aws_logging_standard_formatting_data { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_log_formatter_init_default (formatter : * mut aws_log_formatter , allocator : * mut aws_allocator , options : * mut aws_log_formatter_standard_options) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_formatter_clean_up (formatter : * mut aws_log_formatter) ; } extern "C" { pub fn aws_format_standard_log_line (formatting_data : * mut aws_logging_standard_formatting_data , args : * mut __va_list_tag) -> :: libc :: c_int ; } pub type aws_log_writer_write_fn = :: std :: option :: Option < unsafe extern "C" fn (writer : * mut aws_log_writer , output : * const aws_string) -> :: libc :: c_int > ; pub type aws_log_writer_clean_up_fn = :: std :: option :: Option < unsafe extern "C" fn (writer : * mut aws_log_writer) > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_log_writer_vtable { pub write : aws_log_writer_write_fn , pub clean_up : aws_log_writer_clean_up_fn , } # [test] fn bindgen_test_layout_aws_log_writer_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_writer_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_writer_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_log_writer_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_writer_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_writer_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . write) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer_vtable) , "::" , stringify ! (write))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clean_up) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer_vtable) , "::" , stringify ! (clean_up))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_writer { pub vtable : * mut aws_log_writer_vtable , pub allocator : * mut aws_allocator , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_log_writer () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_writer > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_writer > () , 24usize , concat ! ("Size of: " , stringify ! (aws_log_writer))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_writer > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_writer))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer) , "::" , stringify ! (impl_))) ; } impl Default for aws_log_writer { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_writer_file_options { pub filename : * const :: libc :: c_char , pub file : * mut FILE , } # [test] fn bindgen_test_layout_aws_log_writer_file_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_writer_file_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_writer_file_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_log_writer_file_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_writer_file_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_writer_file_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . filename) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer_file_options) , "::" , stringify ! (filename))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . file) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer_file_options) , "::" , stringify ! (file))) ; } impl Default for aws_log_writer_file_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_log_writer_init_stdout (writer : * mut aws_log_writer , allocator : * mut aws_allocator) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_writer_init_stderr (writer : * mut aws_log_writer , allocator : * mut aws_allocator) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_writer_init_file (writer : * mut aws_log_writer , allocator : * mut aws_allocator , options : * mut aws_log_writer_file_options) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_writer_clean_up (writer : * mut aws_log_writer) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_socket_endpoint { _unused : [u8 ; 0] , } # [doc = " Invoked when connect completes.\n\n If unsuccessful, error_code will be set, connection will be NULL,\n and the on_shutdown callback will never be invoked.\n\n If successful, error_code will be 0 and connection will be valid.\n The user is now responsible for the connection and must\n call aws_http_connection_release() when they are done with it.\n\n The connection uses one event-loop thread to do all its work.\n The thread invoking this callback will be the same thread that invokes all\n future callbacks for this connection and its streams."] pub type aws_http_on_client_connection_setup_fn = :: std :: option :: Option < unsafe extern "C" fn (connection : * mut aws_http_connection , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when the connection has finished shutting down.\n Never invoked if on_setup failed.\n This is always invoked on connection's event-loop thread.\n Note that the connection is not completely done until on_shutdown has been invoked\n AND aws_http_connection_release() has been called."] pub type aws_http_on_client_connection_shutdown_fn = :: std :: option :: Option < unsafe extern "C" fn (connection : * mut aws_http_connection , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when the HTTP/2 settings change is complete.\n If connection setup successfully this will always be invoked whether settings change successfully or unsuccessfully.\n If error_code is AWS_ERROR_SUCCESS (0), then the peer has acknowledged the settings and the change has been applied.\n If error_code is non-zero, then a connection error occurred before the settings could be fully acknowledged and\n applied. This is always invoked on the connection's event-loop thread."] pub type aws_http2_on_change_settings_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (http2_connection : * mut aws_http_connection , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when the HTTP/2 PING completes, whether peer has acknowledged it or not.\n If error_code is AWS_ERROR_SUCCESS (0), then the peer has acknowledged the PING and round_trip_time_ns will be the\n round trip time in nano seconds for the connection.\n If error_code is non-zero, then a connection error occurred before the PING get acknowledgment and round_trip_time_ns\n will be useless in this case."] pub type aws_http2_on_ping_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (http2_connection : * mut aws_http_connection , round_trip_time_ns : u64 , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when an HTTP/2 GOAWAY frame is received from peer.\n Implies that the peer has initiated shutdown, or encountered a serious error.\n Once a GOAWAY is received, no further streams may be created on this connection.\n\n @param http2_connection This HTTP/2 connection.\n @param last_stream_id ID of the last locally-initiated stream that peer will\n process. Any locally-initiated streams with a higher ID are ignored by\n peer, and are safe to retry on another connection.\n @param http2_error_code The HTTP/2 error code (RFC-7540 section 7) sent by peer.\n `enum aws_http2_error_code` lists official codes.\n @param debug_data The debug data sent by peer. It can be empty. (NOTE: this data is only valid for the lifetime of\n the callback. Make a deep copy if you wish to keep it longer.)\n @param user_data User-data passed to the callback."] pub type aws_http2_on_goaway_received_fn = :: std :: option :: Option < unsafe extern "C" fn (http2_connection : * mut aws_http_connection , last_stream_id : u32 , http2_error_code : u32 , debug_data : aws_byte_cursor , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when new HTTP/2 settings from peer have been applied.\n Settings_array is the array of aws_http2_settings that contains all the settings we just changed in the order we\n applied (the order settings arrived). Num_settings is the number of elements in that array."] pub type aws_http2_on_remote_settings_change_fn = :: std :: option :: Option < unsafe extern "C" fn (http2_connection : * mut aws_http_connection , settings_array : * const aws_http2_setting , num_settings : usize , user_data : * mut :: libc :: c_void) > ; # [doc = " Callback invoked on each statistics sample.\n\n connection_nonce is unique to each connection for disambiguation of each callback per connection."] pub type aws_http_statistics_observer_fn = :: std :: option :: Option < unsafe extern "C" fn (connection_nonce : usize , stats_list : * const aws_array_list , user_data : * mut :: libc :: c_void) > ; # [doc = " Configuration options for connection monitoring"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_connection_monitoring_options { # [doc = " minimum required throughput of the connection. Throughput is only measured against the interval of time where\n there is actual io to perform. Read and write throughput are measured and checked independently of one another."] pub minimum_throughput_bytes_per_second : u64 , pub allowable_throughput_failure_interval_seconds : u32 , # [doc = " invoked on each statistics publish by the underlying IO channel. Install this callback to receive the statistics\n for observation. This field is optional."] pub statistics_observer_fn : aws_http_statistics_observer_fn , # [doc = " user_data to be passed to statistics_observer_fn."] pub statistics_observer_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_http_connection_monitoring_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_connection_monitoring_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_connection_monitoring_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_http_connection_monitoring_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_connection_monitoring_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_connection_monitoring_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . minimum_throughput_bytes_per_second) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_monitoring_options) , "::" , stringify ! (minimum_throughput_bytes_per_second))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allowable_throughput_failure_interval_seconds) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_monitoring_options) , "::" , stringify ! (allowable_throughput_failure_interval_seconds))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . statistics_observer_fn) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_monitoring_options) , "::" , stringify ! (statistics_observer_fn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . statistics_observer_user_data) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_monitoring_options) , "::" , stringify ! (statistics_observer_user_data))) ; } impl Default for aws_http_connection_monitoring_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Options specific to HTTP/1.x connections."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http1_connection_options { # [doc = " Optional\n Capacity in bytes of the HTTP/1 connection's read buffer.\n The buffer grows if the flow-control window of the incoming HTTP-stream\n reaches zero. If the buffer reaches capacity, no further socket data is\n read until the HTTP-stream's window opens again, allowing data to resume flowing.\n\n Ignored if `manual_window_management` is false.\n If zero is specified (the default) then a default capacity is chosen.\n A capacity that is too small may hinder throughput.\n A capacity that is too big may waste memory without helping throughput."] pub read_buffer_capacity : usize , } # [test] fn bindgen_test_layout_aws_http1_connection_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http1_connection_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http1_connection_options > () , 8usize , concat ! ("Size of: " , stringify ! (aws_http1_connection_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http1_connection_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http1_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . read_buffer_capacity) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http1_connection_options) , "::" , stringify ! (read_buffer_capacity))) ; } # [doc = " Options specific to HTTP/2 connections."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http2_connection_options { # [doc = " Optional\n The data of settings to change for initial settings.\n Note: each setting has its boundary. If settings_array is not set, num_settings has to be 0 to send an empty\n SETTINGS frame."] pub initial_settings_array : * mut aws_http2_setting , # [doc = " Required\n The num of settings to change (Length of the initial_settings_array)."] pub num_initial_settings : usize , # [doc = " Optional.\n Invoked when the HTTP/2 initial settings change is complete.\n If failed to setup the connection, this will not be invoked.\n Otherwise, this will be invoked, whether settings change successfully or unsuccessfully.\n See `aws_http2_on_change_settings_complete_fn`."] pub on_initial_settings_completed : aws_http2_on_change_settings_complete_fn , # [doc = " Optional\n The max number of recently-closed streams to remember.\n Set it to zero to use the default setting, AWS_HTTP2_DEFAULT_MAX_CLOSED_STREAMS\n\n If the connection receives a frame for a closed stream,\n the frame will be ignored or cause a connection error,\n depending on the frame type and how the stream was closed.\n Remembering more streams reduces the chances that a late frame causes\n a connection error, but costs some memory."] pub max_closed_streams : usize , # [doc = " Optional.\n Invoked when a valid GOAWAY frame received.\n See `aws_http2_on_goaway_received_fn`."] pub on_goaway_received : aws_http2_on_goaway_received_fn , # [doc = " Optional.\n Invoked when new settings from peer have been applied.\n See `aws_http2_on_remote_settings_change_fn`."] pub on_remote_settings_change : aws_http2_on_remote_settings_change_fn , # [doc = " Optional.\n Set to true to manually manage the flow-control window of whole HTTP/2 connection.\n\n If false, the connection will maintain its flow-control windows such that\n no back-pressure is applied and data arrives as fast as possible.\n\n If true, the flow-control window of the whole connection will shrink as body data\n is received (headers, padding, and other metadata do not affect the window) for every streams\n created on this connection.\n The initial connection flow-control window is 65,535.\n Once the connection's flow-control window reaches to 0, all the streams on the connection stop receiving any\n further data.\n The user must call aws_http2_connection_update_window() to increment the connection's\n window and keep data flowing.\n Note: the padding of data frame counts to the flow-control window.\n But, the client will always automatically update the window for padding even for manual window update."] pub conn_manual_window_management : bool , } # [test] fn bindgen_test_layout_aws_http2_connection_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http2_connection_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http2_connection_options > () , 56usize , concat ! ("Size of: " , stringify ! (aws_http2_connection_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http2_connection_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http2_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_settings_array) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (initial_settings_array))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_initial_settings) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (num_initial_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_initial_settings_completed) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (on_initial_settings_completed))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_closed_streams) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (max_closed_streams))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_goaway_received) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (on_goaway_received))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_remote_settings_change) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (on_remote_settings_change))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . conn_manual_window_management) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (conn_manual_window_management))) ; } impl Default for aws_http2_connection_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Options for creating an HTTP client connection.\n Initialize with AWS_HTTP_CLIENT_CONNECTION_OPTIONS_INIT to set default values."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_client_connection_options { # [doc = " The sizeof() this struct, used for versioning.\n Set by AWS_HTTP_CLIENT_CONNECTION_OPTIONS_INIT."] pub self_size : usize , # [doc = " Required.\n Must outlive the connection."] pub allocator : * mut aws_allocator , # [doc = " Required.\n The connection keeps the bootstrap alive via ref-counting."] pub bootstrap : * mut aws_client_bootstrap , # [doc = " Required.\n aws_http_client_connect() makes a copy."] pub host_name : aws_byte_cursor , # [doc = " Required."] pub port : u16 , # [doc = " Required.\n aws_http_client_connect() makes a copy."] pub socket_options : * const aws_socket_options , # [doc = " Optional.\n aws_http_client_connect() deep-copies all contents,\n and keeps `aws_tls_ctx` alive via ref-counting."] pub tls_options : * const aws_tls_connection_options , # [doc = " Optional\n Configuration options related to http proxy usage.\n Relevant fields are copied internally."] pub proxy_options : * const aws_http_proxy_options , pub proxy_ev_settings : * const proxy_env_var_settings , # [doc = " Optional\n Configuration options related to connection health monitoring"] pub monitoring_options : * const aws_http_connection_monitoring_options , # [doc = " Set to true to manually manage the flow-control window of each stream.\n\n If false, the connection will maintain its flow-control windows such that\n no back-pressure is applied and data arrives as fast as possible.\n\n If true, the flow-control window of each stream will shrink as body data\n is received (headers, padding, and other metadata do not affect the window).\n `initial_window_size` determines the starting size of each stream's window for HTTP/1 stream, while HTTP/2 stream\n will use the settings AWS_HTTP2_SETTINGS_INITIAL_WINDOW_SIZE to inform the other side about read back pressure\n\n If a stream's flow-control window reaches 0, no further data will be received. The user must call\n aws_http_stream_update_window() to increment the stream's window and keep data flowing.\n\n If a HTTP/2 connection created, it will ONLY control the stream window\n management. Connection window management is controlled by\n conn_manual_window_management. Note: the padding of data frame counts to the flow-control window.\n But, the client will always automatically update the window for padding even for manual window update."] pub manual_window_management : bool , # [doc = " The starting size of each HTTP stream's flow-control window for HTTP/1 connection.\n Required if `manual_window_management` is true,\n ignored if `manual_window_management` is false.\n\n Always ignored when HTTP/2 connection created. The initial window size is controlled by the settings,\n `AWS_HTTP2_SETTINGS_INITIAL_WINDOW_SIZE`"] pub initial_window_size : usize , # [doc = " User data for callbacks\n Optional."] pub user_data : * mut :: libc :: c_void , # [doc = " Invoked when connect completes.\n Required.\n See `aws_http_on_client_connection_setup_fn`."] pub on_setup : aws_http_on_client_connection_setup_fn , # [doc = " Invoked when the connection has finished shutting down.\n Never invoked if setup failed.\n Optional.\n See `aws_http_on_client_connection_shutdown_fn`."] pub on_shutdown : aws_http_on_client_connection_shutdown_fn , # [doc = " Optional.\n When true, use prior knowledge to set up an HTTP/2 connection on a cleartext\n connection.\n When TLS is set and this is true, the connection will failed to be established,\n as prior knowledge only works for cleartext TLS.\n Refer to RFC7540 3.4"] pub prior_knowledge_http2 : bool , # [doc = " Optional.\n Pointer to the hash map containing the ALPN string to protocol to use.\n Hash from `struct aws_string *` to `enum aws_http_version`.\n If not set, only the predefined string `h2` and `http/1.1` will be recognized. Other negotiated ALPN string will\n result in a HTTP1/1 connection\n Note: Connection will keep a deep copy of the table and the strings."] pub alpn_string_map : * mut aws_hash_table , # [doc = " Options specific to HTTP/1.x connections.\n Optional.\n Ignored if connection is not HTTP/1.x.\n If connection is HTTP/1.x and options were not specified, default values are used."] pub http1_options : * const aws_http1_connection_options , # [doc = " Options specific to HTTP/2 connections.\n Optional.\n Ignored if connection is not HTTP/2.\n If connection is HTTP/2 and options were not specified, default values are used."] pub http2_options : * const aws_http2_connection_options , # [doc = " Optional.\n Requests the channel/connection be bound to a specific event loop rather than chosen sequentially from the\n event loop group associated with the client bootstrap."] pub requested_event_loop : * mut aws_event_loop , # [doc = " Optional\n Host resolution override that allows the user to override DNS behavior for this particular connection."] pub host_resolution_config : * const aws_host_resolution_config , } # [test] fn bindgen_test_layout_aws_http_client_connection_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_client_connection_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_client_connection_options > () , 176usize , concat ! ("Size of: " , stringify ! (aws_http_client_connection_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_client_connection_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_client_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . self_size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (self_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . socket_options) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (socket_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_options) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (tls_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_options) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_settings) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (proxy_ev_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . monitoring_options) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (monitoring_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . manual_window_management) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (manual_window_management))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_window_size) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (initial_window_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_setup) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (on_setup))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_shutdown) as usize - ptr as usize } , 120usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (on_shutdown))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . prior_knowledge_http2) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (prior_knowledge_http2))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alpn_string_map) as usize - ptr as usize } , 136usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (alpn_string_map))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http1_options) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (http1_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http2_options) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (http2_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . requested_event_loop) as usize - ptr as usize } , 160usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (requested_event_loop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolution_config) as usize - ptr as usize } , 168usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (host_resolution_config))) ; } impl Default for aws_http_client_connection_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } impl aws_http2_settings_id { pub const AWS_HTTP2_SETTINGS_HEADER_TABLE_SIZE : aws_http2_settings_id = aws_http2_settings_id :: AWS_HTTP2_SETTINGS_BEGIN_RANGE ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http2_settings_id { AWS_HTTP2_SETTINGS_BEGIN_RANGE = 1 , AWS_HTTP2_SETTINGS_ENABLE_PUSH = 2 , AWS_HTTP2_SETTINGS_MAX_CONCURRENT_STREAMS = 3 , AWS_HTTP2_SETTINGS_INITIAL_WINDOW_SIZE = 4 , AWS_HTTP2_SETTINGS_MAX_FRAME_SIZE = 5 , AWS_HTTP2_SETTINGS_MAX_HEADER_LIST_SIZE = 6 , AWS_HTTP2_SETTINGS_END_RANGE = 7 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http2_setting { pub id : aws_http2_settings_id , pub value : u32 , } # [test] fn bindgen_test_layout_aws_http2_setting () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http2_setting > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http2_setting > () , 8usize , concat ! ("Size of: " , stringify ! (aws_http2_setting))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http2_setting > () , 4usize , concat ! ("Alignment of " , stringify ! (aws_http2_setting))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . id) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http2_setting) , "::" , stringify ! (id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (aws_http2_setting) , "::" , stringify ! (value))) ; } impl Default for aws_http2_setting { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Asynchronously establish a client connection.\n The on_setup callback is invoked when the operation has created a connection or failed."] pub fn aws_http_client_connect (options : * const aws_http_client_connection_options) -> :: libc :: c_int ; } extern "C" { # [doc = " Users must release the connection when they are done with it.\n The connection's memory cannot be reclaimed until this is done.\n If the connection was not already shutting down, it will be shut down.\n\n Users should always wait for the on_shutdown() callback to be called before releasing any data passed to the\n http_connection (Eg aws_tls_connection_options, aws_socket_options) otherwise there will be race conditions between\n http_connection shutdown tasks and memory release tasks, causing Segfaults."] pub fn aws_http_connection_release (connection : * mut aws_http_connection) ; } extern "C" { # [doc = " Begin shutdown sequence of the connection if it hasn't already started. This will schedule shutdown tasks on the\n EventLoop that may send HTTP/TLS/TCP shutdown messages to peers if necessary, and will eventually cause internal\n connection memory to stop being accessed and on_shutdown() callback to be called.\n\n It's safe to call this function regardless of the connection state as long as you hold a reference to the connection."] pub fn aws_http_connection_close (connection : * mut aws_http_connection) ; } extern "C" { # [doc = " Stop accepting new requests for the connection. It will NOT start the shutdown process for the connection. The\n requests that are already open can still wait to be completed, but new requests will fail to be created,"] pub fn aws_http_connection_stop_new_requests (connection : * mut aws_http_connection) ; } extern "C" { # [doc = " Returns true unless the connection is closed or closing."] pub fn aws_http_connection_is_open (connection : * const aws_http_connection) -> bool ; } extern "C" { # [doc = " Return whether the connection can make a new requests.\n If false, then a new connection must be established to make further requests."] pub fn aws_http_connection_new_requests_allowed (connection : * const aws_http_connection) -> bool ; } extern "C" { # [doc = " Returns true if this is a client connection."] pub fn aws_http_connection_is_client (connection : * const aws_http_connection) -> bool ; } extern "C" { pub fn aws_http_connection_get_version (connection : * const aws_http_connection) -> aws_http_version ; } extern "C" { # [doc = " Returns the channel hosting the HTTP connection.\n Do not expose this function to language bindings."] pub fn aws_http_connection_get_channel (connection : * mut aws_http_connection) -> * mut aws_channel ; } extern "C" { # [doc = " Returns the remote endpoint of the HTTP connection."] pub fn aws_http_connection_get_remote_endpoint (connection : * const aws_http_connection) -> * const aws_socket_endpoint ; } extern "C" { # [doc = " Initialize an map copied from the *src map, which maps `struct aws_string *` to `enum aws_http_version`."] pub fn aws_http_alpn_map_init_copy (allocator : * mut aws_allocator , dest : * mut aws_hash_table , src : * mut aws_hash_table) -> :: libc :: c_int ; } extern "C" { # [doc = " Initialize an empty hash-table that maps `struct aws_string *` to `enum aws_http_version`.\n This map can used in aws_http_client_connections_options.alpn_string_map."] pub fn aws_http_alpn_map_init (allocator : * mut aws_allocator , map : * mut aws_hash_table) -> :: libc :: c_int ; } extern "C" { # [doc = " Checks http proxy options for correctness"] pub fn aws_http_options_validate_proxy_configuration (options : * const aws_http_client_connection_options) -> :: libc :: c_int ; } extern "C" { # [doc = " Send a SETTINGS frame (HTTP/2 only).\n SETTINGS will be applied locally when SETTINGS ACK is received from peer.\n\n @param http2_connection HTTP/2 connection.\n @param settings_array The array of settings to change. Note: each setting has its boundary.\n @param num_settings The num of settings to change in settings_array.\n @param on_completed Optional callback, see `aws_http2_on_change_settings_complete_fn`.\n @param user_data User-data pass to on_completed callback."] pub fn aws_http2_connection_change_settings (http2_connection : * mut aws_http_connection , settings_array : * const aws_http2_setting , num_settings : usize , on_completed : aws_http2_on_change_settings_complete_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Send a PING frame (HTTP/2 only).\n Round-trip-time is calculated when PING ACK is received from peer.\n\n @param http2_connection HTTP/2 connection.\n @param optional_opaque_data Optional payload for PING frame.\n Must be NULL, or exactly 8 bytes (AWS_HTTP2_PING_DATA_SIZE).\n If NULL, the 8 byte payload will be all zeroes.\n @param on_completed Optional callback, invoked when PING ACK is received from peer,\n or when a connection error prevents the PING ACK from being received.\n Callback always fires on the connection's event-loop thread.\n @param user_data User-data pass to on_completed callback."] pub fn aws_http2_connection_ping (http2_connection : * mut aws_http_connection , optional_opaque_data : * const aws_byte_cursor , on_completed : aws_http2_on_ping_complete_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the local settings we are using to affect the decoding.\n\n @param http2_connection HTTP/2 connection.\n @param out_settings fixed size array of aws_http2_setting gets set to the local settings"] pub fn aws_http2_connection_get_local_settings (http2_connection : * const aws_http_connection , out_settings : * mut aws_http2_setting) ; } extern "C" { # [doc = " Get the settings received from remote peer, which we are using to restricts the message to send.\n\n @param http2_connection HTTP/2 connection.\n @param out_settings fixed size array of aws_http2_setting gets set to the remote settings"] pub fn aws_http2_connection_get_remote_settings (http2_connection : * const aws_http_connection , out_settings : * mut aws_http2_setting) ; } extern "C" { # [doc = " Send a custom GOAWAY frame (HTTP/2 only).\n\n Note that the connection automatically attempts to send a GOAWAY during\n shutdown (unless a GOAWAY with a valid Last-Stream-ID has already been sent).\n\n This call can be used to gracefully warn the peer of an impending shutdown\n (http2_error=0, allow_more_streams=true), or to customize the final GOAWAY\n frame that is sent by this connection.\n\n The other end may not receive the goaway, if the connection already closed.\n\n @param http2_connection HTTP/2 connection.\n @param http2_error The HTTP/2 error code (RFC-7540 section 7) to send.\n `enum aws_http2_error_code` lists official codes.\n @param allow_more_streams If true, new peer-initiated streams will continue\n to be acknowledged and the GOAWAY's Last-Stream-ID will be set to a max value.\n If false, new peer-initiated streams will be ignored and the GOAWAY's\n Last-Stream-ID will be set to the latest acknowledged stream.\n @param optional_debug_data Optional debug data to send. Size must not exceed 16KB."] pub fn aws_http2_connection_send_goaway (http2_connection : * mut aws_http_connection , http2_error : u32 , allow_more_streams : bool , optional_debug_data : * const aws_byte_cursor) ; } extern "C" { # [doc = " Get data about the latest GOAWAY frame sent to peer (HTTP/2 only).\n If no GOAWAY has been sent, AWS_ERROR_HTTP_DATA_NOT_AVAILABLE will be raised.\n Note that GOAWAY frames are typically sent automatically by the connection\n during shutdown.\n\n @param http2_connection HTTP/2 connection.\n @param out_http2_error Gets set to HTTP/2 error code sent in most recent GOAWAY.\n @param out_last_stream_id Gets set to Last-Stream-ID sent in most recent GOAWAY."] pub fn aws_http2_connection_get_sent_goaway (http2_connection : * mut aws_http_connection , out_http2_error : * mut u32 , out_last_stream_id : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Get data about the latest GOAWAY frame received from peer (HTTP/2 only).\n If no GOAWAY has been received, or the GOAWAY payload is still in transmitting,\n AWS_ERROR_HTTP_DATA_NOT_AVAILABLE will be raised.\n\n @param http2_connection HTTP/2 connection.\n @param out_http2_error Gets set to HTTP/2 error code received in most recent GOAWAY.\n @param out_last_stream_id Gets set to Last-Stream-ID received in most recent GOAWAY."] pub fn aws_http2_connection_get_received_goaway (http2_connection : * mut aws_http_connection , out_http2_error : * mut u32 , out_last_stream_id : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Increment the connection's flow-control window to keep data flowing (HTTP/2 only).\n\n If the connection was created with `conn_manual_window_management` set true,\n the flow-control window of the connection will shrink as body data is received for all the streams created on it.\n (headers, padding, and other metadata do not affect the window).\n The initial connection flow-control window is 65,535.\n Once the connection's flow-control window reaches to 0, all the streams on the connection stop receiving any further\n data.\n\n If `conn_manual_window_management` is false, this call will have no effect.\n The connection maintains its flow-control windows such that\n no back-pressure is applied and data arrives as fast as possible.\n\n If you are not connected, this call will have no effect.\n\n Crashes when the connection is not http2 connection.\n The limit of the Maximum Size is 2**31 - 1. If the increment size cause the connection flow window exceeds the\n Maximum size, this call will result in the connection lost.\n\n @param http2_connection HTTP/2 connection.\n @param increment_size The size to increment for the connection's flow control window"] pub fn aws_http2_connection_update_window (http2_connection : * mut aws_http_connection , increment_size : u32) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_future_impl { _unused : [u8 ; 0] , } # [doc = " Completion callback for aws_future"] pub type aws_future_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; pub type aws_future_impl_result_clean_up_fn = :: std :: option :: Option < unsafe extern "C" fn (result_addr : * mut :: libc :: c_void) > ; pub type aws_future_impl_result_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (result : * mut :: libc :: c_void) > ; pub type aws_future_impl_result_release_fn = :: std :: option :: Option < unsafe extern "C" fn (result : * mut :: libc :: c_void) -> * mut :: libc :: c_void > ; extern "C" { pub fn aws_future_impl_new_by_value (alloc : * mut aws_allocator , sizeof_result : usize) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_new_by_value_with_clean_up (alloc : * mut aws_allocator , sizeof_result : usize , result_clean_up : aws_future_impl_result_clean_up_fn) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_new_pointer (alloc : * mut aws_allocator) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_new_pointer_with_destroy (alloc : * mut aws_allocator , result_destroy : aws_future_impl_result_destroy_fn) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_new_pointer_with_release (alloc : * mut aws_allocator , result_release : aws_future_impl_result_release_fn) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_release (promise : * mut aws_future_impl) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_acquire (promise : * mut aws_future_impl) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_set_error (promise : * mut aws_future_impl , error_code : :: libc :: c_int) ; } extern "C" { pub fn aws_future_impl_set_result_by_move (promise : * mut aws_future_impl , src_address : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_impl_is_done (future : * const aws_future_impl) -> bool ; } extern "C" { pub fn aws_future_impl_register_callback (future : * mut aws_future_impl , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_impl_register_callback_if_not_done (future : * mut aws_future_impl , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) -> bool ; } extern "C" { pub fn aws_future_impl_register_event_loop_callback (future : * mut aws_future_impl , event_loop : * mut aws_event_loop , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_impl_register_channel_callback (future : * mut aws_future_impl , channel : * mut aws_channel , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_impl_wait (future : * const aws_future_impl , timeout_ns : u64) -> bool ; } extern "C" { pub fn aws_future_impl_get_error (future : * const aws_future_impl) -> :: libc :: c_int ; } extern "C" { pub fn aws_future_impl_get_result_address (future : * const aws_future_impl) -> * mut :: libc :: c_void ; } extern "C" { pub fn aws_future_impl_get_result_by_move (future : * mut aws_future_impl , dst_address : * mut :: libc :: c_void) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_future_size { _unused : [u8 ; 0] , } extern "C" { pub fn aws_future_size_new (alloc : * mut aws_allocator) -> * mut aws_future_size ; } extern "C" { pub fn aws_future_size_set_result (future : * mut aws_future_size , result : usize) ; } extern "C" { pub fn aws_future_size_get_result (future : * const aws_future_size) -> usize ; } extern "C" { pub fn aws_future_size_acquire (future : * mut aws_future_size) -> * mut aws_future_size ; } extern "C" { pub fn aws_future_size_release (future : * mut aws_future_size) -> * mut aws_future_size ; } extern "C" { pub fn aws_future_size_set_error (future : * mut aws_future_size , error_code : :: libc :: c_int) ; } extern "C" { pub fn aws_future_size_is_done (future : * const aws_future_size) -> bool ; } extern "C" { pub fn aws_future_size_get_error (future : * const aws_future_size) -> :: libc :: c_int ; } extern "C" { pub fn aws_future_size_register_callback (future : * mut aws_future_size , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_size_register_callback_if_not_done (future : * mut aws_future_size , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) -> bool ; } extern "C" { pub fn aws_future_size_register_event_loop_callback (future : * mut aws_future_size , event_loop : * mut aws_event_loop , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_size_register_channel_callback (future : * mut aws_future_size , channel : * mut aws_channel , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_size_wait (future : * mut aws_future_size , timeout_ns : u64) -> bool ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_future_bool { _unused : [u8 ; 0] , } extern "C" { pub fn aws_future_bool_new (alloc : * mut aws_allocator) -> * mut aws_future_bool ; } extern "C" { pub fn aws_future_bool_set_result (future : * mut aws_future_bool , result : bool) ; } extern "C" { pub fn aws_future_bool_get_result (future : * const aws_future_bool) -> bool ; } extern "C" { pub fn aws_future_bool_acquire (future : * mut aws_future_bool) -> * mut aws_future_bool ; } extern "C" { pub fn aws_future_bool_release (future : * mut aws_future_bool) -> * mut aws_future_bool ; } extern "C" { pub fn aws_future_bool_set_error (future : * mut aws_future_bool , error_code : :: libc :: c_int) ; } extern "C" { pub fn aws_future_bool_is_done (future : * const aws_future_bool) -> bool ; } extern "C" { pub fn aws_future_bool_get_error (future : * const aws_future_bool) -> :: libc :: c_int ; } extern "C" { pub fn aws_future_bool_register_callback (future : * mut aws_future_bool , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_bool_register_callback_if_not_done (future : * mut aws_future_bool , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) -> bool ; } extern "C" { pub fn aws_future_bool_register_event_loop_callback (future : * mut aws_future_bool , event_loop : * mut aws_event_loop , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_bool_register_channel_callback (future : * mut aws_future_bool , channel : * mut aws_channel , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_bool_wait (future : * mut aws_future_bool , timeout_ns : u64) -> bool ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_future_void { _unused : [u8 ; 0] , } extern "C" { `# [doc = " aws_future"]` pub fn aws_future_void_new (alloc : * mut aws_allocator) -> * mut aws_future_void ; } extern "C" { pub fn aws_future_void_set_result (future : * mut aws_future_void) ; } extern "C" { pub fn aws_future_void_acquire (future : * mut aws_future_void) -> * mut aws_future_void ; } extern "C" { pub fn aws_future_void_release (future : * mut aws_future_void) -> * mut aws_future_void ; } extern "C" { pub fn aws_future_void_set_error (future : * mut aws_future_void , error_code : :: libc :: c_int) ; } extern "C" { pub fn aws_future_void_is_done (future : * const aws_future_void) -> bool ; } extern "C" { pub fn aws_future_void_get_error (future : * const aws_future_void) -> :: libc :: c_int ; } extern "C" { pub fn aws_future_void_register_callback (future : * mut aws_future_void , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_void_register_callback_if_not_done (future : * mut aws_future_void , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) -> bool ; } extern "C" { pub fn aws_future_void_register_event_loop_callback (future : * mut aws_future_void , event_loop : * mut aws_event_loop , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_void_register_channel_callback (future : * mut aws_future_void , channel : * mut aws_channel , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_void_wait (future : * mut aws_future_void , timeout_ns : u64) -> bool ; } # [doc = " A stream exists for the duration of a request/response exchange.\n A client creates a stream to send a request and receive a response.\n A server creates a stream to receive a request and send a response.\n In http/2, a push-promise stream can be sent by a server and received by a client."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_stream { _unused : [u8 ; 0] , } # [repr (u32)] # [non_exhaustive] # [doc = " Controls whether a header's strings may be compressed by encoding the index of\n strings in a cache, rather than encoding the literal string.\n\n This setting has no effect on HTTP/1.x connections.\n On HTTP/2 connections this controls HPACK behavior.\n See RFC-7541 Section 7.1 for security considerations."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_header_compression { # [doc = " Compress header by encoding the cached index of its strings,\n or by updating the cache to contain these strings for future reference.\n Best for headers that are sent repeatedly.\n This is the default setting."] AWS_HTTP_HEADER_COMPRESSION_USE_CACHE = 0 , # [doc = " Encode header strings literally.\n If an intermediary re-broadcasts the headers, it is permitted to use cache.\n Best for unique headers that are unlikely to repeat."] AWS_HTTP_HEADER_COMPRESSION_NO_CACHE = 1 , # [doc = " Encode header strings literally and forbid all intermediaries from using\n cache when re-broadcasting.\n Best for header fields that are highly valuable or sensitive to recovery."] AWS_HTTP_HEADER_COMPRESSION_NO_FORWARD_CACHE = 2 , } # [doc = " A lightweight HTTP header struct.\n Note that the underlying strings are not owned by the byte cursors."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_header { pub name : aws_byte_cursor , pub value : aws_byte_cursor , pub compression : aws_http_header_compression , } # [test] fn bindgen_test_layout_aws_http_header () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_header > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_header > () , 40usize , concat ! ("Size of: " , stringify ! (aws_http_header))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_header > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_header))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . name) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_header) , "::" , stringify ! (name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_header) , "::" , stringify ! (value))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . compression) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_header) , "::" , stringify ! (compression))) ; } impl Default for aws_http_header { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " A transformable block of HTTP headers.\n Provides a nice API for getting/setting header names and values.\n\n All strings are copied and stored within this datastructure.\n The index of a given header may change any time headers are modified.\n When iterating headers, the following ordering rules apply:\n\n - Headers with the same name will always be in the same order, relative to one another.\n If \"A: one\" is added before \"A: two\", then \"A: one\" will always precede \"A: two\".\n\n - Headers with different names could be in any order, relative to one another.\n If \"A: one\" is seen before \"B: bee\" in one iteration, you might see \"B: bee\" before \"A: one\" on the next."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_headers { _unused : [u8 ; 0] , } # [repr (u32)] # [non_exhaustive] # [doc = " Header block type.\n INFORMATIONAL: Header block for 1xx informational (interim) responses.\n MAIN: Main header block sent with request or response.\n TRAILING: Headers sent after the body of a request or response."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_header_block { AWS_HTTP_HEADER_BLOCK_MAIN = 0 , AWS_HTTP_HEADER_BLOCK_INFORMATIONAL = 1 , AWS_HTTP_HEADER_BLOCK_TRAILING = 2 , } # [doc = " The definition for an outgoing HTTP request or response.\n The message may be transformed (ex: signing the request) before its data is eventually sent.\n\n The message keeps internal copies of its trivial strings (method, path, headers)\n but does NOT take ownership of its body stream.\n\n A language binding would likely present this as an HttpMessage base class with\n HttpRequest and HttpResponse subclasses."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_message { _unused : [u8 ; 0] , } # [doc = " Function to invoke when a message transformation completes.\n This function MUST be invoked or the application will soft-lock.\n `message` and `complete_ctx` must be the same pointers provided to the `aws_http_message_transform_fn`.\n `error_code` should should be AWS_ERROR_SUCCESS if transformation was successful,\n otherwise pass a different AWS_ERROR_X value."] pub type aws_http_message_transform_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (message : * mut aws_http_message , error_code : :: libc :: c_int , complete_ctx : * mut :: libc :: c_void) > ; # [doc = " A function that may modify a request or response before it is sent.\n The transformation may be asynchronous or immediate.\n The user MUST invoke the `complete_fn` when transformation is complete or the application will soft-lock.\n When invoking the `complete_fn`, pass along the `message` and `complete_ctx` provided here and an error code.\n The error code should be AWS_ERROR_SUCCESS if transformation was successful,\n otherwise pass a different AWS_ERROR_X value."] pub type aws_http_message_transform_fn = :: std :: option :: Option < unsafe extern "C" fn (message : * mut aws_http_message , user_data : * mut :: libc :: c_void , complete_fn : aws_http_message_transform_complete_fn , complete_ctx : * mut :: libc :: c_void) > ; # [doc = " Invoked repeatedly times as headers are received.\n At this point, aws_http_stream_get_incoming_response_status() can be called for the client.\n And aws_http_stream_get_incoming_request_method() and aws_http_stream_get_incoming_request_uri() can be called for\n the server.\n This is always invoked on the HTTP connection's event-loop thread.\n\n Return AWS_OP_SUCCESS to continue processing the stream.\n Return AWS_OP_ERR to indicate failure and cancel the stream."] pub type aws_http_on_incoming_headers_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , header_block : aws_http_header_block , header_array : * const aws_http_header , num_headers : usize , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Invoked when the incoming header block of this type(informational/main/trailing) has been completely read.\n This is always invoked on the HTTP connection's event-loop thread.\n\n Return AWS_OP_SUCCESS to continue processing the stream.\n Return AWS_OP_ERR to indicate failure and cancel the stream."] pub type aws_http_on_incoming_header_block_done_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , header_block : aws_http_header_block , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Called repeatedly as body data is received.\n The data must be copied immediately if you wish to preserve it.\n This is always invoked on the HTTP connection's event-loop thread.\n\n Note that, if the connection is using manual_window_management then the window\n size has shrunk by the amount of body data received. If the window size\n reaches 0 no further data will be received. Increment the window size with\n aws_http_stream_update_window().\n\n Return AWS_OP_SUCCESS to continue processing the stream.\n Return AWS_OP_ERR to indicate failure and cancel the stream."] pub type aws_http_on_incoming_body_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , data : * const aws_byte_cursor , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Invoked when request has been completely read.\n This is always invoked on the HTTP connection's event-loop thread.\n\n Return AWS_OP_SUCCESS to continue processing the stream.\n Return AWS_OP_ERR to indicate failure and cancel the stream."] pub type aws_http_on_incoming_request_done_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Invoked when request/response stream is completely destroyed.\n This may be invoked synchronously when aws_http_stream_release() is called.\n This is invoked even if the stream is never activated."] pub type aws_http_on_stream_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when request/response stream destroy completely.\n This can be invoked within the same thead who release the refcount on http stream."] pub type aws_http_on_stream_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [doc = " Tracing metrics for aws_http_stream.\n Data maybe not be available if the data of stream was never sent/received before it completes."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http_stream_metrics { pub send_start_timestamp_ns : i64 , pub send_end_timestamp_ns : i64 , pub sending_duration_ns : i64 , pub receive_start_timestamp_ns : i64 , pub receive_end_timestamp_ns : i64 , pub receiving_duration_ns : i64 , pub stream_id : u32 , } # [test] fn bindgen_test_layout_aws_http_stream_metrics () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_stream_metrics > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_stream_metrics > () , 56usize , concat ! ("Size of: " , stringify ! (aws_http_stream_metrics))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_stream_metrics > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_stream_metrics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . send_start_timestamp_ns) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (send_start_timestamp_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . send_end_timestamp_ns) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (send_end_timestamp_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . sending_duration_ns) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (sending_duration_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . receive_start_timestamp_ns) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (receive_start_timestamp_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . receive_end_timestamp_ns) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (receive_end_timestamp_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . receiving_duration_ns) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (receiving_duration_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . stream_id) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (stream_id))) ; } # [doc = " Invoked right before request/response stream is complete to report the tracing metrics for aws_http_stream.\n This may be invoked synchronously when aws_http_stream_release() is called.\n This is invoked even if the stream is never activated.\n See `aws_http_stream_metrics` for details."] pub type aws_http_on_stream_metrics_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , metrics : * const aws_http_stream_metrics , user_data : * mut :: libc :: c_void) > ; # [doc = " Options for creating a stream which sends a request from the client and receives a response from the server."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_make_request_options { # [doc = " The sizeof() this struct, used for versioning.\n Required."] pub self_size : usize , # [doc = " Definition for outgoing request.\n Required.\n The request will be kept alive via refcounting until the request completes."] pub request : * mut aws_http_message , pub user_data : * mut :: libc :: c_void , # [doc = " Invoked repeatedly times as headers are received.\n Optional.\n See `aws_http_on_incoming_headers_fn`."] pub on_response_headers : aws_http_on_incoming_headers_fn , # [doc = " Invoked when response header block has been completely read.\n Optional.\n See `aws_http_on_incoming_header_block_done_fn`."] pub on_response_header_block_done : aws_http_on_incoming_header_block_done_fn , # [doc = " Invoked repeatedly as body data is received.\n Optional.\n See `aws_http_on_incoming_body_fn`."] pub on_response_body : aws_http_on_incoming_body_fn , # [doc = " Invoked right before stream is complete, whether successful or unsuccessful\n Optional.\n See `aws_http_on_stream_metrics_fn`"] pub on_metrics : aws_http_on_stream_metrics_fn , # [doc = " Invoked when request/response stream is complete, whether successful or unsuccessful\n Optional.\n See `aws_http_on_stream_complete_fn`."] pub on_complete : aws_http_on_stream_complete_fn , pub on_destroy : aws_http_on_stream_destroy_fn , # [doc = " When using HTTP/2, request body data will be provided over time. The stream will only be polled for writing\n when data has been supplied via `aws_http2_stream_write_data`"] pub http2_use_manual_data_writes : bool , } # [test] fn bindgen_test_layout_aws_http_make_request_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_make_request_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_make_request_options > () , 80usize , concat ! ("Size of: " , stringify ! (aws_http_make_request_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_make_request_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_make_request_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . self_size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (self_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . request) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (request))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_response_headers) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_response_headers))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_response_header_block_done) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_response_header_block_done))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_response_body) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_response_body))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_metrics) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_metrics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_complete) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_destroy) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http2_use_manual_data_writes) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (http2_use_manual_data_writes))) ; } impl Default for aws_http_make_request_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_request_handler_options { pub self_size : usize , # [doc = " Required."] pub server_connection : * mut aws_http_connection , # [doc = " user_data passed to callbacks.\n Optional."] pub user_data : * mut :: libc :: c_void , # [doc = " Invoked repeatedly times as headers are received.\n Optional.\n See `aws_http_on_incoming_headers_fn`."] pub on_request_headers : aws_http_on_incoming_headers_fn , # [doc = " Invoked when the request header block has been completely read.\n Optional.\n See `aws_http_on_incoming_header_block_done_fn`."] pub on_request_header_block_done : aws_http_on_incoming_header_block_done_fn , # [doc = " Invoked as body data is received.\n Optional.\n See `aws_http_on_incoming_body_fn`."] pub on_request_body : aws_http_on_incoming_body_fn , # [doc = " Invoked when request has been completely read.\n Optional.\n See `aws_http_on_incoming_request_done_fn`."] pub on_request_done : aws_http_on_incoming_request_done_fn , # [doc = " Invoked when request/response stream is complete, whether successful or unsuccessful\n Optional.\n See `aws_http_on_stream_complete_fn`."] pub on_complete : aws_http_on_stream_complete_fn , pub on_destroy : aws_http_on_stream_destroy_fn , } # [test] fn bindgen_test_layout_aws_http_request_handler_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_request_handler_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_request_handler_options > () , 72usize , concat ! ("Size of: " , stringify ! (aws_http_request_handler_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_request_handler_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_request_handler_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . self_size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (self_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . server_connection) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (server_connection))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_request_headers) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_request_headers))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_request_header_block_done) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_request_header_block_done))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_request_body) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_request_body))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_request_done) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_request_done))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_complete) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_destroy) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_destroy))) ; } impl Default for aws_http_request_handler_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Invoked when the data stream of an outgoing HTTP write operation is no longer in use.\n This is always invoked on the HTTP connection's event-loop thread.\n\n @param stream HTTP-stream this write operation was submitted to.\n @param error_code If error_code is AWS_ERROR_SUCCESS (0), the data was successfully sent.\n Any other error_code indicates that the HTTP-stream is in the process of terminating.\n If the error_code is AWS_ERROR_HTTP_STREAM_HAS_COMPLETED,\n the stream's termination has nothing to do with this write operation.\n Any other non-zero error code indicates a problem with this particular write\n operation's data.\n @param user_data User data for this write operation."] pub type aws_http_stream_write_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when the data of an outgoing HTTP/1.1 chunk is no longer in use.\n This is always invoked on the HTTP connection's event-loop thread.\n\n @param stream HTTP-stream this chunk was submitted to.\n @param error_code If error_code is AWS_ERROR_SUCCESS (0), the data was successfully sent.\n Any other error_code indicates that the HTTP-stream is in the process of terminating.\n If the error_code is AWS_ERROR_HTTP_STREAM_HAS_COMPLETED,\n the stream's termination has nothing to do with this chunk.\n Any other non-zero error code indicates a problem with this particular chunk's data.\n @param user_data User data for this chunk."] pub type aws_http1_stream_write_chunk_complete_fn = aws_http_stream_write_complete_fn ; # [doc = " HTTP/1.1 chunk extension for chunked encoding.\n Note that the underlying strings are not owned by the byte cursors."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http1_chunk_extension { pub key : aws_byte_cursor , pub value : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_http1_chunk_extension () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http1_chunk_extension > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http1_chunk_extension > () , 32usize , concat ! ("Size of: " , stringify ! (aws_http1_chunk_extension))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http1_chunk_extension > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http1_chunk_extension))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . key) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_extension) , "::" , stringify ! (key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_extension) , "::" , stringify ! (value))) ; } impl Default for aws_http1_chunk_extension { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Encoding options for an HTTP/1.1 chunked transfer encoding chunk."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http1_chunk_options { pub chunk_data : * mut aws_input_stream , pub chunk_data_size : u64 , # [doc = " A pointer to an array of chunked extensions.\n The num_extensions must match the length of the array.\n This data is deep-copied by aws_http1_stream_write_chunk(),\n it does not need to remain valid until on_complete is invoked."] pub extensions : * mut aws_http1_chunk_extension , # [doc = " The number of elements defined in the extensions array."] pub num_extensions : usize , # [doc = " Invoked when the chunk data is no longer in use, whether or not it was successfully sent.\n Optional.\n See `aws_http1_stream_write_chunk_complete_fn`."] pub on_complete : aws_http1_stream_write_chunk_complete_fn , # [doc = " User provided data passed to the on_complete callback on its invocation."] pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_http1_chunk_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http1_chunk_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http1_chunk_options > () , 48usize , concat ! ("Size of: " , stringify ! (aws_http1_chunk_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http1_chunk_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http1_chunk_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . chunk_data) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (chunk_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . chunk_data_size) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (chunk_data_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . extensions) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (extensions))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_extensions) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (num_extensions))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_complete) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (on_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (user_data))) ; } impl Default for aws_http1_chunk_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Invoked when the data of an outgoing HTTP2 data frame is no longer in use.\n This is always invoked on the HTTP connection's event-loop thread.\n\n @param stream HTTP2-stream this write was submitted to.\n @param error_code If error_code is AWS_ERROR_SUCCESS (0), the data was successfully sent.\n Any other error_code indicates that the HTTP-stream is in the process of terminating.\n If the error_code is AWS_ERROR_HTTP_STREAM_HAS_COMPLETED,\n the stream's termination has nothing to do with this write.\n Any other non-zero error code indicates a problem with this particular write's data.\n @param user_data User data for this write."] pub type aws_http2_stream_write_data_complete_fn = aws_http_stream_write_complete_fn ; # [doc = " Encoding options for manual H2 data frame writes"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http2_stream_write_data_options { # [doc = " The data to be sent.\n Optional.\n If not set, input stream with length 0 will be used."] pub data : * mut aws_input_stream , # [doc = " Set true when it's the last chunk to be sent.\n After a write with end_stream, no more data write will be accepted."] pub end_stream : bool , # [doc = " Invoked when the data stream is no longer in use, whether or not it was successfully sent.\n Optional.\n See `aws_http2_stream_write_data_complete_fn`."] pub on_complete : aws_http2_stream_write_data_complete_fn , # [doc = " User provided data passed to the on_complete callback on its invocation."] pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_http2_stream_write_data_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http2_stream_write_data_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http2_stream_write_data_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_http2_stream_write_data_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http2_stream_write_data_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http2_stream_write_data_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . data) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http2_stream_write_data_options) , "::" , stringify ! (data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . end_stream) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http2_stream_write_data_options) , "::" , stringify ! (end_stream))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_complete) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http2_stream_write_data_options) , "::" , stringify ! (on_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http2_stream_write_data_options) , "::" , stringify ! (user_data))) ; } impl Default for aws_http2_stream_write_data_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Return whether both names are equivalent.\n This is a case-insensitive string comparison.\n\n Example Matches:\n \"Content-Length\" == \"content-length\" // upper or lower case ok\n\n Example Mismatches:\n \"Content-Length\" != \" Content-Length\" // leading whitespace bad"] pub fn aws_http_header_name_eq (name_a : aws_byte_cursor , name_b : aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Create a new headers object.\n The caller has a hold on the object and must call aws_http_headers_release() when they are done with it."] pub fn aws_http_headers_new (allocator : * mut aws_allocator) -> * mut aws_http_headers ; } extern "C" { # [doc = " Acquire a hold on the object, preventing it from being deleted until\n aws_http_headers_release() is called by all those with a hold on it."] pub fn aws_http_headers_acquire (headers : * mut aws_http_headers) ; } extern "C" { # [doc = " Release a hold on the object.\n The object is deleted when all holds on it are released."] pub fn aws_http_headers_release (headers : * mut aws_http_headers) ; } extern "C" { # [doc = " Add a header.\n The underlying strings are copied."] pub fn aws_http_headers_add_header (headers : * mut aws_http_headers , header : * const aws_http_header) -> :: libc :: c_int ; } extern "C" { # [doc = " Add a header.\n The underlying strings are copied."] pub fn aws_http_headers_add (headers : * mut aws_http_headers , name : aws_byte_cursor , value : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Add an array of headers.\n The underlying strings are copied."] pub fn aws_http_headers_add_array (headers : * mut aws_http_headers , array : * const aws_http_header , count : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Set a header value.\n The header is added if necessary and any existing values for this name are removed.\n The underlying strings are copied."] pub fn aws_http_headers_set (headers : * mut aws_http_headers , name : aws_byte_cursor , value : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the total number of headers."] pub fn aws_http_headers_count (headers : * const aws_http_headers) -> usize ; } extern "C" { # [doc = " Get the header at the specified index.\n The index of a given header may change any time headers are modified.\n When iterating headers, the following ordering rules apply:\n\n - Headers with the same name will always be in the same order, relative to one another.\n If \"A: one\" is added before \"A: two\", then \"A: one\" will always precede \"A: two\".\n\n - Headers with different names could be in any order, relative to one another.\n If \"A: one\" is seen before \"B: bee\" in one iteration, you might see \"B: bee\" before \"A: one\" on the next.\n\n AWS_ERROR_INVALID_INDEX is raised if the index is invalid."] pub fn aws_http_headers_get_index (headers : * const aws_http_headers , index : usize , out_header : * mut aws_http_header) -> :: libc :: c_int ; } extern "C" { # [doc = " Get all values with this name, combined into one new aws_string that you are responsible for destroying.\n If there are multiple headers with this name, their values are appended with comma-separators.\n If there are no headers with this name, NULL is returned and AWS_ERROR_HTTP_HEADER_NOT_FOUND is raised."] pub fn aws_http_headers_get_all (headers : * const aws_http_headers , name : aws_byte_cursor) -> * mut aws_string ; } extern "C" { # [doc = " Get the first value for this name, ignoring any additional values.\n AWS_ERROR_HTTP_HEADER_NOT_FOUND is raised if the name is not found."] pub fn aws_http_headers_get (headers : * const aws_http_headers , name : aws_byte_cursor , out_value : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Test if header name exists or not in headers"] pub fn aws_http_headers_has (headers : * const aws_http_headers , name : aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Remove all headers with this name.\n AWS_ERROR_HTTP_HEADER_NOT_FOUND is raised if no headers with this name are found."] pub fn aws_http_headers_erase (headers : * mut aws_http_headers , name : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Remove the first header found with this name and value.\n AWS_ERROR_HTTP_HEADER_NOT_FOUND is raised if no such header is found."] pub fn aws_http_headers_erase_value (headers : * mut aws_http_headers , name : aws_byte_cursor , value : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Remove the header at the specified index.\n\n AWS_ERROR_INVALID_INDEX is raised if the index is invalid."] pub fn aws_http_headers_erase_index (headers : * mut aws_http_headers , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Clear all headers."] pub fn aws_http_headers_clear (headers : * mut aws_http_headers) ; } extern "C" { # [doc = " Get the `:method` value (HTTP/2 headers only)."] pub fn aws_http2_headers_get_request_method (h2_headers : * const aws_http_headers , out_method : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set `:method` (HTTP/2 headers only).\n The headers makes its own copy of the underlying string."] pub fn aws_http2_headers_set_request_method (h2_headers : * mut aws_http_headers , method : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_http2_headers_get_request_scheme (h2_headers : * const aws_http_headers , out_scheme : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set `:scheme` (request pseudo headers only).\n The pseudo headers makes its own copy of the underlying string."] pub fn aws_http2_headers_set_request_scheme (h2_headers : * mut aws_http_headers , scheme : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_http2_headers_get_request_authority (h2_headers : * const aws_http_headers , out_authority : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set `:authority` (request pseudo headers only).\n The pseudo headers makes its own copy of the underlying string."] pub fn aws_http2_headers_set_request_authority (h2_headers : * mut aws_http_headers , authority : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_http2_headers_get_request_path (h2_headers : * const aws_http_headers , out_path : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set `:path` (request pseudo headers only).\n The pseudo headers makes its own copy of the underlying string."] pub fn aws_http2_headers_set_request_path (h2_headers : * mut aws_http_headers , path : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Get `:status` (response pseudo headers only).\n If no status is set, AWS_ERROR_HTTP_DATA_NOT_AVAILABLE is raised."] pub fn aws_http2_headers_get_response_status (h2_headers : * const aws_http_headers , out_status_code : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Set `:status` (response pseudo headers only)."] pub fn aws_http2_headers_set_response_status (h2_headers : * mut aws_http_headers , status_code : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Create a new HTTP/1.1 request message.\n The message is blank, all properties (method, path, etc) must be set individually.\n If HTTP/1.1 message used in HTTP/2 connection, the transformation will be automatically applied.\n A HTTP/2 message will created and sent based on the HTTP/1.1 message.\n\n The caller has a hold on the object and must call aws_http_message_release() when they are done with it."] pub fn aws_http_message_new_request (allocator : * mut aws_allocator) -> * mut aws_http_message ; } extern "C" { # [doc = " Like aws_http_message_new_request(), but uses existing aws_http_headers instead of creating a new one.\n Acquires a hold on the headers, and releases it when the request is destroyed."] pub fn aws_http_message_new_request_with_headers (allocator : * mut aws_allocator , existing_headers : * mut aws_http_headers) -> * mut aws_http_message ; } extern "C" { # [doc = " Create a new HTTP/1.1 response message.\n The message is blank, all properties (status, headers, etc) must be set individually.\n\n The caller has a hold on the object and must call aws_http_message_release() when they are done with it."] pub fn aws_http_message_new_response (allocator : * mut aws_allocator) -> * mut aws_http_message ; } extern "C" { # [doc = " Create a new HTTP/2 request message.\n pseudo headers need to be set from aws_http2_headers_set_request_* to the headers of the aws_http_message.\n Will be errored out if used in HTTP/1.1 connection.\n\n The caller has a hold on the object and must call aws_http_message_release() when they are done with it."] pub fn aws_http2_message_new_request (allocator : * mut aws_allocator) -> * mut aws_http_message ; } extern "C" { # [doc = " Create a new HTTP/2 response message.\n pseudo headers need to be set from aws_http2_headers_set_response_status to the headers of the aws_http_message.\n Will be errored out if used in HTTP/1.1 connection.\n\n The caller has a hold on the object and must call aws_http_message_release() when they are done with it."] pub fn aws_http2_message_new_response (allocator : * mut aws_allocator) -> * mut aws_http_message ; } extern "C" { # [doc = " Create an HTTP/2 message from HTTP/1.1 message.\n pseudo headers will be created from the context and added to the headers of new message.\n Normal headers will be copied to the headers of new message.\n Note:\n - if `host` exist, it will be removed and `:authority` will be added using the information.\n - `:scheme` always defaults to \"https\". To use a different scheme create the HTTP/2 message directly"] pub fn aws_http2_message_new_from_http1 (alloc : * mut aws_allocator , http1_msg : * const aws_http_message) -> * mut aws_http_message ; } extern "C" { # [doc = " Acquire a hold on the object, preventing it from being deleted until\n aws_http_message_release() is called by all those with a hold on it.\n\n This function returns the passed in message (possibly NULL) so that acquire-and-assign can be done with a single\n statement."] pub fn aws_http_message_acquire (message : * mut aws_http_message) -> * mut aws_http_message ; } extern "C" { # [doc = " Release a hold on the object.\n The object is deleted when all holds on it are released.\n\n This function always returns NULL so that release-and-assign-NULL can be done with a single statement."] pub fn aws_http_message_release (message : * mut aws_http_message) -> * mut aws_http_message ; } extern "C" { # [doc = " Deprecated. This is equivalent to aws_http_message_release()."] pub fn aws_http_message_destroy (message : * mut aws_http_message) ; } extern "C" { pub fn aws_http_message_is_request (message : * const aws_http_message) -> bool ; } extern "C" { pub fn aws_http_message_is_response (message : * const aws_http_message) -> bool ; } extern "C" { # [doc = " Get the protocol version of the http message."] pub fn aws_http_message_get_protocol_version (message : * const aws_http_message) -> aws_http_version ; } extern "C" { # [doc = " Get the method (request messages only)."] pub fn aws_http_message_get_request_method (request_message : * const aws_http_message , out_method : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set the method (request messages only).\n The request makes its own copy of the underlying string."] pub fn aws_http_message_set_request_method (request_message : * mut aws_http_message , method : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_http_message_get_request_path (request_message : * const aws_http_message , out_path : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set the path-and-query value (request messages only).\n The request makes its own copy of the underlying string."] pub fn aws_http_message_set_request_path (request_message : * mut aws_http_message , path : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the status code (response messages only).\n If no status is set, AWS_ERROR_HTTP_DATA_NOT_AVAILABLE is raised."] pub fn aws_http_message_get_response_status (response_message : * const aws_http_message , out_status_code : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Set the status code (response messages only)."] pub fn aws_http_message_set_response_status (response_message : * mut aws_http_message , status_code : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the body stream.\n Returns NULL if no body stream is set."] pub fn aws_http_message_get_body_stream (message : * const aws_http_message) -> * mut aws_input_stream ; } extern "C" { # [doc = " Set the body stream.\n NULL is an acceptable value for messages with no body.\n Note: The message does NOT take ownership of the body stream.\n The stream must not be destroyed until the message is complete."] pub fn aws_http_message_set_body_stream (message : * mut aws_http_message , body_stream : * mut aws_input_stream) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_future_http_message { _unused : [u8 ; 0] , } extern "C" { pub fn aws_future_http_message_new (alloc : * mut aws_allocator) -> * mut aws_future_http_message ; } extern "C" { pub fn aws_future_http_message_set_result_by_move (future : * mut aws_future_http_message , pointer_address : * mut * mut aws_http_message) ; } extern "C" { pub fn aws_future_http_message_get_result_by_move (future : * mut aws_future_http_message) -> * mut aws_http_message ; } extern "C" { pub fn aws_future_http_message_peek_result (future : * const aws_future_http_message) -> * mut aws_http_message ; } extern "C" { pub fn aws_future_http_message_acquire (future : * mut aws_future_http_message) -> * mut aws_future_http_message ; } extern "C" { pub fn aws_future_http_message_release (future : * mut aws_future_http_message) -> * mut aws_future_http_message ; } extern "C" { pub fn aws_future_http_message_set_error (future : * mut aws_future_http_message , error_code : :: libc :: c_int) ; } extern "C" { pub fn aws_future_http_message_is_done (future : * const aws_future_http_message) -> bool ; } extern "C" { pub fn aws_future_http_message_get_error (future : * const aws_future_http_message) -> :: libc :: c_int ; } extern "C" { pub fn aws_future_http_message_register_callback (future : * mut aws_future_http_message , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_http_message_register_callback_if_not_done (future : * mut aws_future_http_message , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) -> bool ; } extern "C" { pub fn aws_future_http_message_register_event_loop_callback (future : * mut aws_future_http_message , event_loop : * mut aws_event_loop , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_http_message_register_channel_callback (future : * mut aws_future_http_message , channel : * mut aws_channel , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_http_message_wait (future : * mut aws_future_http_message , timeout_ns : u64) -> bool ; } extern "C" { # [doc = " Submit a chunk of data to be sent on an HTTP/1.1 stream.\n The stream must have specified \"chunked\" in a \"transfer-encoding\" header.\n For client streams, activate() must be called before any chunks are submitted.\n For server streams, the response must be submitted before any chunks.\n A final chunk with size 0 must be submitted to successfully complete the HTTP-stream.\n\n Returns AWS_OP_SUCCESS if the chunk has been submitted. The chunk's completion\n callback will be invoked when the HTTP-stream is done with the chunk data,\n whether or not it was successfully sent (see `aws_http1_stream_write_chunk_complete_fn`).\n The chunk data must remain valid until the completion callback is invoked.\n\n Returns AWS_OP_ERR and raises an error if the chunk could not be submitted.\n In this case, the chunk's completion callback will never be invoked.\n Note that it is always possible for the HTTP-stream to terminate unexpectedly\n prior to this call being made, in which case the error raised is\n AWS_ERROR_HTTP_STREAM_HAS_COMPLETED."] pub fn aws_http1_stream_write_chunk (http1_stream : * mut aws_http_stream , options : * const aws_http1_chunk_options) -> :: libc :: c_int ; } extern "C" { # [doc = " The stream must have specified `http2_use_manual_data_writes` during request creation.\n For client streams, activate() must be called before any frames are submitted.\n For server streams, the response headers must be submitted before any frames.\n A write with options that has end_stream set to be true will end the stream and prevent any further write.\n\n @return AWS_OP_SUCCESS if the write was queued\n AWS_OP_ERROR indicating the attempt raised an error code.\n AWS_ERROR_INVALID_STATE will be raised for invalid usage.\n AWS_ERROR_HTTP_STREAM_HAS_COMPLETED will be raised if the stream ended for reasons behind the scenes.\n\n Typical usage will be something like:\n options.http2_use_manual_data_writes = true;\n stream = aws_http_connection_make_request(connection, &options);\n aws_http_stream_activate(stream);\n ...\n struct aws_http2_stream_write_data_options write;\n aws_http2_stream_write_data(stream, &write);\n ...\n struct aws_http2_stream_write_data_options last_write;\n last_write.end_stream = true;\n aws_http2_stream_write_data(stream, &write);\n ...\n aws_http_stream_release(stream);"] pub fn aws_http2_stream_write_data (http2_stream : * mut aws_http_stream , options : * const aws_http2_stream_write_data_options) -> :: libc :: c_int ; } extern "C" { # [doc = " Add a list of headers to be added as trailing headers sent after the last chunk is sent.\n a \"Trailer\" header field which indicates the fields present in the trailer.\n\n Certain headers are forbidden in the trailer (e.g., Transfer-Encoding, Content-Length, Host). See RFC-7541\n Section 4.1.2 for more details.\n\n For client streams, activate() must be called before any chunks are submitted.\n\n For server streams, the response must be submitted before the trailer can be added\n\n aws_http1_stream_add_chunked_trailer must be called before the final size 0 chunk, and at the moment can only\n be called once, though this could change if need be.\n\n Returns AWS_OP_SUCCESS if the chunk has been submitted."] pub fn aws_http1_stream_add_chunked_trailer (http1_stream : * mut aws_http_stream , trailing_headers : * const aws_http_headers) -> :: libc :: c_int ; } extern "C" { # [doc = " This datastructure has more functions for inspecting and modifying headers than\n are available on the aws_http_message datastructure."] pub fn aws_http_message_get_headers (message : * const aws_http_message) -> * mut aws_http_headers ; } extern "C" { # [doc = " Get the message's const aws_http_headers."] pub fn aws_http_message_get_const_headers (message : * const aws_http_message) -> * const aws_http_headers ; } extern "C" { # [doc = " Get the number of headers."] pub fn aws_http_message_get_header_count (message : * const aws_http_message) -> usize ; } extern "C" { # [doc = " Get the header at the specified index.\n This function cannot fail if a valid index is provided.\n Otherwise, AWS_ERROR_INVALID_INDEX will be raised.\n\n The underlying strings are stored within the message."] pub fn aws_http_message_get_header (message : * const aws_http_message , out_header : * mut aws_http_header , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Add a header to the end of the array.\n The message makes its own copy of the underlying strings."] pub fn aws_http_message_add_header (message : * mut aws_http_message , header : aws_http_header) -> :: libc :: c_int ; } extern "C" { # [doc = " Add an array of headers to the end of the header array.\n The message makes its own copy of the underlying strings.\n\n This is a helper function useful when it's easier to define headers as a stack array, rather than calling add_header\n repeatedly."] pub fn aws_http_message_add_header_array (message : * mut aws_http_message , headers : * const aws_http_header , num_headers : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Remove the header at the specified index.\n Headers after this index are all shifted back one position.\n\n This function cannot fail if a valid index is provided.\n Otherwise, AWS_ERROR_INVALID_INDEX will be raised."] pub fn aws_http_message_erase_header (message : * mut aws_http_message , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Create a stream, with a client connection sending a request.\n The request does not start sending automatically once the stream is created. You must call\n aws_http_stream_activate to begin execution of the request.\n\n The `options` are copied during this call.\n\n Tip for language bindings: Do not bind the `options` struct. Use something more natural for your language,\n such as Builder Pattern in Java, or Python's ability to take many optional arguments by name.\n\n Note: The header of the request will be sent as it is when the message to send protocol matches the protocol of the\n connection.\n - No `user-agent` will be added.\n - No security check will be enforced. eg: `referer` header privacy should be enforced by the user-agent who adds the\n header\n - When HTTP/1 message sent on HTTP/2 connection, `aws_http2_message_new_from_http1` will be applied under the hood.\n - When HTTP/2 message sent on HTTP/1 connection, no change will be made."] pub fn aws_http_connection_make_request (client_connection : * mut aws_http_connection , options : * const aws_http_make_request_options) -> * mut aws_http_stream ; } extern "C" { # [doc = " Create a stream, with a server connection receiving and responding to a request.\n This function can only be called from the `aws_http_on_incoming_request_fn` callback.\n aws_http_stream_send_response() should be used to send a response."] pub fn aws_http_stream_new_server_request_handler (options : * const aws_http_request_handler_options) -> * mut aws_http_stream ; } extern "C" { # [doc = " Acquire refcount on the stream to prevent it from being cleaned up until it is released."] pub fn aws_http_stream_acquire (stream : * mut aws_http_stream) -> * mut aws_http_stream ; } extern "C" { # [doc = " Users must release the stream when they are done with it, or its memory will never be cleaned up.\n This will not cancel the stream, its callbacks will still fire if the stream is still in progress.\n\n Tips for language bindings:\n - Invoke this from the wrapper class's finalizer/destructor.\n - Do not let the wrapper class be destroyed until on_complete() has fired."] pub fn aws_http_stream_release (stream : * mut aws_http_stream) ; } extern "C" { # [doc = " Only used for client initiated streams (immediately following a call to aws_http_connection_make_request).\n\n Activates the request's outgoing stream processing."] pub fn aws_http_stream_activate (stream : * mut aws_http_stream) -> :: libc :: c_int ; } extern "C" { pub fn aws_http_stream_get_connection (stream : * const aws_http_stream) -> * mut aws_http_connection ; } extern "C" { pub fn aws_http_stream_get_incoming_response_status (stream : * const aws_http_stream , out_status : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { pub fn aws_http_stream_get_incoming_request_method (stream : * const aws_http_stream , out_method : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_http_stream_get_incoming_request_uri (stream : * const aws_http_stream , out_uri : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Send response (only callable from \"request handler\" streams)\n The response object must stay alive at least until the stream's on_complete is called."] pub fn aws_http_stream_send_response (stream : * mut aws_http_stream , response : * mut aws_http_message) -> :: libc :: c_int ; } extern "C" { # [doc = " Increment the stream's flow-control window to keep data flowing.\n\n If the connection was created with `manual_window_management` set true,\n the flow-control window of each stream will shrink as body data is received\n (headers, padding, and other metadata do not affect the window).\n The connection's `initial_window_size` determines the starting size of each stream's window.\n If a stream's flow-control window reaches 0, no further data will be received.\n\n If `manual_window_management` is false, this call will have no effect.\n The connection maintains its flow-control windows such that\n no back-pressure is applied and data arrives as fast as possible."] pub fn aws_http_stream_update_window (stream : * mut aws_http_stream , increment_size : usize) ; } extern "C" { # [doc = " Gets the HTTP/2 id associated with a stream. Even h1 streams have an id (using the same allocation procedure\n as http/2) for easier tracking purposes. For client streams, this will only be non-zero after a successful call\n to aws_http_stream_activate()"] pub fn aws_http_stream_get_id (stream : * const aws_http_stream) -> u32 ; } extern "C" { # [doc = " Reset the HTTP/2 stream (HTTP/2 only).\n Note that if the stream closes before this async call is fully processed, the RST_STREAM frame will not be sent.\n\n @param http2_stream HTTP/2 stream.\n @param http2_error aws_http2_error_code. Reason to reset the stream."] pub fn aws_http2_stream_reset (http2_stream : * mut aws_http_stream , http2_error : u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the error code received in rst_stream.\n Only valid if the stream has completed, and an RST_STREAM frame has received.\n\n @param http2_stream HTTP/2 stream.\n @param out_http2_error Gets to set to HTTP/2 error code received in rst_stream."] pub fn aws_http2_stream_get_received_reset_error_code (http2_stream : * mut aws_http_stream , out_http2_error : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the HTTP/2 error code sent in the RST_STREAM frame (HTTP/2 only).\n Only valid if the stream has completed, and has sent an RST_STREAM frame.\n\n @param http2_stream HTTP/2 stream.\n @param out_http2_error Gets to set to HTTP/2 error code sent in rst_stream."] pub fn aws_http2_stream_get_sent_reset_error_code (http2_stream : * mut aws_http_stream , out_http2_error : * mut u32) -> :: libc :: c_int ; } pub type aws_simple_completion_callback = :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_ref_count { pub ref_count : aws_atomic_var , pub object : * mut :: libc :: c_void , pub on_zero_fn : aws_simple_completion_callback , } # [test] fn bindgen_test_layout_aws_ref_count () { const UNINIT : :: std :: mem :: MaybeUninit < aws_ref_count > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_ref_count > () , 24usize , concat ! ("Size of: " , stringify ! (aws_ref_count))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_ref_count > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_ref_count) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . object) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_ref_count) , "::" , stringify ! (object))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_zero_fn) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_ref_count) , "::" , stringify ! (on_zero_fn))) ; } impl Default for aws_ref_count { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_shutdown_callback_options { pub shutdown_callback_fn : aws_simple_completion_callback , pub shutdown_callback_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_shutdown_callback_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_shutdown_callback_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_shutdown_callback_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_shutdown_callback_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_shutdown_callback_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_shutdown_callback_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback_fn) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_shutdown_callback_options) , "::" , stringify ! (shutdown_callback_fn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback_user_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_shutdown_callback_options) , "::" , stringify ! (shutdown_callback_user_data))) ; } impl Default for aws_shutdown_callback_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Initializes a ref-counter structure. After initialization, the ref count will be 1.\n\n @param ref_count ref-counter to initialize\n @param object object being ref counted\n @param on_zero_fn function to invoke when the ref count reaches zero"] pub fn aws_ref_count_init (ref_count : * mut aws_ref_count , object : * mut :: libc :: c_void , on_zero_fn : aws_simple_completion_callback) ; } extern "C" { # [doc = " Increments a ref-counter's ref count\n\n @param ref_count ref-counter to increment the count for\n @return the object being ref-counted"] pub fn aws_ref_count_acquire (ref_count : * mut aws_ref_count) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Decrements a ref-counter's ref count. Invokes the on_zero callback if the ref count drops to zero\n @param ref_count ref-counter to decrement the count for\n @return the value of the decremented ref count"] pub fn aws_ref_count_release (ref_count : * mut aws_ref_count) -> usize ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_async_input_stream { pub vtable : * const aws_async_input_stream_vtable , pub alloc : * mut aws_allocator , pub ref_count : aws_ref_count , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_async_input_stream () { const UNINIT : :: std :: mem :: MaybeUninit < aws_async_input_stream > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_async_input_stream > () , 48usize , concat ! ("Size of: " , stringify ! (aws_async_input_stream))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_async_input_stream > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_async_input_stream))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream) , "::" , stringify ! (impl_))) ; } impl Default for aws_async_input_stream { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_async_input_stream_vtable { # [doc = " Destroy the stream, its refcount has reached 0."] pub destroy : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_async_input_stream) > , # [doc = " Read once into the buffer.\n Complete the read when at least 1 byte is read, the buffer is full, or EOF is reached.\n Do not resize the buffer (do not use \"aws_byte_buf_xyz_dynamic()\" functions)\n Do not assume that buffer len starts at 0.\n You may assume that read() won't be called again until the current one completes.\n You may assume that the buffer has some space available.\n Return a future, which will contain an error code if something went wrong,\n or a result bool indicating whether EOF has been reached."] pub read : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_async_input_stream , dest : * mut aws_byte_buf) -> * mut aws_future_bool > , } # [test] fn bindgen_test_layout_aws_async_input_stream_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_async_input_stream_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_async_input_stream_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_async_input_stream_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_async_input_stream_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_async_input_stream_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . read) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream_vtable) , "::" , stringify ! (read))) ; } extern "C" { # [doc = " Initialize aws_async_input_stream \"base class\""] pub fn aws_async_input_stream_init_base (stream : * mut aws_async_input_stream , alloc : * mut aws_allocator , vtable : * const aws_async_input_stream_vtable , impl_ : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Increment reference count.\n You may pass in NULL (has no effect).\n Returns whatever pointer was passed in."] pub fn aws_async_input_stream_acquire (stream : * mut aws_async_input_stream) -> * mut aws_async_input_stream ; } extern "C" { # [doc = " Decrement reference count.\n You may pass in NULL (has no effect).\n Always returns NULL."] pub fn aws_async_input_stream_release (stream : * mut aws_async_input_stream) -> * mut aws_async_input_stream ; } extern "C" { # [doc = " Read once from the async stream into the buffer.\n The read completes when at least 1 byte is read, the buffer is full, or EOF is reached.\n Depending on implementation, the read could complete at any time.\n It may complete synchronously. It may complete on another thread.\n Returns a future, which will contain an error code if something went wrong,\n or a result bool indicating whether EOF has been reached.\n\n WARNING: The buffer must have space available.\n WARNING: Do not read again until the previous read is complete."] pub fn aws_async_input_stream_read (stream : * mut aws_async_input_stream , dest : * mut aws_byte_buf) -> * mut aws_future_bool ; } extern "C" { # [doc = " Read repeatedly from the async stream until the buffer is full, or EOF is reached.\n Depending on implementation, this could complete at any time.\n It may complete synchronously. It may complete on another thread.\n Returns a future, which will contain an error code if something went wrong,\n or a result bool indicating whether EOF has been reached.\n\n WARNING: The buffer must have space available.\n WARNING: Do not read again until the previous read is complete."] pub fn aws_async_input_stream_read_to_fill (stream : * mut aws_async_input_stream , dest : * mut aws_byte_buf) -> * mut aws_future_bool ; } pub type aws_crt_statistics_category_t = u32 ; pub const AWS_CRT_STATISTICS_CATEGORY_STRIDE_BITS : _bindgen_ty_22 = _bindgen_ty_22 :: AWS_CRT_STATISTICS_CATEGORY_STRIDE_BITS ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_22 { AWS_CRT_STATISTICS_CATEGORY_STRIDE_BITS = 8 , } # [repr (u32)] # [non_exhaustive] # [doc = " The common-specific range of the aws_crt_statistics_category cross-library enum.\n\n This enum functions as an RTTI value that lets statistics handler's interpret (via cast) a\n specific statistics structure if the RTTI value is understood.\n\n Common doesn't have any statistics structures presently, so its range is essentially empty.\n"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_crt_common_statistics_category { AWSCRT_STAT_CAT_INVALID = 0 , } # [doc = " Pattern-struct that functions as a base \"class\" for all statistics structures. To conform\n to the pattern, a statistics structure must have its first member be the category. In that\n case it becomes \"safe\" to cast from aws_crt_statistics_base to the specific statistics structure\n based on the category value."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_crt_statistics_base { pub category : aws_crt_statistics_category_t , } # [test] fn bindgen_test_layout_aws_crt_statistics_base () { const UNINIT : :: std :: mem :: MaybeUninit < aws_crt_statistics_base > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_crt_statistics_base > () , 4usize , concat ! ("Size of: " , stringify ! (aws_crt_statistics_base))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_crt_statistics_base > () , 4usize , concat ! ("Alignment of " , stringify ! (aws_crt_statistics_base))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . category) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_base) , "::" , stringify ! (category))) ; } # [doc = " The start and end time, in milliseconds-since-epoch, that a set of statistics was gathered over."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_crt_statistics_sample_interval { pub begin_time_ms : u64 , pub end_time_ms : u64 , } # [test] fn bindgen_test_layout_aws_crt_statistics_sample_interval () { const UNINIT : :: std :: mem :: MaybeUninit < aws_crt_statistics_sample_interval > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_crt_statistics_sample_interval > () , 16usize , concat ! ("Size of: " , stringify ! (aws_crt_statistics_sample_interval))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_crt_statistics_sample_interval > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_crt_statistics_sample_interval))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . begin_time_ms) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_sample_interval) , "::" , stringify ! (begin_time_ms))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . end_time_ms) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_sample_interval) , "::" , stringify ! (end_time_ms))) ; } pub type aws_crt_statistics_handler_process_statistics_fn = :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_crt_statistics_handler , interval : * mut aws_crt_statistics_sample_interval , stats : * mut aws_array_list , context : * mut :: libc :: c_void) > ; pub type aws_crt_statistics_handler_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_crt_statistics_handler) > ; pub type aws_crt_statistics_handler_get_report_interval_ms_fn = :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut aws_crt_statistics_handler) -> u64 > ; # [doc = " Vtable for functions that all statistics handlers must implement"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_crt_statistics_handler_vtable { pub process_statistics : aws_crt_statistics_handler_process_statistics_fn , pub destroy : aws_crt_statistics_handler_destroy_fn , pub get_report_interval_ms : aws_crt_statistics_handler_get_report_interval_ms_fn , } # [test] fn bindgen_test_layout_aws_crt_statistics_handler_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_crt_statistics_handler_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_crt_statistics_handler_vtable > () , 24usize , concat ! ("Size of: " , stringify ! (aws_crt_statistics_handler_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_crt_statistics_handler_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_crt_statistics_handler_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_statistics) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler_vtable) , "::" , stringify ! (process_statistics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_report_interval_ms) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler_vtable) , "::" , stringify ! (get_report_interval_ms))) ; } # [doc = " Base structure for all statistics handler implementations.\n\n A statistics handler is an object that listens to a stream of polymorphic (via the category RTTI enum) statistics\n structures emitted from some arbitrary source. In the initial implementation, statistics handlers are primarily\n attached to channels, where they monitor IO throughput and state data (from channel handlers) to determine a\n connection's health.\n\n Statistics handlers are a generalization of the timeout and bandwidth filters that are often associated with\n SDK network connections. Configurable, default implementations are defined at the protocol level (http, etc...)\n where they can be attached at connection (channel) creation time."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_crt_statistics_handler { pub vtable : * mut aws_crt_statistics_handler_vtable , pub allocator : * mut aws_allocator , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_crt_statistics_handler () { const UNINIT : :: std :: mem :: MaybeUninit < aws_crt_statistics_handler > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_crt_statistics_handler > () , 24usize , concat ! ("Size of: " , stringify ! (aws_crt_statistics_handler))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_crt_statistics_handler > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_crt_statistics_handler))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler) , "::" , stringify ! (impl_))) ; } impl Default for aws_crt_statistics_handler { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Submits a list of statistics objects to a statistics handler for processing\n\n handler - the statistics handler that will process the statistics objects\n interval - time period over which the statistics were gathered\n stats - list of pointers to structures that can be case to aws_crt_statistics_base (i.e. have category as a first\n member)\n context - (optional) additional context specific to where the statistics handler has been attached"] pub fn aws_crt_statistics_handler_process_statistics (handler : * mut aws_crt_statistics_handler , interval : * mut aws_crt_statistics_sample_interval , stats : * mut aws_array_list , context : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Queries the frequency (via an interval in milliseconds) which a statistics handler would like to be informed\n of statistics."] pub fn aws_crt_statistics_handler_get_report_interval_ms (handler : * mut aws_crt_statistics_handler) -> u64 ; } extern "C" { # [doc = " completely destroys a statistics handler. The handler's cleanup function must clean up the impl portion completely\n (including its allocation, if done separately)."] pub fn aws_crt_statistics_handler_destroy (handler : * mut aws_crt_statistics_handler) ; } pub type aws_priority_queue_compare_fn = :: std :: option :: Option < unsafe extern "C" fn (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> :: libc :: c_int > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_priority_queue { # [doc = " predicate that determines the priority of the elements in the queue."] pub pred : aws_priority_queue_compare_fn , # [doc = " The underlying container storing the queue elements."] pub container : aws_array_list , # [doc = " An array of pointers to backpointer elements. This array is initialized when\n the first call to aws_priority_queue_push_bp is made, and is subsequently maintained\n through any heap node manipulations.\n\n Each element is a struct aws_priority_queue_node *, pointing to a backpointer field\n owned by the calling code, or a NULL. The backpointer field is continually updated\n with information needed to locate and remove a specific node later on."] pub backpointers : aws_array_list , } # [test] fn bindgen_test_layout_aws_priority_queue () { const UNINIT : :: std :: mem :: MaybeUninit < aws_priority_queue > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_priority_queue > () , 88usize , concat ! ("Size of: " , stringify ! (aws_priority_queue))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_priority_queue > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_priority_queue))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . pred) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_priority_queue) , "::" , stringify ! (pred))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . container) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_priority_queue) , "::" , stringify ! (container))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . backpointers) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_priority_queue) , "::" , stringify ! (backpointers))) ; } impl Default for aws_priority_queue { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_priority_queue_node { # [doc = " The current index of the node in question, or SIZE_MAX if the node has been removed."] pub current_index : usize , } # [test] fn bindgen_test_layout_aws_priority_queue_node () { const UNINIT : :: std :: mem :: MaybeUninit < aws_priority_queue_node > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_priority_queue_node > () , 8usize , concat ! ("Size of: " , stringify ! (aws_priority_queue_node))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_priority_queue_node > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_priority_queue_node))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . current_index) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_priority_queue_node) , "::" , stringify ! (current_index))) ; } extern "C" { # [doc = " Initializes a priority queue struct for use. This mode will grow memory automatically (exponential model)\n Default size is the inital size of the queue\n item_size is the size of each element in bytes. Mixing items types is not supported by this API.\n pred is the function that will be used to determine priority."] pub fn aws_priority_queue_init_dynamic (queue : * mut aws_priority_queue , alloc : * mut aws_allocator , default_size : usize , item_size : usize , pred : aws_priority_queue_compare_fn) -> :: libc :: c_int ; } extern "C" { # [doc = " Initializes a priority queue struct for use. This mode will not allocate any additional memory. When the heap fills\n new enqueue operations will fail with AWS_ERROR_PRIORITY_QUEUE_FULL.\n\n Heaps initialized using this call do not support the aws_priority_queue_push_ref call with a non-NULL backpointer\n parameter.\n\n heap is the raw memory allocated for this priority_queue\n item_count is the maximum number of elements the raw heap can contain\n item_size is the size of each element in bytes. Mixing items types is not supported by this API.\n pred is the function that will be used to determine priority."] pub fn aws_priority_queue_init_static (queue : * mut aws_priority_queue , heap : * mut :: libc :: c_void , item_count : usize , item_size : usize , pred : aws_priority_queue_compare_fn) ; } extern "C" { # [doc = " Checks that the backpointer at a specific index of the queue is\n NULL or points to a correctly allocated aws_priority_queue_node."] pub fn aws_priority_queue_backpointer_index_valid (queue : * const aws_priority_queue , index : usize) -> bool ; } extern "C" { # [doc = " Checks that the backpointers of the priority queue are either NULL\n or correctly allocated to point at aws_priority_queue_nodes. This\n check is O(n), as it accesses every backpointer in a loop, and thus\n shouldn't be used carelessly."] pub fn aws_priority_queue_backpointers_valid_deep (queue : * const aws_priority_queue) -> bool ; } extern "C" { # [doc = " Checks that the backpointers of the priority queue satisfy validity\n constraints."] pub fn aws_priority_queue_backpointers_valid (queue : * const aws_priority_queue) -> bool ; } extern "C" { # [doc = " Set of properties of a valid aws_priority_queue."] pub fn aws_priority_queue_is_valid (queue : * const aws_priority_queue) -> bool ; } extern "C" { # [doc = " Cleans up any internally allocated memory and resets the struct for reuse or deletion."] pub fn aws_priority_queue_clean_up (queue : * mut aws_priority_queue) ; } extern "C" { # [doc = " Copies item into the queue and places it in the proper priority order. Complexity: O(log(n))."] pub fn aws_priority_queue_push (queue : * mut aws_priority_queue , item : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies item into the queue and places it in the proper priority order. Complexity: O(log(n)).\n\n If the backpointer parameter is non-null, the heap will continually update the pointed-to field\n with information needed to remove the node later on. *backpointer must remain valid until the node\n is removed from the heap, and may be updated on any mutating operation on the priority queue.\n\n If the node is removed, the backpointer will be set to a sentinel value that indicates that the\n node has already been removed. It is safe (and a no-op) to call aws_priority_queue_remove with\n such a sentinel value."] pub fn aws_priority_queue_push_ref (queue : * mut aws_priority_queue , item : * mut :: libc :: c_void , backpointer : * mut aws_priority_queue_node) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the element of the highest priority, and removes it from the queue.. Complexity: O(log(n)).\n If queue is empty, AWS_ERROR_PRIORITY_QUEUE_EMPTY will be raised."] pub fn aws_priority_queue_pop (queue : * mut aws_priority_queue , item : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes a specific node from the priority queue. Complexity: O(log(n))\n After removing a node (using either _remove or _pop), the backpointer set at push_ref time is set\n to a sentinel value. If this sentinel value is passed to aws_priority_queue_remove,\n AWS_ERROR_PRIORITY_QUEUE_BAD_NODE will be raised. Note, however, that passing uninitialized\n aws_priority_queue_nodes, or ones from different priority queues, results in undefined behavior."] pub fn aws_priority_queue_remove (queue : * mut aws_priority_queue , item : * mut :: libc :: c_void , node : * const aws_priority_queue_node) -> :: libc :: c_int ; } extern "C" { # [doc = " Obtains a pointer to the element of the highest priority. Complexity: constant time.\n If queue is empty, AWS_ERROR_PRIORITY_QUEUE_EMPTY will be raised."] pub fn aws_priority_queue_top (queue : * const aws_priority_queue , item : * mut * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Current number of elements in the queue"] pub fn aws_priority_queue_size (queue : * const aws_priority_queue) -> usize ; } extern "C" { # [doc = " Current allocated capacity for the queue, in dynamic mode this grows over time, in static mode, this will never\n change."] pub fn aws_priority_queue_capacity (queue : * const aws_priority_queue) -> usize ; } impl aws_task_status { pub const AWS_TASK_STATUS_RUN_READY : aws_task_status = aws_task_status (0) ; } impl aws_task_status { pub const AWS_TASK_STATUS_CANCELED : aws_task_status = aws_task_status (1) ; } # [repr (transparent)] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub struct aws_task_status (pub :: libc :: c_uint) ; # [doc = " A scheduled function."] pub type aws_task_fn = :: std :: option :: Option < unsafe extern "C" fn (task : * mut aws_task , arg : * mut :: libc :: c_void , arg1 : aws_task_status) > ; # [repr (C)] # [derive (Copy , Clone)] pub struct aws_task { pub fn_ : aws_task_fn , pub arg : * mut :: libc :: c_void , pub timestamp : u64 , pub node : aws_linked_list_node , pub priority_queue_node : aws_priority_queue_node , pub type_tag : * const :: libc :: c_char , pub abi_extension : aws_task__bindgen_ty_1 , } # [repr (C)] # [derive (Copy , Clone)] pub union aws_task__bindgen_ty_1 { pub scheduled : bool , pub reserved : usize , } # [test] fn bindgen_test_layout_aws_task__bindgen_ty_1 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_task__bindgen_ty_1 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_task__bindgen_ty_1 > () , 8usize , concat ! ("Size of: " , stringify ! (aws_task__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_task__bindgen_ty_1 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_task__bindgen_ty_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . scheduled) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_task__bindgen_ty_1) , "::" , stringify ! (scheduled))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . reserved) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_task__bindgen_ty_1) , "::" , stringify ! (reserved))) ; } impl Default for aws_task__bindgen_ty_1 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [test] fn bindgen_test_layout_aws_task () { const UNINIT : :: std :: mem :: MaybeUninit < aws_task > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_task > () , 64usize , concat ! ("Size of: " , stringify ! (aws_task))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_task > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_task))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . fn_) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (fn_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . arg) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (arg))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . timestamp) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (timestamp))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . node) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (node))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . priority_queue_node) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (priority_queue_node))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . type_tag) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (type_tag))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . abi_extension) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (abi_extension))) ; } impl Default for aws_task { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_task_scheduler { pub alloc : * mut aws_allocator , pub timed_queue : aws_priority_queue , pub timed_list : aws_linked_list , pub asap_list : aws_linked_list , } # [test] fn bindgen_test_layout_aws_task_scheduler () { const UNINIT : :: std :: mem :: MaybeUninit < aws_task_scheduler > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_task_scheduler > () , 160usize , concat ! ("Size of: " , stringify ! (aws_task_scheduler))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_task_scheduler > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_task_scheduler))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_task_scheduler) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . timed_queue) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_task_scheduler) , "::" , stringify ! (timed_queue))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . timed_list) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_task_scheduler) , "::" , stringify ! (timed_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . asap_list) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_task_scheduler) , "::" , stringify ! (asap_list))) ; } impl Default for aws_task_scheduler { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Init an aws_task"] pub fn aws_task_init (task : * mut aws_task , fn_ : aws_task_fn , arg : * mut :: libc :: c_void , type_tag : * const :: libc :: c_char) ; } extern "C" { pub fn aws_task_run (task : * mut aws_task , status : aws_task_status) ; } extern "C" { # [doc = " Initializes a task scheduler instance."] pub fn aws_task_scheduler_init (scheduler : * mut aws_task_scheduler , alloc : * mut aws_allocator) -> :: libc :: c_int ; } extern "C" { # [doc = " Empties and executes all queued tasks, passing the AWS_TASK_STATUS_CANCELED status to the task function.\n Cleans up any memory allocated, and prepares the instance for reuse or deletion."] pub fn aws_task_scheduler_clean_up (scheduler : * mut aws_task_scheduler) ; } extern "C" { pub fn aws_task_scheduler_is_valid (scheduler : * const aws_task_scheduler) -> bool ; } extern "C" { # [doc = " Returns whether the scheduler has any scheduled tasks.\n next_task_time (optional) will be set to time of the next task, note that 0 will be set if tasks were\n added via aws_task_scheduler_schedule_now() and UINT64_MAX will be set if no tasks are scheduled at all."] pub fn aws_task_scheduler_has_tasks (scheduler : * const aws_task_scheduler , next_task_time : * mut u64) -> bool ; } extern "C" { # [doc = " Schedules a task to run immediately.\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_task_scheduler_schedule_now (scheduler : * mut aws_task_scheduler , task : * mut aws_task) ; } extern "C" { # [doc = " Schedules a task to run at time_to_run.\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_task_scheduler_schedule_future (scheduler : * mut aws_task_scheduler , task : * mut aws_task , time_to_run : u64) ; } extern "C" { # [doc = " Removes task from the scheduler and invokes the task with the AWS_TASK_STATUS_CANCELED status."] pub fn aws_task_scheduler_cancel_task (scheduler : * mut aws_task_scheduler , task : * mut aws_task) ; } extern "C" { # [doc = " Sequentially execute all tasks scheduled to run at, or before current_time.\n AWS_TASK_STATUS_RUN_READY will be passed to the task function as the task status.\n\n If a task schedules another task, the new task will not be executed until the next call to this function."] pub fn aws_task_scheduler_run_all (scheduler : * mut aws_task_scheduler , current_time : u64) ; } extern "C" { # [doc = " Convert a status value to a c-string suitable for logging"] pub fn aws_task_status_to_c_str (status : aws_task_status) -> * const :: libc :: c_char ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_channel_direction { AWS_CHANNEL_DIR_READ = 0 , AWS_CHANNEL_DIR_WRITE = 1 , } pub type aws_channel_on_setup_completed_fn = :: std :: option :: Option < unsafe extern "C" fn (channel : * mut aws_channel , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_channel_on_shutdown_completed_fn = :: std :: option :: Option < unsafe extern "C" fn (channel : * mut aws_channel , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_channel_slot { pub alloc : * mut aws_allocator , pub channel : * mut aws_channel , pub adj_left : * mut aws_channel_slot , pub adj_right : * mut aws_channel_slot , pub handler : * mut aws_channel_handler , pub window_size : usize , pub upstream_message_overhead : usize , pub current_window_update_batch_size : usize , } # [test] fn bindgen_test_layout_aws_channel_slot () { const UNINIT : :: std :: mem :: MaybeUninit < aws_channel_slot > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_channel_slot > () , 64usize , concat ! ("Size of: " , stringify ! (aws_channel_slot))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_channel_slot > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_channel_slot))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . channel) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (channel))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . adj_left) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (adj_left))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . adj_right) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (adj_right))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . handler) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (handler))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . window_size) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (window_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . upstream_message_overhead) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (upstream_message_overhead))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . current_window_update_batch_size) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (current_window_update_batch_size))) ; } impl Default for aws_channel_slot { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_channel_task_fn = :: std :: option :: Option < unsafe extern "C" fn (channel_task : * mut aws_channel_task , arg : * mut :: libc :: c_void , status : aws_task_status) > ; # [repr (C)] # [derive (Copy , Clone)] pub struct aws_channel_task { pub wrapper_task : aws_task , pub task_fn : aws_channel_task_fn , pub arg : * mut :: libc :: c_void , pub type_tag : * const :: libc :: c_char , pub node : aws_linked_list_node , } # [test] fn bindgen_test_layout_aws_channel_task () { const UNINIT : :: std :: mem :: MaybeUninit < aws_channel_task > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_channel_task > () , 104usize , concat ! ("Size of: " , stringify ! (aws_channel_task))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_channel_task > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_channel_task))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . wrapper_task) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_channel_task) , "::" , stringify ! (wrapper_task))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . task_fn) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_channel_task) , "::" , stringify ! (task_fn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . arg) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_channel_task) , "::" , stringify ! (arg))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . type_tag) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_channel_task) , "::" , stringify ! (type_tag))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . node) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_channel_task) , "::" , stringify ! (node))) ; } impl Default for aws_channel_task { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_channel_handler_vtable { # [doc = " Called by the channel when a message is available for processing in the read direction. It is your\n responsibility to call aws_mem_release(message->allocator, message); on message when you are finished with it.\n\n Also keep in mind that your slot's internal window has been decremented. You'll want to call\n aws_channel_slot_increment_read_window() at some point in the future if you want to keep receiving data."] pub process_read_message : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , message : * mut aws_io_message) -> :: libc :: c_int > , # [doc = " Called by the channel when a message is available for processing in the write direction. It is your\n responsibility to call aws_mem_release(message->allocator, message); on message when you are finished with it."] pub process_write_message : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , message : * mut aws_io_message) -> :: libc :: c_int > , # [doc = " Called by the channel when a downstream handler has issued a window increment. You'll want to update your\n internal state and likely propagate a window increment message of your own by calling\n 'aws_channel_slot_increment_read_window()'"] pub increment_read_window : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , size : usize) -> :: libc :: c_int > , # [doc = " The channel calls shutdown on all handlers twice, once to shut down reading, and once to shut down writing.\n Shutdown always begins with the left-most handler, and proceeds to the right with dir set to\n AWS_CHANNEL_DIR_READ. Then shutdown is called on handlers from right to left with dir set to\n AWS_CHANNEL_DIR_WRITE.\n\n The shutdown process does not need to complete immediately and may rely on scheduled tasks.\n The handler must call aws_channel_slot_on_handler_shutdown_complete() when it is finished,\n which propagates shutdown to the next handler. If 'free_scarce_resources_immediately' is true,\n then resources vulnerable to denial-of-service attacks (such as sockets and file handles)\n must be closed immediately before the shutdown() call returns."] pub shutdown : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , dir : aws_channel_direction , error_code : :: libc :: c_int , free_scarce_resources_immediately : bool) -> :: libc :: c_int > , # [doc = " Called by the channel when the handler is added to a slot, to get the initial window size."] pub initial_window_size : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler) -> usize > , # [doc = " Called by the channel anytime a handler is added or removed, provides a hint for downstream\n handlers to avoid message fragmentation due to message overhead."] pub message_overhead : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler) -> usize > , # [doc = " Clean up any resources and deallocate yourself. The shutdown process will already be completed before this\n function is called."] pub destroy : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler) > , # [doc = " Directs the channel handler to reset all of the internal statistics it tracks about itself."] pub reset_statistics : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler) > , # [doc = " Adds a pointer to the handler's internal statistics (if they exist) to a list of statistics structures\n associated with the channel's handler chain."] pub gather_statistics : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler , stats_list : * mut aws_array_list) > , pub trigger_read : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler) > , } # [test] fn bindgen_test_layout_aws_channel_handler_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_channel_handler_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_channel_handler_vtable > () , 80usize , concat ! ("Size of: " , stringify ! (aws_channel_handler_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_channel_handler_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_channel_handler_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_read_message) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (process_read_message))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_write_message) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (process_write_message))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . increment_read_window) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (increment_read_window))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (shutdown))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_window_size) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (initial_window_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . message_overhead) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (message_overhead))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . reset_statistics) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (reset_statistics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . gather_statistics) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (gather_statistics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . trigger_read) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (trigger_read))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_channel_handler { pub vtable : * mut aws_channel_handler_vtable , pub alloc : * mut aws_allocator , pub slot : * mut aws_channel_slot , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_channel_handler () { const UNINIT : :: std :: mem :: MaybeUninit < aws_channel_handler > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_channel_handler > () , 32usize , concat ! ("Size of: " , stringify ! (aws_channel_handler))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_channel_handler > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_channel_handler))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . slot) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler) , "::" , stringify ! (slot))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler) , "::" , stringify ! (impl_))) ; } impl Default for aws_channel_handler { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Args for creating a new channel.\n event_loop to use for IO and tasks. on_setup_completed will be invoked when\n the setup process is finished It will be executed in the event loop's thread.\n on_shutdown_completed will be executed upon channel shutdown.\n\n enable_read_back_pressure toggles whether or not back pressure will be applied in the channel.\n Leave this option off unless you're using something like reactive-streams, since it is a slight throughput\n penalty.\n\n Unless otherwise\n specified all functions for channels and channel slots must be executed within that channel's event-loop's thread."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_channel_options { pub event_loop : * mut aws_event_loop , pub on_setup_completed : aws_channel_on_setup_completed_fn , pub on_shutdown_completed : aws_channel_on_shutdown_completed_fn , pub setup_user_data : * mut :: libc :: c_void , pub shutdown_user_data : * mut :: libc :: c_void , pub enable_read_back_pressure : bool , } # [test] fn bindgen_test_layout_aws_channel_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_channel_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_channel_options > () , 48usize , concat ! ("Size of: " , stringify ! (aws_channel_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_channel_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_channel_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . event_loop) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (event_loop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_setup_completed) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (on_setup_completed))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_shutdown_completed) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (on_shutdown_completed))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . setup_user_data) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (setup_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_user_data) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (shutdown_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_back_pressure) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (enable_read_back_pressure))) ; } impl Default for aws_channel_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub static mut g_aws_channel_max_fragment_size : usize ; } extern "C" { # [doc = " Initializes channel_task for use."] pub fn aws_channel_task_init (channel_task : * mut aws_channel_task , task_fn : aws_channel_task_fn , arg : * mut :: libc :: c_void , type_tag : * const :: libc :: c_char) ; } extern "C" { # [doc = " Allocates new channel, Unless otherwise specified all functions for channels and channel slots must be executed\n within that channel's event-loop's thread. channel_options are copied."] pub fn aws_channel_new (allocator : * mut aws_allocator , creation_args : * const aws_channel_options) -> * mut aws_channel ; } extern "C" { # [doc = " Mark the channel, along with all slots and handlers, for destruction.\n Must be called after shutdown has completed.\n Can be called from any thread assuming 'aws_channel_shutdown()' has completed.\n Note that memory will not be freed until all users which acquired holds on the channel via\n aws_channel_acquire_hold(), release them via aws_channel_release_hold()."] pub fn aws_channel_destroy (channel : * mut aws_channel) ; } extern "C" { # [doc = " Initiates shutdown of the channel. Shutdown will begin with the left-most slot. Each handler will invoke\n 'aws_channel_slot_on_handler_shutdown_complete' once they've finished their shutdown process for the read direction.\n Once the right-most slot has shutdown in the read direction, the process will start shutting down starting on the\n right-most slot. Once the left-most slot has shutdown in the write direction, 'callbacks->shutdown_completed' will be\n invoked in the event loop's thread.\n\n This function can be called from any thread."] pub fn aws_channel_shutdown (channel : * mut aws_channel , error_code : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Prevent a channel's memory from being freed.\n Any number of users may acquire a hold to prevent a channel and its handlers from being unexpectedly freed.\n Any user which acquires a hold must release it via aws_channel_release_hold().\n Memory will be freed once all holds are released and aws_channel_destroy() has been called."] pub fn aws_channel_acquire_hold (channel : * mut aws_channel) ; } extern "C" { # [doc = " Release a hold on the channel's memory, allowing it to be freed.\n This may be called before or after aws_channel_destroy()."] pub fn aws_channel_release_hold (channel : * mut aws_channel) ; } extern "C" { # [doc = " Allocates and initializes a new slot for use with the channel. If this is the first slot in the channel, it will\n automatically be added to the channel as the first slot. For all subsequent calls on a given channel, the slot will\n need to be added to the channel via. the aws_channel_slot_insert_right(), aws_channel_slot_insert_end(), and\n aws_channel_slot_insert_left() APIs."] pub fn aws_channel_slot_new (channel : * mut aws_channel) -> * mut aws_channel_slot ; } extern "C" { # [doc = " Fetches the event loop the channel is a part of."] pub fn aws_channel_get_event_loop (channel : * mut aws_channel) -> * mut aws_event_loop ; } extern "C" { # [doc = " Fetches the current timestamp from the event-loop's clock, in nanoseconds."] pub fn aws_channel_current_clock_time (channel : * mut aws_channel , time_nanos : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Retrieves an object by key from the event loop's local storage."] pub fn aws_channel_fetch_local_object (channel : * mut aws_channel , key : * const :: libc :: c_void , obj : * mut aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Stores an object by key in the event loop's local storage."] pub fn aws_channel_put_local_object (channel : * mut aws_channel , key : * const :: libc :: c_void , obj : * const aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes an object by key from the event loop's local storage."] pub fn aws_channel_remove_local_object (channel : * mut aws_channel , key : * const :: libc :: c_void , removed_obj : * mut aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Acquires a message from the event loop's message pool. size_hint is merely a hint, it may be smaller than you\n requested and you are responsible for checking the bounds of it. If the returned message is not large enough, you\n must send multiple messages."] pub fn aws_channel_acquire_message_from_pool (channel : * mut aws_channel , message_type : aws_io_message_type , size_hint : usize) -> * mut aws_io_message ; } extern "C" { # [doc = " Schedules a task to run on the event loop as soon as possible.\n This is the ideal way to move a task into the correct thread. It's also handy for context switches.\n This function is safe to call from any thread.\n\n If called from the channel's event loop, the task will get directly added to the run-now list.\n If called from outside the channel's event loop, the task will go into a cross-thread task queue.\n\n If tasks must be serialized relative to some source synchronization, you may not want to use this API\n because tasks submitted from the event loop thread can \"jump ahead\" of tasks submitted from external threads\n due to this optimization. If this is a problem, you can either refactor your submission logic or use\n the aws_channel_schedule_task_now_serialized variant which does not perform this optimization.\n\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_channel_schedule_task_now (channel : * mut aws_channel , task : * mut aws_channel_task) ; } extern "C" { # [doc = " Schedules a task to run on the event loop as soon as possible.\n\n This variant always uses the cross thread queue rather than conditionally skipping it when already in\n the destination event loop. While not \"optimal\", this allows us to serialize task execution no matter where\n the task was submitted from: if you are submitting tasks from a critical section, the serialized order that you\n submit is guaranteed to be the order that they execute on the event loop.\n\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_channel_schedule_task_now_serialized (channel : * mut aws_channel , task : * mut aws_channel_task) ; } extern "C" { # [doc = " Schedules a task to run on the event loop at the specified time.\n This is the ideal way to move a task into the correct thread. It's also handy for context switches.\n Use aws_channel_current_clock_time() to get the current time in nanoseconds.\n This function is safe to call from any thread.\n\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_channel_schedule_task_future (channel : * mut aws_channel , task : * mut aws_channel_task , run_at_nanos : u64) ; } extern "C" { # [doc = " Instrument a channel with a statistics handler. While instrumented with a statistics handler, the channel\n will periodically report per-channel-handler-specific statistics about handler performance and state.\n\n Assigning a statistics handler to a channel is a transfer of ownership -- the channel will clean up\n the handler appropriately. Statistics handlers may be changed dynamically (for example, the upgrade\n from a vanilla http channel to a websocket channel), but this function may only be called from the\n event loop thread that the channel is a part of.\n\n The first possible hook to set a statistics handler is the channel's creation callback."] pub fn aws_channel_set_statistics_handler (channel : * mut aws_channel , handler : * mut aws_crt_statistics_handler) -> :: libc :: c_int ; } extern "C" { # [doc = " Returns true if the caller is on the event loop's thread. If false, you likely need to use\n aws_channel_schedule_task(). This function is safe to call from any thread."] pub fn aws_channel_thread_is_callers_thread (channel : * mut aws_channel) -> bool ; } extern "C" { # [doc = " Sets the handler for a slot, the slot will also call get_current_window_size() and propagate a window update\n upstream."] pub fn aws_channel_slot_set_handler (slot : * mut aws_channel_slot , handler : * mut aws_channel_handler) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes slot from the channel and deallocates the slot and its handler."] pub fn aws_channel_slot_remove (slot : * mut aws_channel_slot) -> :: libc :: c_int ; } extern "C" { # [doc = " Replaces remove with new_slot. Deallocates remove and its handler."] pub fn aws_channel_slot_replace (remove : * mut aws_channel_slot , new_slot : * mut aws_channel_slot) -> :: libc :: c_int ; } extern "C" { # [doc = " inserts 'to_add' to the position immediately to the right of slot. Note that the first call to\n aws_channel_slot_new() adds it to the channel implicitly."] pub fn aws_channel_slot_insert_right (slot : * mut aws_channel_slot , to_add : * mut aws_channel_slot) -> :: libc :: c_int ; } extern "C" { # [doc = " Inserts to 'to_add' the end of the channel. Note that the first call to\n aws_channel_slot_new() adds it to the channel implicitly."] pub fn aws_channel_slot_insert_end (channel : * mut aws_channel , to_add : * mut aws_channel_slot) -> :: libc :: c_int ; } extern "C" { # [doc = " inserts 'to_add' to the position immediately to the left of slot. Note that the first call to\n aws_channel_slot_new() adds it to the channel implicitly."] pub fn aws_channel_slot_insert_left (slot : * mut aws_channel_slot , to_add : * mut aws_channel_slot) -> :: libc :: c_int ; } extern "C" { # [doc = " Sends a message to the adjacent slot in the channel based on dir. Also does window size checking.\n\n NOTE: if this function returns an error code, it is the caller's responsibility to release message\n back to the pool. If this function returns AWS_OP_SUCCESS, the recipient of the message has taken\n ownership of the message. So, for example, don't release a message to the pool and then return an error.\n If you encounter an error condition in this case, shutdown the channel with the appropriate error code."] pub fn aws_channel_slot_send_message (slot : * mut aws_channel_slot , message : * mut aws_io_message , dir : aws_channel_direction) -> :: libc :: c_int ; } extern "C" { # [doc = " Convenience function that invokes aws_channel_acquire_message_from_pool(),\n asking for the largest reasonable DATA message that can be sent in the write direction,\n with upstream overhead accounted for."] pub fn aws_channel_slot_acquire_max_message_for_write (slot : * mut aws_channel_slot) -> * mut aws_io_message ; } extern "C" { # [doc = " Issues a window update notification upstream (to the left.)"] pub fn aws_channel_slot_increment_read_window (slot : * mut aws_channel_slot , window : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Called by handlers once they have finished their shutdown in the 'dir' direction. Propagates the shutdown process\n to the next handler in the channel."] pub fn aws_channel_slot_on_handler_shutdown_complete (slot : * mut aws_channel_slot , dir : aws_channel_direction , err_code : :: libc :: c_int , free_scarce_resources_immediately : bool) -> :: libc :: c_int ; } extern "C" { # [doc = " Initiates shutdown on slot. callbacks->on_shutdown_completed will be called\n once the shutdown process is completed."] pub fn aws_channel_slot_shutdown (slot : * mut aws_channel_slot , dir : aws_channel_direction , err_code : :: libc :: c_int , free_scarce_resources_immediately : bool) -> :: libc :: c_int ; } extern "C" { # [doc = " Fetches the downstream read window. This gives you the information necessary to honor the read window. If you call\n send_message() and it exceeds this window, the message will be rejected."] pub fn aws_channel_slot_downstream_read_window (slot : * mut aws_channel_slot) -> usize ; } extern "C" { # [doc = " Fetches the current overhead of upstream handlers. This provides a hint to avoid fragmentation if you care."] pub fn aws_channel_slot_upstream_message_overhead (slot : * mut aws_channel_slot) -> usize ; } extern "C" { # [doc = " Calls destroy on handler's vtable"] pub fn aws_channel_handler_destroy (handler : * mut aws_channel_handler) ; } extern "C" { # [doc = " Calls process_read_message on handler's vtable"] pub fn aws_channel_handler_process_read_message (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , message : * mut aws_io_message) -> :: libc :: c_int ; } extern "C" { # [doc = " Calls process_write_message on handler's vtable."] pub fn aws_channel_handler_process_write_message (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , message : * mut aws_io_message) -> :: libc :: c_int ; } extern "C" { # [doc = " Calls on_window_update on handler's vtable."] pub fn aws_channel_handler_increment_read_window (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , size : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " calls shutdown_direction on handler's vtable."] pub fn aws_channel_handler_shutdown (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , dir : aws_channel_direction , error_code : :: libc :: c_int , free_scarce_resources_immediately : bool) -> :: libc :: c_int ; } extern "C" { # [doc = " Calls initial_window_size on handler's vtable."] pub fn aws_channel_handler_initial_window_size (handler : * mut aws_channel_handler) -> usize ; } extern "C" { pub fn aws_channel_get_first_slot (channel : * mut aws_channel) -> * mut aws_channel_slot ; } extern "C" { # [doc = " A way for external processes to force a read by the data-source channel handler. Necessary in certain cases, like\n when a server channel finishes setting up its initial handlers, a read may have already been triggered on the\n socket (the client's CLIENT_HELLO tls payload, for example) and absent further data/notifications, this data\n would never get processed."] pub fn aws_channel_trigger_read (channel : * mut aws_channel) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_address_record_type { AWS_ADDRESS_RECORD_TYPE_A = 0 , AWS_ADDRESS_RECORD_TYPE_AAAA = 1 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_get_host_address_flags { AWS_GET_HOST_ADDRESS_COUNT_RECORD_TYPE_A = 1 , AWS_GET_HOST_ADDRESS_COUNT_RECORD_TYPE_AAAA = 2 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_address { pub allocator : * mut aws_allocator , pub host : * const aws_string , pub address : * const aws_string , pub record_type : aws_address_record_type , pub expiry : u64 , pub use_count : usize , pub connection_failure_count : usize , pub weight : u8 , } # [test] fn bindgen_test_layout_aws_host_address () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_address > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_address > () , 64usize , concat ! ("Size of: " , stringify ! (aws_host_address))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_address > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_address))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . address) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (address))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . record_type) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (record_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . expiry) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (expiry))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . use_count) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (use_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connection_failure_count) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (connection_failure_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . weight) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (weight))) ; } impl Default for aws_host_address { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Invoked once an address has been resolved for host. The type in host_addresses is struct aws_host_address (by-value).\n The caller does not own this memory and you must copy the host address before returning from this function if you\n plan to use it later. For convenience, we've provided the aws_host_address_copy() and aws_host_address_clean_up()\n functions."] pub type aws_on_host_resolved_result_fn = :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , host_name : * const aws_string , err_code : :: libc :: c_int , host_addresses : * const aws_array_list , user_data : * mut :: libc :: c_void) > ; # [doc = " Function signature for configuring your own resolver (the default just uses getaddrinfo()). The type in\n output_addresses is struct aws_host_address (by-value). We assume this function blocks, hence this absurdly\n complicated design."] pub type aws_resolve_host_implementation_fn = :: std :: option :: Option < unsafe extern "C" fn (allocator : * mut aws_allocator , host_name : * const aws_string , output_addresses : * mut aws_array_list , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_resolution_config { pub impl_ : aws_resolve_host_implementation_fn , pub max_ttl : usize , pub impl_data : * mut :: libc :: c_void , pub resolve_frequency_ns : u64 , } # [test] fn bindgen_test_layout_aws_host_resolution_config () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_resolution_config > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_resolution_config > () , 32usize , concat ! ("Size of: " , stringify ! (aws_host_resolution_config))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_resolution_config > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_resolution_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolution_config) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_ttl) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolution_config) , "::" , stringify ! (max_ttl))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_data) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolution_config) , "::" , stringify ! (impl_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . resolve_frequency_ns) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolution_config) , "::" , stringify ! (resolve_frequency_ns))) ; } impl Default for aws_host_resolution_config { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_listener { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_listener_options { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_resolver_purge_host_options { pub host : * const aws_string , pub on_host_purge_complete_callback : aws_simple_completion_callback , pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_host_resolver_purge_host_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_resolver_purge_host_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_resolver_purge_host_options > () , 24usize , concat ! ("Size of: " , stringify ! (aws_host_resolver_purge_host_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_resolver_purge_host_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_resolver_purge_host_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_purge_host_options) , "::" , stringify ! (host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_host_purge_complete_callback) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_purge_host_options) , "::" , stringify ! (on_host_purge_complete_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_purge_host_options) , "::" , stringify ! (user_data))) ; } impl Default for aws_host_resolver_purge_host_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " should you absolutely disdain the default implementation, feel free to implement your own."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_host_resolver_vtable { # [doc = " clean up everything you allocated, but not resolver itself."] pub destroy : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver) > , # [doc = " resolve the host by host_name, the user owns host_name, so it needs to be copied if you persist it,\n invoke res with the result. This function should never block."] pub resolve_host : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , host_name : * const aws_string , res : aws_on_host_resolved_result_fn , config : * const aws_host_resolution_config , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > , # [doc = " gives your implementation a hint that an address has some failed connections occuring. Do whatever you want (or\n nothing) about it."] pub record_connection_failure : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , address : * const aws_host_address) -> :: libc :: c_int > , # [doc = " @Deprecated Use purge_cache_with_callback instead\n wipe out anything you have cached."] pub purge_cache : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver) -> :: libc :: c_int > , # [doc = " wipe out anything you have cached."] pub purge_cache_with_callback : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , on_purge_cache_complete_callback : aws_simple_completion_callback , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > , # [doc = " wipe out anything cached for a specific host"] pub purge_host_cache : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , options : * const aws_host_resolver_purge_host_options) -> :: libc :: c_int > , # [doc = " get number of addresses for a given host."] pub get_host_address_count : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , host_name : * const aws_string , flags : u32) -> usize > , } # [test] fn bindgen_test_layout_aws_host_resolver_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_resolver_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_resolver_vtable > () , 56usize , concat ! ("Size of: " , stringify ! (aws_host_resolver_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_resolver_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_resolver_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . resolve_host) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (resolve_host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . record_connection_failure) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (record_connection_failure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . purge_cache) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (purge_cache))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . purge_cache_with_callback) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (purge_cache_with_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . purge_host_cache) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (purge_host_cache))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_host_address_count) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (get_host_address_count))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_resolver { pub allocator : * mut aws_allocator , pub impl_ : * mut :: libc :: c_void , pub vtable : * mut aws_host_resolver_vtable , pub ref_count : aws_ref_count , pub shutdown_options : aws_shutdown_callback_options , } # [test] fn bindgen_test_layout_aws_host_resolver () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_resolver > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_resolver > () , 64usize , concat ! ("Size of: " , stringify ! (aws_host_resolver))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_resolver > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_resolver))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver) , "::" , stringify ! (shutdown_options))) ; } impl Default for aws_host_resolver { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_resolver_default_options { pub max_entries : usize , pub el_group : * mut aws_event_loop_group , pub shutdown_options : * const aws_shutdown_callback_options , pub system_clock_override_fn : aws_io_clock_fn , } # [test] fn bindgen_test_layout_aws_host_resolver_default_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_resolver_default_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_resolver_default_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_host_resolver_default_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_resolver_default_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_resolver_default_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_entries) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_default_options) , "::" , stringify ! (max_entries))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . el_group) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_default_options) , "::" , stringify ! (el_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_default_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . system_clock_override_fn) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_default_options) , "::" , stringify ! (system_clock_override_fn))) ; } impl Default for aws_host_resolver_default_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Copies `from` to `to`."] pub fn aws_host_address_copy (from : * const aws_host_address , to : * mut aws_host_address) -> :: libc :: c_int ; } extern "C" { # [doc = " Moves `from` to `to`. After this call, from is no longer usable. Though, it could be resused for another\n move or copy operation."] pub fn aws_host_address_move (from : * mut aws_host_address , to : * mut aws_host_address) ; } extern "C" { # [doc = " Cleans up the memory for `address`"] pub fn aws_host_address_clean_up (address : * mut aws_host_address) ; } extern "C" { # [doc = " WARNING! do not call this function directly (getaddrinfo()): it blocks. Provide a pointer to this function for other\n resolution functions."] pub fn aws_default_dns_resolve (allocator : * mut aws_allocator , host_name : * const aws_string , output_addresses : * mut aws_array_list , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Creates a host resolver with the default behavior. Here's the behavior:\n\n Since there's not a reliable way to do non-blocking DNS without a ton of risky work that would need years of testing\n on every Unix system in existence, we work around it by doing a threaded implementation.\n\n When you request an address, it checks the cache. If the entry isn't in the cache it creates a new one.\n Each entry has a potentially short lived back-ground thread based on ttl for the records. Once we've populated the\n cache and you keep the resolver active, the resolution callback will be invoked immediately. When it's idle, it will\n take a little while in the background thread to fetch more, evaluate TTLs etc... In that case your callback will be\n invoked from the background thread.\n\n --------------------------------------------------------------------------------------------------------------------\n\n A few things to note about TTLs and connection failures.\n\n We attempt to honor your max ttl but will not honor it if dns queries are failing or all of your connections are\n marked as failed. Once we are able to query dns again, we will re-evaluate the TTLs.\n\n Upon notification connection failures, we move them to a separate list. Eventually we retry them when it's likely\n that the endpoint is healthy again or we don't really have another choice, but we try to keep them out of your\n hot path.\n\n ---------------------------------------------------------------------------------------------------------------------\n\n Finally, this entire design attempts to prevent problems where developers have to choose between large TTLs and thus\n sticky hosts or short TTLs and good fleet utilization but now higher latencies. In this design, we resolve every\n second in the background (only while you're actually using the record), but we do not expire the earlier resolved\n addresses until max ttl has passed.\n\n This for example, should enable you to hit thousands of hosts in the Amazon S3 fleet instead of just one or two."] pub fn aws_host_resolver_new_default (allocator : * mut aws_allocator , options : * const aws_host_resolver_default_options) -> * mut aws_host_resolver ; } extern "C" { # [doc = " Increments the reference count on the host resolver, allowing the caller to take a reference to it.\n\n Returns the same host resolver passed in."] pub fn aws_host_resolver_acquire (resolver : * mut aws_host_resolver) -> * mut aws_host_resolver ; } extern "C" { # [doc = " Decrements a host resolver's ref count. When the ref count drops to zero, the resolver will be destroyed."] pub fn aws_host_resolver_release (resolver : * mut aws_host_resolver) ; } extern "C" { # [doc = " calls resolve_host on the vtable. config will be copied."] pub fn aws_host_resolver_resolve_host (resolver : * mut aws_host_resolver , host_name : * const aws_string , res : aws_on_host_resolved_result_fn , config : * const aws_host_resolution_config , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " calls record_connection_failure on the vtable."] pub fn aws_host_resolver_record_connection_failure (resolver : * mut aws_host_resolver , address : * const aws_host_address) -> :: libc :: c_int ; } extern "C" { # [doc = " @Deprecated Use purge_cache_with_callback instead\n calls purge_cache on the vtable."] pub fn aws_host_resolver_purge_cache (resolver : * mut aws_host_resolver) -> :: libc :: c_int ; } extern "C" { # [doc = " Calls aws_host_resolver_purge_cache_with_callback on the vtable which will wipe out everything host resolver has\n cached."] pub fn aws_host_resolver_purge_cache_with_callback (resolver : * mut aws_host_resolver , on_purge_cache_complete_callback : aws_simple_completion_callback , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes the cache for a host asynchronously."] pub fn aws_host_resolver_purge_host_cache (resolver : * mut aws_host_resolver , options : * const aws_host_resolver_purge_host_options) -> :: libc :: c_int ; } extern "C" { # [doc = " get number of addresses for a given host."] pub fn aws_host_resolver_get_host_address_count (resolver : * mut aws_host_resolver , host_name : * const aws_string , flags : u32) -> usize ; } extern "C" { # [doc = " Returns the default host resolution config used internally if none specified.\n\n @return default host resolution config"] pub fn aws_host_resolver_init_default_resolution_config () -> aws_host_resolution_config ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_socket { _unused : [u8 ; 0] , } # [doc = " Generic event function for channel lifecycle events.\n\n Callbacks are provided for:\n (1) Channel creation\n (2) Channel setup - If TLS is being used, this function is called once the socket has connected, the channel has\n been initialized, and TLS has been successfully negotiated. A TLS handler has already been added to the channel. If\n TLS negotiation fails, this function will be called with the corresponding error code. If TLS is not being used, this\n function is called once the socket has connected and the channel has been initialized.\n (3) Channel shutdown\n\n These callbacks are always invoked within the thread of the event-loop that the channel is assigned to.\n\n This function does NOT always imply \"success\" -- if error_code is AWS_OP_SUCCESS then everything was successful,\n otherwise an error condition occurred."] pub type aws_client_bootstrap_on_channel_event_fn = :: std :: option :: Option < unsafe extern "C" fn (bootstrap : * mut aws_client_bootstrap , error_code : :: libc :: c_int , channel : * mut aws_channel , user_data : * mut :: libc :: c_void) > ; # [doc = " If ALPN is being used this function will be invoked by the channel once an ALPN message is received. The returned\n channel_handler will be added to, and managed by, the channel."] pub type aws_channel_on_protocol_negotiated_fn = :: std :: option :: Option < unsafe extern "C" fn (new_slot : * mut aws_channel_slot , protocol : * mut aws_byte_buf , user_data : * mut :: libc :: c_void) -> * mut aws_channel_handler > ; # [doc = " Called after client bootstrap has been completely cleaned up, after its last refcount is released."] pub type aws_client_bootstrap_shutdown_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [doc = " aws_client_bootstrap handles creation and setup of channels that communicate via socket with a specific endpoint."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_client_bootstrap { pub allocator : * mut aws_allocator , pub event_loop_group : * mut aws_event_loop_group , pub host_resolver : * mut aws_host_resolver , pub host_resolver_config : aws_host_resolution_config , pub on_protocol_negotiated : aws_channel_on_protocol_negotiated_fn , pub ref_count : aws_ref_count , pub on_shutdown_complete : aws_client_bootstrap_shutdown_complete_fn , pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_client_bootstrap () { const UNINIT : :: std :: mem :: MaybeUninit < aws_client_bootstrap > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_client_bootstrap > () , 104usize , concat ! ("Size of: " , stringify ! (aws_client_bootstrap))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_client_bootstrap > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_client_bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . event_loop_group) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (event_loop_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolver) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (host_resolver))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolver_config) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (host_resolver_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_protocol_negotiated) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (on_protocol_negotiated))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_shutdown_complete) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (on_shutdown_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (user_data))) ; } impl Default for aws_client_bootstrap { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " aws_client_bootstrap creation options."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_client_bootstrap_options { pub event_loop_group : * mut aws_event_loop_group , pub host_resolver : * mut aws_host_resolver , pub host_resolution_config : * const aws_host_resolution_config , pub on_shutdown_complete : aws_client_bootstrap_shutdown_complete_fn , pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_client_bootstrap_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_client_bootstrap_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_client_bootstrap_options > () , 40usize , concat ! ("Size of: " , stringify ! (aws_client_bootstrap_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_client_bootstrap_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_client_bootstrap_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . event_loop_group) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap_options) , "::" , stringify ! (event_loop_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolver) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap_options) , "::" , stringify ! (host_resolver))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolution_config) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap_options) , "::" , stringify ! (host_resolution_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_shutdown_complete) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap_options) , "::" , stringify ! (on_shutdown_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap_options) , "::" , stringify ! (user_data))) ; } impl Default for aws_client_bootstrap_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " If TLS is being used, this function is called once the socket has received an incoming connection, the channel has\n been initialized, and TLS has been successfully negotiated. A TLS handler has already been added to the channel. If\n TLS negotiation fails, this function will be called with the corresponding error code.\n\n If TLS is not being used, this function is called once the socket has received an incoming connection and the channel\n has been initialized.\n\n This function is always called within the thread of the event-loop that the new channel is assigned to upon success.\n\n On failure, the channel might not be assigned to an event loop yet, and will thus be invoked on the listener's\n event-loop thread.\n\n This function does NOT mean \"success\", if error_code is AWS_OP_SUCCESS then everything was successful, otherwise an\n error condition occurred.\n\n If an error occurred, you do not need to shutdown the channel. The `aws_channel_client_shutdown_callback` will be\n invoked once the channel has finished shutting down."] pub type aws_server_bootstrap_on_accept_channel_setup_fn = :: std :: option :: Option < unsafe extern "C" fn (bootstrap : * mut aws_server_bootstrap , error_code : :: libc :: c_int , channel : * mut aws_channel , user_data : * mut :: libc :: c_void) > ; # [doc = " Once the channel shuts down, this function will be invoked within the thread of\n the event-loop that the channel is assigned to.\n\n Note: this function is only invoked if the channel was successfully setup,\n e.g. aws_server_bootstrap_on_accept_channel_setup_fn() was invoked without an error code."] pub type aws_server_bootstrap_on_accept_channel_shutdown_fn = :: std :: option :: Option < unsafe extern "C" fn (bootstrap : * mut aws_server_bootstrap , error_code : :: libc :: c_int , channel : * mut aws_channel , user_data : * mut :: libc :: c_void) > ; # [doc = " Once the server listener socket is finished destroying, and all the existing connections are closed, this fuction\n will be invoked."] pub type aws_server_bootstrap_on_server_listener_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (bootstrap : * mut aws_server_bootstrap , user_data : * mut :: libc :: c_void) > ; # [doc = " aws_server_bootstrap manages listening sockets, creating and setting up channels to handle each incoming connection."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_server_bootstrap { pub allocator : * mut aws_allocator , pub event_loop_group : * mut aws_event_loop_group , pub on_protocol_negotiated : aws_channel_on_protocol_negotiated_fn , pub ref_count : aws_ref_count , } # [test] fn bindgen_test_layout_aws_server_bootstrap () { const UNINIT : :: std :: mem :: MaybeUninit < aws_server_bootstrap > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_server_bootstrap > () , 48usize , concat ! ("Size of: " , stringify ! (aws_server_bootstrap))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_server_bootstrap > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_server_bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_server_bootstrap) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . event_loop_group) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_server_bootstrap) , "::" , stringify ! (event_loop_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_protocol_negotiated) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_server_bootstrap) , "::" , stringify ! (on_protocol_negotiated))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_server_bootstrap) , "::" , stringify ! (ref_count))) ; } impl Default for aws_server_bootstrap { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Socket-based channel creation options.\n\n bootstrap - configs name resolution and which event loop group the connection will be seated into\n host_name - host to connect to; if a dns address, will be resolved prior to connecting\n port - port to connect to\n socket_options - socket properties, including type (tcp vs. udp vs. unix domain) and connect timeout. TLS\n connections are currently restricted to tcp (AWS_SOCKET_STREAM) only.\n tls_options - (optional) tls context to apply after connection establishment. If NULL, the connection will\n not be protected by TLS.\n creation_callback - (optional) callback invoked when the channel is first created. This is always right after\n the connection was successfully established. *Does NOT* get called if the initial connect failed.\n setup_callback - callback invoked once the channel is ready for use and TLS has been negotiated or if an error\n is encountered\n shutdown_callback - callback invoked once the channel has shutdown.\n enable_read_back_pressure - controls whether or not back pressure will be applied in the channel\n user_data - arbitrary data to pass back to the various callbacks\n requested_event_loop - if set, the connection will be placed on the requested event loop rather than one\n chosen internally from the bootstrap's associated event loop group. It is an error to pass in an event loop\n that is not associated with the bootstrap's event loop group.\n\n Immediately after the `shutdown_callback` returns, the channel is cleaned up automatically. All callbacks are invoked\n in the thread of the event-loop that the new channel is assigned to.\n"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_socket_channel_bootstrap_options { pub bootstrap : * mut aws_client_bootstrap , pub host_name : * const :: libc :: c_char , pub port : u16 , pub socket_options : * const aws_socket_options , pub tls_options : * const aws_tls_connection_options , pub creation_callback : aws_client_bootstrap_on_channel_event_fn , pub setup_callback : aws_client_bootstrap_on_channel_event_fn , pub shutdown_callback : aws_client_bootstrap_on_channel_event_fn , pub enable_read_back_pressure : bool , pub user_data : * mut :: libc :: c_void , pub requested_event_loop : * mut aws_event_loop , pub host_resolution_override_config : * const aws_host_resolution_config , } # [test] fn bindgen_test_layout_aws_socket_channel_bootstrap_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_socket_channel_bootstrap_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_socket_channel_bootstrap_options > () , 96usize , concat ! ("Size of: " , stringify ! (aws_socket_channel_bootstrap_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_socket_channel_bootstrap_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_socket_channel_bootstrap_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . socket_options) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (socket_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_options) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (tls_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . creation_callback) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (creation_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . setup_callback) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (setup_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_back_pressure) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (enable_read_back_pressure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . requested_event_loop) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (requested_event_loop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolution_override_config) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (host_resolution_override_config))) ; } impl Default for aws_socket_channel_bootstrap_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Arguments to setup a server socket listener which will also negotiate and configure TLS.\n This creates a socket listener bound to `host` and 'port' using socket options `options`, and TLS options\n `tls_options`. `incoming_callback` will be invoked once an incoming channel is ready for use and TLS is\n finished negotiating, or if an error is encountered. `shutdown_callback` will be invoked once the channel has\n shutdown. `destroy_callback` will be invoked after the server socket listener is destroyed, and all associated\n connections and channels have finished shutting down. Immediately after the `shutdown_callback` returns, the channel\n is cleaned up automatically. All callbacks are invoked in the thread of the event-loop that listener is assigned to.\n\n Upon shutdown of your application, you'll want to call `aws_server_bootstrap_destroy_socket_listener` with the return\n value from this function.\n\n The socket type in `options` must be AWS_SOCKET_STREAM if tls_options is set.\n DTLS is not currently supported for tls."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_server_socket_channel_bootstrap_options { pub bootstrap : * mut aws_server_bootstrap , pub host_name : * const :: libc :: c_char , pub port : u16 , pub socket_options : * const aws_socket_options , pub tls_options : * const aws_tls_connection_options , pub incoming_callback : aws_server_bootstrap_on_accept_channel_setup_fn , pub shutdown_callback : aws_server_bootstrap_on_accept_channel_shutdown_fn , pub destroy_callback : aws_server_bootstrap_on_server_listener_destroy_fn , pub enable_read_back_pressure : bool , pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_server_socket_channel_bootstrap_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_server_socket_channel_bootstrap_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_server_socket_channel_bootstrap_options > () , 80usize , concat ! ("Size of: " , stringify ! (aws_server_socket_channel_bootstrap_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_server_socket_channel_bootstrap_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_server_socket_channel_bootstrap_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . socket_options) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (socket_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_options) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (tls_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . incoming_callback) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (incoming_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy_callback) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (destroy_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_back_pressure) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (enable_read_back_pressure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (user_data))) ; } impl Default for aws_server_socket_channel_bootstrap_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Create the client bootstrap."] pub fn aws_client_bootstrap_new (allocator : * mut aws_allocator , options : * const aws_client_bootstrap_options) -> * mut aws_client_bootstrap ; } extern "C" { # [doc = " Increments a client bootstrap's ref count, allowing the caller to take a reference to it.\n\n Returns the same client bootstrap passed in."] pub fn aws_client_bootstrap_acquire (bootstrap : * mut aws_client_bootstrap) -> * mut aws_client_bootstrap ; } extern "C" { # [doc = " Decrements a client bootstrap's ref count. When the ref count drops to zero, the bootstrap will be destroyed."] pub fn aws_client_bootstrap_release (bootstrap : * mut aws_client_bootstrap) ; } extern "C" { # [doc = " When using TLS, if ALPN is used, this callback will be invoked from the channel. The returned handler will be added\n to the channel."] pub fn aws_client_bootstrap_set_alpn_callback (bootstrap : * mut aws_client_bootstrap , on_protocol_negotiated : aws_channel_on_protocol_negotiated_fn) -> :: libc :: c_int ; } extern "C" { # [doc = " Sets up a client socket channel."] pub fn aws_client_bootstrap_new_socket_channel (options : * mut aws_socket_channel_bootstrap_options) -> :: libc :: c_int ; } extern "C" { # [doc = " Initializes the server bootstrap with `allocator` and `el_group`. This object manages listeners, server connections,\n and channels."] pub fn aws_server_bootstrap_new (allocator : * mut aws_allocator , el_group : * mut aws_event_loop_group) -> * mut aws_server_bootstrap ; } extern "C" { # [doc = " Increments a server bootstrap's ref count, allowing the caller to take a reference to it.\n\n Returns the same server bootstrap passed in."] pub fn aws_server_bootstrap_acquire (bootstrap : * mut aws_server_bootstrap) -> * mut aws_server_bootstrap ; } extern "C" { # [doc = " Decrements a server bootstrap's ref count. When the ref count drops to zero, the bootstrap will be destroyed."] pub fn aws_server_bootstrap_release (bootstrap : * mut aws_server_bootstrap) ; } extern "C" { # [doc = " When using TLS, if ALPN is used, this callback will be invoked from the channel. The returned handler will be added\n to the channel."] pub fn aws_server_bootstrap_set_alpn_callback (bootstrap : * mut aws_server_bootstrap , on_protocol_negotiated : aws_channel_on_protocol_negotiated_fn) -> :: libc :: c_int ; } extern "C" { # [doc = " Sets up a server socket listener. If you are planning on using TLS, use\n `aws_server_bootstrap_new_tls_socket_listener` instead. This creates a socket listener bound to `local_endpoint`\n using socket options `options`. `incoming_callback` will be invoked once an incoming channel is ready for use or if\n an error is encountered. `shutdown_callback` will be invoked once the channel has shutdown. `destroy_callback` will\n be invoked after the server socket listener is destroyed, and all associated connections and channels have finished\n shutting down. Immediately after the `shutdown_callback` returns, the channel is cleaned up automatically. All\n callbacks are invoked the thread of the event-loop that the listening socket is assigned to\n\n Upon shutdown of your application, you'll want to call `aws_server_bootstrap_destroy_socket_listener` with the return\n value from this function.\n\n bootstrap_options is copied."] pub fn aws_server_bootstrap_new_socket_listener (bootstrap_options : * const aws_server_socket_channel_bootstrap_options) -> * mut aws_socket ; } extern "C" { # [doc = " Shuts down 'listener' and cleans up any resources associated with it. Any incoming channels on `listener` will still\n be active. `destroy_callback` will be invoked after the server socket listener is destroyed, and all associated\n connections and channels have finished shutting down."] pub fn aws_server_bootstrap_destroy_socket_listener (bootstrap : * mut aws_server_bootstrap , listener : * mut aws_socket) ; } pub const AWS_COMMON_HASH_TABLE_ITER_CONTINUE : _bindgen_ty_23 = _bindgen_ty_23 :: AWS_COMMON_HASH_TABLE_ITER_CONTINUE ; pub const AWS_COMMON_HASH_TABLE_ITER_DELETE : _bindgen_ty_23 = _bindgen_ty_23 :: AWS_COMMON_HASH_TABLE_ITER_DELETE ; pub const AWS_COMMON_HASH_TABLE_ITER_ERROR : _bindgen_ty_23 = _bindgen_ty_23 :: AWS_COMMON_HASH_TABLE_ITER_ERROR ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_23 { AWS_COMMON_HASH_TABLE_ITER_CONTINUE = 1 , AWS_COMMON_HASH_TABLE_ITER_DELETE = 2 , AWS_COMMON_HASH_TABLE_ITER_ERROR = 4 , } # [doc = " Hash table data structure. This module provides an automatically resizing\n hash table implementation for general purpose use. The hash table stores a\n mapping between void * keys and values; it is expected that in most cases,\n these will point to a structure elsewhere in the heap, instead of inlining a\n key or value into the hash table element itself.\n\n Currently, this hash table implements a variant of robin hood hashing, but\n we do not guarantee that this won't change in the future.\n\n Associated with each hash function are four callbacks:\n\n hash_fn - A hash function from the keys to a uint64_t. It is critical that\n the hash function for a key does not change while the key is in the hash\n table; violating this results in undefined behavior. Collisions are\n tolerated, though naturally with reduced performance.\n\n equals_fn - An equality comparison function. This function must be\n reflexive and consistent with hash_fn.\n\n destroy_key_fn, destroy_value_fn - Optional callbacks invoked when the\n table is cleared or cleaned up and at the caller's option when an element\n is removed from the table. Either or both may be set to NULL, which\n has the same effect as a no-op destroy function.\n\n This datastructure can be safely moved between threads, subject to the\n requirements of the underlying allocator. It is also safe to invoke\n non-mutating operations on the hash table from multiple threads. A suitable\n memory barrier must be used when transitioning from single-threaded mutating\n usage to multithreaded usage."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct hash_table_state { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_hash_table { pub p_impl : * mut hash_table_state , } # [test] fn bindgen_test_layout_aws_hash_table () { const UNINIT : :: std :: mem :: MaybeUninit < aws_hash_table > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_hash_table > () , 8usize , concat ! ("Size of: " , stringify ! (aws_hash_table))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_hash_table > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_hash_table))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . p_impl) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_hash_table) , "::" , stringify ! (p_impl))) ; } impl Default for aws_hash_table { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Represents an element in the hash table. Various operations on the hash\n table may provide pointers to elements stored within the hash table;\n generally, calling code may alter value, but must not alter key (or any\n information used to compute key's hash code).\n\n Pointers to elements within the hash are invalidated whenever an operation\n which may change the number of elements in the hash is invoked (i.e. put,\n delete, clear, and clean_up), regardless of whether the number of elements\n actually changes."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_hash_element { pub key : * const :: libc :: c_void , pub value : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_hash_element () { const UNINIT : :: std :: mem :: MaybeUninit < aws_hash_element > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_hash_element > () , 16usize , concat ! ("Size of: " , stringify ! (aws_hash_element))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_hash_element > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_hash_element))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . key) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_hash_element) , "::" , stringify ! (key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_hash_element) , "::" , stringify ! (value))) ; } impl Default for aws_hash_element { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_hash_iter_status { AWS_HASH_ITER_STATUS_DONE = 0 , AWS_HASH_ITER_STATUS_DELETE_CALLED = 1 , AWS_HASH_ITER_STATUS_READY_FOR_USE = 2 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_hash_iter { pub map : * const aws_hash_table , pub element : aws_hash_element , pub slot : usize , pub limit : usize , pub status : aws_hash_iter_status , pub unused_0 : :: libc :: c_int , pub unused_1 : * mut :: libc :: c_void , pub unused_2 : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_hash_iter () { const UNINIT : :: std :: mem :: MaybeUninit < aws_hash_iter > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_hash_iter > () , 64usize , concat ! ("Size of: " , stringify ! (aws_hash_iter))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_hash_iter > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_hash_iter))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . map) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (map))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . element) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (element))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . slot) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (slot))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . limit) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (limit))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . status) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (status))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . unused_0) as usize - ptr as usize } , 44usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (unused_0))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . unused_1) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (unused_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . unused_2) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (unused_2))) ; } impl Default for aws_hash_iter { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Prototype for a key hashing function pointer."] pub type aws_hash_fn = :: std :: option :: Option < unsafe extern "C" fn (key : * const :: libc :: c_void) -> u64 > ; # [doc = " Prototype for a hash table equality check function pointer.\n\n This type is usually used for a function that compares two hash table\n keys, but note that the same type is used for a function that compares\n two hash table values in aws_hash_table_eq.\n\n Equality functions used in a hash table must be reflexive (i.e., a == b if\n and only if b == a), and must be consistent with the hash function in use."] pub type aws_hash_callback_eq_fn = :: std :: option :: Option < unsafe extern "C" fn (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> bool > ; # [doc = " Prototype for a hash table key or value destructor function pointer.\n\n This function is used to destroy elements in the hash table when the\n table is cleared or cleaned up.\n\n Note that functions which remove individual elements from the hash\n table provide options of whether or not to invoke the destructors\n on the key and value of a removed element."] pub type aws_hash_callback_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (key_or_value : * mut :: libc :: c_void) > ; extern "C" { # [doc = " Initializes a hash map with initial capacity for 'size' elements\n without resizing. Uses hash_fn to compute the hash of each element.\n equals_fn to compute equality of two keys. Whenever an element is\n removed without being returned, destroy_key_fn is run on the pointer\n to the key and destroy_value_fn is run on the pointer to the value.\n Either or both may be NULL if a callback is not desired in this case."] pub fn aws_hash_table_init (map : * mut aws_hash_table , alloc : * mut aws_allocator , size : usize , hash_fn : aws_hash_fn , equals_fn : aws_hash_callback_eq_fn , destroy_key_fn : aws_hash_callback_destroy_fn , destroy_value_fn : aws_hash_callback_destroy_fn) -> :: libc :: c_int ; } extern "C" { # [doc = " Deletes every element from map and frees all associated memory.\n destroy_fn will be called for each element. aws_hash_table_init\n must be called before reusing the hash table.\n\n This method is idempotent."] pub fn aws_hash_table_clean_up (map : * mut aws_hash_table) ; } extern "C" { # [doc = " Safely swaps two hash tables. Note that we swap the entirety of the hash\n table, including which allocator is associated.\n\n Neither hash table is required to be initialized; if one or both is\n uninitialized, then the uninitialized state is also swapped."] pub fn aws_hash_table_swap (a : * mut aws_hash_table , b : * mut aws_hash_table) ; } extern "C" { # [doc = " Moves the hash table in 'from' to 'to'. After this move, 'from' will\n be identical to the state of the original 'to' hash table, and 'to'\n will be in the same state as if it had been passed to aws_hash_table_clean_up\n (that is, it will have no memory allocated, and it will be safe to\n either discard it or call aws_hash_table_clean_up again).\n\n Note that 'to' will not be cleaned up. You should make sure that 'to'\n is either uninitialized or cleaned up before moving a hashtable into\n it."] pub fn aws_hash_table_move (to : * mut aws_hash_table , from : * mut aws_hash_table) ; } extern "C" { # [doc = " Returns the current number of entries in the table."] pub fn aws_hash_table_get_entry_count (map : * const aws_hash_table) -> usize ; } extern "C" { # [doc = " Returns an iterator to be used for iterating through a hash table.\n Iterator will already point to the first element of the table it finds,\n which can be accessed as iter.element.\n\n This function cannot fail, but if there are no elements in the table,\n the returned iterator will return true for aws_hash_iter_done(&iter)."] pub fn aws_hash_iter_begin (map : * const aws_hash_table) -> aws_hash_iter ; } extern "C" { # [doc = " Returns true if iterator is done iterating through table, false otherwise.\n If this is true, the iterator will not include an element of the table."] pub fn aws_hash_iter_done (iter : * const aws_hash_iter) -> bool ; } extern "C" { # [doc = " Updates iterator so that it points to next element of hash table.\n\n This and the two previous functions are designed to be used together with\n the following idiom:\n\n for (struct aws_hash_iter iter = aws_hash_iter_begin(&map);\n !aws_hash_iter_done(&iter); aws_hash_iter_next(&iter)) {\n const key_type key = *(const key_type *)iter.element.key;\n value_type value = *(value_type *)iter.element.value;\n // etc.\n }\n\n Note that calling this on an iter which is \"done\" is idempotent:\n i.e. it will return another iter which is \"done\"."] pub fn aws_hash_iter_next (iter : * mut aws_hash_iter) ; } extern "C" { # [doc = " Deletes the element currently pointed-to by the hash iterator.\n After calling this method, the element member of the iterator\n should not be accessed until the next call to aws_hash_iter_next.\n\n @param destroy_contents If true, the destructors for the key and value\n will be called."] pub fn aws_hash_iter_delete (iter : * mut aws_hash_iter , destroy_contents : bool) ; } extern "C" { # [doc = " Attempts to locate an element at key. If the element is found, a\n pointer to the value is placed in *p_elem; if it is not found,\n *pElem is set to NULL. Either way, AWS_OP_SUCCESS is returned.\n\n This method does not change the state of the hash table. Therefore, it\n is safe to call _find from multiple threads on the same hash table,\n provided no mutating operations happen in parallel.\n\n Calling code may update the value in the hash table by modifying **pElem\n after a successful find. However, this pointer is not guaranteed to\n remain usable after a subsequent call to _put, _delete, _clear, or\n _clean_up."] pub fn aws_hash_table_find (map : * const aws_hash_table , key : * const :: libc :: c_void , p_elem : * mut * mut aws_hash_element) -> :: libc :: c_int ; } extern "C" { # [doc = " Attempts to locate an element at key. If no such element was found,\n creates a new element, with value initialized to NULL. In either case, a\n pointer to the element is placed in *p_elem.\n\n If was_created is non-NULL, *was_created is set to 0 if an existing\n element was found, or 1 is a new element was created.\n\n Returns AWS_OP_SUCCESS if an item was found or created.\n Raises AWS_ERROR_OOM if hash table expansion was required and memory\n allocation failed."] pub fn aws_hash_table_create (map : * mut aws_hash_table , key : * const :: libc :: c_void , p_elem : * mut * mut aws_hash_element , was_created : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Inserts a new element at key, with the given value. If another element\n exists at that key, the old element will be overwritten; both old key and\n value objects will be destroyed.\n\n If was_created is non-NULL, *was_created is set to 0 if an existing\n element was found, or 1 is a new element was created.\n\n Returns AWS_OP_SUCCESS if an item was found or created.\n Raises AWS_ERROR_OOM if hash table expansion was required and memory"] pub fn aws_hash_table_put (map : * mut aws_hash_table , key : * const :: libc :: c_void , value : * mut :: libc :: c_void , was_created : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes element at key. Always returns AWS_OP_SUCCESS.\n\n If pValue is non-NULL, the existing value (if any) is moved into\n (*value) before removing from the table, and destroy_fn is _not_\n invoked. If pValue is NULL, then (if the element existed) destroy_fn\n will be invoked on the element being removed.\n\n If was_present is non-NULL, it is set to 0 if the element was\n not present, or 1 if it was present (and is now removed)."] pub fn aws_hash_table_remove (map : * mut aws_hash_table , key : * const :: libc :: c_void , p_value : * mut aws_hash_element , was_present : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes element already known (typically by find()).\n\n p_value should point to a valid element returned by create() or find().\n\n NOTE: DO NOT call this method from inside of a aws_hash_table_foreach callback, return\n AWS_COMMON_HASH_TABLE_ITER_DELETE instead."] pub fn aws_hash_table_remove_element (map : * mut aws_hash_table , p_value : * mut aws_hash_element) -> :: libc :: c_int ; } extern "C" { # [doc = " Iterates through every element in the map and invokes the callback on\n that item. Iteration is performed in an arbitrary, implementation-defined\n order, and is not guaranteed to be consistent across invocations.\n\n The callback may change the value associated with the key by overwriting\n the value pointed-to by value. In this case, the on_element_removed\n callback will not be invoked, unless the callback invokes\n AWS_COMMON_HASH_TABLE_ITER_DELETE (in which case the on_element_removed\n is given the updated value).\n\n The callback must return a bitmask of zero or more of the following values\n ORed together:\n\n # AWS_COMMON_HASH_TABLE_ITER_CONTINUE - Continues iteration to the next\n element (if not set, iteration stops)\n # AWS_COMMON_HASH_TABLE_ITER_DELETE - Deletes the current value and\n continues iteration. destroy_fn will NOT be invoked.\n # AWS_COMMON_HASH_TABLE_ITER_ERROR - Stop iteration with error.\n No action will be taken for the current value and the value before this.\n No rolling back. The deleted value before will NOT be back.\n aws_hash_table_foreach returns AWS_OP_ERR after stropping the iteration.\n\n Invoking any method which may change the contents of the hashtable\n during iteration results in undefined behavior. However, you may safely\n invoke non-mutating operations during an iteration.\n\n This operation is mutating only if AWS_COMMON_HASH_TABLE_ITER_DELETE\n is returned at some point during iteration. Otherwise, it is non-mutating\n and is safe to invoke in parallel with other non-mutating operations."] pub fn aws_hash_table_foreach (map : * mut aws_hash_table , callback : :: std :: option :: Option < unsafe extern "C" fn (context : * mut :: libc :: c_void , p_element : * mut aws_hash_element) -> :: libc :: c_int > , context : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Compares two hash tables for equality. Both hash tables must have equivalent\n key comparators; values will be compared using the comparator passed into this\n function. The key hash function does not need to be equivalent between the\n two hash tables."] pub fn aws_hash_table_eq (a : * const aws_hash_table , b : * const aws_hash_table , value_eq : aws_hash_callback_eq_fn) -> bool ; } extern "C" { # [doc = " Removes every element from the hash map. destroy_fn will be called for\n each element."] pub fn aws_hash_table_clear (map : * mut aws_hash_table) ; } extern "C" { # [doc = " Convenience hash function for NULL-terminated C-strings"] pub fn aws_hash_c_string (item : * const :: libc :: c_void) -> u64 ; } extern "C" { # [doc = " Convenience hash function for struct aws_strings.\n Hash is same as used on the string bytes by aws_hash_c_string."] pub fn aws_hash_string (item : * const :: libc :: c_void) -> u64 ; } extern "C" { # [doc = " Convenience hash function for struct aws_byte_cursor.\n Hash is same as used on the string bytes by aws_hash_c_string."] pub fn aws_hash_byte_cursor_ptr (item : * const :: libc :: c_void) -> u64 ; } extern "C" { # [doc = " Convenience hash function which hashes the pointer value directly,\n without dereferencing. This can be used in cases where pointer identity\n is desired, or where a uintptr_t is encoded into a const void *."] pub fn aws_hash_ptr (item : * const :: libc :: c_void) -> u64 ; } extern "C" { pub fn aws_hash_combine (item1 : u64 , item2 : u64) -> u64 ; } extern "C" { # [doc = " Convenience eq callback for NULL-terminated C-strings"] pub fn aws_hash_callback_c_str_eq (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> bool ; } extern "C" { # [doc = " Convenience eq callback for AWS strings"] pub fn aws_hash_callback_string_eq (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> bool ; } extern "C" { # [doc = " Convenience destroy callback for AWS strings"] pub fn aws_hash_callback_string_destroy (a : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Equality function which compares pointer equality."] pub fn aws_ptr_eq (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> bool ; } extern "C" { # [doc = " Best-effort check of hash_table_state data-structure invariants"] pub fn aws_hash_table_is_valid (map : * const aws_hash_table) -> bool ; } extern "C" { # [doc = " Given a pointer to a hash_iter, checks that it is well-formed, with all data-structure invariants."] pub fn aws_hash_iter_is_valid (iter : * const aws_hash_iter) -> bool ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_io_event_type { AWS_IO_EVENT_TYPE_READABLE = 1 , AWS_IO_EVENT_TYPE_WRITABLE = 2 , AWS_IO_EVENT_TYPE_REMOTE_HANG_UP = 4 , AWS_IO_EVENT_TYPE_CLOSED = 8 , AWS_IO_EVENT_TYPE_ERROR = 16 , } pub type aws_event_loop_on_event_fn = :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle , events : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_event_loop_vtable { pub destroy : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop) > , pub run : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop) -> :: libc :: c_int > , pub stop : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop) -> :: libc :: c_int > , pub wait_for_stop_completion : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop) -> :: libc :: c_int > , pub schedule_task_now : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , task : * mut aws_task) > , pub schedule_task_future : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , task : * mut aws_task , run_at_nanos : u64) > , pub cancel_task : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , task : * mut aws_task) > , pub subscribe_to_io_events : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle , events : :: libc :: c_int , on_event : aws_event_loop_on_event_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > , pub unsubscribe_from_io_events : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle) -> :: libc :: c_int > , pub free_io_event_resources : :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > , pub is_on_callers_thread : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop) -> bool > , } # [test] fn bindgen_test_layout_aws_event_loop_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_event_loop_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_event_loop_vtable > () , 88usize , concat ! ("Size of: " , stringify ! (aws_event_loop_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_event_loop_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_event_loop_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . run) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (run))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . stop) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (stop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . wait_for_stop_completion) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (wait_for_stop_completion))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . schedule_task_now) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (schedule_task_now))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . schedule_task_future) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (schedule_task_future))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cancel_task) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (cancel_task))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subscribe_to_io_events) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (subscribe_to_io_events))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . unsubscribe_from_io_events) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (unsubscribe_from_io_events))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . free_io_event_resources) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (free_io_event_resources))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . is_on_callers_thread) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (is_on_callers_thread))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_event_loop { pub vtable : * mut aws_event_loop_vtable , pub alloc : * mut aws_allocator , pub clock : aws_io_clock_fn , pub local_data : aws_hash_table , pub current_load_factor : aws_atomic_var , pub latest_tick_start : u64 , pub current_tick_latency_sum : usize , pub next_flush_time : aws_atomic_var , pub impl_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_event_loop () { const UNINIT : :: std :: mem :: MaybeUninit < aws_event_loop > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_event_loop > () , 72usize , concat ! ("Size of: " , stringify ! (aws_event_loop))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_event_loop > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_event_loop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clock) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (clock))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . local_data) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (local_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . current_load_factor) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (current_load_factor))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . latest_tick_start) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (latest_tick_start))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . current_tick_latency_sum) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (current_tick_latency_sum))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . next_flush_time) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (next_flush_time))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_data) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (impl_data))) ; } impl Default for aws_event_loop { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_event_loop_on_local_object_removed_fn = :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut aws_event_loop_local_object) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_event_loop_local_object { pub key : * const :: libc :: c_void , pub object : * mut :: libc :: c_void , pub on_object_removed : aws_event_loop_on_local_object_removed_fn , } # [test] fn bindgen_test_layout_aws_event_loop_local_object () { const UNINIT : :: std :: mem :: MaybeUninit < aws_event_loop_local_object > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_event_loop_local_object > () , 24usize , concat ! ("Size of: " , stringify ! (aws_event_loop_local_object))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_event_loop_local_object > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_event_loop_local_object))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . key) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_local_object) , "::" , stringify ! (key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . object) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_local_object) , "::" , stringify ! (object))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_object_removed) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_local_object) , "::" , stringify ! (on_object_removed))) ; } impl Default for aws_event_loop_local_object { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_event_loop_options { pub clock : aws_io_clock_fn , pub thread_options : * mut aws_thread_options , } # [test] fn bindgen_test_layout_aws_event_loop_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_event_loop_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_event_loop_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_event_loop_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_event_loop_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_event_loop_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clock) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_options) , "::" , stringify ! (clock))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . thread_options) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_options) , "::" , stringify ! (thread_options))) ; } impl Default for aws_event_loop_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_new_event_loop_fn = :: std :: option :: Option < unsafe extern "C" fn (alloc : * mut aws_allocator , options : * const aws_event_loop_options , new_loop_user_data : * mut :: libc :: c_void) -> * mut aws_event_loop > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_event_loop_group { pub allocator : * mut aws_allocator , pub event_loops : aws_array_list , pub ref_count : aws_ref_count , pub shutdown_options : aws_shutdown_callback_options , } # [test] fn bindgen_test_layout_aws_event_loop_group () { const UNINIT : :: std :: mem :: MaybeUninit < aws_event_loop_group > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_event_loop_group > () , 88usize , concat ! ("Size of: " , stringify ! (aws_event_loop_group))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_event_loop_group > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_event_loop_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_group) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . event_loops) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_group) , "::" , stringify ! (event_loops))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_group) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_group) , "::" , stringify ! (shutdown_options))) ; } impl Default for aws_event_loop_group { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Creates an instance of the default event loop implementation for the current architecture and operating system."] pub fn aws_event_loop_new_default (alloc : * mut aws_allocator , clock : aws_io_clock_fn) -> * mut aws_event_loop ; } extern "C" { # [doc = " Creates an instance of the default event loop implementation for the current architecture and operating system using\n extendable options."] pub fn aws_event_loop_new_default_with_options (alloc : * mut aws_allocator , options : * const aws_event_loop_options) -> * mut aws_event_loop ; } extern "C" { # [doc = " Invokes the destroy() fn for the event loop implementation.\n If the event loop is still in a running state, this function will block waiting on the event loop to shutdown.\n If you do not want this function to block, call aws_event_loop_stop() manually first.\n If the event loop is shared by multiple threads then destroy must be called by exactly one thread. All other threads\n must ensure their API calls to the event loop happen-before the call to destroy."] pub fn aws_event_loop_destroy (event_loop : * mut aws_event_loop) ; } extern "C" { # [doc = " Initializes common event-loop data structures.\n This is only called from the *new() function of event loop implementations."] pub fn aws_event_loop_init_base (event_loop : * mut aws_event_loop , alloc : * mut aws_allocator , clock : aws_io_clock_fn) -> :: libc :: c_int ; } extern "C" { # [doc = " Common cleanup code for all implementations.\n This is only called from the *destroy() function of event loop implementations."] pub fn aws_event_loop_clean_up_base (event_loop : * mut aws_event_loop) ; } extern "C" { # [doc = " Fetches an object from the event-loop's data store. Key will be taken as the memory address of the memory pointed to\n by key. This function is not thread safe and should be called inside the event-loop's thread."] pub fn aws_event_loop_fetch_local_object (event_loop : * mut aws_event_loop , key : * mut :: libc :: c_void , obj : * mut aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Puts an item object the event-loop's data store. Key will be taken as the memory address of the memory pointed to by\n key. The lifetime of item must live until remove or a put item overrides it. This function is not thread safe and\n should be called inside the event-loop's thread."] pub fn aws_event_loop_put_local_object (event_loop : * mut aws_event_loop , obj : * mut aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes an object from the event-loop's data store. Key will be taken as the memory address of the memory pointed to\n by key. If removed_item is not null, the removed item will be moved to it if it exists. Otherwise, the default\n deallocation strategy will be used. This function is not thread safe and should be called inside the event-loop's\n thread."] pub fn aws_event_loop_remove_local_object (event_loop : * mut aws_event_loop , key : * mut :: libc :: c_void , removed_obj : * mut aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Triggers the running of the event loop. This function must not block. The event loop is not active until this\n function is invoked. This function can be called again on an event loop after calling aws_event_loop_stop() and\n aws_event_loop_wait_for_stop_completion()."] pub fn aws_event_loop_run (event_loop : * mut aws_event_loop) -> :: libc :: c_int ; } extern "C" { # [doc = " Triggers the event loop to stop, but does not wait for the loop to stop completely.\n This function may be called from outside or inside the event loop thread. It is safe to call multiple times.\n This function is called from destroy().\n\n If you do not call destroy(), an event loop can be run again by calling stop(), wait_for_stop_completion(), run()."] pub fn aws_event_loop_stop (event_loop : * mut aws_event_loop) -> :: libc :: c_int ; } extern "C" { # [doc = " For event-loop implementations to use for providing metrics info to the base event-loop. This enables the\n event-loop load balancer to take into account load when vending another event-loop to a caller.\n\n Call this function at the beginning of your event-loop tick: after wake-up, but before processing any IO or tasks."] pub fn aws_event_loop_register_tick_start (event_loop : * mut aws_event_loop) ; } extern "C" { # [doc = " For event-loop implementations to use for providing metrics info to the base event-loop. This enables the\n event-loop load balancer to take into account load when vending another event-loop to a caller.\n\n Call this function at the end of your event-loop tick: after processing IO and tasks."] pub fn aws_event_loop_register_tick_end (event_loop : * mut aws_event_loop) ; } extern "C" { # [doc = " Returns the current load factor (however that may be calculated). If the event-loop is not invoking\n aws_event_loop_register_tick_start() and aws_event_loop_register_tick_end(), this value will always be 0."] pub fn aws_event_loop_get_load_factor (event_loop : * mut aws_event_loop) -> usize ; } extern "C" { # [doc = " Blocks until the event loop stops completely.\n If you want to call aws_event_loop_run() again, you must call this after aws_event_loop_stop().\n It is not safe to call this function from inside the event loop thread."] pub fn aws_event_loop_wait_for_stop_completion (event_loop : * mut aws_event_loop) -> :: libc :: c_int ; } extern "C" { # [doc = " The event loop will schedule the task and run it on the event loop thread as soon as possible.\n Note that cancelled tasks may execute outside the event loop thread.\n This function may be called from outside or inside the event loop thread.\n\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_event_loop_schedule_task_now (event_loop : * mut aws_event_loop , task : * mut aws_task) ; } extern "C" { # [doc = " The event loop will schedule the task and run it at the specified time.\n Use aws_event_loop_current_clock_time() to query the current time in nanoseconds.\n Note that cancelled tasks may execute outside the event loop thread.\n This function may be called from outside or inside the event loop thread.\n\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_event_loop_schedule_task_future (event_loop : * mut aws_event_loop , task : * mut aws_task , run_at_nanos : u64) ; } extern "C" { # [doc = " Cancels task.\n This function must be called from the event loop's thread, and is only guaranteed\n to work properly on tasks scheduled from within the event loop's thread.\n The task will be executed with the AWS_TASK_STATUS_CANCELED status inside this call."] pub fn aws_event_loop_cancel_task (event_loop : * mut aws_event_loop , task : * mut aws_task) ; } extern "C" { # [doc = " Subscribes on_event to events on the event-loop for handle. events is a bitwise concatenation of the events that were\n received. The definition for these values can be found in aws_io_event_type. Currently, only\n AWS_IO_EVENT_TYPE_READABLE and AWS_IO_EVENT_TYPE_WRITABLE are honored. You always are registered for error conditions\n and closure. This function may be called from outside or inside the event loop thread. However, the unsubscribe\n function must be called inside the event-loop's thread."] pub fn aws_event_loop_subscribe_to_io_events (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle , events : :: libc :: c_int , on_event : aws_event_loop_on_event_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Unsubscribes handle from event-loop notifications.\n This function is not thread safe and should be called inside the event-loop's thread.\n\n NOTE: if you are using io completion ports, this is a risky call. We use it in places, but only when we're certain\n there's no pending events. If you want to use it, it's your job to make sure you don't have pending events before\n calling it."] pub fn aws_event_loop_unsubscribe_from_io_events (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle) -> :: libc :: c_int ; } extern "C" { # [doc = " Cleans up resources (user_data) associated with the I/O eventing subsystem for a given handle. This should only\n ever be necessary in the case where you are cleaning up an event loop during shutdown and its thread has already\n been joined."] pub fn aws_event_loop_free_io_event_resources (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle) ; } extern "C" { # [doc = " Returns true if the event loop's thread is the same thread that called this function, otherwise false."] pub fn aws_event_loop_thread_is_callers_thread (event_loop : * mut aws_event_loop) -> bool ; } extern "C" { # [doc = " Gets the current timestamp for the event loop's clock, in nanoseconds. This function is thread-safe."] pub fn aws_event_loop_current_clock_time (event_loop : * mut aws_event_loop , time_nanos : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Creates an event loop group, with clock, number of loops to manage, and the function to call for creating a new\n event loop."] pub fn aws_event_loop_group_new (alloc : * mut aws_allocator , clock : aws_io_clock_fn , el_count : u16 , new_loop_fn : aws_new_event_loop_fn , new_loop_user_data : * mut :: libc :: c_void , shutdown_options : * const aws_shutdown_callback_options) -> * mut aws_event_loop_group ; } extern "C" { # [doc = " Creates an event loop group, with clock, number of loops to manage, the function to call for creating a new\n event loop, and also pins all loops to hw threads on the same cpu_group (e.g. NUMA nodes). Note:\n If el_count exceeds the number of hw threads in the cpu_group it will be ignored on the assumption that if you\n care about NUMA, you don't want hyper-threads doing your IO and you especially don't want IO on a different node."] pub fn aws_event_loop_group_new_pinned_to_cpu_group (alloc : * mut aws_allocator , clock : aws_io_clock_fn , el_count : u16 , cpu_group : u16 , new_loop_fn : aws_new_event_loop_fn , new_loop_user_data : * mut :: libc :: c_void , shutdown_options : * const aws_shutdown_callback_options) -> * mut aws_event_loop_group ; } extern "C" { # [doc = " Initializes an event loop group with platform defaults. If max_threads == 0, then the\n loop count will be the number of available processors on the machine / 2 (to exclude hyper-threads).\n Otherwise, max_threads will be the number of event loops in the group."] pub fn aws_event_loop_group_new_default (alloc : * mut aws_allocator , max_threads : u16 , shutdown_options : * const aws_shutdown_callback_options) -> * mut aws_event_loop_group ; } extern "C" { # [doc = " Creates an event loop group, with clock, number of loops to manage, the function to call for creating a new\n event loop, and also pins all loops to hw threads on the same cpu_group (e.g. NUMA nodes). Note:\n If el_count exceeds the number of hw threads in the cpu_group it will be clamped to the number of hw threads\n on the assumption that if you care about NUMA, you don't want hyper-threads doing your IO and you especially\n don't want IO on a different node.\n\n If max_threads == 0, then the\n loop count will be the number of available processors in the cpu_group / 2 (to exclude hyper-threads)"] pub fn aws_event_loop_group_new_default_pinned_to_cpu_group (alloc : * mut aws_allocator , max_threads : u16 , cpu_group : u16 , shutdown_options : * const aws_shutdown_callback_options) -> * mut aws_event_loop_group ; } extern "C" { # [doc = " Increments the reference count on the event loop group, allowing the caller to take a reference to it.\n\n Returns the same event loop group passed in."] pub fn aws_event_loop_group_acquire (el_group : * mut aws_event_loop_group) -> * mut aws_event_loop_group ; } extern "C" { # [doc = " Decrements an event loop group's ref count. When the ref count drops to zero, the event loop group will be\n destroyed."] pub fn aws_event_loop_group_release (el_group : * mut aws_event_loop_group) ; } extern "C" { pub fn aws_event_loop_group_get_loop_at (el_group : * mut aws_event_loop_group , index : usize) -> * mut aws_event_loop ; } extern "C" { pub fn aws_event_loop_group_get_loop_count (el_group : * mut aws_event_loop_group) -> usize ; } extern "C" { # [doc = " Fetches the next loop for use. The purpose is to enable load balancing across loops. You should not depend on how\n this load balancing is done as it is subject to change in the future. Currently it uses the \"best-of-two\" algorithm\n based on the load factor of each loop."] pub fn aws_event_loop_group_get_next_loop (el_group : * mut aws_event_loop_group) -> * mut aws_event_loop ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_stream_seek_basis { AWS_SSB_BEGIN = 0 , AWS_SSB_END = 2 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_stream_status { pub is_end_of_stream : bool , pub is_valid : bool , } # [test] fn bindgen_test_layout_aws_stream_status () { const UNINIT : :: std :: mem :: MaybeUninit < aws_stream_status > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_stream_status > () , 2usize , concat ! ("Size of: " , stringify ! (aws_stream_status))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_stream_status > () , 1usize , concat ! ("Alignment of " , stringify ! (aws_stream_status))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . is_end_of_stream) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_stream_status) , "::" , stringify ! (is_end_of_stream))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . is_valid) as usize - ptr as usize } , 1usize , concat ! ("Offset of field: " , stringify ! (aws_stream_status) , "::" , stringify ! (is_valid))) ; } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_input_stream_vtable { pub seek : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream , offset : i64 , basis : aws_stream_seek_basis) -> :: libc :: c_int > , # [doc = " Stream as much data as will fit into the destination buffer and update its length.\n The destination buffer's capacity MUST NOT be changed.\n\n Return AWS_OP_SUCCESS if the read is successful.\n If AWS_OP_ERR is returned, the stream is assumed to be invalid and any data written to the buffer is ignored.\n\n If no more data is currently available, or the end of the stream has been reached, simply return AWS_OP_SUCCESS\n without touching the destination buffer."] pub read : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream , dest : * mut aws_byte_buf) -> :: libc :: c_int > , pub get_status : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream , status : * mut aws_stream_status) -> :: libc :: c_int > , pub get_length : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream , out_length : * mut i64) -> :: libc :: c_int > , # [doc = " Optional.\n If not set, the default aws_ref_count_acquire/release will be used.\n Set for high level language binding that has its own refcounting implementation and needs to be kept alive from\n C.\n If set, ref_count member will not be used."] pub acquire : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream) > , pub release : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream) > , } # [test] fn bindgen_test_layout_aws_input_stream_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_input_stream_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_input_stream_vtable > () , 48usize , concat ! ("Size of: " , stringify ! (aws_input_stream_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_input_stream_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_input_stream_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . seek) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (seek))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . read) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (read))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_status) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (get_status))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_length) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (get_length))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . acquire) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (acquire))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . release) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (release))) ; } # [doc = " Base class for input streams.\n Note: when you implement one input stream, the ref_count needs to be initialized to clean up the resource when\n reaches to zero."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_input_stream { pub impl_ : * mut :: libc :: c_void , pub vtable : * const aws_input_stream_vtable , pub ref_count : aws_ref_count , } # [test] fn bindgen_test_layout_aws_input_stream () { const UNINIT : :: std :: mem :: MaybeUninit < aws_input_stream > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_input_stream > () , 40usize , concat ! ("Size of: " , stringify ! (aws_input_stream))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_input_stream > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_input_stream))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream) , "::" , stringify ! (ref_count))) ; } impl Default for aws_input_stream { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Increments the reference count on the input stream, allowing the caller to take a reference to it.\n\n Returns the same input stream passed in."] pub fn aws_input_stream_acquire (stream : * mut aws_input_stream) -> * mut aws_input_stream ; } extern "C" { # [doc = " Decrements a input stream's ref count. When the ref count drops to zero, the input stream will be destroyed.\n\n Returns NULL always."] pub fn aws_input_stream_release (stream : * mut aws_input_stream) -> * mut aws_input_stream ; } extern "C" { pub fn aws_input_stream_seek (stream : * mut aws_input_stream , offset : i64 , basis : aws_stream_seek_basis) -> :: libc :: c_int ; } extern "C" { pub fn aws_input_stream_read (stream : * mut aws_input_stream , dest : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { pub fn aws_input_stream_get_status (stream : * mut aws_input_stream , status : * mut aws_stream_status) -> :: libc :: c_int ; } extern "C" { pub fn aws_input_stream_get_length (stream : * mut aws_input_stream , out_length : * mut i64) -> :: libc :: c_int ; } extern "C" { pub fn aws_input_stream_destroy (stream : * mut aws_input_stream) ; } extern "C" { pub fn aws_input_stream_new_from_cursor (allocator : * mut aws_allocator , cursor : * const aws_byte_cursor) -> * mut aws_input_stream ; } extern "C" { pub fn aws_input_stream_new_from_file (allocator : * mut aws_allocator , file_name : * const :: libc :: c_char) -> * mut aws_input_stream ; } extern "C" { pub fn aws_input_stream_new_from_open_file (allocator : * mut aws_allocator , file : * mut FILE) -> * mut aws_input_stream ; } # [doc = " Data representing a URI. uri_str is always allocated and filled in.\n The other portions are merely storing offsets into uri_str."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_uri { pub self_size : usize , pub allocator : * mut aws_allocator , pub uri_str : aws_byte_buf , pub scheme : aws_byte_cursor , pub authority : aws_byte_cursor , pub userinfo : aws_byte_cursor , pub user : aws_byte_cursor , pub password : aws_byte_cursor , pub host_name : aws_byte_cursor , pub port : u16 , pub path : aws_byte_cursor , pub query_string : aws_byte_cursor , pub path_and_query : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_uri () { const UNINIT : :: std :: mem :: MaybeUninit < aws_uri > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_uri > () , 200usize , concat ! ("Size of: " , stringify ! (aws_uri))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_uri > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_uri))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . self_size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (self_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . uri_str) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (uri_str))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . scheme) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (scheme))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . authority) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (authority))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . userinfo) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (userinfo))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (user))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . password) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (password))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . path) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (path))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . query_string) as usize - ptr as usize } , 168usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (query_string))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . path_and_query) as usize - ptr as usize } , 184usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (path_and_query))) ; } impl Default for aws_uri { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " key/value pairs for a query string. If the query fragment was not in format key=value, the fragment value\n will be stored in key"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_uri_param { pub key : aws_byte_cursor , pub value : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_uri_param () { const UNINIT : :: std :: mem :: MaybeUninit < aws_uri_param > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_uri_param > () , 32usize , concat ! ("Size of: " , stringify ! (aws_uri_param))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_uri_param > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_uri_param))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . key) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_uri_param) , "::" , stringify ! (key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_uri_param) , "::" , stringify ! (value))) ; } impl Default for aws_uri_param { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Arguments for building a URI instance. All members must\n be initialized before passing them to aws_uri_init().\n\n query_string and query_params are exclusive to each other. If you set\n query_string, do not prepend it with '?'"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_uri_builder_options { pub scheme : aws_byte_cursor , pub path : aws_byte_cursor , pub host_name : aws_byte_cursor , pub port : u16 , pub query_params : * mut aws_array_list , pub query_string : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_uri_builder_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_uri_builder_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_uri_builder_options > () , 80usize , concat ! ("Size of: " , stringify ! (aws_uri_builder_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_uri_builder_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_uri_builder_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . scheme) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (scheme))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . path) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (path))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . query_params) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (query_params))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . query_string) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (query_string))) ; } impl Default for aws_uri_builder_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Parses 'uri_str' and initializes uri. Returns AWS_OP_SUCCESS, on success, AWS_OP_ERR on failure.\n After calling this function, the parts can be accessed."] pub fn aws_uri_init_parse (uri : * mut aws_uri , allocator : * mut aws_allocator , uri_str : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Initializes uri to values specified in options. Returns AWS_OP_SUCCESS, on success, AWS_OP_ERR on failure.\n After calling this function, the parts can be accessed."] pub fn aws_uri_init_from_builder_options (uri : * mut aws_uri , allocator : * mut aws_allocator , options : * mut aws_uri_builder_options) -> :: libc :: c_int ; } extern "C" { pub fn aws_uri_clean_up (uri : * mut aws_uri) ; } extern "C" { # [doc = " Returns the scheme portion of the uri (e.g. http, https, ftp, ftps, etc...). If the scheme was not present\n in the uri, the returned value will be empty. It is the users job to determine the appropriate defaults\n if this field is empty, based on protocol, port, etc..."] pub fn aws_uri_scheme (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " Returns the authority portion of the uri (host[:port]). If it was not present, this was a request uri. In that\n case, the value will be empty."] pub fn aws_uri_authority (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " Returns the path portion of the uri, including any leading '/'. If not present, this value will be empty."] pub fn aws_uri_path (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " Returns the query string portion of the uri, minus the '?'. If not present, this value will be empty."] pub fn aws_uri_query_string (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " Returns the 'host_name' portion of the authority. If no authority was present, this value will be empty."] pub fn aws_uri_host_name (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " Returns the port portion of the authority if it was present, otherwise, returns 0.\n If this is 0, it is the users job to determine the correct port based on scheme and protocol."] pub fn aws_uri_port (uri : * const aws_uri) -> u16 ; } extern "C" { # [doc = " Returns the path and query portion of the uri (i.e., the thing you send across the wire)."] pub fn aws_uri_path_and_query (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " For iterating over the params in the uri query string.\n `param` is an in/out argument used to track progress, it MUST be zeroed out to start.\n If true is returned, `param` contains the value of the next param.\n If false is returned, there are no further params.\n\n Edge cases:\n 1) Entries without '=' sign are treated as having a key and no value.\n Example: First param in query string \"a&b=c\" has key=\"a\" value=\"\"\n\n 2) Blank entries are skipped.\n Example: The only param in query string \"&&a=b\" is key=\"a\" value=\"b\""] pub fn aws_uri_query_string_next_param (uri : * const aws_uri , param : * mut aws_uri_param) -> bool ; } extern "C" { # [doc = " Parses query string and stores the parameters in 'out_params'. Returns AWS_OP_SUCCESS on success and\n AWS_OP_ERR on failure. The user is responsible for initializing out_params with item size of struct aws_query_param.\n The user is also responsible for cleaning up out_params when finished."] pub fn aws_uri_query_string_params (uri : * const aws_uri , out_params : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Writes the uri path encoding of a cursor to a buffer. This is the modified version of rfc3986 used by\n sigv4 signing."] pub fn aws_byte_buf_append_encoding_uri_path (buffer : * mut aws_byte_buf , cursor : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Writes the uri query param encoding (passthrough alnum + '-' '_' '~' '.') of a UTF-8 cursor to a buffer\n For example, reading \"a b_c\" would write \"a%20b_c\"."] pub fn aws_byte_buf_append_encoding_uri_param (buffer : * mut aws_byte_buf , cursor : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Writes the uri decoding of a UTF-8 cursor to a buffer,\n replacing %xx escapes by their single byte equivalent.\n For example, reading \"a%20b_c\" would write \"a b_c\"."] pub fn aws_byte_buf_append_decoding_uri (buffer : * mut aws_byte_buf , cursor : * const aws_byte_cursor) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_errors { AWS_ERROR_S3_MISSING_CONTENT_RANGE_HEADER = 14336 , AWS_ERROR_S3_INVALID_CONTENT_RANGE_HEADER = 14337 , AWS_ERROR_S3_MISSING_CONTENT_LENGTH_HEADER = 14338 , AWS_ERROR_S3_INVALID_CONTENT_LENGTH_HEADER = 14339 , AWS_ERROR_S3_MISSING_ETAG = 14340 , AWS_ERROR_S3_INTERNAL_ERROR = 14341 , AWS_ERROR_S3_SLOW_DOWN = 14342 , AWS_ERROR_S3_INVALID_RESPONSE_STATUS = 14343 , AWS_ERROR_S3_MISSING_UPLOAD_ID = 14344 , AWS_ERROR_S3_PROXY_PARSE_FAILED = 14345 , AWS_ERROR_S3_UNSUPPORTED_PROXY_SCHEME = 14346 , AWS_ERROR_S3_CANCELED = 14347 , AWS_ERROR_S3_INVALID_RANGE_HEADER = 14348 , AWS_ERROR_S3_MULTIRANGE_HEADER_UNSUPPORTED = 14349 , AWS_ERROR_S3_RESPONSE_CHECKSUM_MISMATCH = 14350 , AWS_ERROR_S3_CHECKSUM_CALCULATION_FAILED = 14351 , AWS_ERROR_S3_PAUSED = 14352 , AWS_ERROR_S3_LIST_PARTS_PARSE_FAILED = 14353 , AWS_ERROR_S3_RESUMED_PART_CHECKSUM_MISMATCH = 14354 , AWS_ERROR_S3_RESUME_FAILED = 14355 , AWS_ERROR_S3_OBJECT_MODIFIED = 14356 , AWS_ERROR_S3_NON_RECOVERABLE_ASYNC_ERROR = 14357 , AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE = 14358 , AWS_ERROR_S3_INCORRECT_CONTENT_LENGTH = 14359 , AWS_ERROR_S3_END_RANGE = 15359 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_subject { AWS_LS_S3_GENERAL = 14336 , AWS_LS_S3_CLIENT = 14337 , AWS_LS_S3_CLIENT_STATS = 14338 , AWS_LS_S3_REQUEST = 14339 , AWS_LS_S3_META_REQUEST = 14340 , AWS_LS_S3_ENDPOINT = 14341 , AWS_LS_S3_LAST = 15359 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_cpu_group_info { pub cpu_group : u16 , pub nic_name_array : * const aws_byte_cursor , pub nic_name_array_length : usize , } # [test] fn bindgen_test_layout_aws_s3_cpu_group_info () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_cpu_group_info > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_cpu_group_info > () , 24usize , concat ! ("Size of: " , stringify ! (aws_s3_cpu_group_info))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_cpu_group_info > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_cpu_group_info))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cpu_group) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_cpu_group_info) , "::" , stringify ! (cpu_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . nic_name_array) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_cpu_group_info) , "::" , stringify ! (nic_name_array))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . nic_name_array_length) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_cpu_group_info) , "::" , stringify ! (nic_name_array_length))) ; } impl Default for aws_s3_cpu_group_info { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_compute_platform_info { pub instance_type : aws_byte_cursor , pub max_throughput_gbps : u16 , pub cpu_group_info_array : * const aws_s3_cpu_group_info , pub cpu_group_info_array_length : usize , } # [test] fn bindgen_test_layout_aws_s3_compute_platform_info () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_compute_platform_info > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_compute_platform_info > () , 40usize , concat ! ("Size of: " , stringify ! (aws_s3_compute_platform_info))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_compute_platform_info > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_compute_platform_info))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . instance_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_compute_platform_info) , "::" , stringify ! (instance_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_throughput_gbps) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_compute_platform_info) , "::" , stringify ! (max_throughput_gbps))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cpu_group_info_array) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_compute_platform_info) , "::" , stringify ! (cpu_group_info_array))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cpu_group_info_array_length) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_compute_platform_info) , "::" , stringify ! (cpu_group_info_array_length))) ; } impl Default for aws_s3_compute_platform_info { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Initializes internal datastructures used by aws-c-s3.\n Must be called before using any functionality in aws-c-s3."] pub fn aws_s3_library_init (allocator : * mut aws_allocator) ; } extern "C" { # [doc = " Retrieves the pre-configured metadata for an ec2 instance type. If no such pre-configuration exists, returns NULL."] pub fn aws_s3_get_compute_platform_info_for_instance_type (instance_type_name : aws_byte_cursor) -> * mut aws_s3_compute_platform_info ; } extern "C" { # [doc = " Shuts down the internal datastructures used by aws-c-s3."] pub fn aws_s3_library_clean_up () ; } pub type aws_should_sign_header_fn = :: std :: option :: Option < unsafe extern "C" fn (name : * const aws_byte_cursor , userdata : * mut :: libc :: c_void) -> bool > ; # [repr (u32)] # [non_exhaustive] # [doc = " A primitive RTTI indicator for signing configuration structs\n\n There must be one entry per config structure type and it's a fatal error\n to put the wrong value in the \"config_type\" member of your config structure."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_signing_config_type { AWS_SIGNING_CONFIG_AWS = 1 , } # [doc = " All signing configuration structs must match this by having\n the config_type member as the first member."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_signing_config_base { pub config_type : aws_signing_config_type , } # [test] fn bindgen_test_layout_aws_signing_config_base () { const UNINIT : :: std :: mem :: MaybeUninit < aws_signing_config_base > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_signing_config_base > () , 4usize , concat ! ("Size of: " , stringify ! (aws_signing_config_base))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_signing_config_base > () , 4usize , concat ! ("Alignment of " , stringify ! (aws_signing_config_base))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_base) , "::" , stringify ! (config_type))) ; } impl Default for aws_signing_config_base { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [doc = " What version of the AWS signing process should we use."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_signing_algorithm { AWS_SIGNING_ALGORITHM_V4 = 0 , AWS_SIGNING_ALGORITHM_V4_ASYMMETRIC = 1 , } # [repr (u32)] # [non_exhaustive] # [doc = " What sort of signature should be computed from the signable?"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_signature_type { # [doc = " A signature for a full http request should be computed, with header updates applied to the signing result."] AWS_ST_HTTP_REQUEST_HEADERS = 0 , # [doc = " A signature for a full http request should be computed, with query param updates applied to the signing result."] AWS_ST_HTTP_REQUEST_QUERY_PARAMS = 1 , # [doc = " Compute a signature for a payload chunk. The signable's input stream should be the chunk data and the\n signable should contain the most recent signature value (either the original http request or the most recent\n chunk) in the \"previous-signature\" property."] AWS_ST_HTTP_REQUEST_CHUNK = 2 , # [doc = " Compute a signature for an event stream event. The signable's input stream should be the encoded event-stream\n message (headers + payload), the signable should contain the most recent signature value (either the original\n http request or the most recent event) in the \"previous-signature\" property.\n\n This option is only supported for Sigv4 for now."] AWS_ST_HTTP_REQUEST_EVENT = 3 , # [doc = " Compute a signature for an http request via it's already-computed canonical request. Only the authorization\n signature header is added to the signing result."] AWS_ST_CANONICAL_REQUEST_HEADERS = 4 , # [doc = " Compute a signature for an http request via it's already-computed canonical request. Only the authorization\n signature query param is added to the signing result."] AWS_ST_CANONICAL_REQUEST_QUERY_PARAMS = 5 , # [doc = " Compute a signature for the trailing headers.\n the signable should contain the most recent signature value (either the original http request or the most recent\n chunk) in the \"previous-signature\" property."] AWS_ST_HTTP_REQUEST_TRAILING_HEADERS = 6 , } extern "C" { # [doc = " The SHA-256 of an empty string:\n 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_empty_sha256 : aws_byte_cursor ; } extern "C" { # [doc = " 'UNSIGNED-PAYLOAD'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_unsigned_payload : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-UNSIGNED-PAYLOAD-TRAILER'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_streaming_unsigned_payload_trailer : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-AWS4-HMAC-SHA256-PAYLOAD'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_streaming_aws4_hmac_sha256_payload : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-AWS4-HMAC-SHA256-PAYLOAD-TRAILER'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_streaming_aws4_hmac_sha256_payload_trailer : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-AWS4-ECDSA-P256-SHA256-PAYLOAD'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_streaming_aws4_ecdsa_p256_sha256_payload : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-AWS4-ECDSA-P256-SHA256-PAYLOAD-TRAILER'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_streaming_aws4_ecdsa_p256_sha256_payload_trailer : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-AWS4-HMAC-SHA256-EVENTS'\n For use with `aws_signing_config_aws.signed_body_value`.\n\n Event signing is only supported for Sigv4 for now."] pub static g_aws_signed_body_value_streaming_aws4_hmac_sha256_events : aws_byte_cursor ; } # [repr (u32)] # [non_exhaustive] # [doc = " Controls if signing adds a header containing the canonical request's body value"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_signed_body_header_type { # [doc = " Do not add a header"] AWS_SBHT_NONE = 0 , # [doc = " Add the \"x-amz-content-sha256\" header with the canonical request's body value"] AWS_SBHT_X_AMZ_CONTENT_SHA256 = 1 , } # [doc = " A configuration structure for use in AWS-related signing. Currently covers sigv4 only, but is not required to."] # [repr (C)] pub struct aws_signing_config_aws { # [doc = " What kind of config structure is this?"] pub config_type : aws_signing_config_type , # [doc = " What signing algorithm to use."] pub algorithm : aws_signing_algorithm , # [doc = " What sort of signature should be computed?"] pub signature_type : aws_signature_type , pub region : aws_byte_cursor , # [doc = " name of service to sign a request for"] pub service : aws_byte_cursor , # [doc = " Raw date to use during the signing process."] pub date : aws_date_time , # [doc = " Optional function to control which headers are a part of the canonical request.\n Skipping auth-required headers will result in an unusable signature. Headers injected by the signing process\n are not skippable.\n\n This function does not override the internal check function (x-amzn-trace-id, user-agent), but rather\n supplements it. In particular, a header will get signed if and only if it returns true to both\n the internal check (skips x-amzn-trace-id, user-agent) and this function (if defined)."] pub should_sign_header : aws_should_sign_header_fn , pub should_sign_header_ud : * mut :: libc :: c_void , pub flags : aws_signing_config_aws__bindgen_ty_1 , # [doc = " Optional string to use as the canonical request's body value.\n If string is empty, a value will be calculated from the payload during signing.\n Typically, this is the SHA-256 of the (request/chunk/event) payload, written as lowercase hex.\n If this has been precalculated, it can be set here. Special values used by certain services can also be set\n (e.g. \"UNSIGNED-PAYLOAD\" \"STREAMING-AWS4-HMAC-SHA256-PAYLOAD\" \"STREAMING-AWS4-HMAC-SHA256-EVENTS\")."] pub signed_body_value : aws_byte_cursor , # [doc = " Controls what body \"hash\" header, if any, should be added to the canonical request and the signed request:\n AWS_SBHT_NONE - no header should be added\n AWS_SBHT_X_AMZ_CONTENT_SHA256 - the body \"hash\" should be added in the X-Amz-Content-Sha256 header"] pub signed_body_header : aws_signed_body_header_type , pub credentials : * const aws_credentials , pub credentials_provider : * mut aws_credentials_provider , # [doc = " If non-zero and the signing transform is query param, then signing will add X-Amz-Expires to the query\n string, equal to the value specified here. If this value is zero or if header signing is being used then\n this parameter has no effect."] pub expiration_in_seconds : u64 , } # [repr (C)] # [repr (align (4))] # [derive (Debug , Default , Copy , Clone)] pub struct aws_signing_config_aws__bindgen_ty_1 { pub _bitfield_align_1 : [u8 ; 0] , pub _bitfield_1 : __BindgenBitfieldUnit < [u8 ; 1usize] > , pub __bindgen_padding_0 : [u8 ; 3usize] , } # [test] fn bindgen_test_layout_aws_signing_config_aws__bindgen_ty_1 () { assert_eq ! (:: std :: mem :: size_of :: < aws_signing_config_aws__bindgen_ty_1 > () , 4usize , concat ! ("Size of: " , stringify ! (aws_signing_config_aws__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_signing_config_aws__bindgen_ty_1 > () , 4usize , concat ! ("Alignment of " , stringify ! (aws_signing_config_aws__bindgen_ty_1))) ; } impl aws_signing_config_aws__bindgen_ty_1 { # [inline] pub fn use_double_uri_encode (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (0usize , 1u8) as u32) } } # [inline] pub fn set_use_double_uri_encode (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (0usize , 1u8 , val as u64) } } # [inline] pub fn should_normalize_uri_path (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (1usize , 1u8) as u32) } } # [inline] pub fn set_should_normalize_uri_path (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (1usize , 1u8 , val as u64) } } # [inline] pub fn omit_session_token (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (2usize , 1u8) as u32) } } # [inline] pub fn set_omit_session_token (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (2usize , 1u8 , val as u64) } } # [inline] pub fn new_bitfield_1 (use_double_uri_encode : u32 , should_normalize_uri_path : u32 , omit_session_token : u32) -> __BindgenBitfieldUnit < [u8 ; 1usize] > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [u8 ; 1usize] > = Default :: default () ; __bindgen_bitfield_unit . set (0usize , 1u8 , { let use_double_uri_encode : u32 = unsafe { :: std :: mem :: transmute (use_double_uri_encode) } ; use_double_uri_encode as u64 }) ; __bindgen_bitfield_unit . set (1usize , 1u8 , { let should_normalize_uri_path : u32 = unsafe { :: std :: mem :: transmute (should_normalize_uri_path) } ; should_normalize_uri_path as u64 }) ; __bindgen_bitfield_unit . set (2usize , 1u8 , { let omit_session_token : u32 = unsafe { :: std :: mem :: transmute (omit_session_token) } ; omit_session_token as u64 }) ; __bindgen_bitfield_unit } } # [test] fn bindgen_test_layout_aws_signing_config_aws () { const UNINIT : :: std :: mem :: MaybeUninit < aws_signing_config_aws > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_signing_config_aws > () , 256usize , concat ! ("Size of: " , stringify ! (aws_signing_config_aws))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_signing_config_aws > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_signing_config_aws))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (config_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . algorithm) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (algorithm))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . signature_type) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (signature_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . region) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (region))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . service) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (service))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . date) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (date))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . should_sign_header) as usize - ptr as usize } , 184usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (should_sign_header))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . should_sign_header_ud) as usize - ptr as usize } , 192usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (should_sign_header_ud))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . flags) as usize - ptr as usize } , 200usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (flags))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . signed_body_value) as usize - ptr as usize } , 208usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (signed_body_value))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . signed_body_header) as usize - ptr as usize } , 224usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (signed_body_header))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . credentials) as usize - ptr as usize } , 232usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (credentials))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . credentials_provider) as usize - ptr as usize } , 240usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (credentials_provider))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . expiration_in_seconds) as usize - ptr as usize } , 248usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (expiration_in_seconds))) ; } impl Default for aws_signing_config_aws { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Returns a c-string that describes the supplied signing algorithm\n\n @param algorithm signing algorithm to get a friendly string name for\n\n @return friendly string name of the supplied algorithm, or \"Unknown\" if the algorithm is not recognized"] pub fn aws_signing_algorithm_to_string (algorithm : aws_signing_algorithm) -> * const :: libc :: c_char ; } extern "C" { # [doc = " Checks a signing configuration for invalid settings combinations.\n\n @param config signing configuration to validate\n\n @return - AWS_OP_SUCCESS if the configuration is valid, AWS_OP_ERR otherwise"] pub fn aws_validate_aws_signing_config_aws (config : * const aws_signing_config_aws) -> :: libc :: c_int ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_request { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_meta_request { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_request_metrics { _unused : [u8 ; 0] , } # [repr (u32)] # [non_exhaustive] # [doc = " A Meta Request represents a group of generated requests that are being done on behalf of the\n original request. For example, one large GetObject request can be transformed into a series\n of ranged GetObject requests that are executed in parallel to improve throughput.\n\n The aws_s3_meta_request_type is a hint of transformation to be applied."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_meta_request_type { # [doc = " The Default meta request type sends any request to S3 as-is (with no transformation). For example,\n it can be used to pass a CreateBucket request."] AWS_S3_META_REQUEST_TYPE_DEFAULT = 0 , # [doc = " The GetObject request will be split into a series of ranged GetObject requests that are\n executed in parallel to improve throughput, when possible."] AWS_S3_META_REQUEST_TYPE_GET_OBJECT = 1 , # [doc = " The PutObject request will be split into MultiPart uploads that are executed in parallel\n to improve throughput, when possible.\n Note: put object supports both known and unknown body length. The client\n relies on Content-Length header to determine length of the body.\n Request with unknown content length are always sent using multipart\n upload regardless of final number of parts and do have the following limitations:\n - multipart threshold is ignored and all request are made through mpu,\n even if they only need one part\n - pause/resume is not supported\n - meta request will throw error if checksum header is provider (due to\n general limitation of checksum not being usable if meta request is\n getting split)"] AWS_S3_META_REQUEST_TYPE_PUT_OBJECT = 2 , # [doc = " The CopyObject meta request performs a multi-part copy\n using multiple S3 UploadPartCopy requests in parallel, or bypasses\n a CopyObject request to S3 if the object size is not large enough for\n a multipart upload.\n Note: copy support is still in development and has following limitations:\n - host header must use virtual host addressing style (path style is not\n supported) and both source and dest buckets must have dns compliant name\n - only {bucket}/{key} format is supported for source and passing arn as\n source will not work\n - source bucket is assumed to be in the same region as dest"] AWS_S3_META_REQUEST_TYPE_COPY_OBJECT = 3 , # [doc = " The CopyObject meta request performs a multi-part copy\n using multiple S3 UploadPartCopy requests in parallel, or bypasses\n a CopyObject request to S3 if the object size is not large enough for\n a multipart upload.\n Note: copy support is still in development and has following limitations:\n - host header must use virtual host addressing style (path style is not\n supported) and both source and dest buckets must have dns compliant name\n - only {bucket}/{key} format is supported for source and passing arn as\n source will not work\n - source bucket is assumed to be in the same region as dest"] AWS_S3_META_REQUEST_TYPE_MAX = 4 , } # [repr (u32)] # [non_exhaustive] # [doc = " The type of S3 request made. Used by metrics."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_request_type { AWS_S3_REQUEST_TYPE_DEFAULT = 0 , AWS_S3_REQUEST_TYPE_HEAD_OBJECT = 1 , AWS_S3_REQUEST_TYPE_GET_OBJECT = 2 , AWS_S3_REQUEST_TYPE_LIST_PARTS = 3 , AWS_S3_REQUEST_TYPE_CREATE_MULTIPART_UPLOAD = 4 , AWS_S3_REQUEST_TYPE_UPLOAD_PART = 5 , AWS_S3_REQUEST_TYPE_ABORT_MULTIPART_UPLOAD = 6 , AWS_S3_REQUEST_TYPE_COMPLETE_MULTIPART_UPLOAD = 7 , AWS_S3_REQUEST_TYPE_UPLOAD_PART_COPY = 8 , AWS_S3_REQUEST_TYPE_MAX = 9 , } # [doc = " Invoked to provide response headers received during execution of the meta request, both for\n success and error HTTP status codes.\n\n Return AWS_OP_SUCCESS to continue processing the request.\n\n Return aws_raise_error(E) to cancel the request.\n The error you raise will be reflected in `aws_s3_meta_request_result.error_code`.\n If you're not sure which error to raise, use AWS_ERROR_S3_CANCELED."] pub type aws_s3_meta_request_headers_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , headers : * const aws_http_headers , response_status : :: libc :: c_int , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Invoked to provide the response body as it is received.\n\n Note: If you set `enable_read_backpressure` true on the S3 client,\n you must maintain the flow-control window.\n The flow-control window shrinks as you receive body data via this callback.\n Whenever the flow-control window reaches 0 you will stop downloading data.\n Use aws_s3_meta_request_increment_read_window() to increment the window and keep data flowing.\n Maintain a larger window to keep up a high download throughput,\n parts cannot download in parallel unless the window is large enough to hold multiple parts.\n Maintain a smaller window to limit the amount of data buffered in memory.\n\n If `manual_window_management` is false, you do not need to maintain the flow-control window.\n No back-pressure is applied and data arrives as fast as possible.\n\n Return AWS_OP_SUCCESS to continue processing the request.\n\n Return aws_raise_error(E) to cancel the request.\n The error you raise will be reflected in `aws_s3_meta_request_result.error_code`.\n If you're not sure which error to raise, use AWS_ERROR_S3_CANCELED."] pub type aws_s3_meta_request_receive_body_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , body : * const aws_byte_cursor , range_start : u64 , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Invoked when the entire meta request execution is complete."] pub type aws_s3_meta_request_finish_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , meta_request_result : * const aws_s3_meta_request_result , user_data : * mut :: libc :: c_void) > ; # [doc = " Information sent in the meta_request progress callback."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_s3_meta_request_progress { pub bytes_transferred : u64 , pub content_length : u64 , } # [test] fn bindgen_test_layout_aws_s3_meta_request_progress () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_meta_request_progress > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_meta_request_progress > () , 16usize , concat ! ("Size of: " , stringify ! (aws_s3_meta_request_progress))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_meta_request_progress > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_meta_request_progress))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bytes_transferred) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_progress) , "::" , stringify ! (bytes_transferred))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . content_length) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_progress) , "::" , stringify ! (content_length))) ; } # [doc = " Invoked to report progress of a meta-request.\n For PutObject, progress refers to bytes uploaded.\n For CopyObject, progress refers to bytes copied.\n For GetObject, progress refers to bytes downloaded.\n For anything else, progress refers to response body bytes received."] pub type aws_s3_meta_request_progress_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , progress : * const aws_s3_meta_request_progress , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked to report the telemetry of the meta request once a single request finishes. Invoked from the thread of the\n connection that request made from.\n Note: *metrics is only valid for the duration of the callback. If you need to keep it around, use\n `aws_s3_request_metrics_acquire`"] pub type aws_s3_meta_request_telemetry_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , metrics : * mut aws_s3_request_metrics , user_data : * mut :: libc :: c_void) > ; pub type aws_s3_meta_request_shutdown_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; pub type aws_s3_client_shutdown_complete_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_meta_request_tls_mode { AWS_MR_TLS_ENABLED = 0 , AWS_MR_TLS_DISABLED = 1 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_meta_request_compute_content_md5 { AWS_MR_CONTENT_MD5_DISABLED = 0 , AWS_MR_CONTENT_MD5_ENABLED = 1 , } impl aws_s3_checksum_algorithm { pub const AWS_SCA_CRC32C : aws_s3_checksum_algorithm = aws_s3_checksum_algorithm :: AWS_SCA_INIT ; } impl aws_s3_checksum_algorithm { pub const AWS_SCA_END : aws_s3_checksum_algorithm = aws_s3_checksum_algorithm :: AWS_SCA_SHA256 ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_checksum_algorithm { AWS_SCA_NONE = 0 , AWS_SCA_INIT = 1 , AWS_SCA_CRC32 = 2 , AWS_SCA_SHA1 = 3 , AWS_SCA_SHA256 = 4 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_checksum_location { AWS_SCL_NONE = 0 , AWS_SCL_HEADER = 1 , AWS_SCL_TRAILER = 2 , } # [doc = " Info about a single part, for you to review before the upload completes."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_upload_part_review { pub size : u64 , pub checksum : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_s3_upload_part_review () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_upload_part_review > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_upload_part_review > () , 24usize , concat ! ("Size of: " , stringify ! (aws_s3_upload_part_review))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_upload_part_review > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_upload_part_review))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_part_review) , "::" , stringify ! (size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . checksum) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_part_review) , "::" , stringify ! (checksum))) ; } impl Default for aws_s3_upload_part_review { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Info for you to review before an upload completes.\n\n WARNING: This feature is experimental/unstable.\n At this time, review is only available for multipart upload\n (when Content-Length is above the `multipart_upload_threshold`,\n or Content-Length not specified)."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_upload_review { pub checksum_algorithm : aws_s3_checksum_algorithm , pub part_count : usize , pub part_array : * mut aws_s3_upload_part_review , } # [test] fn bindgen_test_layout_aws_s3_upload_review () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_upload_review > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_upload_review > () , 24usize , concat ! ("Size of: " , stringify ! (aws_s3_upload_review))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_upload_review > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_upload_review))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . checksum_algorithm) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_review) , "::" , stringify ! (checksum_algorithm))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_count) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_review) , "::" , stringify ! (part_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_array) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_review) , "::" , stringify ! (part_array))) ; } impl Default for aws_s3_upload_review { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Optional callback, for you to review an upload before it completes.\n For example, you can review each part's checksum and fail the upload if\n you do not agree with them.\n\n @param meta_request pointer to the aws_s3_meta_request of the upload.\n @param info Detailed info about the upload.\n\n Return AWS_OP_SUCCESS to continue processing the request.\n\n Return aws_raise_error(E) to cancel the request.\n The error you raise will be reflected in `aws_s3_meta_request_result.error_code`.\n If you're not sure which error to raise, use AWS_ERROR_S3_CANCELED.\n\n WARNING: This feature is experimental/unstable.\n At this time, the callback is only invoked for multipart upload\n (when Content-Length is above the `multipart_upload_threshold`,\n or Content-Length not specified)."] pub type aws_s3_meta_request_upload_review_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , review : * const aws_s3_upload_review , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_s3_tcp_keep_alive_options { pub keep_alive_interval_sec : u16 , pub keep_alive_timeout_sec : u16 , pub keep_alive_max_failed_probes : u16 , } # [test] fn bindgen_test_layout_aws_s3_tcp_keep_alive_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_tcp_keep_alive_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_tcp_keep_alive_options > () , 6usize , concat ! ("Size of: " , stringify ! (aws_s3_tcp_keep_alive_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_tcp_keep_alive_options > () , 2usize , concat ! ("Alignment of " , stringify ! (aws_s3_tcp_keep_alive_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . keep_alive_interval_sec) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_tcp_keep_alive_options) , "::" , stringify ! (keep_alive_interval_sec))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . keep_alive_timeout_sec) as usize - ptr as usize } , 2usize , concat ! ("Offset of field: " , stringify ! (aws_s3_tcp_keep_alive_options) , "::" , stringify ! (keep_alive_timeout_sec))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . keep_alive_max_failed_probes) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (aws_s3_tcp_keep_alive_options) , "::" , stringify ! (keep_alive_max_failed_probes))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_client_config { pub max_active_connections_override : u32 , pub region : aws_byte_cursor , pub client_bootstrap : * mut aws_client_bootstrap , pub tls_mode : aws_s3_meta_request_tls_mode , pub tls_connection_options : * mut aws_tls_connection_options , pub signing_config : * mut aws_signing_config_aws , pub part_size : u64 , pub max_part_size : u64 , pub multipart_upload_threshold : u64 , pub throughput_target_gbps : f64 , pub retry_strategy : * mut aws_retry_strategy , # [doc = " TODO: move MD5 config to checksum config.\n For multi-part upload, content-md5 will be calculated if the AWS_MR_CONTENT_MD5_ENABLED is specified\n or initial request has content-md5 header.\n For single-part upload, keep the content-md5 in the initial request unchanged."] pub compute_content_md5 : aws_s3_meta_request_compute_content_md5 , pub shutdown_callback : aws_s3_client_shutdown_complete_callback_fn , pub shutdown_callback_user_data : * mut :: libc :: c_void , # [doc = " Optional.\n Proxy configuration for http connection.\n If the connection_type is AWS_HPCT_HTTP_LEGACY, it will be converted to AWS_HPCT_HTTP_TUNNEL if tls_mode is\n ENABLED. Otherwise, it will be converted to AWS_HPCT_HTTP_FORWARD."] pub proxy_options : * mut aws_http_proxy_options , # [doc = " Optional.\n Configuration for fetching proxy configuration from environment.\n By Default proxy_ev_settings.aws_http_proxy_env_var_type is set to AWS_HPEV_ENABLE which means read proxy\n configuration from environment.\n Only works when proxy_options is not set. If both are set, configuration from proxy_options is used."] pub proxy_ev_settings : * mut proxy_env_var_settings , # [doc = " Optional.\n If set to 0, default value is used."] pub connect_timeout_ms : u32 , # [doc = " Optional.\n Set keepalive to periodically transmit messages for detecting a disconnected peer."] pub tcp_keep_alive_options : * mut aws_s3_tcp_keep_alive_options , # [doc = " Optional.\n Configuration options for connection monitoring.\n If the transfer speed falls below the specified minimum_throughput_bytes_per_second, the operation is aborted.\n If set to NULL, default values are used."] pub monitoring_options : * mut aws_http_connection_monitoring_options , # [doc = " Enable backpressure and prevent response data from downloading faster than you can handle it.\n\n If false (default), no backpressure is applied and data will download as fast as possible.\n\n If true, each meta request has a flow-control window that shrinks as\n response body data is downloaded (headers do not affect the window).\n `initial_read_window` determines the starting size of each meta request's window.\n You will stop downloading data whenever the flow-control window reaches 0\n You must call aws_s3_meta_request_increment_read_window() to keep data flowing.\n\n WARNING: This feature is experimental.\n Currently, backpressure is only applied to GetObject requests which are split into multiple parts,\n and you may still receive some data after the window reaches 0."] pub enable_read_backpressure : bool , # [doc = " The starting size of each meta request's flow-control window, in bytes.\n Ignored unless `enable_read_backpressure` is true."] pub initial_read_window : usize , } # [test] fn bindgen_test_layout_aws_s3_client_config () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client_config > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client_config > () , 176usize , concat ! ("Size of: " , stringify ! (aws_s3_client_config))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client_config > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_active_connections_override) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (max_active_connections_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . region) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (region))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client_bootstrap) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (client_bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_mode) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (tls_mode))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_connection_options) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (tls_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . signing_config) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (signing_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_size) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_part_size) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (max_part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . multipart_upload_threshold) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (multipart_upload_threshold))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . throughput_target_gbps) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (throughput_target_gbps))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . retry_strategy) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (retry_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . compute_content_md5) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (compute_content_md5))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback_user_data) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (shutdown_callback_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_options) as usize - ptr as usize } , 120usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_settings) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (proxy_ev_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connect_timeout_ms) as usize - ptr as usize } , 136usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (connect_timeout_ms))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tcp_keep_alive_options) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (tcp_keep_alive_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . monitoring_options) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (monitoring_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_backpressure) as usize - ptr as usize } , 160usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (enable_read_backpressure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_read_window) as usize - ptr as usize } , 168usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (initial_read_window))) ; } impl Default for aws_s3_client_config { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_checksum_config { # [doc = " The location of client added checksum header.\n\n If AWS_SCL_NONE. No request payload checksum will be add and calculated.\n\n If AWS_SCL_HEADER, the checksum will be calculated by client and added related header to the request sent.\n\n If AWS_SCL_TRAILER, the payload will be aws_chunked encoded, The checksum will be calculate while reading the\n payload by client. Related header will be added to the trailer part of the encoded payload. Note the payload of\n the original request cannot be aws-chunked encoded already. Otherwise, error will be raised."] pub location : aws_s3_checksum_location , # [doc = " The checksum algorithm used.\n Must be set if location is not AWS_SCL_NONE. Must be AWS_SCA_NONE if location is AWS_SCL_NONE."] pub checksum_algorithm : aws_s3_checksum_algorithm , # [doc = " Enable checksum mode header will be attached to GET requests, this will tell s3 to send back checksums headers if\n they exist. Calculate the corresponding checksum on the response bodies. The meta request will finish with a did\n validate field and set the error code to AWS_ERROR_S3_RESPONSE_CHECKSUM_MISMATCH if the calculated\n checksum, and checksum found in the response header do not match."] pub validate_response_checksum : bool , # [doc = " Optional array of `enum aws_s3_checksum_algorithm`.\n\n Ignored when validate_response_checksum is not set.\n If not set all the algorithms will be selected as default behavior.\n Owned by the caller.\n\n The list of algorithms for user to pick up when validate the checksum. Client will pick up the algorithm from the\n list with the priority based on performance, and the algorithm sent by server. The priority based on performance\n is [CRC32C, CRC32, SHA1, SHA256].\n\n If the response checksum was validated by client, the result will indicate which algorithm was picked."] pub validate_checksum_algorithms : * mut aws_array_list , } # [test] fn bindgen_test_layout_aws_s3_checksum_config () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_checksum_config > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_checksum_config > () , 24usize , concat ! ("Size of: " , stringify ! (aws_s3_checksum_config))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_checksum_config > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_checksum_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . location) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_checksum_config) , "::" , stringify ! (location))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . checksum_algorithm) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (aws_s3_checksum_config) , "::" , stringify ! (checksum_algorithm))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . validate_response_checksum) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_checksum_config) , "::" , stringify ! (validate_response_checksum))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . validate_checksum_algorithms) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_checksum_config) , "::" , stringify ! (validate_checksum_algorithms))) ; } impl Default for aws_s3_checksum_config { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Options for a new meta request, ie, file transfer that will be handled by the high performance client.\n\n There are several ways to pass the request's body data:\n 1) If the data is already in memory, set the body-stream on `message`.\n 2) If the data is on disk, set `send_filepath` for best performance.\n 3) If the data will be be produced in asynchronous chunks, set `send_async_stream`."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_meta_request_options { pub type_ : aws_s3_meta_request_type , pub signing_config : * const aws_signing_config_aws , pub message : * mut aws_http_message , # [doc = " Optional.\n If set, this file is sent as the request body.\n This gives the best performance when sending data from a file.\n Do not set if the body is being passed by other means (see note above)."] pub send_filepath : aws_byte_cursor , # [doc = " Optional - EXPERIMENTAL/UNSTABLE\n If set, the request body comes from this async stream.\n Use this when outgoing data will be produced in asynchronous chunks.\n Do not set if the body is being passed by other means (see note above)."] pub send_async_stream : * mut aws_async_input_stream , # [doc = " Optional.\n if set, the flexible checksum will be performed by client based on the config."] pub checksum_config : * const aws_s3_checksum_config , pub user_data : * mut :: libc :: c_void , # [doc = " Optional.\n Invoked to provide response headers received during execution of the meta request.\n Note: this callback will not be fired for cases when resuming an\n operation that was already completed (ex. pausing put object after it\n uploaded all data and then resuming it)\n See `aws_s3_meta_request_headers_callback_fn`."] pub headers_callback : aws_s3_meta_request_headers_callback_fn , # [doc = " Invoked to provide the response body as it is received.\n See `aws_s3_meta_request_receive_body_callback_fn`."] pub body_callback : aws_s3_meta_request_receive_body_callback_fn , # [doc = " Invoked when the entire meta request execution is complete.\n See `aws_s3_meta_request_finish_fn`."] pub finish_callback : aws_s3_meta_request_finish_fn , pub shutdown_callback : aws_s3_meta_request_shutdown_fn , # [doc = " Invoked to report progress of the meta request execution.\n See `aws_s3_meta_request_progress_fn`."] pub progress_callback : aws_s3_meta_request_progress_fn , # [doc = " Optional.\n To get telemetry metrics when a single request finishes.\n If set the request will keep track of the metrics from `aws_s3_request_metrics`, and fire the callback when the\n request finishes receiving response.\n See `aws_s3_meta_request_telemetry_fn`\n\n Notes:\n - The callback will be invoked multiple times from different threads."] pub telemetry_callback : aws_s3_meta_request_telemetry_fn , # [doc = " Optional.\n Callback for reviewing an upload before it completes.\n WARNING: experimental/unstable\n See `aws_s3_upload_review_fn`"] pub upload_review_callback : aws_s3_meta_request_upload_review_fn , # [doc = " Optional.\n Endpoint override for request. Can be used to override scheme and port of\n the endpoint.\n There is some overlap between Host header and Endpoint and corner cases\n are handled as follows:\n - Only Host header is set - Host is used to construct endpoint. https is\n default with corresponding port\n - Only endpoint is set - Host header is created from endpoint. Port and\n Scheme from endpoint is used.\n - Both Host and Endpoint is set - Host header must match Authority of\n Endpoint uri. Port and Scheme from endpoint is used."] pub endpoint : * mut aws_uri , # [doc = " Optional.\n For meta requests that support pause/resume (e.g. PutObject), serialized resume token returned by\n aws_s3_meta_request_pause() can be provided here.\n Note: If PutObject request specifies a checksum algorithm, client will calculate checksums while skipping parts\n from the buffer and compare them them to previously uploaded part checksums."] pub resume_token : * mut aws_s3_meta_request_resume_token , } # [test] fn bindgen_test_layout_aws_s3_meta_request_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_meta_request_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_meta_request_options > () , 136usize , concat ! ("Size of: " , stringify ! (aws_s3_meta_request_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_meta_request_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_meta_request_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . type_) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (type_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . signing_config) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (signing_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . message) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (message))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . send_filepath) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (send_filepath))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . send_async_stream) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (send_async_stream))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . checksum_config) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (checksum_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . headers_callback) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (headers_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . body_callback) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (body_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . finish_callback) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (finish_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . progress_callback) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (progress_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . telemetry_callback) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (telemetry_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . upload_review_callback) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (upload_review_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoint) as usize - ptr as usize } , 120usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (endpoint))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . resume_token) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (resume_token))) ; } impl Default for aws_s3_meta_request_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_meta_request_result { pub error_response_headers : * mut aws_http_headers , pub error_response_body : * mut aws_byte_buf , pub response_status : :: libc :: c_int , pub did_validate : bool , pub validation_algorithm : aws_s3_checksum_algorithm , pub error_code : :: libc :: c_int , } # [test] fn bindgen_test_layout_aws_s3_meta_request_result () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_meta_request_result > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_meta_request_result > () , 32usize , concat ! ("Size of: " , stringify ! (aws_s3_meta_request_result))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_meta_request_result > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_meta_request_result))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_response_headers) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (error_response_headers))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_response_body) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (error_response_body))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . response_status) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (response_status))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . did_validate) as usize - ptr as usize } , 20usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (did_validate))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . validation_algorithm) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (validation_algorithm))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_code) as usize - ptr as usize } , 28usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (error_code))) ; } impl Default for aws_s3_meta_request_result { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_s3_client_new (allocator : * mut aws_allocator , client_config : * const aws_s3_client_config) -> * mut aws_s3_client ; } extern "C" { # [doc = " Add a reference, keeping this object alive.\n The reference must be released when you are done with it, or it's memory will never be cleaned up.\n You must not pass in NULL.\n Always returns the same pointer that was passed in."] pub fn aws_s3_client_acquire (client : * mut aws_s3_client) -> * mut aws_s3_client ; } extern "C" { # [doc = " Release a reference.\n When the reference count drops to 0, this object will be cleaned up.\n It's OK to pass in NULL (nothing happens).\n Always returns NULL."] pub fn aws_s3_client_release (client : * mut aws_s3_client) -> * mut aws_s3_client ; } extern "C" { pub fn aws_s3_client_make_meta_request (client : * mut aws_s3_client , options : * const aws_s3_meta_request_options) -> * mut aws_s3_meta_request ; } extern "C" { # [doc = " Increment the flow-control window, so that response data continues downloading.\n\n If the client was created with `enable_read_backpressure` set true,\n each meta request has a flow-control window that shrinks as response\n body data is downloaded (headers do not affect the size of the window).\n The client's `initial_read_window` determines the starting size of each meta request's window.\n If a meta request's flow-control window reaches 0, no further data will be downloaded.\n If the `initial_read_window` is 0, the request will not start until the window is incremented.\n Maintain a larger window to keep up a high download throughput,\n parts cannot download in parallel unless the window is large enough to hold multiple parts.\n Maintain a smaller window to limit the amount of data buffered in memory.\n\n If `enable_read_backpressure` is false this call will have no effect,\n no backpressure is being applied and data is being downloaded as fast as possible.\n\n WARNING: This feature is experimental.\n Currently, backpressure is only applied to GetObject requests which are split into multiple parts,\n and you may still receive some data after the window reaches 0."] pub fn aws_s3_meta_request_increment_read_window (meta_request : * mut aws_s3_meta_request , bytes : u64) ; } extern "C" { pub fn aws_s3_meta_request_cancel (meta_request : * mut aws_s3_meta_request) ; } extern "C" { # [doc = " Note: pause is currently only supported on upload requests.\n In order to pause an ongoing upload, call aws_s3_meta_request_pause() that\n will return resume token. Token can be used to query the state of operation\n at the pausing time.\n To resume an upload that was paused, supply resume token in the meta\n request options structure member aws_s3_meta_request_options.resume_token.\n The upload can be resumed either from the same client or a different one.\n Corner cases for resume upload are as follows:\n - upload is not MPU - fail with AWS_ERROR_UNSUPPORTED_OPERATION\n - pausing before MPU is created - NULL resume token returned. NULL resume\n token is equivalent to restarting upload\n - pausing in the middle of part transfer - return resume token. scheduling of\n new part uploads stops.\n - pausing after completeMPU started - return resume token. if s3 cannot find\n find associated MPU id when resuming with that token and num of parts\n uploaded equals to total num parts, then operation is a no op. Otherwise\n operation fails.\n Note: for no op case the call will succeed and finish/shutdown request callbacks will\n fire, but on headers callback will not fire.\n Note: similar to cancel pause does not cancel requests already in flight and\n and parts might complete after pause is requested.\n @param meta_request pointer to the aws_s3_meta_request of the upload to be paused\n @param resume_token resume token\n @return either AWS_OP_ERR or AWS_OP_SUCCESS"] pub fn aws_s3_meta_request_pause (meta_request : * mut aws_s3_meta_request , out_resume_token : * mut * mut aws_s3_meta_request_resume_token) -> :: libc :: c_int ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_upload_resume_token_options { pub upload_id : aws_byte_cursor , pub part_size : u64 , pub total_num_parts : usize , # [doc = " Optional.\n\n Note: during resume num_parts_uploaded is used for sanity checking against\n uploads on s3 side.\n In cases where upload id does not exist (already resumed using this token\n or pause called after upload completes, etc...) and num_parts_uploaded\n equals to total num parts, resume will become a noop."] pub num_parts_completed : usize , } # [test] fn bindgen_test_layout_aws_s3_upload_resume_token_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_upload_resume_token_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_upload_resume_token_options > () , 40usize , concat ! ("Size of: " , stringify ! (aws_s3_upload_resume_token_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_upload_resume_token_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_upload_resume_token_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . upload_id) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_resume_token_options) , "::" , stringify ! (upload_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_size) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_resume_token_options) , "::" , stringify ! (part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . total_num_parts) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_resume_token_options) , "::" , stringify ! (total_num_parts))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_parts_completed) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_resume_token_options) , "::" , stringify ! (num_parts_completed))) ; } impl Default for aws_s3_upload_resume_token_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Create upload resume token from persisted data.\n Note: Data required for resume token varies per operation."] pub fn aws_s3_meta_request_resume_token_new_upload (allocator : * mut aws_allocator , options : * const aws_s3_upload_resume_token_options) -> * mut aws_s3_meta_request_resume_token ; } extern "C" { pub fn aws_s3_meta_request_resume_token_acquire (resume_token : * mut aws_s3_meta_request_resume_token) -> * mut aws_s3_meta_request_resume_token ; } extern "C" { pub fn aws_s3_meta_request_resume_token_release (resume_token : * mut aws_s3_meta_request_resume_token) -> * mut aws_s3_meta_request_resume_token ; } extern "C" { pub fn aws_s3_meta_request_resume_token_type (resume_token : * mut aws_s3_meta_request_resume_token) -> aws_s3_meta_request_type ; } extern "C" { pub fn aws_s3_meta_request_resume_token_part_size (resume_token : * mut aws_s3_meta_request_resume_token) -> u64 ; } extern "C" { pub fn aws_s3_meta_request_resume_token_total_num_parts (resume_token : * mut aws_s3_meta_request_resume_token) -> usize ; } extern "C" { pub fn aws_s3_meta_request_resume_token_num_parts_completed (resume_token : * mut aws_s3_meta_request_resume_token) -> usize ; } extern "C" { pub fn aws_s3_meta_request_resume_token_upload_id (resume_token : * mut aws_s3_meta_request_resume_token) -> aws_byte_cursor ; } extern "C" { # [doc = " Add a reference, keeping this object alive.\n The reference must be released when you are done with it, or it's memory will never be cleaned up.\n You must not pass in NULL.\n Always returns the same pointer that was passed in."] pub fn aws_s3_meta_request_acquire (meta_request : * mut aws_s3_meta_request) -> * mut aws_s3_meta_request ; } extern "C" { # [doc = " Release a reference.\n When the reference count drops to 0, this object will be cleaned up.\n It's OK to pass in NULL (nothing happens).\n Always returns NULL."] pub fn aws_s3_meta_request_release (meta_request : * mut aws_s3_meta_request) -> * mut aws_s3_meta_request ; } extern "C" { # [doc = " Initialize the configuration for a default S3 signing."] pub fn aws_s3_init_default_signing_config (signing_config : * mut aws_signing_config_aws , region : aws_byte_cursor , credentials_provider : * mut aws_credentials_provider) ; } extern "C" { # [doc = " Add a reference, keeping this object alive.\n The reference must be released when you are done with it, or it's memory will never be cleaned up.\n Always returns the same pointer that was passed in."] pub fn aws_s3_request_metrics_acquire (metrics : * mut aws_s3_request_metrics) -> * mut aws_s3_request_metrics ; } extern "C" { # [doc = " Release a reference.\n When the reference count drops to 0, this object will be cleaned up.\n It's OK to pass in NULL (nothing happens).\n Always returns NULL."] pub fn aws_s3_request_metrics_release (metrics : * mut aws_s3_request_metrics) -> * mut aws_s3_request_metrics ; } extern "C" { # [doc = " Getters for s3 request metrics ************************************************/\n/**\n Get the request ID from aws_s3_request_metrics.\n If unavailable, AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE will be raised.\n If available, out_request_id will be set to a string. Be warned this string's lifetime is tied to the metrics\n object."] pub fn aws_s3_request_metrics_get_request_id (metrics : * const aws_s3_request_metrics , out_request_id : * mut * const aws_string) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_start_timestamp_ns (metrics : * const aws_s3_request_metrics , out_start_time : * mut u64) ; } extern "C" { pub fn aws_s3_request_metrics_get_end_timestamp_ns (metrics : * const aws_s3_request_metrics , out_end_time : * mut u64) ; } extern "C" { pub fn aws_s3_request_metrics_get_total_duration_ns (metrics : * const aws_s3_request_metrics , out_total_duration : * mut u64) ; } extern "C" { pub fn aws_s3_request_metrics_get_send_start_timestamp_ns (metrics : * const aws_s3_request_metrics , out_send_start_time : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_send_end_timestamp_ns (metrics : * const aws_s3_request_metrics , out_send_end_time : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_sending_duration_ns (metrics : * const aws_s3_request_metrics , out_sending_duration : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_receive_start_timestamp_ns (metrics : * const aws_s3_request_metrics , out_receive_start_time : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_receive_end_timestamp_ns (metrics : * const aws_s3_request_metrics , out_receive_end_time : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_receiving_duration_ns (metrics : * const aws_s3_request_metrics , out_receiving_duration : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_response_status_code (metrics : * const aws_s3_request_metrics , out_response_status : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_response_headers (metrics : * const aws_s3_request_metrics , out_response_headers : * mut * mut aws_http_headers) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the path and query of the request.\n If unavailable, AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE will be raised.\n If available, out_request_path_query will be set to a string. Be warned this string's lifetime is tied to the metrics\n object."] pub fn aws_s3_request_metrics_get_request_path_query (metrics : * const aws_s3_request_metrics , out_request_path_query : * mut * const aws_string) ; } extern "C" { # [doc = " Get the host_address of the request.\n If unavailable, AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE will be raised.\n If available, out_host_address will be set to a string. Be warned this string's lifetime is tied to the metrics\n object."] pub fn aws_s3_request_metrics_get_host_address (metrics : * const aws_s3_request_metrics , out_host_address : * mut * const aws_string) ; } extern "C" { # [doc = " Get the IP address of the request connected to.\n If unavailable, AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE will be raised.\n If available, out_ip_address will be set to a string. Be warned this string's lifetime is tied to the metrics object."] pub fn aws_s3_request_metrics_get_ip_address (metrics : * const aws_s3_request_metrics , out_ip_address : * mut * const aws_string) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_connection_id (metrics : * const aws_s3_request_metrics , out_connection_id : * mut usize) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_thread_id (metrics : * const aws_s3_request_metrics , out_thread_id : * mut aws_thread_id_t) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_request_stream_id (metrics : * const aws_s3_request_metrics , out_stream_id : * mut u32) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_request_type (metrics : * const aws_s3_request_metrics , out_request_type : * mut aws_s3_request_type) ; } extern "C" { pub fn aws_s3_request_metrics_get_error_code (metrics : * const aws_s3_request_metrics) -> :: libc :: c_int ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_endpoints_request_context { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_endpoints_rule_engine { _unused : [u8 ; 0] , } extern "C" { # [doc = " Creates a new S3 endpoint resolver.\n Warning: Before using this header, you have to enable it by\n setting cmake config AWS_ENABLE_S3_ENDPOINT_RESOLVER=ON"] pub fn aws_s3_endpoint_resolver_new (allocator : * mut aws_allocator) -> * mut aws_endpoints_rule_engine ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_endpoints_ruleset { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_partitions_config { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_endpoints_parameter { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_endpoints_resolved_endpoint { _unused : [u8 ; 0] , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_endpoints_parameter_type { AWS_ENDPOINTS_PARAMETER_STRING = 0 , AWS_ENDPOINTS_PARAMETER_BOOLEAN = 1 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_endpoints_resolved_endpoint_type { AWS_ENDPOINTS_RESOLVED_ENDPOINT = 0 , AWS_ENDPOINTS_RESOLVED_ERROR = 1 , } extern "C" { pub fn aws_endpoints_get_supported_ruleset_version () -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_parameter_get_type (parameter : * const aws_endpoints_parameter) -> aws_endpoints_parameter_type ; } extern "C" { pub fn aws_endpoints_parameter_get_built_in (parameter : * const aws_endpoints_parameter) -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_parameter_get_default_string (parameter : * const aws_endpoints_parameter , out_cursor : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_parameter_get_default_boolean (parameter : * const aws_endpoints_parameter , out_bool : * mut * const bool) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_parameter_get_is_required (parameter : * const aws_endpoints_parameter) -> bool ; } extern "C" { pub fn aws_endpoints_parameter_get_documentation (parameter : * const aws_endpoints_parameter) -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_parameters_get_is_deprecated (parameter : * const aws_endpoints_parameter) -> bool ; } extern "C" { pub fn aws_endpoints_parameter_get_deprecated_message (parameter : * const aws_endpoints_parameter) -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_parameter_get_deprecated_since (parameter : * const aws_endpoints_parameter) -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_ruleset_new_from_string (allocator : * mut aws_allocator , ruleset_json : aws_byte_cursor) -> * mut aws_endpoints_ruleset ; } extern "C" { pub fn aws_endpoints_ruleset_acquire (ruleset : * mut aws_endpoints_ruleset) -> * mut aws_endpoints_ruleset ; } extern "C" { pub fn aws_endpoints_ruleset_release (ruleset : * mut aws_endpoints_ruleset) -> * mut aws_endpoints_ruleset ; } extern "C" { pub fn aws_endpoints_ruleset_get_parameters (ruleset : * mut aws_endpoints_ruleset) -> * const aws_hash_table ; } extern "C" { pub fn aws_endpoints_ruleset_get_version (ruleset : * const aws_endpoints_ruleset) -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_ruleset_get_service_id (ruleset : * const aws_endpoints_ruleset) -> aws_byte_cursor ; } extern "C" { # [doc = " Create new rule engine for a given ruleset.\n In cases of failure NULL is returned and last error is set."] pub fn aws_endpoints_rule_engine_new (allocator : * mut aws_allocator , ruleset : * mut aws_endpoints_ruleset , partitions_config : * mut aws_partitions_config) -> * mut aws_endpoints_rule_engine ; } extern "C" { pub fn aws_endpoints_rule_engine_acquire (rule_engine : * mut aws_endpoints_rule_engine) -> * mut aws_endpoints_rule_engine ; } extern "C" { pub fn aws_endpoints_rule_engine_release (rule_engine : * mut aws_endpoints_rule_engine) -> * mut aws_endpoints_rule_engine ; } extern "C" { pub fn aws_endpoints_request_context_new (allocator : * mut aws_allocator) -> * mut aws_endpoints_request_context ; } extern "C" { pub fn aws_endpoints_request_context_acquire (request_context : * mut aws_endpoints_request_context) -> * mut aws_endpoints_request_context ; } extern "C" { pub fn aws_endpoints_request_context_release (request_context : * mut aws_endpoints_request_context) -> * mut aws_endpoints_request_context ; } extern "C" { pub fn aws_endpoints_request_context_add_string (allocator : * mut aws_allocator , context : * mut aws_endpoints_request_context , name : aws_byte_cursor , value : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_request_context_add_boolean (allocator : * mut aws_allocator , context : * mut aws_endpoints_request_context , name : aws_byte_cursor , value : bool) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_rule_engine_resolve (engine : * mut aws_endpoints_rule_engine , context : * const aws_endpoints_request_context , out_resolved_endpoint : * mut * mut aws_endpoints_resolved_endpoint) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_acquire (resolved_endpoint : * mut aws_endpoints_resolved_endpoint) -> * mut aws_endpoints_resolved_endpoint ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_release (resolved_endpoint : * mut aws_endpoints_resolved_endpoint) -> * mut aws_endpoints_resolved_endpoint ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_get_type (resolved_endpoint : * const aws_endpoints_resolved_endpoint) -> aws_endpoints_resolved_endpoint_type ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_get_url (resolved_endpoint : * const aws_endpoints_resolved_endpoint , out_url : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_get_properties (resolved_endpoint : * const aws_endpoints_resolved_endpoint , out_properties : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_get_headers (resolved_endpoint : * const aws_endpoints_resolved_endpoint , out_headers : * mut * const aws_hash_table) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_get_error (resolved_endpoint : * const aws_endpoints_resolved_endpoint , out_error : * mut aws_byte_cursor) -> :: libc :: c_int ; } # [repr (C)] pub struct aws_mutex { pub mutex_handle : pthread_mutex_t , pub initialized : bool , } # [test] fn bindgen_test_layout_aws_mutex () { const UNINIT : :: std :: mem :: MaybeUninit < aws_mutex > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_mutex > () , 48usize , concat ! ("Size of: " , stringify ! (aws_mutex))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_mutex > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_mutex))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . mutex_handle) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_mutex) , "::" , stringify ! (mutex_handle))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initialized) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_mutex) , "::" , stringify ! (initialized))) ; } impl Default for aws_mutex { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Initializes a new platform instance of mutex."] pub fn aws_mutex_init (mutex : * mut aws_mutex) -> :: libc :: c_int ; } extern "C" { # [doc = " Cleans up internal resources."] pub fn aws_mutex_clean_up (mutex : * mut aws_mutex) ; } extern "C" { # [doc = " Blocks until it acquires the lock. While on some platforms such as Windows,\n this may behave as a reentrant mutex, you should not treat it like one. On\n platforms it is possible for it to be non-reentrant, it will be."] pub fn aws_mutex_lock (mutex : * mut aws_mutex) -> :: libc :: c_int ; } extern "C" { # [doc = " Attempts to acquire the lock but returns immediately if it can not.\n While on some platforms such as Windows, this may behave as a reentrant mutex,\n you should not treat it like one. On platforms it is possible for it to be non-reentrant, it will be.\n Note: For windows, minimum support server version is Windows Server 2008 R2 [desktop apps | UWP apps]"] pub fn aws_mutex_try_lock (mutex : * mut aws_mutex) -> :: libc :: c_int ; } extern "C" { # [doc = " Releases the lock."] pub fn aws_mutex_unlock (mutex : * mut aws_mutex) -> :: libc :: c_int ; } # [repr (i32)] # [non_exhaustive] # [doc = " Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n SPDX-License-Identifier: Apache-2.0."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_status_code { AWS_HTTP_STATUS_CODE_UNKNOWN = - 1 , AWS_HTTP_STATUS_CODE_100_CONTINUE = 100 , AWS_HTTP_STATUS_CODE_101_SWITCHING_PROTOCOLS = 101 , AWS_HTTP_STATUS_CODE_102_PROCESSING = 102 , AWS_HTTP_STATUS_CODE_103_EARLY_HINTS = 103 , AWS_HTTP_STATUS_CODE_200_OK = 200 , AWS_HTTP_STATUS_CODE_201_CREATED = 201 , AWS_HTTP_STATUS_CODE_202_ACCEPTED = 202 , AWS_HTTP_STATUS_CODE_203_NON_AUTHORITATIVE_INFORMATION = 203 , AWS_HTTP_STATUS_CODE_204_NO_CONTENT = 204 , AWS_HTTP_STATUS_CODE_205_RESET_CONTENT = 205 , AWS_HTTP_STATUS_CODE_206_PARTIAL_CONTENT = 206 , AWS_HTTP_STATUS_CODE_207_MULTI_STATUS = 207 , AWS_HTTP_STATUS_CODE_208_ALREADY_REPORTED = 208 , AWS_HTTP_STATUS_CODE_226_IM_USED = 226 , AWS_HTTP_STATUS_CODE_300_MULTIPLE_CHOICES = 300 , AWS_HTTP_STATUS_CODE_301_MOVED_PERMANENTLY = 301 , AWS_HTTP_STATUS_CODE_302_FOUND = 302 , AWS_HTTP_STATUS_CODE_303_SEE_OTHER = 303 , AWS_HTTP_STATUS_CODE_304_NOT_MODIFIED = 304 , AWS_HTTP_STATUS_CODE_305_USE_PROXY = 305 , AWS_HTTP_STATUS_CODE_307_TEMPORARY_REDIRECT = 307 , AWS_HTTP_STATUS_CODE_308_PERMANENT_REDIRECT = 308 , AWS_HTTP_STATUS_CODE_400_BAD_REQUEST = 400 , AWS_HTTP_STATUS_CODE_401_UNAUTHORIZED = 401 , AWS_HTTP_STATUS_CODE_402_PAYMENT_REQUIRED = 402 , AWS_HTTP_STATUS_CODE_403_FORBIDDEN = 403 , AWS_HTTP_STATUS_CODE_404_NOT_FOUND = 404 , AWS_HTTP_STATUS_CODE_405_METHOD_NOT_ALLOWED = 405 , AWS_HTTP_STATUS_CODE_406_NOT_ACCEPTABLE = 406 , AWS_HTTP_STATUS_CODE_407_PROXY_AUTHENTICATION_REQUIRED = 407 , AWS_HTTP_STATUS_CODE_408_REQUEST_TIMEOUT = 408 , AWS_HTTP_STATUS_CODE_409_CONFLICT = 409 , AWS_HTTP_STATUS_CODE_410_GONE = 410 , AWS_HTTP_STATUS_CODE_411_LENGTH_REQUIRED = 411 , AWS_HTTP_STATUS_CODE_412_PRECONDITION_FAILED = 412 , AWS_HTTP_STATUS_CODE_413_REQUEST_ENTITY_TOO_LARGE = 413 , AWS_HTTP_STATUS_CODE_414_REQUEST_URI_TOO_LONG = 414 , AWS_HTTP_STATUS_CODE_415_UNSUPPORTED_MEDIA_TYPE = 415 , AWS_HTTP_STATUS_CODE_416_REQUESTED_RANGE_NOT_SATISFIABLE = 416 , AWS_HTTP_STATUS_CODE_417_EXPECTATION_FAILED = 417 , AWS_HTTP_STATUS_CODE_421_MISDIRECTED_REQUEST = 421 , AWS_HTTP_STATUS_CODE_422_UNPROCESSABLE_ENTITY = 422 , AWS_HTTP_STATUS_CODE_423_LOCKED = 423 , AWS_HTTP_STATUS_CODE_424_FAILED_DEPENDENCY = 424 , AWS_HTTP_STATUS_CODE_425_TOO_EARLY = 425 , AWS_HTTP_STATUS_CODE_426_UPGRADE_REQUIRED = 426 , AWS_HTTP_STATUS_CODE_428_PRECONDITION_REQUIRED = 428 , AWS_HTTP_STATUS_CODE_429_TOO_MANY_REQUESTS = 429 , AWS_HTTP_STATUS_CODE_431_REQUEST_HEADER_FIELDS_TOO_LARGE = 431 , AWS_HTTP_STATUS_CODE_451_UNAVAILABLE_FOR_LEGAL_REASON = 451 , AWS_HTTP_STATUS_CODE_500_INTERNAL_SERVER_ERROR = 500 , AWS_HTTP_STATUS_CODE_501_NOT_IMPLEMENTED = 501 , AWS_HTTP_STATUS_CODE_502_BAD_GATEWAY = 502 , AWS_HTTP_STATUS_CODE_503_SERVICE_UNAVAILABLE = 503 , AWS_HTTP_STATUS_CODE_504_GATEWAY_TIMEOUT = 504 , AWS_HTTP_STATUS_CODE_505_HTTP_VERSION_NOT_SUPPORTED = 505 , AWS_HTTP_STATUS_CODE_506_VARIANT_ALSO_NEGOTIATES = 506 , AWS_HTTP_STATUS_CODE_507_INSUFFICIENT_STORAGE = 507 , AWS_HTTP_STATUS_CODE_508_LOOP_DETECTED = 508 , AWS_HTTP_STATUS_CODE_510_NOT_EXTENDED = 510 , AWS_HTTP_STATUS_CODE_511_NETWORK_AUTHENTICATION_REQUIRED = 511 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_config { _unused : [u8 ; 0] , } # [repr (u32)] # [non_exhaustive] # [doc = " @Deprecated - Supported proxy authentication modes. Superceded by proxy strategy."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_proxy_authentication_type { AWS_HPAT_NONE = 0 , AWS_HPAT_BASIC = 1 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_proxy_env_var_type { # [doc = " Default.\n Disable reading from environment variable for proxy."] AWS_HPEV_DISABLE = 0 , # [doc = " Enable get proxy URL from environment variable, when the manual proxy options of connection manager is not set.\n env HTTPS_PROXY/https_proxy will be checked when the main connection use tls.\n env HTTP_PROXY/http_proxy will be checked when the main connection NOT use tls.\n The lower case version has precedence."] AWS_HPEV_ENABLE = 1 , } # [repr (u32)] # [non_exhaustive] # [doc = " Supported proxy connection types"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_proxy_connection_type { # [doc = " Deprecated, but 0-valued for backwards compatibility\n\n If tls options are provided (for the main connection) then treat the proxy as a tunneling proxy\n If tls options are not provided (for the main connection), then treat the proxy as a forwarding proxy"] AWS_HPCT_HTTP_LEGACY = 0 , # [doc = " Use the proxy to forward http requests. Attempting to use both this mode and TLS on the tunnel destination\n is a configuration error."] AWS_HPCT_HTTP_FORWARD = 1 , # [doc = " Use the proxy to establish a connection to a remote endpoint via a CONNECT request through the proxy.\n Works for both plaintext and tls connections."] AWS_HPCT_HTTP_TUNNEL = 2 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct proxy_env_var_settings { pub env_var_type : aws_http_proxy_env_var_type , pub connection_type : aws_http_proxy_connection_type , pub tls_options : * const aws_tls_connection_options , } # [test] fn bindgen_test_layout_proxy_env_var_settings () { const UNINIT : :: std :: mem :: MaybeUninit < proxy_env_var_settings > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < proxy_env_var_settings > () , 16usize , concat ! ("Size of: " , stringify ! (proxy_env_var_settings))) ; assert_eq ! (:: std :: mem :: align_of :: < proxy_env_var_settings > () , 8usize , concat ! ("Alignment of " , stringify ! (proxy_env_var_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . env_var_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (proxy_env_var_settings) , "::" , stringify ! (env_var_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connection_type) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (proxy_env_var_settings) , "::" , stringify ! (connection_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_options) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (proxy_env_var_settings) , "::" , stringify ! (tls_options))) ; } impl Default for proxy_env_var_settings { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Options for http proxy server usage"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_options { # [doc = " Type of proxy connection to make"] pub connection_type : aws_http_proxy_connection_type , # [doc = " Proxy host to connect to"] pub host : aws_byte_cursor , # [doc = " Port to make the proxy connection to"] pub port : u16 , # [doc = " Optional.\n TLS configuration for the Local <-> Proxy connection\n Must be distinct from the the TLS options in the parent aws_http_connection_options struct"] pub tls_options : * const aws_tls_connection_options , # [doc = " Optional\n Advanced option that allows the user to create a custom strategy that gives low-level control of\n certain logical flows within the proxy logic.\n\n For tunneling proxies it allows custom retry and adaptive negotiation of CONNECT requests.\n For forwarding proxies it allows custom request transformations."] pub proxy_strategy : * mut aws_http_proxy_strategy , # [doc = " @Deprecated - What type of proxy authentication to use, if any.\n Replaced by instantiating a proxy_strategy"] pub auth_type : aws_http_proxy_authentication_type , # [doc = " @Deprecated - Optional user name to use for basic authentication\n Replaced by instantiating a proxy_strategy via aws_http_proxy_strategy_new_basic_auth()"] pub auth_username : aws_byte_cursor , # [doc = " @Deprecated - Optional password to use for basic authentication\n Replaced by instantiating a proxy_strategy via aws_http_proxy_strategy_new_basic_auth()"] pub auth_password : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_http_proxy_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_options > () , 88usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connection_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (connection_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_options) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (tls_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_strategy) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (proxy_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . auth_type) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (auth_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . auth_username) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (auth_username))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . auth_password) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (auth_password))) ; } impl Default for aws_http_proxy_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Synchronous (for now) callback function to fetch a token used in modifying CONNECT requests"] pub type aws_http_proxy_negotiation_get_token_sync_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void , out_error_code : * mut :: libc :: c_int) -> * mut aws_string > ; # [doc = " Synchronous (for now) callback function to fetch a token used in modifying CONNECT request. Includes a (byte string)\n context intended to be used as part of a challenge-response flow."] pub type aws_http_proxy_negotiation_get_challenge_token_sync_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void , challenge_context : * const aws_byte_cursor , out_error_code : * mut :: libc :: c_int) -> * mut aws_string > ; # [doc = " Proxy negotiation logic must call this function to indicate an unsuccessful outcome"] pub type aws_http_proxy_negotiation_terminate_fn = :: std :: option :: Option < unsafe extern "C" fn (message : * mut aws_http_message , error_code : :: libc :: c_int , internal_proxy_user_data : * mut :: libc :: c_void) > ; # [doc = " Proxy negotiation logic must call this function to forward the potentially-mutated request back to the proxy\n connection logic."] pub type aws_http_proxy_negotiation_http_request_forward_fn = :: std :: option :: Option < unsafe extern "C" fn (message : * mut aws_http_message , internal_proxy_user_data : * mut :: libc :: c_void) > ; # [doc = " User-supplied transform callback which implements the proxy request flow and ultimately, across all execution\n pathways, invokes either the terminate function or the forward function appropriately.\n\n For tunneling proxy connections, this request flow transform only applies to the CONNECT stage of proxy\n connection establishment.\n\n For forwarding proxy connections, this request flow transform applies to every single http request that goes\n out on the connection.\n\n Forwarding proxy connections cannot yet support a truly async request transform without major surgery on http\n stream creation, so for now, we split into an async version (for tunneling proxies) and a separate\n synchronous version for forwarding proxies. Also forwarding proxies are a kind of legacy dead-end in some\n sense.\n"] pub type aws_http_proxy_negotiation_http_request_transform_async_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator , message : * mut aws_http_message , negotiation_termination_callback : aws_http_proxy_negotiation_terminate_fn , negotiation_http_request_forward_callback : aws_http_proxy_negotiation_http_request_forward_fn , internal_proxy_user_data : * mut :: libc :: c_void) > ; pub type aws_http_proxy_negotiation_http_request_transform_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator , message : * mut aws_http_message) -> :: libc :: c_int > ; # [doc = " Tunneling proxy connections only. A callback that lets the negotiator examine the headers in the\n response to the most recent CONNECT request as they arrive."] pub type aws_http_proxy_negotiation_connect_on_incoming_headers_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator , header_block : aws_http_header_block , header_array : * const aws_http_header , num_headers : usize) -> :: libc :: c_int > ; # [doc = " Tunneling proxy connections only. A callback that lets the negotiator examine the status code of the\n response to the most recent CONNECT request."] pub type aws_http_proxy_negotiator_connect_status_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator , status_code : aws_http_status_code) -> :: libc :: c_int > ; # [doc = " Tunneling proxy connections only. A callback that lets the negotiator examine the body of the response\n to the most recent CONNECT request."] pub type aws_http_proxy_negotiator_connect_on_incoming_body_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator , data : * const aws_byte_cursor) -> :: libc :: c_int > ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_proxy_negotiation_retry_directive { AWS_HPNRD_STOP = 0 , AWS_HPNRD_NEW_CONNECTION = 1 , AWS_HPNRD_CURRENT_CONNECTION = 2 , } pub type aws_http_proxy_negotiator_get_retry_directive_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator) -> aws_http_proxy_negotiation_retry_directive > ; # [doc = " Vtable for forwarding-based proxy negotiators"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http_proxy_negotiator_forwarding_vtable { pub forward_request_transform : aws_http_proxy_negotiation_http_request_transform_fn , } # [test] fn bindgen_test_layout_aws_http_proxy_negotiator_forwarding_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_negotiator_forwarding_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_negotiator_forwarding_vtable > () , 8usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_negotiator_forwarding_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_negotiator_forwarding_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_negotiator_forwarding_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . forward_request_transform) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_forwarding_vtable) , "::" , stringify ! (forward_request_transform))) ; } # [doc = " Vtable for tunneling-based proxy negotiators"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http_proxy_negotiator_tunnelling_vtable { pub connect_request_transform : aws_http_proxy_negotiation_http_request_transform_async_fn , pub on_incoming_headers_callback : aws_http_proxy_negotiation_connect_on_incoming_headers_fn , pub on_status_callback : aws_http_proxy_negotiator_connect_status_fn , pub on_incoming_body_callback : aws_http_proxy_negotiator_connect_on_incoming_body_fn , pub get_retry_directive : aws_http_proxy_negotiator_get_retry_directive_fn , } # [test] fn bindgen_test_layout_aws_http_proxy_negotiator_tunnelling_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_negotiator_tunnelling_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_negotiator_tunnelling_vtable > () , 40usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_negotiator_tunnelling_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connect_request_transform) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable) , "::" , stringify ! (connect_request_transform))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_incoming_headers_callback) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable) , "::" , stringify ! (on_incoming_headers_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_status_callback) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable) , "::" , stringify ! (on_status_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_incoming_body_callback) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable) , "::" , stringify ! (on_incoming_body_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_retry_directive) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable) , "::" , stringify ! (get_retry_directive))) ; } # [repr (C)] # [derive (Copy , Clone)] pub struct aws_http_proxy_negotiator { pub ref_count : aws_ref_count , pub impl_ : * mut :: libc :: c_void , pub strategy_vtable : aws_http_proxy_negotiator__bindgen_ty_1 , } # [repr (C)] # [derive (Copy , Clone)] pub union aws_http_proxy_negotiator__bindgen_ty_1 { pub forwarding_vtable : * mut aws_http_proxy_negotiator_forwarding_vtable , pub tunnelling_vtable : * mut aws_http_proxy_negotiator_tunnelling_vtable , } # [test] fn bindgen_test_layout_aws_http_proxy_negotiator__bindgen_ty_1 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_negotiator__bindgen_ty_1 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_negotiator__bindgen_ty_1 > () , 8usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_negotiator__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_negotiator__bindgen_ty_1 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_negotiator__bindgen_ty_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . forwarding_vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator__bindgen_ty_1) , "::" , stringify ! (forwarding_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tunnelling_vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator__bindgen_ty_1) , "::" , stringify ! (tunnelling_vtable))) ; } impl Default for aws_http_proxy_negotiator__bindgen_ty_1 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [test] fn bindgen_test_layout_aws_http_proxy_negotiator () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_negotiator > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_negotiator > () , 40usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_negotiator))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_negotiator > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_negotiator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . strategy_vtable) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator) , "::" , stringify ! (strategy_vtable))) ; } impl Default for aws_http_proxy_negotiator { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_http_proxy_strategy_create_negotiator_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_strategy : * mut aws_http_proxy_strategy , allocator : * mut aws_allocator) -> * mut aws_http_proxy_negotiator > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http_proxy_strategy_vtable { pub create_negotiator : aws_http_proxy_strategy_create_negotiator_fn , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_vtable > () , 8usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . create_negotiator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_vtable) , "::" , stringify ! (create_negotiator))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy { pub ref_count : aws_ref_count , pub vtable : * mut aws_http_proxy_strategy_vtable , pub impl_ : * mut :: libc :: c_void , pub proxy_connection_type : aws_http_proxy_connection_type , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy > () , 48usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_connection_type) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy) , "::" , stringify ! (proxy_connection_type))) ; } impl Default for aws_http_proxy_strategy { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy_basic_auth_options { pub proxy_connection_type : aws_http_proxy_connection_type , pub user_name : aws_byte_cursor , pub password : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_basic_auth_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_basic_auth_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_basic_auth_options > () , 40usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_basic_auth_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_basic_auth_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_basic_auth_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_connection_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_basic_auth_options) , "::" , stringify ! (proxy_connection_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_name) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_basic_auth_options) , "::" , stringify ! (user_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . password) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_basic_auth_options) , "::" , stringify ! (password))) ; } impl Default for aws_http_proxy_strategy_basic_auth_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy_tunneling_kerberos_options { pub get_token : aws_http_proxy_negotiation_get_token_sync_fn , pub get_token_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_tunneling_kerberos_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_tunneling_kerberos_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_tunneling_kerberos_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_tunneling_kerberos_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_tunneling_kerberos_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_tunneling_kerberos_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_token) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_kerberos_options) , "::" , stringify ! (get_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_token_user_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_kerberos_options) , "::" , stringify ! (get_token_user_data))) ; } impl Default for aws_http_proxy_strategy_tunneling_kerberos_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy_tunneling_ntlm_options { pub get_token : aws_http_proxy_negotiation_get_token_sync_fn , pub get_challenge_token : aws_http_proxy_negotiation_get_challenge_token_sync_fn , pub get_challenge_token_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_tunneling_ntlm_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_tunneling_ntlm_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_tunneling_ntlm_options > () , 24usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_tunneling_ntlm_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_tunneling_ntlm_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_tunneling_ntlm_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_token) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_ntlm_options) , "::" , stringify ! (get_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_challenge_token) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_ntlm_options) , "::" , stringify ! (get_challenge_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_challenge_token_user_data) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_ntlm_options) , "::" , stringify ! (get_challenge_token_user_data))) ; } impl Default for aws_http_proxy_strategy_tunneling_ntlm_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy_tunneling_adaptive_options { pub kerberos_options : * mut aws_http_proxy_strategy_tunneling_kerberos_options , pub ntlm_options : * mut aws_http_proxy_strategy_tunneling_ntlm_options , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_tunneling_adaptive_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_tunneling_adaptive_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_tunneling_adaptive_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_tunneling_adaptive_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_tunneling_adaptive_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_tunneling_adaptive_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . kerberos_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_adaptive_options) , "::" , stringify ! (kerberos_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ntlm_options) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_adaptive_options) , "::" , stringify ! (ntlm_options))) ; } impl Default for aws_http_proxy_strategy_tunneling_adaptive_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy_tunneling_sequence_options { pub strategies : * mut * mut aws_http_proxy_strategy , pub strategy_count : u32 , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_tunneling_sequence_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_tunneling_sequence_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_tunneling_sequence_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_tunneling_sequence_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_tunneling_sequence_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_tunneling_sequence_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . strategies) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_sequence_options) , "::" , stringify ! (strategies))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . strategy_count) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_sequence_options) , "::" , stringify ! (strategy_count))) ; } impl Default for aws_http_proxy_strategy_tunneling_sequence_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Take a reference to an http proxy negotiator\n @param proxy_negotiator negotiator to take a reference to\n @return the strategy"] pub fn aws_http_proxy_negotiator_acquire (proxy_negotiator : * mut aws_http_proxy_negotiator) -> * mut aws_http_proxy_negotiator ; } extern "C" { # [doc = " Release a reference to an http proxy negotiator\n @param proxy_negotiator negotiator to release a reference to"] pub fn aws_http_proxy_negotiator_release (proxy_negotiator : * mut aws_http_proxy_negotiator) ; } extern "C" { # [doc = " Creates a new proxy negotiator from a proxy strategy\n @param allocator memory allocator to use\n @param strategy strategy to creation a new negotiator for\n @return a new proxy negotiator if successful, otherwise NULL"] pub fn aws_http_proxy_strategy_create_negotiator (strategy : * mut aws_http_proxy_strategy , allocator : * mut aws_allocator) -> * mut aws_http_proxy_negotiator ; } extern "C" { # [doc = " Take a reference to an http proxy strategy\n @param proxy_strategy strategy to take a reference to\n @return the strategy"] pub fn aws_http_proxy_strategy_acquire (proxy_strategy : * mut aws_http_proxy_strategy) -> * mut aws_http_proxy_strategy ; } extern "C" { # [doc = " Release a reference to an http proxy strategy\n @param proxy_strategy strategy to release a reference to"] pub fn aws_http_proxy_strategy_release (proxy_strategy : * mut aws_http_proxy_strategy) ; } extern "C" { # [doc = " A constructor for a proxy strategy that performs basic authentication by adding the appropriate\n header and header value to requests or CONNECT requests.\n\n @param allocator memory allocator to use\n @param config basic authentication configuration info\n @return a new proxy strategy if successfully constructed, otherwise NULL"] pub fn aws_http_proxy_strategy_new_basic_auth (allocator : * mut aws_allocator , config : * mut aws_http_proxy_strategy_basic_auth_options) -> * mut aws_http_proxy_strategy ; } extern "C" { # [doc = " Constructor for an adaptive tunneling proxy strategy. This strategy attempts a vanilla CONNECT and if that\n fails it may make followup CONNECT attempts using kerberos or ntlm tokens, based on configuration and proxy\n response properties.\n\n @param allocator memory allocator to use\n @param config configuration options for the strategy\n @return a new proxy strategy if successfully constructed, otherwise NULL"] pub fn aws_http_proxy_strategy_new_tunneling_adaptive (allocator : * mut aws_allocator , config : * mut aws_http_proxy_strategy_tunneling_adaptive_options) -> * mut aws_http_proxy_strategy ; } extern "C" { # [doc = " Create a persistent proxy configuration from http connection options\n @param allocator memory allocator to use\n @param options http connection options to source proxy configuration from\n @return"] pub fn aws_http_proxy_config_new_from_connection_options (allocator : * mut aws_allocator , options : * const aws_http_client_connection_options) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Create a persistent proxy configuration from http connection manager options\n @param allocator memory allocator to use\n @param options http connection manager options to source proxy configuration from\n @return"] pub fn aws_http_proxy_config_new_from_manager_options (allocator : * mut aws_allocator , options : * const aws_http_connection_manager_options) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Create a persistent proxy configuration from non-persistent proxy options. The resulting\n proxy configuration assumes a tunneling connection type.\n\n @param allocator memory allocator to use\n @param options http proxy options to source proxy configuration from\n @return"] pub fn aws_http_proxy_config_new_tunneling_from_proxy_options (allocator : * mut aws_allocator , options : * const aws_http_proxy_options) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Create a persistent proxy configuration from non-persistent proxy options.\n Legacy connection type of proxy options will be rejected.\n\n @param allocator memory allocator to use\n @param options http proxy options to source proxy configuration from\n @return"] pub fn aws_http_proxy_config_new_from_proxy_options (allocator : * mut aws_allocator , options : * const aws_http_proxy_options) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Create a persistent proxy configuration from non-persistent proxy options.\n\n @param allocator memory allocator to use\n @param options http proxy options to source proxy configuration from\n @param is_tls_connection tls connection info of the main connection to determine connection_type\n when the connection_type is legacy.\n @return"] pub fn aws_http_proxy_config_new_from_proxy_options_with_tls_info (allocator : * mut aws_allocator , proxy_options : * const aws_http_proxy_options , is_tls_connection : bool) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Clones an existing proxy configuration. A refactor could remove this (do a \"move\" between the old and new user\n data in the one spot it's used) but that should wait until we have better test cases for the logic where this\n gets invoked (ntlm/kerberos chains).\n\n @param allocator memory allocator to use\n @param proxy_config http proxy configuration to clone\n @return"] pub fn aws_http_proxy_config_new_clone (allocator : * mut aws_allocator , proxy_config : * const aws_http_proxy_config) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Destroys an http proxy configuration\n @param config http proxy configuration to destroy"] pub fn aws_http_proxy_config_destroy (config : * mut aws_http_proxy_config) ; } extern "C" { # [doc = " Initializes non-persistent http proxy options from a persistent http proxy configuration\n @param options http proxy options to initialize\n @param config the http proxy config to use as an initialization source"] pub fn aws_http_proxy_options_init_from_config (options : * mut aws_http_proxy_options , config : * const aws_http_proxy_config) ; } extern "C" { # [doc = " Establish an arbitrary protocol connection through an http proxy via tunneling CONNECT. Alpn is\n not required for this connection process to succeed, but we encourage its use if available.\n\n @param channel_options configuration options for the socket level connection\n @param proxy_options configuration options for the proxy connection\n\n @return AWS_OP_SUCCESS if the asynchronous channel kickoff succeeded, AWS_OP_ERR otherwise"] pub fn aws_http_proxy_new_socket_channel (channel_options : * mut aws_socket_channel_bootstrap_options , proxy_options : * const aws_http_proxy_options) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_connection_finish_code { AWS_S3_CONNECTION_FINISH_CODE_SUCCESS = 0 , AWS_S3_CONNECTION_FINISH_CODE_FAILED = 1 , AWS_S3_CONNECTION_FINISH_CODE_RETRY = 2 , } pub type aws_s3_endpoint_shutdown_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_endpoint_options { pub host_name : * mut aws_string , pub shutdown_callback : aws_s3_endpoint_shutdown_fn , pub client_bootstrap : * mut aws_client_bootstrap , pub tls_connection_options : * const aws_tls_connection_options , pub dns_host_address_ttl_seconds : usize , pub client : * mut aws_s3_client , pub max_connections : u32 , pub port : u16 , # [doc = " Optional.\n Proxy configuration for http connection."] pub proxy_config : * mut aws_http_proxy_config , # [doc = " Optional.\n Configuration for fetching proxy configuration from environment.\n By Default proxy_ev_settings.aws_http_proxy_env_var_type is set to AWS_HPEV_ENABLE which means read proxy\n configuration from environment.\n Only works when proxy_config is not set. If both are set, configuration from proxy_config is used."] pub proxy_ev_settings : * mut proxy_env_var_settings , # [doc = " Optional.\n If set to 0, default value is used."] pub connect_timeout_ms : u32 , # [doc = " Optional.\n Set keepalive to periodically transmit messages for detecting a disconnected peer."] pub tcp_keep_alive_options : * mut aws_s3_tcp_keep_alive_options , # [doc = " Optional.\n Configuration options for connection monitoring.\n If the transfer speed falls below the specified minimum_throughput_bytes_per_second, the operation is aborted."] pub monitoring_options : * mut aws_http_connection_monitoring_options , } # [test] fn bindgen_test_layout_aws_s3_endpoint_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_endpoint_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_endpoint_options > () , 96usize , concat ! ("Size of: " , stringify ! (aws_s3_endpoint_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_endpoint_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_endpoint_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client_bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (client_bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_connection_options) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (tls_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . dns_host_address_ttl_seconds) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (dns_host_address_ttl_seconds))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (client))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_connections) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (max_connections))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 52usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_config) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (proxy_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_settings) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (proxy_ev_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connect_timeout_ms) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (connect_timeout_ms))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tcp_keep_alive_options) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (tcp_keep_alive_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . monitoring_options) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (monitoring_options))) ; } impl Default for aws_s3_endpoint_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_s3_endpoint_system_vtable { pub acquire : :: std :: option :: Option < unsafe extern "C" fn (endpoint : * mut aws_s3_endpoint , already_holding_lock : bool) > , pub release : :: std :: option :: Option < unsafe extern "C" fn (endpoint : * mut aws_s3_endpoint) > , } # [test] fn bindgen_test_layout_aws_s3_endpoint_system_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_endpoint_system_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_endpoint_system_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_s3_endpoint_system_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_endpoint_system_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_endpoint_system_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . acquire) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_system_vtable) , "::" , stringify ! (acquire))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . release) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_system_vtable) , "::" , stringify ! (release))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_endpoint { pub client_synced_data : aws_s3_endpoint__bindgen_ty_1 , pub allocator : * mut aws_allocator , pub host_name : * mut aws_string , pub http_connection_manager : * mut aws_http_connection_manager , pub client : * mut aws_s3_client , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_s3_endpoint__bindgen_ty_1 { pub ref_count : usize , } # [test] fn bindgen_test_layout_aws_s3_endpoint__bindgen_ty_1 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_endpoint__bindgen_ty_1 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_endpoint__bindgen_ty_1 > () , 8usize , concat ! ("Size of: " , stringify ! (aws_s3_endpoint__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_endpoint__bindgen_ty_1 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_endpoint__bindgen_ty_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint__bindgen_ty_1) , "::" , stringify ! (ref_count))) ; } # [test] fn bindgen_test_layout_aws_s3_endpoint () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_endpoint > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_endpoint > () , 40usize , concat ! ("Size of: " , stringify ! (aws_s3_endpoint))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_endpoint > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_endpoint))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client_synced_data) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint) , "::" , stringify ! (client_synced_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http_connection_manager) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint) , "::" , stringify ! (http_connection_manager))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint) , "::" , stringify ! (client))) ; } impl Default for aws_s3_endpoint { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_connection { pub endpoint : * mut aws_s3_endpoint , pub http_connection : * mut aws_http_connection , pub request : * mut aws_s3_request , pub retry_token : * mut aws_retry_token , } # [test] fn bindgen_test_layout_aws_s3_connection () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_connection > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_connection > () , 32usize , concat ! ("Size of: " , stringify ! (aws_s3_connection))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_connection > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_connection))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoint) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_connection) , "::" , stringify ! (endpoint))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http_connection) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_connection) , "::" , stringify ! (http_connection))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . request) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_connection) , "::" , stringify ! (request))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . retry_token) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_connection) , "::" , stringify ! (retry_token))) ; } impl Default for aws_s3_connection { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_s3_client_vtable { pub meta_request_factory : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client , options : * const aws_s3_meta_request_options) -> * mut aws_s3_meta_request > , pub create_connection_for_request : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client , request : * mut aws_s3_request) > , pub acquire_http_connection : :: std :: option :: Option < unsafe extern "C" fn (conn_manager : * mut aws_http_connection_manager , on_connection_acquired_callback : aws_http_connection_manager_on_connection_setup_fn , user_data : * mut :: libc :: c_void) > , pub get_host_address_count : :: std :: option :: Option < unsafe extern "C" fn (host_resolver : * mut aws_host_resolver , host_name : * const aws_string , flags : u32) -> usize > , pub schedule_process_work_synced : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client) > , pub process_work : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client) > , pub endpoint_shutdown_callback : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client) > , pub finish_destroy : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client) > , } # [test] fn bindgen_test_layout_aws_s3_client_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client_vtable > () , 64usize , concat ! ("Size of: " , stringify ! (aws_s3_client_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . meta_request_factory) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (meta_request_factory))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . create_connection_for_request) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (create_connection_for_request))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . acquire_http_connection) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (acquire_http_connection))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_host_address_count) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (get_host_address_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . schedule_process_work_synced) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (schedule_process_work_synced))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_work) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (process_work))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoint_shutdown_callback) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (endpoint_shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . finish_destroy) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (finish_destroy))) ; } # [repr (C)] pub struct aws_s3_client { pub allocator : * mut aws_allocator , pub vtable : * mut aws_s3_client_vtable , pub ref_count : aws_ref_count , pub client_bootstrap : * mut aws_client_bootstrap , pub process_work_event_loop : * mut aws_event_loop , pub body_streaming_elg : * mut aws_event_loop_group , pub region : * mut aws_string , pub part_size : usize , pub max_part_size : u64 , pub multipart_upload_threshold : u64 , pub tls_connection_options : * mut aws_tls_connection_options , pub cached_signing_config : * mut aws_cached_signing_config_aws , pub throughput_target_gbps : f64 , pub ideal_vip_count : u32 , # [doc = " For multi-part upload, content-md5 will be calculated if the AWS_MR_CONTENT_MD5_ENABLED is specified\n or initial request has content-md5 header.\n For single-part upload, if the content-md5 header is specified, it will remain unchanged. If the header is not\n specified, and this is set to AWS_MR_CONTENT_MD5_ENABLED, it will be calculated."] pub compute_content_md5 : aws_s3_meta_request_compute_content_md5 , pub max_active_connections_override : u32 , pub max_allowed_connections : aws_atomic_var , pub retry_strategy : * mut aws_retry_strategy , # [doc = " Optional.\n Proxy configuration for http connection."] pub proxy_config : * mut aws_http_proxy_config , # [doc = " Optional.\n Configuration for fetching proxy configuration from environment.\n By Default proxy_ev_settings.aws_http_proxy_env_var_type is set to AWS_HPEV_ENABLE which means read proxy\n configuration from environment.\n Only works when proxy_config is not set. If both are set, configuration from proxy_config is used."] pub proxy_ev_settings : * mut proxy_env_var_settings , # [doc = " Optional.\n If set to 0, default value is used."] pub connect_timeout_ms : u32 , # [doc = " Optional.\n Set keepalive to periodically transmit messages for detecting a disconnected peer."] pub tcp_keep_alive_options : * mut aws_s3_tcp_keep_alive_options , # [doc = " Configuration options for connection monitoring.\n If the transfer speed falls below the specified minimum_throughput_bytes_per_second, the operation is aborted.\n If user passes in NULL, default values are used."] pub monitoring_options : aws_http_connection_monitoring_options , pub proxy_ev_tls_options : * mut aws_tls_connection_options , pub shutdown_callback : aws_s3_client_shutdown_complete_callback_fn , pub shutdown_callback_user_data : * mut :: libc :: c_void , pub enable_read_backpressure : bool , pub initial_read_window : usize , pub stats : aws_s3_client__bindgen_ty_1 , pub synced_data : aws_s3_client__bindgen_ty_2 , pub threaded_data : aws_s3_client__bindgen_ty_3 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_client__bindgen_ty_1 { pub num_requests_in_flight : aws_atomic_var , pub num_requests_network_io : [aws_atomic_var ; 4usize] , pub num_requests_stream_queued_waiting : aws_atomic_var , pub num_requests_streaming_response : aws_atomic_var , } # [test] fn bindgen_test_layout_aws_s3_client__bindgen_ty_1 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client__bindgen_ty_1 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client__bindgen_ty_1 > () , 56usize , concat ! ("Size of: " , stringify ! (aws_s3_client__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client__bindgen_ty_1 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client__bindgen_ty_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_requests_in_flight) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_1) , "::" , stringify ! (num_requests_in_flight))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_requests_network_io) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_1) , "::" , stringify ! (num_requests_network_io))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_requests_stream_queued_waiting) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_1) , "::" , stringify ! (num_requests_stream_queued_waiting))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_requests_streaming_response) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_1) , "::" , stringify ! (num_requests_streaming_response))) ; } impl Default for aws_s3_client__bindgen_ty_1 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] pub struct aws_s3_client__bindgen_ty_2 { pub lock : aws_mutex , pub endpoints : aws_hash_table , pub num_failed_prepare_requests : u32 , pub pending_meta_request_work : aws_linked_list , pub prepared_requests : aws_linked_list , pub process_work_task : aws_task , pub num_endpoints_allocated : u32 , pub _bitfield_align_1 : [u8 ; 0] , pub _bitfield_1 : __BindgenBitfieldUnit < [u8 ; 1usize] > , pub __bindgen_padding_0 : [u8 ; 3usize] , } # [test] fn bindgen_test_layout_aws_s3_client__bindgen_ty_2 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client__bindgen_ty_2 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client__bindgen_ty_2 > () , 200usize , concat ! ("Size of: " , stringify ! (aws_s3_client__bindgen_ty_2))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client__bindgen_ty_2 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client__bindgen_ty_2))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . lock) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (lock))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoints) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (endpoints))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_failed_prepare_requests) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (num_failed_prepare_requests))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . pending_meta_request_work) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (pending_meta_request_work))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . prepared_requests) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (prepared_requests))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_work_task) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (process_work_task))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_endpoints_allocated) as usize - ptr as usize } , 192usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (num_endpoints_allocated))) ; } impl Default for aws_s3_client__bindgen_ty_2 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } impl aws_s3_client__bindgen_ty_2 { # [inline] pub fn active (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (0usize , 1u8) as u32) } } # [inline] pub fn set_active (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (0usize , 1u8 , val as u64) } } # [inline] pub fn start_destroy_executing (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (1usize , 1u8) as u32) } } # [inline] pub fn set_start_destroy_executing (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (1usize , 1u8 , val as u64) } } # [inline] pub fn process_work_task_scheduled (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (2usize , 1u8) as u32) } } # [inline] pub fn set_process_work_task_scheduled (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (2usize , 1u8 , val as u64) } } # [inline] pub fn process_work_task_in_progress (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (3usize , 1u8) as u32) } } # [inline] pub fn set_process_work_task_in_progress (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (3usize , 1u8 , val as u64) } } # [inline] pub fn body_streaming_elg_allocated (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (4usize , 1u8) as u32) } } # [inline] pub fn set_body_streaming_elg_allocated (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (4usize , 1u8 , val as u64) } } # [inline] pub fn finish_destroy (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (5usize , 1u8) as u32) } } # [inline] pub fn set_finish_destroy (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (5usize , 1u8 , val as u64) } } # [inline] pub fn new_bitfield_1 (active : u32 , start_destroy_executing : u32 , process_work_task_scheduled : u32 , process_work_task_in_progress : u32 , body_streaming_elg_allocated : u32 , finish_destroy : u32) -> __BindgenBitfieldUnit < [u8 ; 1usize] > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [u8 ; 1usize] > = Default :: default () ; __bindgen_bitfield_unit . set (0usize , 1u8 , { let active : u32 = unsafe { :: std :: mem :: transmute (active) } ; active as u64 }) ; __bindgen_bitfield_unit . set (1usize , 1u8 , { let start_destroy_executing : u32 = unsafe { :: std :: mem :: transmute (start_destroy_executing) } ; start_destroy_executing as u64 }) ; __bindgen_bitfield_unit . set (2usize , 1u8 , { let process_work_task_scheduled : u32 = unsafe { :: std :: mem :: transmute (process_work_task_scheduled) } ; process_work_task_scheduled as u64 }) ; __bindgen_bitfield_unit . set (3usize , 1u8 , { let process_work_task_in_progress : u32 = unsafe { :: std :: mem :: transmute (process_work_task_in_progress) } ; process_work_task_in_progress as u64 }) ; __bindgen_bitfield_unit . set (4usize , 1u8 , { let body_streaming_elg_allocated : u32 = unsafe { :: std :: mem :: transmute (body_streaming_elg_allocated) } ; body_streaming_elg_allocated as u64 }) ; __bindgen_bitfield_unit . set (5usize , 1u8 , { let finish_destroy : u32 = unsafe { :: std :: mem :: transmute (finish_destroy) } ; finish_destroy as u64 }) ; __bindgen_bitfield_unit } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_client__bindgen_ty_3 { pub request_queue : aws_linked_list , pub meta_requests : aws_linked_list , pub request_queue_size : u32 , pub num_requests_being_prepared : u32 , } # [test] fn bindgen_test_layout_aws_s3_client__bindgen_ty_3 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client__bindgen_ty_3 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client__bindgen_ty_3 > () , 72usize , concat ! ("Size of: " , stringify ! (aws_s3_client__bindgen_ty_3))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client__bindgen_ty_3 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client__bindgen_ty_3))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . request_queue) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_3) , "::" , stringify ! (request_queue))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . meta_requests) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_3) , "::" , stringify ! (meta_requests))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . request_queue_size) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_3) , "::" , stringify ! (request_queue_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_requests_being_prepared) as usize - ptr as usize } , 68usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_3) , "::" , stringify ! (num_requests_being_prepared))) ; } impl Default for aws_s3_client__bindgen_ty_3 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [test] fn bindgen_test_layout_aws_s3_client () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client > () , 584usize , concat ! ("Size of: " , stringify ! (aws_s3_client))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client_bootstrap) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (client_bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_work_event_loop) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (process_work_event_loop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . body_streaming_elg) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (body_streaming_elg))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . region) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (region))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_size) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_part_size) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (max_part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . multipart_upload_threshold) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (multipart_upload_threshold))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_connection_options) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (tls_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cached_signing_config) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (cached_signing_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . throughput_target_gbps) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (throughput_target_gbps))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ideal_vip_count) as usize - ptr as usize } , 120usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (ideal_vip_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . compute_content_md5) as usize - ptr as usize } , 124usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (compute_content_md5))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_active_connections_override) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (max_active_connections_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_allowed_connections) as usize - ptr as usize } , 136usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (max_allowed_connections))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . retry_strategy) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (retry_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_config) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (proxy_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_settings) as usize - ptr as usize } , 160usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (proxy_ev_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connect_timeout_ms) as usize - ptr as usize } , 168usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (connect_timeout_ms))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tcp_keep_alive_options) as usize - ptr as usize } , 176usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (tcp_keep_alive_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . monitoring_options) as usize - ptr as usize } , 184usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (monitoring_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_tls_options) as usize - ptr as usize } , 216usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (proxy_ev_tls_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 224usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback_user_data) as usize - ptr as usize } , 232usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (shutdown_callback_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_backpressure) as usize - ptr as usize } , 240usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (enable_read_backpressure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_read_window) as usize - ptr as usize } , 248usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (initial_read_window))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . stats) as usize - ptr as usize } , 256usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (stats))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . synced_data) as usize - ptr as usize } , 312usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (synced_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . threaded_data) as usize - ptr as usize } , 512usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (threaded_data))) ; } impl Default for aws_s3_client { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_meta_request_resume_token { pub allocator : * mut aws_allocator , pub ref_count : aws_ref_count , pub type_ : aws_s3_meta_request_type , pub multipart_upload_id : * mut aws_string , pub part_size : usize , pub total_num_parts : usize , pub num_parts_completed : usize , } # [test] fn bindgen_test_layout_aws_s3_meta_request_resume_token () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_meta_request_resume_token > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_meta_request_resume_token > () , 72usize , concat ! ("Size of: " , stringify ! (aws_s3_meta_request_resume_token))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_meta_request_resume_token > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_meta_request_resume_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . type_) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (type_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . multipart_upload_id) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (multipart_upload_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_size) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . total_num_parts) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (total_num_parts))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_parts_completed) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (num_parts_completed))) ; } impl Default for aws_s3_meta_request_resume_token { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_s3_client_notify_connection_finished (client : * mut aws_s3_client , connection : * mut aws_s3_connection , error_code : :: libc :: c_int , finish_code : aws_s3_connection_finish_code) ; } extern "C" { pub fn aws_s3_meta_request_resume_token_new (allocator : * mut aws_allocator) -> * mut aws_s3_meta_request_resume_token ; } extern "C" { pub fn aws_s3_set_dns_ttl (ttl : usize) ; } extern "C" { pub fn aws_s3_client_get_max_requests_prepare (client : * mut aws_s3_client) -> u32 ; } extern "C" { pub fn aws_s3_client_get_max_active_connections (client : * mut aws_s3_client , meta_request : * mut aws_s3_meta_request) -> u32 ; } extern "C" { pub fn aws_s3_client_get_max_requests_in_flight (client : * mut aws_s3_client) -> u32 ; } extern "C" { pub fn aws_s3_client_queue_requests_threaded (client : * mut aws_s3_client , request_list : * mut aws_linked_list , queue_front : bool) -> u32 ; } extern "C" { pub fn aws_s3_client_dequeue_request_threaded (client : * mut aws_s3_client) -> * mut aws_s3_request ; } extern "C" { pub fn aws_s3_client_schedule_process_work (client : * mut aws_s3_client) ; } extern "C" { pub fn aws_s3_client_update_meta_requests_threaded (client : * mut aws_s3_client) ; } extern "C" { pub fn aws_s3_client_update_connections_threaded (client : * mut aws_s3_client) ; } extern "C" { pub fn aws_s3_endpoint_new (allocator : * mut aws_allocator , options : * const aws_s3_endpoint_options) -> * mut aws_s3_endpoint ; } extern "C" { pub fn aws_s3_client_lock_synced_data (client : * mut aws_s3_client) ; } extern "C" { pub fn aws_s3_client_unlock_synced_data (client : * mut aws_s3_client) ; } extern "C" { pub fn aws_s3_endpoint_set_system_vtable (vtable : * const aws_s3_endpoint_system_vtable) ; } extern "C" { pub fn aws_s3_endpoint_acquire (endpoint : * mut aws_s3_endpoint , already_holding_lock : bool) -> * mut aws_s3_endpoint ; } extern "C" { pub fn aws_s3_endpoint_release (endpoint : * mut aws_s3_endpoint) ; } extern "C" { pub static g_max_num_connections_per_vip : u32 ; } extern "C" { pub static g_num_conns_per_vip_meta_request_look_up : [u32 ; 0usize] ; } pub type __builtin_va_list = [__va_list_tag ; 1usize] ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct __va_list_tag { pub gp_offset : :: libc :: c_uint , pub fp_offset : :: libc :: c_uint , pub overflow_arg_area : * mut :: libc :: c_void , pub reg_save_area : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout___va_list_tag () { const UNINIT : :: std :: mem :: MaybeUninit < __va_list_tag > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < __va_list_tag > () , 24usize , concat ! ("Size of: " , stringify ! (__va_list_tag))) ; assert_eq ! (:: std :: mem :: align_of :: < __va_list_tag > () , 8usize , concat ! ("Alignment of " , stringify ! (__va_list_tag))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . gp_offset) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (__va_list_tag) , "::" , stringify ! (gp_offset))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . fp_offset) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (__va_list_tag) , "::" , stringify ! (fp_offset))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . overflow_arg_area) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (__va_list_tag) , "::" , stringify ! (overflow_arg_area))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . reg_save_area) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (__va_list_tag) , "::" , stringify ! (reg_save_area))) ; } impl Default for __va_list_tag { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " (Optional)\n Use a cached merged profile collection. A merge collection has both config file\n (~/.aws/config) and credentials file based profile collection (~/.aws/credentials) using\n `aws_profile_collection_new_from_merge`.\n If this option is provided, `config_file_name_override` and `credentials_file_name_override` will be ignored."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_profile_collection { pub _address : u8 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_tls_ctx { pub _address : u8 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_cached_signing_config_aws { pub _address : u8 , } [INFO] [stdout] | + + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unclosed HTML tag `T` [INFO] [stdout] --> /opt/rustwide/target/debug/build/mountpoint-s3-crt-sys-f5c1badc4e97417b/out/bindings.rs:5:346649 [INFO] [stdout] | [INFO] [stdout] 5 | ... aws_future_impl { _unused : [u8 ; 0] , } # [doc = " Completion callback for aws_future"] pub type aws_future_callback_fn = :: std ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: try marking as source code [INFO] [stdout] | [INFO] [stdout] 5 | # [repr (C)] # [derive (Copy , Clone , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd)] pub struct __BindgenBitfieldUnit < Storage > { storage : Storage , } impl < Storage > __BindgenBitfieldUnit < Storage > { # [inline] pub const fn new (storage : Storage) -> Self { Self { storage } } } impl < Storage > __BindgenBitfieldUnit < Storage > where Storage : AsRef < [u8] > + AsMut < [u8] >, { # [inline] pub fn get_bit (& self , index : usize) -> bool { debug_assert ! (index / 8 < self . storage . as_ref () . len ()) ; let byte_index = index / 8 ; let byte = self . storage . as_ref () [byte_index] ; let bit_index = if cfg ! (target_endian = "big") { 7 - (index % 8) } else { index % 8 } ; let mask = 1 << bit_index ; byte & mask == mask } # [inline] pub fn set_bit (& mut self , index : usize , val : bool) { debug_assert ! (index / 8 < self . storage . as_ref () . len ()) ; let byte_index = index / 8 ; let byte = & mut self . storage . as_mut () [byte_index] ; let bit_index = if cfg ! (target_endian = "big") { 7 - (index % 8) } else { index % 8 } ; let mask = 1 << bit_index ; if val { * byte |= mask ; } else { * byte &= ! mask ; } } # [inline] pub fn get (& self , bit_offset : usize , bit_width : u8) -> u64 { debug_assert ! (bit_width <= 64) ; debug_assert ! (bit_offset / 8 < self . storage . as_ref () . len ()) ; debug_assert ! ((bit_offset + (bit_width as usize)) / 8 <= self . storage . as_ref () . len ()) ; let mut val = 0 ; for i in 0 .. (bit_width as usize) { if self . get_bit (i + bit_offset) { let index = if cfg ! (target_endian = "big") { bit_width as usize - 1 - i } else { i } ; val |= 1 << index ; } } val } # [inline] pub fn set (& mut self , bit_offset : usize , bit_width : u8 , val : u64) { debug_assert ! (bit_width <= 64) ; debug_assert ! (bit_offset / 8 < self . storage . as_ref () . len ()) ; debug_assert ! ((bit_offset + (bit_width as usize)) / 8 <= self . storage . as_ref () . len ()) ; for i in 0 .. (bit_width as usize) { let mask = 1 << i ; let val_bit_is_set = val & mask == mask ; let index = if cfg ! (target_endian = "big") { bit_width as usize - 1 - i } else { i } ; self . set_bit (index + bit_offset , val_bit_is_set) ; } } } pub const PRInSTR : & [u8 ; 5] = b"%.*s\0" ; pub const AWS_PACKAGE_SLOTS : i32 = 16 ; pub const AWS_C_COMMON_PACKAGE_ID : i32 = 0 ; pub const AWS_OP_SUCCESS : i32 = 0 ; pub const AWS_OP_ERR : i32 = - 1 ; pub const AWS_ERROR_ENUM_STRIDE_BITS : i32 = 10 ; pub const AWS_ERROR_ENUM_STRIDE : i32 = 1024 ; pub const SIZE_BITS : i32 = 64 ; pub const AWS_C_IO_PACKAGE_ID : i32 = 1 ; pub const AWS_THREAD_NAME_RECOMMENDED_STRLEN : i32 = 15 ; pub const AWS_THREAD_ONCE_STATIC_INIT : i32 = 0 ; pub const AWS_LOG_LEVEL_NONE : i32 = 0 ; pub const AWS_LOG_LEVEL_FATAL : i32 = 1 ; pub const AWS_LOG_LEVEL_ERROR : i32 = 2 ; pub const AWS_LOG_LEVEL_WARN : i32 = 3 ; pub const AWS_LOG_LEVEL_INFO : i32 = 4 ; pub const AWS_LOG_LEVEL_DEBUG : i32 = 5 ; pub const AWS_LOG_LEVEL_TRACE : i32 = 6 ; pub const AWS_C_SDKUTILS_PACKAGE_ID : i32 = 15 ; pub const AWS_C_AUTH_PACKAGE_ID : i32 = 6 ; pub const AWS_C_HTTP_PACKAGE_ID : i32 = 2 ; pub const AWS_HTTP2_DEFAULT_MAX_CLOSED_STREAMS : i32 = 32 ; pub const AWS_HTTP2_PING_DATA_SIZE : i32 = 8 ; pub const AWS_HTTP2_SETTINGS_COUNT : i32 = 6 ; pub const AWS_C_S3_PACKAGE_ID : i32 = 14 ; pub const AWS_S3_CLIENT_VERSION : & [u8 ; 6] = b"0.1.x\0" ; pub const AWS_CACHE_LINE : _bindgen_ty_18 = _bindgen_ty_18 :: AWS_CACHE_LINE ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_18 { AWS_CACHE_LINE = 64 , } pub type va_list = __builtin_va_list ; pub type __gnuc_va_list = __builtin_va_list ; extern "C" { pub fn aws_fatal_assert (cond_str : * const :: libc :: c_char , file : * const :: libc :: c_char , line : :: libc :: c_int) -> ! ; } pub type pthread_once_t = :: libc :: c_int ; # [doc = " @deprecated Use int64_t instead for offsets in public APIs."] pub type aws_off_t = i64 ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_allocator { pub mem_acquire : :: std :: option :: Option < unsafe extern "C" fn (allocator : * mut aws_allocator , size : usize) -> * mut :: libc :: c_void > , pub mem_release : :: std :: option :: Option < unsafe extern "C" fn (allocator : * mut aws_allocator , ptr : * mut :: libc :: c_void) > , pub mem_realloc : :: std :: option :: Option < unsafe extern "C" fn (allocator : * mut aws_allocator , oldptr : * mut :: libc :: c_void , oldsize : usize , newsize : usize) -> * mut :: libc :: c_void > , pub mem_calloc : :: std :: option :: Option < unsafe extern "C" fn (allocator : * mut aws_allocator , num : usize , size : usize) -> * mut :: libc :: c_void > , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_allocator () { const UNINIT : :: std :: mem :: MaybeUninit < aws_allocator > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_allocator > () , 40usize , concat ! ("Size of: " , stringify ! (aws_allocator))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_allocator > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . mem_acquire) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_allocator) , "::" , stringify ! (mem_acquire))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . mem_release) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_allocator) , "::" , stringify ! (mem_release))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . mem_realloc) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_allocator) , "::" , stringify ! (mem_realloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . mem_calloc) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_allocator) , "::" , stringify ! (mem_calloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_allocator) , "::" , stringify ! (impl_))) ; } impl Default for aws_allocator { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Inexpensive (constant time) check of data-structure invariants."] pub fn aws_allocator_is_valid (alloc : * const aws_allocator) -> bool ; } extern "C" { pub fn aws_default_allocator () -> * mut aws_allocator ; } extern "C" { # [doc = " Returns at least `size` of memory ready for usage. In versions v0.6.8 and prior, this function was allowed to return\n NULL. In later versions, if allocator->mem_acquire() returns NULL, this function will assert and exit. To handle\n conditions where OOM is not a fatal error, allocator->mem_acquire() is responsible for finding/reclaiming/running a\n GC etc...before returning."] pub fn aws_mem_acquire (allocator : * mut aws_allocator , size : usize) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Allocates a block of memory for an array of num elements, each of them size bytes long, and initializes all its bits\n to zero. In versions v0.6.8 and prior, this function was allowed to return NULL.\n In later versions, if allocator->mem_calloc() returns NULL, this function will assert and exit. To handle\n conditions where OOM is not a fatal error, allocator->mem_calloc() is responsible for finding/reclaiming/running a\n GC etc...before returning."] pub fn aws_mem_calloc (allocator : * mut aws_allocator , num : usize , size : usize) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Allocates many chunks of bytes into a single block. Expects to be called with alternating void ** (dest), size_t\n (size). The first void ** will be set to the root of the allocation. Alignment is assumed to be sizeof(intmax_t).\n\n This is useful for allocating structs using the pimpl pattern, as you may allocate the public object and impl object\n in the same contiguous block of memory.\n\n Returns a pointer to the allocation.\n\n In versions v0.6.8 and prior, this function was allowed to return\n NULL. In later versions, if allocator->mem_acquire() returns NULL, this function will assert and exit. To handle\n conditions where OOM is not a fatal error, allocator->mem_acquire() is responsible for finding/reclaiming/running a\n GC etc...before returning."] pub fn aws_mem_acquire_many (allocator : * mut aws_allocator , count : usize , ...) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Releases ptr back to whatever allocated it.\n Nothing happens if ptr is NULL."] pub fn aws_mem_release (allocator : * mut aws_allocator , ptr : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Attempts to adjust the size of the pointed-to memory buffer from oldsize to\n newsize. The pointer (*ptr) may be changed if the memory needs to be\n reallocated.\n\n In versions v0.6.8 and prior, this function was allowed to return\n NULL. In later versions, if allocator->mem_realloc() returns NULL, this function will assert and exit. To handle\n conditions where OOM is not a fatal error, allocator->mem_realloc() is responsible for finding/reclaiming/running a\n GC etc...before returning."] pub fn aws_mem_realloc (allocator : * mut aws_allocator , ptr : * mut * mut :: libc :: c_void , oldsize : usize , newsize : usize) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_mem_trace_level { AWS_MEMTRACE_NONE = 0 , AWS_MEMTRACE_BYTES = 1 , AWS_MEMTRACE_STACKS = 2 , } extern "C" { pub fn aws_mem_tracer_new (allocator : * mut aws_allocator , deprecated : * mut aws_allocator , level : aws_mem_trace_level , frames_per_stack : usize) -> * mut aws_allocator ; } extern "C" { pub fn aws_mem_tracer_destroy (trace_allocator : * mut aws_allocator) -> * mut aws_allocator ; } extern "C" { pub fn aws_mem_tracer_dump (trace_allocator : * mut aws_allocator) ; } extern "C" { pub fn aws_mem_tracer_bytes (trace_allocator : * mut aws_allocator) -> usize ; } extern "C" { pub fn aws_mem_tracer_count (trace_allocator : * mut aws_allocator) -> usize ; } extern "C" { pub fn aws_small_block_allocator_new (allocator : * mut aws_allocator , multi_threaded : bool) -> * mut aws_allocator ; } extern "C" { pub fn aws_small_block_allocator_destroy (sba_allocator : * mut aws_allocator) ; } extern "C" { pub fn aws_small_block_allocator_bytes_active (sba_allocator : * mut aws_allocator) -> usize ; } extern "C" { pub fn aws_small_block_allocator_bytes_reserved (sba_allocator : * mut aws_allocator) -> usize ; } extern "C" { pub fn aws_small_block_allocator_page_size (sba_allocator : * mut aws_allocator) -> usize ; } extern "C" { pub fn aws_small_block_allocator_page_size_available (sba_allocator : * mut aws_allocator) -> usize ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_error_info { pub error_code : :: libc :: c_int , pub literal_name : * const :: libc :: c_char , pub error_str : * const :: libc :: c_char , pub lib_name : * const :: libc :: c_char , pub formatted_name : * const :: libc :: c_char , } # [test] fn bindgen_test_layout_aws_error_info () { const UNINIT : :: std :: mem :: MaybeUninit < aws_error_info > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_error_info > () , 40usize , concat ! ("Size of: " , stringify ! (aws_error_info))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_error_info > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_error_info))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_code) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_error_info) , "::" , stringify ! (error_code))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . literal_name) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_error_info) , "::" , stringify ! (literal_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_str) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_error_info) , "::" , stringify ! (error_str))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . lib_name) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_error_info) , "::" , stringify ! (lib_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . formatted_name) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_error_info) , "::" , stringify ! (formatted_name))) ; } impl Default for aws_error_info { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_error_info_list { pub error_list : * const aws_error_info , pub count : u16 , } # [test] fn bindgen_test_layout_aws_error_info_list () { const UNINIT : :: std :: mem :: MaybeUninit < aws_error_info_list > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_error_info_list > () , 16usize , concat ! ("Size of: " , stringify ! (aws_error_info_list))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_error_info_list > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_error_info_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_list) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_error_info_list) , "::" , stringify ! (error_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . count) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_error_info_list) , "::" , stringify ! (count))) ; } impl Default for aws_error_info_list { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_error_handler_fn = :: std :: option :: Option < unsafe extern "C" fn (err : :: libc :: c_int , ctx : * mut :: libc :: c_void) > ; extern "C" { pub fn aws_last_error () -> :: libc :: c_int ; } extern "C" { pub fn aws_error_str (err : :: libc :: c_int) -> * const :: libc :: c_char ; } extern "C" { pub fn aws_error_name (err : :: libc :: c_int) -> * const :: libc :: c_char ; } extern "C" { pub fn aws_error_lib_name (err : :: libc :: c_int) -> * const :: libc :: c_char ; } extern "C" { pub fn aws_error_debug_str (err : :: libc :: c_int) -> * const :: libc :: c_char ; } extern "C" { pub fn aws_raise_error_private (err : :: libc :: c_int) ; } extern "C" { pub fn aws_raise_error (err : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { pub fn aws_reset_error () ; } extern "C" { pub fn aws_restore_error (err : :: libc :: c_int) ; } extern "C" { pub fn aws_set_global_error_handler_fn (handler : aws_error_handler_fn , ctx : * mut :: libc :: c_void) -> aws_error_handler_fn ; } extern "C" { pub fn aws_set_thread_local_error_handler_fn (handler : aws_error_handler_fn , ctx : * mut :: libc :: c_void) -> aws_error_handler_fn ; } extern "C" { # [doc = " TODO: this needs to be a private function (wait till we have the cmake story\n better before moving it though). It should be external for the purpose of\n other libs we own, but customers should not be able to hit it without going\n out of their way to do so."] pub fn aws_register_error_info (error_info : * const aws_error_info_list) ; } extern "C" { pub fn aws_unregister_error_info (error_info : * const aws_error_info_list) ; } extern "C" { # [doc = " Convert a c library io error into an aws error, and raise it.\n If no conversion is found, AWS_ERROR_SYS_CALL_FAILURE is raised.\n Always returns AWS_OP_ERR."] pub fn aws_translate_and_raise_io_error (error_no : :: libc :: c_int) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_common_error { AWS_ERROR_SUCCESS = 0 , AWS_ERROR_OOM = 1 , AWS_ERROR_NO_SPACE = 2 , AWS_ERROR_UNKNOWN = 3 , AWS_ERROR_SHORT_BUFFER = 4 , AWS_ERROR_OVERFLOW_DETECTED = 5 , AWS_ERROR_UNSUPPORTED_OPERATION = 6 , AWS_ERROR_INVALID_BUFFER_SIZE = 7 , AWS_ERROR_INVALID_HEX_STR = 8 , AWS_ERROR_INVALID_BASE64_STR = 9 , AWS_ERROR_INVALID_INDEX = 10 , AWS_ERROR_THREAD_INVALID_SETTINGS = 11 , AWS_ERROR_THREAD_INSUFFICIENT_RESOURCE = 12 , AWS_ERROR_THREAD_NO_PERMISSIONS = 13 , AWS_ERROR_THREAD_NOT_JOINABLE = 14 , AWS_ERROR_THREAD_NO_SUCH_THREAD_ID = 15 , AWS_ERROR_THREAD_DEADLOCK_DETECTED = 16 , AWS_ERROR_MUTEX_NOT_INIT = 17 , AWS_ERROR_MUTEX_TIMEOUT = 18 , AWS_ERROR_MUTEX_CALLER_NOT_OWNER = 19 , AWS_ERROR_MUTEX_FAILED = 20 , AWS_ERROR_COND_VARIABLE_INIT_FAILED = 21 , AWS_ERROR_COND_VARIABLE_TIMED_OUT = 22 , AWS_ERROR_COND_VARIABLE_ERROR_UNKNOWN = 23 , AWS_ERROR_CLOCK_FAILURE = 24 , AWS_ERROR_LIST_EMPTY = 25 , AWS_ERROR_DEST_COPY_TOO_SMALL = 26 , AWS_ERROR_LIST_EXCEEDS_MAX_SIZE = 27 , AWS_ERROR_LIST_STATIC_MODE_CANT_SHRINK = 28 , AWS_ERROR_PRIORITY_QUEUE_FULL = 29 , AWS_ERROR_PRIORITY_QUEUE_EMPTY = 30 , AWS_ERROR_PRIORITY_QUEUE_BAD_NODE = 31 , AWS_ERROR_HASHTBL_ITEM_NOT_FOUND = 32 , AWS_ERROR_INVALID_DATE_STR = 33 , AWS_ERROR_INVALID_ARGUMENT = 34 , AWS_ERROR_RANDOM_GEN_FAILED = 35 , AWS_ERROR_MALFORMED_INPUT_STRING = 36 , AWS_ERROR_UNIMPLEMENTED = 37 , AWS_ERROR_INVALID_STATE = 38 , AWS_ERROR_ENVIRONMENT_GET = 39 , AWS_ERROR_ENVIRONMENT_SET = 40 , AWS_ERROR_ENVIRONMENT_UNSET = 41 , AWS_ERROR_STREAM_UNSEEKABLE = 42 , AWS_ERROR_NO_PERMISSION = 43 , AWS_ERROR_FILE_INVALID_PATH = 44 , AWS_ERROR_MAX_FDS_EXCEEDED = 45 , AWS_ERROR_SYS_CALL_FAILURE = 46 , AWS_ERROR_C_STRING_BUFFER_NOT_NULL_TERMINATED = 47 , AWS_ERROR_STRING_MATCH_NOT_FOUND = 48 , AWS_ERROR_DIVIDE_BY_ZERO = 49 , AWS_ERROR_INVALID_FILE_HANDLE = 50 , AWS_ERROR_OPERATION_INTERUPTED = 51 , AWS_ERROR_DIRECTORY_NOT_EMPTY = 52 , AWS_ERROR_PLATFORM_NOT_SUPPORTED = 53 , AWS_ERROR_INVALID_UTF8 = 54 , AWS_ERROR_GET_HOME_DIRECTORY_FAILED = 55 , AWS_ERROR_INVALID_XML = 56 , AWS_ERROR_END_COMMON_RANGE = 1023 , } extern "C" { # [doc = " Returns whether each byte is zero."] pub fn aws_is_mem_zeroed (buf : * const :: libc :: c_void , bufsize : usize) -> bool ; } extern "C" { # [doc = " Securely zeroes a memory buffer. This function will attempt to ensure that\n the compiler will not optimize away this zeroing operation."] pub fn aws_secure_zero (pBuf : * mut :: libc :: c_void , bufsize : usize) ; } extern "C" { # [doc = " Initializes internal data structures used by aws-c-common.\n Must be called before using any functionality in aws-c-common."] pub fn aws_common_library_init (allocator : * mut aws_allocator) ; } extern "C" { # [doc = " Shuts down the internal data structures used by aws-c-common."] pub fn aws_common_library_clean_up () ; } extern "C" { pub fn aws_common_fatal_assert_library_initialized () ; } extern "C" { # [doc = " Multiplies a * b. If the result overflows, returns 2^64 - 1."] pub fn aws_mul_u64_saturating (a : u64 , b : u64) -> u64 ; } extern "C" { # [doc = " If a * b overflows, returns AWS_OP_ERR; otherwise multiplies\n a * b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_mul_u64_checked (a : u64 , b : u64 , r : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Multiplies a * b. If the result overflows, returns 2^32 - 1."] pub fn aws_mul_u32_saturating (a : u32 , b : u32) -> u32 ; } extern "C" { # [doc = " If a * b overflows, returns AWS_OP_ERR; otherwise multiplies\n a * b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_mul_u32_checked (a : u32 , b : u32 , r : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Adds a + b. If the result overflows returns 2^64 - 1."] pub fn aws_add_u64_saturating (a : u64 , b : u64) -> u64 ; } extern "C" { # [doc = " If a + b overflows, returns AWS_OP_ERR; otherwise adds\n a + b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_add_u64_checked (a : u64 , b : u64 , r : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Adds a + b. If the result overflows returns 2^32 - 1."] pub fn aws_add_u32_saturating (a : u32 , b : u32) -> u32 ; } extern "C" { # [doc = " If a + b overflows, returns AWS_OP_ERR; otherwise adds\n a + b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_add_u32_checked (a : u32 , b : u32 , r : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Subtracts a - b. If the result overflows returns 0."] pub fn aws_sub_u64_saturating (a : u64 , b : u64) -> u64 ; } extern "C" { # [doc = " If a - b overflows, returns AWS_OP_ERR; otherwise subtracts\n a - b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_sub_u64_checked (a : u64 , b : u64 , r : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Subtracts a - b. If the result overflows returns 0."] pub fn aws_sub_u32_saturating (a : u32 , b : u32) -> u32 ; } extern "C" { # [doc = " If a - b overflows, returns AWS_OP_ERR; otherwise subtracts\n a - b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_sub_u32_checked (a : u32 , b : u32 , r : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Multiplies a * b. If the result overflows, returns SIZE_MAX."] pub fn aws_mul_size_saturating (a : usize , b : usize) -> usize ; } extern "C" { # [doc = " Multiplies a * b and returns the result in *r. If the result\n overflows, returns AWS_OP_ERR; otherwise returns AWS_OP_SUCCESS."] pub fn aws_mul_size_checked (a : usize , b : usize , r : * mut usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Adds a + b. If the result overflows returns SIZE_MAX."] pub fn aws_add_size_saturating (a : usize , b : usize) -> usize ; } extern "C" { # [doc = " Adds a + b and returns the result in *r. If the result\n overflows, returns AWS_OP_ERR; otherwise returns AWS_OP_SUCCESS."] pub fn aws_add_size_checked (a : usize , b : usize , r : * mut usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Adds [num] arguments (expected to be of size_t), and returns the result in *r.\n If the result overflows, returns AWS_OP_ERR; otherwise returns AWS_OP_SUCCESS."] pub fn aws_add_size_checked_varargs (num : usize , r : * mut usize , ...) -> :: libc :: c_int ; } extern "C" { # [doc = " Subtracts a - b. If the result overflows returns 0."] pub fn aws_sub_size_saturating (a : usize , b : usize) -> usize ; } extern "C" { # [doc = " If a - b overflows, returns AWS_OP_ERR; otherwise subtracts\n a - b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_sub_size_checked (a : usize , b : usize , r : * mut usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Function to check if x is power of 2"] pub fn aws_is_power_of_two (x : usize) -> bool ; } extern "C" { # [doc = " Function to find the smallest result that is power of 2 >= n. Returns AWS_OP_ERR if this cannot\n be done without overflow"] pub fn aws_round_up_to_power_of_two (n : usize , result : * mut usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Counts the number of leading 0 bits in an integer. 0 will return the size of the integer in bits."] pub fn aws_clz_u32 (n : u32) -> usize ; } extern "C" { pub fn aws_clz_i32 (n : i32) -> usize ; } extern "C" { pub fn aws_clz_u64 (n : u64) -> usize ; } extern "C" { pub fn aws_clz_i64 (n : i64) -> usize ; } extern "C" { pub fn aws_clz_size (n : usize) -> usize ; } extern "C" { # [doc = " Counts the number of trailing 0 bits in an integer. 0 will return the size of the integer in bits."] pub fn aws_ctz_u32 (n : u32) -> usize ; } extern "C" { pub fn aws_ctz_i32 (n : i32) -> usize ; } extern "C" { pub fn aws_ctz_u64 (n : u64) -> usize ; } extern "C" { pub fn aws_ctz_i64 (n : i64) -> usize ; } extern "C" { pub fn aws_ctz_size (n : usize) -> usize ; } extern "C" { pub fn aws_min_u8 (a : u8 , b : u8) -> u8 ; } extern "C" { pub fn aws_max_u8 (a : u8 , b : u8) -> u8 ; } extern "C" { pub fn aws_min_i8 (a : i8 , b : i8) -> i8 ; } extern "C" { pub fn aws_max_i8 (a : i8 , b : i8) -> i8 ; } extern "C" { pub fn aws_min_u16 (a : u16 , b : u16) -> u16 ; } extern "C" { pub fn aws_max_u16 (a : u16 , b : u16) -> u16 ; } extern "C" { pub fn aws_min_i16 (a : i16 , b : i16) -> i16 ; } extern "C" { pub fn aws_max_i16 (a : i16 , b : i16) -> i16 ; } extern "C" { pub fn aws_min_u32 (a : u32 , b : u32) -> u32 ; } extern "C" { pub fn aws_max_u32 (a : u32 , b : u32) -> u32 ; } extern "C" { pub fn aws_min_i32 (a : i32 , b : i32) -> i32 ; } extern "C" { pub fn aws_max_i32 (a : i32 , b : i32) -> i32 ; } extern "C" { pub fn aws_min_u64 (a : u64 , b : u64) -> u64 ; } extern "C" { pub fn aws_max_u64 (a : u64 , b : u64) -> u64 ; } extern "C" { pub fn aws_min_i64 (a : i64 , b : i64) -> i64 ; } extern "C" { pub fn aws_max_i64 (a : i64 , b : i64) -> i64 ; } extern "C" { pub fn aws_min_size (a : usize , b : usize) -> usize ; } extern "C" { pub fn aws_max_size (a : usize , b : usize) -> usize ; } extern "C" { pub fn aws_min_int (a : :: libc :: c_int , b : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { pub fn aws_max_int (a : :: libc :: c_int , b : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { pub fn aws_min_float (a : f32 , b : f32) -> f32 ; } extern "C" { pub fn aws_max_float (a : f32 , b : f32) -> f32 ; } extern "C" { pub fn aws_min_double (a : f64 , b : f64) -> f64 ; } extern "C" { pub fn aws_max_double (a : f64 , b : f64) -> f64 ; } pub const AWS_ARRAY_LIST_DEBUG_FILL : _bindgen_ty_19 = _bindgen_ty_19 :: AWS_ARRAY_LIST_DEBUG_FILL ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_19 { AWS_ARRAY_LIST_DEBUG_FILL = 221 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_array_list { pub alloc : * mut aws_allocator , pub current_size : usize , pub length : usize , pub item_size : usize , pub data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_array_list () { const UNINIT : :: std :: mem :: MaybeUninit < aws_array_list > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_array_list > () , 40usize , concat ! ("Size of: " , stringify ! (aws_array_list))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_array_list > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_array_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_array_list) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . current_size) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_array_list) , "::" , stringify ! (current_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . length) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_array_list) , "::" , stringify ! (length))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . item_size) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_array_list) , "::" , stringify ! (item_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . data) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_array_list) , "::" , stringify ! (data))) ; } impl Default for aws_array_list { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Prototype for a comparator function for sorting elements.\n\n a and b should be cast to pointers to the element type held in the list\n before being dereferenced. The function should compare the elements and\n return a positive number if a > b, zero if a = b, and a negative number\n if a < b."] pub type aws_array_list_comparator_fn = :: std :: option :: Option < unsafe extern "C" fn (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> :: libc :: c_int > ; extern "C" { # [doc = " Initializes an array list with an array of size initial_item_allocation * item_size. In this mode, the array size\n will grow by a factor of 2 upon insertion if space is not available. initial_item_allocation is the number of\n elements you want space allocated for. item_size is the size of each element in bytes. Mixing items types is not\n supported by this API."] pub fn aws_array_list_init_dynamic (list : * mut aws_array_list , alloc : * mut aws_allocator , initial_item_allocation : usize , item_size : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Initializes an array list with a preallocated array of void *. item_count is the number of elements in the array,\n and item_size is the size in bytes of each element. Mixing items types is not supported\n by this API. Once this list is full, new items will be rejected."] pub fn aws_array_list_init_static (list : * mut aws_array_list , raw_array : * mut :: libc :: c_void , item_count : usize , item_size : usize) ; } extern "C" { # [doc = " Initializes an array list with a preallocated array of *already-initialized* elements. item_count is the number of\n elements in the array, and item_size is the size in bytes of each element.\n\n Once initialized, nothing further can be added to the list, since it will be full and cannot resize.\n\n Primary use case is to treat an already-initialized C array as an array list."] pub fn aws_array_list_init_static_from_initialized (list : * mut aws_array_list , raw_array : * mut :: libc :: c_void , item_count : usize , item_size : usize) ; } extern "C" { # [doc = " Set of properties of a valid aws_array_list."] pub fn aws_array_list_is_valid (list : * const aws_array_list) -> bool ; } extern "C" { # [doc = " Deallocates any memory that was allocated for this list, and resets list for reuse or deletion."] pub fn aws_array_list_clean_up (list : * mut aws_array_list) ; } extern "C" { # [doc = " Erases and then deallocates any memory that was allocated for this list, and resets list for reuse or deletion."] pub fn aws_array_list_clean_up_secure (list : * mut aws_array_list) ; } extern "C" { # [doc = " Pushes the memory pointed to by val onto the end of internal list"] pub fn aws_array_list_push_back (list : * mut aws_array_list , val : * const :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the element at the front of the list if it exists. If list is empty, AWS_ERROR_LIST_EMPTY will be raised"] pub fn aws_array_list_front (list : * const aws_array_list , val : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Pushes the memory pointed to by val onto the front of internal list.\n This call results in shifting all of the elements in the list. Avoid this call unless that\n is intended behavior."] pub fn aws_array_list_push_front (list : * mut aws_array_list , val : * const :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Deletes the element at the front of the list if it exists. If list is empty, AWS_ERROR_LIST_EMPTY will be raised.\n This call results in shifting all of the elements at the end of the array to the front. Avoid this call unless that\n is intended behavior."] pub fn aws_array_list_pop_front (list : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Delete N elements from the front of the list.\n Remaining elements are shifted to the front of the list.\n If the list has less than N elements, the list is cleared.\n This call is more efficient than calling aws_array_list_pop_front() N times."] pub fn aws_array_list_pop_front_n (list : * mut aws_array_list , n : usize) ; } extern "C" { # [doc = " Deletes the element this index in the list if it exists.\n If element does not exist, AWS_ERROR_INVALID_INDEX will be raised.\n This call results in shifting all remaining elements towards the front.\n Avoid this call unless that is intended behavior."] pub fn aws_array_list_erase (list : * mut aws_array_list , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the element at the end of the list if it exists. If list is empty, AWS_ERROR_LIST_EMPTY will be raised."] pub fn aws_array_list_back (list : * const aws_array_list , val : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Deletes the element at the end of the list if it exists. If list is empty, AWS_ERROR_LIST_EMPTY will be raised."] pub fn aws_array_list_pop_back (list : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Clears all elements in the array and resets length to zero. Size does not change in this operation."] pub fn aws_array_list_clear (list : * mut aws_array_list) ; } extern "C" { # [doc = " If in dynamic mode, shrinks the allocated array size to the minimum amount necessary to store its elements."] pub fn aws_array_list_shrink_to_fit (list : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the elements from from to to. If to is in static mode, it must at least be the same length as from. Any data\n in to will be overwritten in this copy."] pub fn aws_array_list_copy (from : * const aws_array_list , to : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Swap contents between two dynamic lists. Both lists must use the same allocator."] pub fn aws_array_list_swap_contents (list_a : * mut aws_array_list , list_b : * mut aws_array_list) ; } extern "C" { # [doc = " Returns the number of elements that can fit in the internal array. If list is initialized in dynamic mode,\n the capacity changes over time."] pub fn aws_array_list_capacity (list : * const aws_array_list) -> usize ; } extern "C" { # [doc = " Returns the number of elements in the internal array."] pub fn aws_array_list_length (list : * const aws_array_list) -> usize ; } extern "C" { # [doc = " Copies the memory at index to val. If element does not exist, AWS_ERROR_INVALID_INDEX will be raised."] pub fn aws_array_list_get_at (list : * const aws_array_list , val : * mut :: libc :: c_void , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the memory address of the element at index to *val. If element does not exist, AWS_ERROR_INVALID_INDEX will be\n raised."] pub fn aws_array_list_get_at_ptr (list : * const aws_array_list , val : * mut * mut :: libc :: c_void , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Ensures that the array list has enough capacity to store a value at the specified index. If there is not already\n enough capacity, and the list is in dynamic mode, this function will attempt to allocate more memory, expanding the\n list. In static mode, if 'index' is beyond the maximum index, AWS_ERROR_INVALID_INDEX will be raised."] pub fn aws_array_list_ensure_capacity (list : * mut aws_array_list , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the the memory pointed to by val into the array at index. If in dynamic mode, the size will grow by a factor\n of two when the array is full. In static mode, AWS_ERROR_INVALID_INDEX will be raised if the index is past the bounds\n of the array."] pub fn aws_array_list_set_at (list : * mut aws_array_list , val : * const :: libc :: c_void , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Swap elements at the specified indices, which must be within the bounds of the array."] pub fn aws_array_list_swap (list : * mut aws_array_list , a : usize , b : usize) ; } extern "C" { # [doc = " Sort elements in the list in-place according to the comparator function."] pub fn aws_array_list_sort (list : * mut aws_array_list , compare_fn : aws_array_list_comparator_fn) ; } extern "C" { # [doc = " Returns 1 if machine is big endian, 0 if little endian.\n If you compile with even -O1 optimization, this check is completely optimized\n out at compile time and code which calls \"if (aws_is_big_endian())\" will do\n the right thing without branching."] pub fn aws_is_big_endian () -> :: libc :: c_int ; } extern "C" { # [doc = " Convert 64 bit integer from host to network byte order."] pub fn aws_hton64 (x : u64) -> u64 ; } extern "C" { # [doc = " Convert 64 bit integer from network to host byte order."] pub fn aws_ntoh64 (x : u64) -> u64 ; } extern "C" { # [doc = " Convert 32 bit integer from host to network byte order."] pub fn aws_hton32 (x : u32) -> u32 ; } extern "C" { # [doc = " Convert 32 bit float from host to network byte order."] pub fn aws_htonf32 (x : f32) -> f32 ; } extern "C" { # [doc = " Convert 64 bit double from host to network byte order."] pub fn aws_htonf64 (x : f64) -> f64 ; } extern "C" { # [doc = " Convert 32 bit integer from network to host byte order."] pub fn aws_ntoh32 (x : u32) -> u32 ; } extern "C" { # [doc = " Convert 32 bit float from network to host byte order."] pub fn aws_ntohf32 (x : f32) -> f32 ; } extern "C" { # [doc = " Convert 32 bit float from network to host byte order."] pub fn aws_ntohf64 (x : f64) -> f64 ; } extern "C" { # [doc = " Convert 16 bit integer from host to network byte order."] pub fn aws_hton16 (x : u16) -> u16 ; } extern "C" { # [doc = " Convert 16 bit integer from network to host byte order."] pub fn aws_ntoh16 (x : u16) -> u16 ; } # [doc = " Represents a length-delimited binary string or buffer. If byte buffer points\n to constant memory or memory that should otherwise not be freed by this\n struct, set allocator to NULL and free function will be a no-op.\n\n This structure used to define the output for all functions that write to a buffer.\n\n Note that this structure allocates memory at the buffer pointer only. The\n struct itself does not get dynamically allocated and must be either\n maintained or copied to avoid losing access to the memory."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_byte_buf { pub len : usize , pub buffer : * mut u8 , pub capacity : usize , pub allocator : * mut aws_allocator , } # [test] fn bindgen_test_layout_aws_byte_buf () { const UNINIT : :: std :: mem :: MaybeUninit < aws_byte_buf > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_byte_buf > () , 32usize , concat ! ("Size of: " , stringify ! (aws_byte_buf))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_byte_buf > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_byte_buf))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . len) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_byte_buf) , "::" , stringify ! (len))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . buffer) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_byte_buf) , "::" , stringify ! (buffer))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . capacity) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_byte_buf) , "::" , stringify ! (capacity))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_byte_buf) , "::" , stringify ! (allocator))) ; } impl Default for aws_byte_buf { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Represents a movable pointer within a larger binary string or buffer.\n\n This structure is used to define buffers for reading."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_byte_cursor { pub len : usize , pub ptr : * mut u8 , } # [test] fn bindgen_test_layout_aws_byte_cursor () { const UNINIT : :: std :: mem :: MaybeUninit < aws_byte_cursor > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_byte_cursor > () , 16usize , concat ! ("Size of: " , stringify ! (aws_byte_cursor))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_byte_cursor > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_byte_cursor))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . len) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_byte_cursor) , "::" , stringify ! (len))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ptr) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_byte_cursor) , "::" , stringify ! (ptr))) ; } impl Default for aws_byte_cursor { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Signature for function argument to trim APIs"] pub type aws_byte_predicate_fn = :: std :: option :: Option < unsafe extern "C" fn (value : u8) -> bool > ; extern "C" { # [doc = " Compare two arrays.\n Return whether their contents are equivalent.\n NULL may be passed as the array pointer if its length is declared to be 0."] pub fn aws_array_eq (array_a : * const :: libc :: c_void , len_a : usize , array_b : * const :: libc :: c_void , len_b : usize) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of two arrays.\n Return whether their contents are equivalent.\n NULL may be passed as the array pointer if its length is declared to be 0.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_array_eq_ignore_case (array_a : * const :: libc :: c_void , len_a : usize , array_b : * const :: libc :: c_void , len_b : usize) -> bool ; } extern "C" { # [doc = " Compare an array and a null-terminated string.\n Returns true if their contents are equivalent.\n The array should NOT contain a null-terminator, or the comparison will always return false.\n NULL may be passed as the array pointer if its length is declared to be 0."] pub fn aws_array_eq_c_str (array : * const :: libc :: c_void , array_len : usize , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of an array and a null-terminated string.\n Return whether their contents are equivalent.\n The array should NOT contain a null-terminator, or the comparison will always return false.\n NULL may be passed as the array pointer if its length is declared to be 0.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_array_eq_c_str_ignore_case (array : * const :: libc :: c_void , array_len : usize , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { pub fn aws_byte_buf_init (buf : * mut aws_byte_buf , allocator : * mut aws_allocator , capacity : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Initializes an aws_byte_buf structure base on another valid one.\n Requires: *src and *allocator are valid objects.\n Ensures: *dest is a valid aws_byte_buf with a new backing array dest->buffer\n which is a copy of the elements from src->buffer."] pub fn aws_byte_buf_init_copy (dest : * mut aws_byte_buf , allocator : * mut aws_allocator , src : * const aws_byte_buf) -> :: libc :: c_int ; } extern "C" { # [doc = " Reads 'filename' into 'out_buf'. If successful, 'out_buf' is allocated and filled with the data;\n It is your responsibility to call 'aws_byte_buf_clean_up()' on it. Otherwise, 'out_buf' remains\n unused. In the very unfortunate case where some API needs to treat out_buf as a c_string, a null terminator\n is appended, but is not included as part of the length field."] pub fn aws_byte_buf_init_from_file (out_buf : * mut aws_byte_buf , alloc : * mut aws_allocator , filename : * const :: libc :: c_char) -> :: libc :: c_int ; } extern "C" { # [doc = " Evaluates the set of properties that define the shape of all valid aws_byte_buf structures.\n It is also a cheap check, in the sense it run in constant time (i.e., no loops or recursion)."] pub fn aws_byte_buf_is_valid (buf : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Evaluates the set of properties that define the shape of all valid aws_byte_cursor structures.\n It is also a cheap check, in the sense it runs in constant time (i.e., no loops or recursion)."] pub fn aws_byte_cursor_is_valid (cursor : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Copies src buffer into dest and sets the correct len and capacity.\n A new memory zone is allocated for dest->buffer. When dest is no longer needed it will have to be cleaned-up using\n aws_byte_buf_clean_up(dest).\n Dest capacity and len will be equal to the src len. Allocator of the dest will be identical with parameter allocator.\n If src buffer is null the dest will have a null buffer with a len and a capacity of 0\n Returns AWS_OP_SUCCESS in case of success or AWS_OP_ERR when memory can't be allocated."] pub fn aws_byte_buf_init_copy_from_cursor (dest : * mut aws_byte_buf , allocator : * mut aws_allocator , src : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Init buffer with contents of multiple cursors, and update cursors to reference the memory stored in the buffer.\n Each cursor arg must be an `struct aws_byte_cursor *`. NULL must be passed as the final arg.\n NOTE: Do not append/grow/resize buffers initialized this way, or the cursors will end up referencing invalid memory.\n Returns AWS_OP_SUCCESS in case of success.\n AWS_OP_ERR is returned if memory can't be allocated or the total cursor length exceeds SIZE_MAX."] pub fn aws_byte_buf_init_cache_and_update_cursors (dest : * mut aws_byte_buf , allocator : * mut aws_allocator , ...) -> :: libc :: c_int ; } extern "C" { pub fn aws_byte_buf_clean_up (buf : * mut aws_byte_buf) ; } extern "C" { # [doc = " Equivalent to calling aws_byte_buf_secure_zero and then aws_byte_buf_clean_up\n on the buffer."] pub fn aws_byte_buf_clean_up_secure (buf : * mut aws_byte_buf) ; } extern "C" { # [doc = " Resets the len of the buffer to 0, but does not free the memory. The buffer can then be reused.\n Optionally zeroes the contents, if the \"zero_contents\" flag is true."] pub fn aws_byte_buf_reset (buf : * mut aws_byte_buf , zero_contents : bool) ; } extern "C" { # [doc = " Sets all bytes of buffer to zero and resets len to zero."] pub fn aws_byte_buf_secure_zero (buf : * mut aws_byte_buf) ; } extern "C" { # [doc = " Compare two aws_byte_buf structures.\n Return whether their contents are equivalent."] pub fn aws_byte_buf_eq (a : * const aws_byte_buf , b : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of two aws_byte_buf structures.\n Return whether their contents are equivalent.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_buf_eq_ignore_case (a : * const aws_byte_buf , b : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Compare an aws_byte_buf and a null-terminated string.\n Returns true if their contents are equivalent.\n The buffer should NOT contain a null-terminator, or the comparison will always return false."] pub fn aws_byte_buf_eq_c_str (buf : * const aws_byte_buf , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of an aws_byte_buf and a null-terminated string.\n Return whether their contents are equivalent.\n The buffer should NOT contain a null-terminator, or the comparison will always return false.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_buf_eq_c_str_ignore_case (buf : * const aws_byte_buf , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " No copies, no buffer allocations. Iterates over input_str, and returns the\n next substring between split_on instances relative to previous substr.\n Behaves similar to strtok with substr being used as state for next split.\n\n Returns true each time substr is set and false when there is no more splits\n (substr is set to empty in that case).\n\n Example usage.\n struct aws_byte_cursor substr = {0};\n while (aws_byte_cursor_next_split(&input_str, ';', &substr)) {\n // ...use substr...\n }\n\n Note: It is the user's responsibility zero-initialize substr before the first call.\n\n Edge case rules are as follows:\n empty input will have single empty split. ex. \"\" splits into \"\"\n if input starts with split_on then first split is empty. ex \";A\" splits into \"\", \"A\"\n adjacent split tokens result in empty split. ex \"A;;B\" splits into \"A\", \"\", \"B\"\n If the input ends with split_on, last split is empty. ex. \"A;\" splits into \"A\", \"\"\n\n It is the user's responsibility to make sure the input buffer stays in memory\n long enough to use the results."] pub fn aws_byte_cursor_next_split (input_str : * const aws_byte_cursor , split_on : :: libc :: c_char , substr : * mut aws_byte_cursor) -> bool ; } extern "C" { # [doc = " No copies, no buffer allocations. Fills in output with a list of\n aws_byte_cursor instances where buffer is an offset into the input_str and\n len is the length of that string in the original buffer.\n\n Edge case rules are as follows:\n if the input begins with split_on, an empty cursor will be the first entry in\n output. if the input has two adjacent split_on tokens, an empty cursor will\n be inserted into the output. if the input ends with split_on, an empty cursor\n will be appended to the output.\n\n It is the user's responsibility to properly initialize output. Recommended number of preallocated elements from\n output is your most likely guess for the upper bound of the number of elements resulting from the split.\n\n The type that will be stored in output is struct aws_byte_cursor (you'll need\n this for the item size param).\n\n It is the user's responsibility to make sure the input buffer stays in memory\n long enough to use the results."] pub fn aws_byte_cursor_split_on_char (input_str : * const aws_byte_cursor , split_on : :: libc :: c_char , output : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " No copies, no buffer allocations. Fills in output with a list of aws_byte_cursor instances where buffer is\n an offset into the input_str and len is the length of that string in the original buffer. N is the max number of\n splits, if this value is zero, it will add all splits to the output.\n\n Edge case rules are as follows:\n if the input begins with split_on, an empty cursor will be the first entry in output\n if the input has two adjacent split_on tokens, an empty cursor will be inserted into the output.\n if the input ends with split_on, an empty cursor will be appended to the output.\n\n It is the user's responsibility to properly initialize output. Recommended number of preallocated elements from\n output is your most likely guess for the upper bound of the number of elements resulting from the split.\n\n If the output array is not large enough, input_str will be updated to point to the first character after the last\n processed split_on instance.\n\n The type that will be stored in output is struct aws_byte_cursor (you'll need this for the item size param).\n\n It is the user's responsibility to make sure the input buffer stays in memory long enough to use the results."] pub fn aws_byte_cursor_split_on_char_n (input_str : * const aws_byte_cursor , split_on : :: libc :: c_char , n : usize , output : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Search for an exact byte match inside a cursor. The first match will be returned. Returns AWS_OP_SUCCESS\n on successful match and first_find will be set to the offset in input_str, and length will be the remaining length\n from input_str past the returned offset. If the match was not found, AWS_OP_ERR will be returned and\n AWS_ERROR_STRING_MATCH_NOT_FOUND will be raised."] pub fn aws_byte_cursor_find_exact (input_str : * const aws_byte_cursor , to_find : * const aws_byte_cursor , first_find : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Shrinks a byte cursor from the right for as long as the supplied predicate is true"] pub fn aws_byte_cursor_right_trim_pred (source : * const aws_byte_cursor , predicate : aws_byte_predicate_fn) -> aws_byte_cursor ; } extern "C" { # [doc = " Shrinks a byte cursor from the left for as long as the supplied predicate is true"] pub fn aws_byte_cursor_left_trim_pred (source : * const aws_byte_cursor , predicate : aws_byte_predicate_fn) -> aws_byte_cursor ; } extern "C" { # [doc = " Shrinks a byte cursor from both sides for as long as the supplied predicate is true"] pub fn aws_byte_cursor_trim_pred (source : * const aws_byte_cursor , predicate : aws_byte_predicate_fn) -> aws_byte_cursor ; } extern "C" { # [doc = " Returns true if the byte cursor's range of bytes all satisfy the predicate"] pub fn aws_byte_cursor_satisfies_pred (source : * const aws_byte_cursor , predicate : aws_byte_predicate_fn) -> bool ; } extern "C" { # [doc = " Copies from to to. If to is too small, AWS_ERROR_DEST_COPY_TOO_SMALL will be\n returned. dest->len will contain the amount of data actually copied to dest.\n\n from and to may be the same buffer, permitting copying a buffer into itself."] pub fn aws_byte_buf_append (to : * mut aws_byte_buf , from : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies from to to while converting bytes via the passed in lookup table.\n If to is too small, AWS_ERROR_DEST_COPY_TOO_SMALL will be\n returned. to->len will contain its original size plus the amount of data actually copied to to.\n\n from and to should not be the same buffer (overlap is not handled)\n lookup_table must be at least 256 bytes"] pub fn aws_byte_buf_append_with_lookup (to : * mut aws_byte_buf , from : * const aws_byte_cursor , lookup_table : * const u8) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies from to to. If to is too small, the buffer will be grown appropriately and\n the old contents copied to, before the new contents are appended.\n\n If the grow fails (overflow or OOM), then an error will be returned.\n\n from and to may be the same buffer, permitting copying a buffer into itself."] pub fn aws_byte_buf_append_dynamic (to : * mut aws_byte_buf , from : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies `from` to `to`. If `to` is too small, the buffer will be grown appropriately and\n the old contents copied over, before the new contents are appended.\n\n If the grow fails (overflow or OOM), then an error will be returned.\n\n If the buffer is grown, the old buffer will be securely cleared before getting freed.\n\n `from` and `to` may be the same buffer, permitting copying a buffer into itself."] pub fn aws_byte_buf_append_dynamic_secure (to : * mut aws_byte_buf , from : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies a single byte into `to`. If `to` is too small, the buffer will be grown appropriately and\n the old contents copied over, before the byte is appended.\n\n If the grow fails (overflow or OOM), then an error will be returned."] pub fn aws_byte_buf_append_byte_dynamic (buffer : * mut aws_byte_buf , value : u8) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies a single byte into `to`. If `to` is too small, the buffer will be grown appropriately and\n the old contents copied over, before the byte is appended.\n\n If the grow fails (overflow or OOM), then an error will be returned.\n\n If the buffer is grown, the old buffer will be securely cleared before getting freed."] pub fn aws_byte_buf_append_byte_dynamic_secure (buffer : * mut aws_byte_buf , value : u8) -> :: libc :: c_int ; } extern "C" { # [doc = " Copy contents of cursor to buffer, then update cursor to reference the memory stored in the buffer.\n If buffer is too small, AWS_ERROR_DEST_COPY_TOO_SMALL will be returned.\n\n The cursor is permitted to reference memory from earlier in the buffer."] pub fn aws_byte_buf_append_and_update (to : * mut aws_byte_buf , from_and_update : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Appends '\\0' at the end of the buffer."] pub fn aws_byte_buf_append_null_terminator (buf : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { # [doc = " Attempts to increase the capacity of a buffer to the requested capacity\n\n If the the buffer's capacity is currently larger than the request capacity, the\n function does nothing (no shrink is performed)."] pub fn aws_byte_buf_reserve (buffer : * mut aws_byte_buf , requested_capacity : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Convenience function that attempts to increase the capacity of a buffer relative to the current\n length.\n\n aws_byte_buf_reserve_relative(buf, x) ~~ aws_byte_buf_reserve(buf, buf->len + x)\n"] pub fn aws_byte_buf_reserve_relative (buffer : * mut aws_byte_buf , additional_length : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Concatenates a variable number of struct aws_byte_buf * into destination.\n Number of args must be greater than 1. If dest is too small,\n AWS_ERROR_DEST_COPY_TOO_SMALL will be returned. dest->len will contain the\n amount of data actually copied to dest."] pub fn aws_byte_buf_cat (dest : * mut aws_byte_buf , number_of_args : usize , ...) -> :: libc :: c_int ; } extern "C" { # [doc = " Compare two aws_byte_cursor structures.\n Return whether their contents are equivalent."] pub fn aws_byte_cursor_eq (a : * const aws_byte_cursor , b : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of two aws_byte_cursor structures.\n Return whether their contents are equivalent.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_cursor_eq_ignore_case (a : * const aws_byte_cursor , b : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Compare an aws_byte_cursor and an aws_byte_buf.\n Return whether their contents are equivalent."] pub fn aws_byte_cursor_eq_byte_buf (a : * const aws_byte_cursor , b : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of an aws_byte_cursor and an aws_byte_buf.\n Return whether their contents are equivalent.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_cursor_eq_byte_buf_ignore_case (a : * const aws_byte_cursor , b : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Compare an aws_byte_cursor and a null-terminated string.\n Returns true if their contents are equivalent.\n The cursor should NOT contain a null-terminator, or the comparison will always return false."] pub fn aws_byte_cursor_eq_c_str (cursor : * const aws_byte_cursor , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of an aws_byte_cursor and a null-terminated string.\n Return whether their contents are equivalent.\n The cursor should NOT contain a null-terminator, or the comparison will always return false.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_cursor_eq_c_str_ignore_case (cursor : * const aws_byte_cursor , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Return true if the input starts with the prefix (exact byte comparison)."] pub fn aws_byte_cursor_starts_with (input : * const aws_byte_cursor , prefix : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Return true if the input starts with the prefix (case-insensitive).\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_cursor_starts_with_ignore_case (input : * const aws_byte_cursor , prefix : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Case-insensitive hash function for array containing ASCII or UTF-8 text."] pub fn aws_hash_array_ignore_case (array : * const :: libc :: c_void , len : usize) -> u64 ; } extern "C" { # [doc = " Case-insensitive hash function for aws_byte_cursors stored in an aws_hash_table.\n For case-sensitive hashing, use aws_hash_byte_cursor_ptr()."] pub fn aws_hash_byte_cursor_ptr_ignore_case (item : * const :: libc :: c_void) -> u64 ; } extern "C" { # [doc = " Returns a lookup table for bytes that is the identity transformation with the exception\n of uppercase ascii characters getting replaced with lowercase characters. Used in\n caseless comparisons."] pub fn aws_lookup_table_to_lower_get () -> * const u8 ; } extern "C" { # [doc = " Returns lookup table to go from ASCII/UTF-8 hex character to a number (0-15).\n Non-hex characters map to 255.\n Valid examples:\n '0' -> 0\n 'F' -> 15\n 'f' -> 15\n Invalid examples:\n ' ' -> 255\n 'Z' -> 255\n '\\0' -> 255"] pub fn aws_lookup_table_hex_to_num_get () -> * const u8 ; } extern "C" { # [doc = " Lexical (byte value) comparison of two byte cursors"] pub fn aws_byte_cursor_compare_lexical (lhs : * const aws_byte_cursor , rhs : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Lexical (byte value) comparison of two byte cursors where the raw values are sent through a lookup table first"] pub fn aws_byte_cursor_compare_lookup (lhs : * const aws_byte_cursor , rhs : * const aws_byte_cursor , lookup_table : * const u8) -> :: libc :: c_int ; } extern "C" { # [doc = " For creating a byte buffer from a null-terminated string literal."] pub fn aws_byte_buf_from_c_str (c_str : * const :: libc :: c_char) -> aws_byte_buf ; } extern "C" { pub fn aws_byte_buf_from_array (bytes : * const :: libc :: c_void , len : usize) -> aws_byte_buf ; } extern "C" { pub fn aws_byte_buf_from_empty_array (bytes : * const :: libc :: c_void , capacity : usize) -> aws_byte_buf ; } extern "C" { pub fn aws_byte_cursor_from_buf (buf : * const aws_byte_buf) -> aws_byte_cursor ; } extern "C" { pub fn aws_byte_cursor_from_c_str (c_str : * const :: libc :: c_char) -> aws_byte_cursor ; } extern "C" { pub fn aws_byte_cursor_from_array (bytes : * const :: libc :: c_void , len : usize) -> aws_byte_cursor ; } extern "C" { # [doc = " Tests if the given aws_byte_cursor has at least len bytes remaining. If so,\n *buf is advanced by len bytes (incrementing ->ptr and decrementing ->len),\n and an aws_byte_cursor referring to the first len bytes of the original *buf\n is returned. Otherwise, an aws_byte_cursor with ->ptr = NULL, ->len = 0 is\n returned.\n\n Note that if len is above (SIZE_MAX / 2), this function will also treat it as\n a buffer overflow, and return NULL without changing *buf."] pub fn aws_byte_cursor_advance (cursor : * mut aws_byte_cursor , len : usize) -> aws_byte_cursor ; } extern "C" { # [doc = " Behaves identically to aws_byte_cursor_advance, but avoids speculative\n execution potentially reading out-of-bounds pointers (by returning an\n empty ptr in such speculated paths).\n\n This should generally be done when using an untrusted or\n data-dependent value for 'len', to avoid speculating into a path where\n cursor->ptr points outside the true ptr length."] pub fn aws_byte_cursor_advance_nospec (cursor : * mut aws_byte_cursor , len : usize) -> aws_byte_cursor ; } extern "C" { # [doc = " Reads specified length of data from byte cursor and copies it to the\n destination array.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read (cur : * mut aws_byte_cursor , dest : * mut :: libc :: c_void , len : usize) -> bool ; } extern "C" { # [doc = " Reads as many bytes from cursor as size of buffer, and copies them to buffer.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_and_fill_buffer (cur : * mut aws_byte_cursor , dest : * mut aws_byte_buf) -> bool ; } extern "C" { # [doc = " Reads a single byte from cursor, placing it in *var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_u8 (cur : * mut aws_byte_cursor , var : * mut u8) -> bool ; } extern "C" { # [doc = " Reads a 16-bit value in network byte order from cur, and places it in host\n byte order into var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_be16 (cur : * mut aws_byte_cursor , var : * mut u16) -> bool ; } extern "C" { # [doc = " Reads an unsigned 24-bit value (3 bytes) in network byte order from cur,\n and places it in host byte order into 32-bit var.\n Ex: if cur's next 3 bytes are {0xAA, 0xBB, 0xCC}, then var becomes 0x00AABBCC.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_be24 (cur : * mut aws_byte_cursor , var : * mut u32) -> bool ; } extern "C" { # [doc = " Reads a 32-bit value in network byte order from cur, and places it in host\n byte order into var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_be32 (cur : * mut aws_byte_cursor , var : * mut u32) -> bool ; } extern "C" { # [doc = " Reads a 64-bit value in network byte order from cur, and places it in host\n byte order into var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_be64 (cur : * mut aws_byte_cursor , var : * mut u64) -> bool ; } extern "C" { # [doc = " Reads a 32-bit value in network byte order from cur, and places it in host\n byte order into var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_float_be32 (cur : * mut aws_byte_cursor , var : * mut f32) -> bool ; } extern "C" { # [doc = " Reads a 64-bit value in network byte order from cur, and places it in host\n byte order into var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_float_be64 (cur : * mut aws_byte_cursor , var : * mut f64) -> bool ; } extern "C" { # [doc = " Reads 2 hex characters from ASCII/UTF-8 text to produce an 8-bit number.\n Accepts both lowercase 'a'-'f' and uppercase 'A'-'F'.\n For example: \"0F\" produces 15.\n\n On success, returns true and advances the cursor by 2.\n If there is insufficient space in the cursor or an invalid character\n is encountered, returns false, leaving the cursor unchanged."] pub fn aws_byte_cursor_read_hex_u8 (cur : * mut aws_byte_cursor , var : * mut u8) -> bool ; } extern "C" { # [doc = " Appends a sub-buffer to the specified buffer.\n\n If the buffer has at least `len' bytes remaining (buffer->capacity - buffer->len >= len),\n then buffer->len is incremented by len, and an aws_byte_buf is assigned to *output corresponding\n to the last len bytes of the input buffer. The aws_byte_buf at *output will have a null\n allocator, a zero initial length, and a capacity of 'len'. The function then returns true.\n\n If there is insufficient space, then this function nulls all fields in *output and returns\n false."] pub fn aws_byte_buf_advance (buffer : * mut aws_byte_buf , output : * mut aws_byte_buf , len : usize) -> bool ; } extern "C" { # [doc = " Write specified number of bytes from array to byte buffer.\n\n On success, returns true and updates the buffer length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write (buf : * mut aws_byte_buf , src : * const u8 , len : usize) -> bool ; } extern "C" { # [doc = " Copies all bytes from buffer to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_from_whole_buffer (buf : * mut aws_byte_buf , src : aws_byte_buf) -> bool ; } extern "C" { # [doc = " Copies all bytes from buffer to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_from_whole_cursor (buf : * mut aws_byte_buf , src : aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Without increasing buf's capacity, write as much as possible from advancing_cursor into buf.\n\n buf's len is updated accordingly.\n advancing_cursor is advanced so it contains the remaining unwritten parts.\n Returns the section of advancing_cursor which was written.\n\n This function cannot fail. If buf is full (len == capacity) or advancing_len has 0 length,\n then buf and advancing_cursor are not altered and a cursor with 0 length is returned.\n\n Example: Given a buf with 2 bytes of space available and advancing_cursor with contents \"abc\".\n \"ab\" will be written to buf and buf->len will increase 2 and become equal to buf->capacity.\n advancing_cursor will advance so its contents become the unwritten \"c\".\n The returned cursor's contents will be the \"ab\" from the original advancing_cursor."] pub fn aws_byte_buf_write_to_capacity (buf : * mut aws_byte_buf , advancing_cursor : * mut aws_byte_cursor) -> aws_byte_cursor ; } extern "C" { # [doc = " Copies one byte to buffer.\n\n On success, returns true and updates the cursor /length\naccordingly.\n\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_u8 (buf : * mut aws_byte_buf , c : u8) -> bool ; } extern "C" { # [doc = " Writes one byte repeatedly to buffer (like memset)\n\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_u8_n (buf : * mut aws_byte_buf , c : u8 , count : usize) -> bool ; } extern "C" { # [doc = " Writes a 16-bit integer in network byte order (big endian) to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_be16 (buf : * mut aws_byte_buf , x : u16) -> bool ; } extern "C" { # [doc = " Writes low 24-bits (3 bytes) of an unsigned integer in network byte order (big endian) to buffer.\n Ex: If x is 0x00AABBCC then {0xAA, 0xBB, 0xCC} is written to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, or x's value cannot fit in 3 bytes,\n returns false, leaving the buffer unchanged."] pub fn aws_byte_buf_write_be24 (buf : * mut aws_byte_buf , x : u32) -> bool ; } extern "C" { # [doc = " Writes a 32-bit integer in network byte order (big endian) to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_be32 (buf : * mut aws_byte_buf , x : u32) -> bool ; } extern "C" { # [doc = " Writes a 32-bit float in network byte order (big endian) to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_float_be32 (buf : * mut aws_byte_buf , x : f32) -> bool ; } extern "C" { # [doc = " Writes a 64-bit integer in network byte order (big endian) to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_be64 (buf : * mut aws_byte_buf , x : u64) -> bool ; } extern "C" { # [doc = " Writes a 64-bit float in network byte order (big endian) to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_float_be64 (buf : * mut aws_byte_buf , x : f64) -> bool ; } extern "C" { # [doc = " Like isalnum(), but ignores C locale.\n Returns true if ch has the value of ASCII/UTF-8: 'a'-'z', 'A'-'Z', or '0'-'9'."] pub fn aws_isalnum (ch : u8) -> bool ; } extern "C" { # [doc = " Like isalpha(), but ignores C locale.\n Returns true if ch has the value of ASCII/UTF-8: 'a'-'z' or 'A'-'Z'."] pub fn aws_isalpha (ch : u8) -> bool ; } extern "C" { # [doc = " Like isdigit().\n Returns true if ch has the value of ASCII/UTF-8: '0'-'9'.\n\n Note: C's built-in isdigit() is also supposed to ignore the C locale,\n but cppreference.com claims \"some implementations (e.g. Microsoft in 1252 codepage)\n may classify additional single-byte characters as digits\""] pub fn aws_isdigit (ch : u8) -> bool ; } extern "C" { # [doc = " Like isxdigit().\n Returns true if ch has the value of ASCII/UTF-8: '0'-'9', 'a'-'f', or 'A'-'F'.\n\n Note: C's built-in isxdigit() is also supposed to ignore the C locale,\n but cppreference.com claims \"some implementations (e.g. Microsoft in 1252 codepage)\n may classify additional single-byte characters as digits\""] pub fn aws_isxdigit (ch : u8) -> bool ; } extern "C" { # [doc = " Like isspace(), but ignores C locale.\n Return true if ch has the value of ASCII/UTF-8: space (0x20), form feed (0x0C),\n line feed (0x0A), carriage return (0x0D), horizontal tab (0x09), or vertical tab (0x0B)."] pub fn aws_isspace (ch : u8) -> bool ; } extern "C" { # [doc = " Read entire cursor as ASCII/UTF-8 unsigned base-10 number.\n Stricter than strtoull(), which allows whitespace and inputs that start with \"0x\"\n\n Examples:\n \"0\" -> 0\n \"123\" -> 123\n \"00004\" -> 4 // leading zeros ok\n\n Rejects things like:\n \"-1\" // negative numbers not allowed\n \"1,000\" // only characters 0-9 allowed\n \"\" // blank string not allowed\n \" 0 \" // whitespace not allowed\n \"0x0\" // hex not allowed\n \"FF\" // hex not allowed\n \"999999999999999999999999999999999999999999\" // larger than max u64"] pub fn aws_byte_cursor_utf8_parse_u64 (cursor : aws_byte_cursor , dst : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Read entire cursor as ASCII/UTF-8 unsigned base-16 number with NO \"0x\" prefix.\n\n Examples:\n \"F\" -> 15\n \"000000ff\" -> 255 // leading zeros ok\n \"Ff\" -> 255 // mixed case ok\n \"123\" -> 291\n \"FFFFFFFFFFFFFFFF\" -> 18446744073709551616 // max u64\n\n Rejects things like:\n \"0x0\" // 0x prefix not allowed\n \"\" // blank string not allowed\n \" F \" // whitespace not allowed\n \"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\" // larger than max u64"] pub fn aws_byte_cursor_utf8_parse_u64_hex (cursor : aws_byte_cursor , dst : * mut u64) -> :: libc :: c_int ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_linked_list_node { pub next : * mut aws_linked_list_node , pub prev : * mut aws_linked_list_node , } # [test] fn bindgen_test_layout_aws_linked_list_node () { const UNINIT : :: std :: mem :: MaybeUninit < aws_linked_list_node > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_linked_list_node > () , 16usize , concat ! ("Size of: " , stringify ! (aws_linked_list_node))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_linked_list_node > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_linked_list_node))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . next) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_linked_list_node) , "::" , stringify ! (next))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . prev) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_linked_list_node) , "::" , stringify ! (prev))) ; } impl Default for aws_linked_list_node { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_linked_list { pub head : aws_linked_list_node , pub tail : aws_linked_list_node , } # [test] fn bindgen_test_layout_aws_linked_list () { const UNINIT : :: std :: mem :: MaybeUninit < aws_linked_list > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_linked_list > () , 32usize , concat ! ("Size of: " , stringify ! (aws_linked_list))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_linked_list > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_linked_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . head) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_linked_list) , "::" , stringify ! (head))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tail) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_linked_list) , "::" , stringify ! (tail))) ; } impl Default for aws_linked_list { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Set node's next and prev pointers to NULL."] pub fn aws_linked_list_node_reset (node : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Tests if the list is empty."] pub fn aws_linked_list_empty (list : * const aws_linked_list) -> bool ; } extern "C" { # [doc = " Checks that a linked list is valid."] pub fn aws_linked_list_is_valid (list : * const aws_linked_list) -> bool ; } extern "C" { # [doc = " Checks that the prev of the next pointer of a node points to the\n node. As this checks whether the [next] connection of a node is\n bidirectional, it returns false if used for the list tail."] pub fn aws_linked_list_node_next_is_valid (node : * const aws_linked_list_node) -> bool ; } extern "C" { # [doc = " Checks that the next of the prev pointer of a node points to the\n node. Similarly to the above, this returns false if used for the\n head of a list."] pub fn aws_linked_list_node_prev_is_valid (node : * const aws_linked_list_node) -> bool ; } extern "C" { # [doc = " Checks that a linked list satisfies double linked list connectivity\n constraints. This check is O(n) as it traverses the whole linked\n list to ensure that tail is reachable from head (and vice versa)\n and that every connection is bidirectional.\n\n Note: This check *cannot* go into an infinite loop, because we\n ensure that the connection to the next node is\n bidirectional. Therefore, if a node's [a] a.next is a previous node\n [b] in the list, b.prev != &a and so this check would fail, thus\n terminating the loop."] pub fn aws_linked_list_is_valid_deep (list : * const aws_linked_list) -> bool ; } extern "C" { # [doc = " Initializes the list. List will be empty after this call."] pub fn aws_linked_list_init (list : * mut aws_linked_list) ; } extern "C" { # [doc = " Returns an iteration pointer for the first element in the list."] pub fn aws_linked_list_begin (list : * const aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Returns an iteration pointer for one past the last element in the list."] pub fn aws_linked_list_end (list : * const aws_linked_list) -> * const aws_linked_list_node ; } extern "C" { # [doc = " Returns a pointer for the last element in the list.\n Used to begin iterating the list in reverse. Ex:\n for (i = aws_linked_list_rbegin(list); i != aws_linked_list_rend(list); i = aws_linked_list_prev(i)) {...}"] pub fn aws_linked_list_rbegin (list : * const aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Returns the pointer to one before the first element in the list.\n Used to end iterating the list in reverse."] pub fn aws_linked_list_rend (list : * const aws_linked_list) -> * const aws_linked_list_node ; } extern "C" { # [doc = " Returns the next element in the list."] pub fn aws_linked_list_next (node : * const aws_linked_list_node) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Returns the previous element in the list."] pub fn aws_linked_list_prev (node : * const aws_linked_list_node) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Inserts to_add immediately after after."] pub fn aws_linked_list_insert_after (after : * mut aws_linked_list_node , to_add : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Swaps the order two nodes in the linked list."] pub fn aws_linked_list_swap_nodes (a : * mut aws_linked_list_node , b : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Inserts to_add immediately before before."] pub fn aws_linked_list_insert_before (before : * mut aws_linked_list_node , to_add : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Removes the specified node from the list (prev/next point to each other) and\n returns the next node in the list."] pub fn aws_linked_list_remove (node : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Append new_node."] pub fn aws_linked_list_push_back (list : * mut aws_linked_list , node : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Returns the element in the back of the list."] pub fn aws_linked_list_back (list : * const aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Returns the element in the back of the list and removes it"] pub fn aws_linked_list_pop_back (list : * mut aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Prepend new_node."] pub fn aws_linked_list_push_front (list : * mut aws_linked_list , node : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Returns the element in the front of the list."] pub fn aws_linked_list_front (list : * const aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Returns the element in the front of the list and removes it"] pub fn aws_linked_list_pop_front (list : * mut aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { pub fn aws_linked_list_swap_contents (a : * mut aws_linked_list , b : * mut aws_linked_list) ; } extern "C" { # [doc = " Remove all nodes from one list, and add them to the back of another.\n\n Example: if dst={1,2} and src={3,4}, they become dst={1,2,3,4} and src={}"] pub fn aws_linked_list_move_all_back (dst : * mut aws_linked_list , src : * mut aws_linked_list) ; } extern "C" { # [doc = " Remove all nodes from one list, and add them to the front of another.\n\n Example: if dst={2,1} and src={4,3}, they become dst={4,3,2,1} and src={}"] pub fn aws_linked_list_move_all_front (dst : * mut aws_linked_list , src : * mut aws_linked_list) ; } # [repr (C)] # [derive (Copy , Clone)] pub struct aws_io_handle { pub data : aws_io_handle__bindgen_ty_1 , pub additional_data : * mut :: libc :: c_void , } # [repr (C)] # [derive (Copy , Clone)] pub union aws_io_handle__bindgen_ty_1 { pub fd : :: libc :: c_int , pub handle : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_io_handle__bindgen_ty_1 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_io_handle__bindgen_ty_1 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_io_handle__bindgen_ty_1 > () , 8usize , concat ! ("Size of: " , stringify ! (aws_io_handle__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_io_handle__bindgen_ty_1 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_io_handle__bindgen_ty_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . fd) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_io_handle__bindgen_ty_1) , "::" , stringify ! (fd))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . handle) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_io_handle__bindgen_ty_1) , "::" , stringify ! (handle))) ; } impl Default for aws_io_handle__bindgen_ty_1 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [test] fn bindgen_test_layout_aws_io_handle () { const UNINIT : :: std :: mem :: MaybeUninit < aws_io_handle > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_io_handle > () , 16usize , concat ! ("Size of: " , stringify ! (aws_io_handle))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_io_handle > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_io_handle))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . data) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_io_handle) , "::" , stringify ! (data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . additional_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_io_handle) , "::" , stringify ! (additional_data))) ; } impl Default for aws_io_handle { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_io_message_type { AWS_IO_MESSAGE_APPLICATION_DATA = 0 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_channel { _unused : [u8 ; 0] , } pub type aws_channel_on_message_write_completed_fn = :: std :: option :: Option < unsafe extern "C" fn (channel : * mut aws_channel , message : * mut aws_io_message , err_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_io_message { # [doc = " Allocator used for the message and message data. If this is null, the message belongs to a pool or some other\n message manager."] pub allocator : * mut aws_allocator , # [doc = " Buffer containing the data for message"] pub message_data : aws_byte_buf , # [doc = " type of the message. This is used for framework control messages. Currently the only type is\n AWS_IO_MESSAGE_APPLICATION_DATA"] pub message_type : aws_io_message_type , # [doc = " Conveys information about the contents of message_data (e.g. cast the ptr to some type). If 0, it's just opaque\n data."] pub message_tag : :: libc :: c_int , # [doc = " In order to avoid excess allocations/copies, on a partial read or write, the copy mark is set to indicate how\n much of this message has already been processed or copied."] pub copy_mark : usize , # [doc = " The channel that the message is bound to."] pub owning_channel : * mut aws_channel , # [doc = " Invoked by the channel once the entire message has been written to the data sink."] pub on_completion : aws_channel_on_message_write_completed_fn , # [doc = " arbitrary user data for the on_completion callback"] pub user_data : * mut :: libc :: c_void , # [doc = " it's incredibly likely something is going to need to queue this,\n go ahead and make sure the list info is part of the original allocation."] pub queueing_handle : aws_linked_list_node , } # [test] fn bindgen_test_layout_aws_io_message () { const UNINIT : :: std :: mem :: MaybeUninit < aws_io_message > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_io_message > () , 96usize , concat ! ("Size of: " , stringify ! (aws_io_message))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_io_message > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_io_message))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . message_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (message_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . message_type) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (message_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . message_tag) as usize - ptr as usize } , 44usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (message_tag))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . copy_mark) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (copy_mark))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . owning_channel) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (owning_channel))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_completion) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (on_completion))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . queueing_handle) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (queueing_handle))) ; } impl Default for aws_io_message { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_io_clock_fn = :: std :: option :: Option < unsafe extern "C" fn (timestamp : * mut u64) -> :: libc :: c_int > ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_io_errors { AWS_IO_CHANNEL_ERROR_ERROR_CANT_ACCEPT_INPUT = 1024 , AWS_IO_CHANNEL_UNKNOWN_MESSAGE_TYPE = 1025 , AWS_IO_CHANNEL_READ_WOULD_EXCEED_WINDOW = 1026 , AWS_IO_EVENT_LOOP_ALREADY_ASSIGNED = 1027 , AWS_IO_EVENT_LOOP_SHUTDOWN = 1028 , AWS_IO_TLS_ERROR_NEGOTIATION_FAILURE = 1029 , AWS_IO_TLS_ERROR_NOT_NEGOTIATED = 1030 , AWS_IO_TLS_ERROR_WRITE_FAILURE = 1031 , AWS_IO_TLS_ERROR_ALERT_RECEIVED = 1032 , AWS_IO_TLS_CTX_ERROR = 1033 , AWS_IO_TLS_VERSION_UNSUPPORTED = 1034 , AWS_IO_TLS_CIPHER_PREF_UNSUPPORTED = 1035 , AWS_IO_MISSING_ALPN_MESSAGE = 1036 , AWS_IO_UNHANDLED_ALPN_PROTOCOL_MESSAGE = 1037 , AWS_IO_FILE_VALIDATION_FAILURE = 1038 , AWS_ERROR_IO_EVENT_LOOP_THREAD_ONLY = 1039 , AWS_ERROR_IO_ALREADY_SUBSCRIBED = 1040 , AWS_ERROR_IO_NOT_SUBSCRIBED = 1041 , AWS_ERROR_IO_OPERATION_CANCELLED = 1042 , AWS_IO_READ_WOULD_BLOCK = 1043 , AWS_IO_BROKEN_PIPE = 1044 , AWS_IO_SOCKET_UNSUPPORTED_ADDRESS_FAMILY = 1045 , AWS_IO_SOCKET_INVALID_OPERATION_FOR_TYPE = 1046 , AWS_IO_SOCKET_CONNECTION_REFUSED = 1047 , AWS_IO_SOCKET_TIMEOUT = 1048 , AWS_IO_SOCKET_NO_ROUTE_TO_HOST = 1049 , AWS_IO_SOCKET_NETWORK_DOWN = 1050 , AWS_IO_SOCKET_CLOSED = 1051 , AWS_IO_SOCKET_NOT_CONNECTED = 1052 , AWS_IO_SOCKET_INVALID_OPTIONS = 1053 , AWS_IO_SOCKET_ADDRESS_IN_USE = 1054 , AWS_IO_SOCKET_INVALID_ADDRESS = 1055 , AWS_IO_SOCKET_ILLEGAL_OPERATION_FOR_STATE = 1056 , AWS_IO_SOCKET_CONNECT_ABORTED = 1057 , AWS_IO_DNS_QUERY_FAILED = 1058 , AWS_IO_DNS_INVALID_NAME = 1059 , AWS_IO_DNS_NO_ADDRESS_FOR_HOST = 1060 , AWS_IO_DNS_HOST_REMOVED_FROM_CACHE = 1061 , AWS_IO_STREAM_INVALID_SEEK_POSITION = 1062 , AWS_IO_STREAM_READ_FAILED = 1063 , DEPRECATED_AWS_IO_INVALID_FILE_HANDLE = 1064 , AWS_IO_SHARED_LIBRARY_LOAD_FAILURE = 1065 , AWS_IO_SHARED_LIBRARY_FIND_SYMBOL_FAILURE = 1066 , AWS_IO_TLS_NEGOTIATION_TIMEOUT = 1067 , AWS_IO_TLS_ALERT_NOT_GRACEFUL = 1068 , AWS_IO_MAX_RETRIES_EXCEEDED = 1069 , AWS_IO_RETRY_PERMISSION_DENIED = 1070 , AWS_IO_TLS_DIGEST_ALGORITHM_UNSUPPORTED = 1071 , AWS_IO_TLS_SIGNATURE_ALGORITHM_UNSUPPORTED = 1072 , AWS_ERROR_PKCS11_VERSION_UNSUPPORTED = 1073 , AWS_ERROR_PKCS11_TOKEN_NOT_FOUND = 1074 , AWS_ERROR_PKCS11_KEY_NOT_FOUND = 1075 , AWS_ERROR_PKCS11_KEY_TYPE_UNSUPPORTED = 1076 , AWS_ERROR_PKCS11_UNKNOWN_CRYPTOKI_RETURN_VALUE = 1077 , AWS_ERROR_PKCS11_CKR_CANCEL = 1078 , AWS_ERROR_PKCS11_CKR_HOST_MEMORY = 1079 , AWS_ERROR_PKCS11_CKR_SLOT_ID_INVALID = 1080 , AWS_ERROR_PKCS11_CKR_GENERAL_ERROR = 1081 , AWS_ERROR_PKCS11_CKR_FUNCTION_FAILED = 1082 , AWS_ERROR_PKCS11_CKR_ARGUMENTS_BAD = 1083 , AWS_ERROR_PKCS11_CKR_NO_EVENT = 1084 , AWS_ERROR_PKCS11_CKR_NEED_TO_CREATE_THREADS = 1085 , AWS_ERROR_PKCS11_CKR_CANT_LOCK = 1086 , AWS_ERROR_PKCS11_CKR_ATTRIBUTE_READ_ONLY = 1087 , AWS_ERROR_PKCS11_CKR_ATTRIBUTE_SENSITIVE = 1088 , AWS_ERROR_PKCS11_CKR_ATTRIBUTE_TYPE_INVALID = 1089 , AWS_ERROR_PKCS11_CKR_ATTRIBUTE_VALUE_INVALID = 1090 , AWS_ERROR_PKCS11_CKR_ACTION_PROHIBITED = 1091 , AWS_ERROR_PKCS11_CKR_DATA_INVALID = 1092 , AWS_ERROR_PKCS11_CKR_DATA_LEN_RANGE = 1093 , AWS_ERROR_PKCS11_CKR_DEVICE_ERROR = 1094 , AWS_ERROR_PKCS11_CKR_DEVICE_MEMORY = 1095 , AWS_ERROR_PKCS11_CKR_DEVICE_REMOVED = 1096 , AWS_ERROR_PKCS11_CKR_ENCRYPTED_DATA_INVALID = 1097 , AWS_ERROR_PKCS11_CKR_ENCRYPTED_DATA_LEN_RANGE = 1098 , AWS_ERROR_PKCS11_CKR_FUNCTION_CANCELED = 1099 , AWS_ERROR_PKCS11_CKR_FUNCTION_NOT_PARALLEL = 1100 , AWS_ERROR_PKCS11_CKR_FUNCTION_NOT_SUPPORTED = 1101 , AWS_ERROR_PKCS11_CKR_KEY_HANDLE_INVALID = 1102 , AWS_ERROR_PKCS11_CKR_KEY_SIZE_RANGE = 1103 , AWS_ERROR_PKCS11_CKR_KEY_TYPE_INCONSISTENT = 1104 , AWS_ERROR_PKCS11_CKR_KEY_NOT_NEEDED = 1105 , AWS_ERROR_PKCS11_CKR_KEY_CHANGED = 1106 , AWS_ERROR_PKCS11_CKR_KEY_NEEDED = 1107 , AWS_ERROR_PKCS11_CKR_KEY_INDIGESTIBLE = 1108 , AWS_ERROR_PKCS11_CKR_KEY_FUNCTION_NOT_PERMITTED = 1109 , AWS_ERROR_PKCS11_CKR_KEY_NOT_WRAPPABLE = 1110 , AWS_ERROR_PKCS11_CKR_KEY_UNEXTRACTABLE = 1111 , AWS_ERROR_PKCS11_CKR_MECHANISM_INVALID = 1112 , AWS_ERROR_PKCS11_CKR_MECHANISM_PARAM_INVALID = 1113 , AWS_ERROR_PKCS11_CKR_OBJECT_HANDLE_INVALID = 1114 , AWS_ERROR_PKCS11_CKR_OPERATION_ACTIVE = 1115 , AWS_ERROR_PKCS11_CKR_OPERATION_NOT_INITIALIZED = 1116 , AWS_ERROR_PKCS11_CKR_PIN_INCORRECT = 1117 , AWS_ERROR_PKCS11_CKR_PIN_INVALID = 1118 , AWS_ERROR_PKCS11_CKR_PIN_LEN_RANGE = 1119 , AWS_ERROR_PKCS11_CKR_PIN_EXPIRED = 1120 , AWS_ERROR_PKCS11_CKR_PIN_LOCKED = 1121 , AWS_ERROR_PKCS11_CKR_SESSION_CLOSED = 1122 , AWS_ERROR_PKCS11_CKR_SESSION_COUNT = 1123 , AWS_ERROR_PKCS11_CKR_SESSION_HANDLE_INVALID = 1124 , AWS_ERROR_PKCS11_CKR_SESSION_PARALLEL_NOT_SUPPORTED = 1125 , AWS_ERROR_PKCS11_CKR_SESSION_READ_ONLY = 1126 , AWS_ERROR_PKCS11_CKR_SESSION_EXISTS = 1127 , AWS_ERROR_PKCS11_CKR_SESSION_READ_ONLY_EXISTS = 1128 , AWS_ERROR_PKCS11_CKR_SESSION_READ_WRITE_SO_EXISTS = 1129 , AWS_ERROR_PKCS11_CKR_SIGNATURE_INVALID = 1130 , AWS_ERROR_PKCS11_CKR_SIGNATURE_LEN_RANGE = 1131 , AWS_ERROR_PKCS11_CKR_TEMPLATE_INCOMPLETE = 1132 , AWS_ERROR_PKCS11_CKR_TEMPLATE_INCONSISTENT = 1133 , AWS_ERROR_PKCS11_CKR_TOKEN_NOT_PRESENT = 1134 , AWS_ERROR_PKCS11_CKR_TOKEN_NOT_RECOGNIZED = 1135 , AWS_ERROR_PKCS11_CKR_TOKEN_WRITE_PROTECTED = 1136 , AWS_ERROR_PKCS11_CKR_UNWRAPPING_KEY_HANDLE_INVALID = 1137 , AWS_ERROR_PKCS11_CKR_UNWRAPPING_KEY_SIZE_RANGE = 1138 , AWS_ERROR_PKCS11_CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT = 1139 , AWS_ERROR_PKCS11_CKR_USER_ALREADY_LOGGED_IN = 1140 , AWS_ERROR_PKCS11_CKR_USER_NOT_LOGGED_IN = 1141 , AWS_ERROR_PKCS11_CKR_USER_PIN_NOT_INITIALIZED = 1142 , AWS_ERROR_PKCS11_CKR_USER_TYPE_INVALID = 1143 , AWS_ERROR_PKCS11_CKR_USER_ANOTHER_ALREADY_LOGGED_IN = 1144 , AWS_ERROR_PKCS11_CKR_USER_TOO_MANY_TYPES = 1145 , AWS_ERROR_PKCS11_CKR_WRAPPED_KEY_INVALID = 1146 , AWS_ERROR_PKCS11_CKR_WRAPPED_KEY_LEN_RANGE = 1147 , AWS_ERROR_PKCS11_CKR_WRAPPING_KEY_HANDLE_INVALID = 1148 , AWS_ERROR_PKCS11_CKR_WRAPPING_KEY_SIZE_RANGE = 1149 , AWS_ERROR_PKCS11_CKR_WRAPPING_KEY_TYPE_INCONSISTENT = 1150 , AWS_ERROR_PKCS11_CKR_RANDOM_SEED_NOT_SUPPORTED = 1151 , AWS_ERROR_PKCS11_CKR_RANDOM_NO_RNG = 1152 , AWS_ERROR_PKCS11_CKR_DOMAIN_PARAMS_INVALID = 1153 , AWS_ERROR_PKCS11_CKR_CURVE_NOT_SUPPORTED = 1154 , AWS_ERROR_PKCS11_CKR_BUFFER_TOO_SMALL = 1155 , AWS_ERROR_PKCS11_CKR_SAVED_STATE_INVALID = 1156 , AWS_ERROR_PKCS11_CKR_INFORMATION_SENSITIVE = 1157 , AWS_ERROR_PKCS11_CKR_STATE_UNSAVEABLE = 1158 , AWS_ERROR_PKCS11_CKR_CRYPTOKI_NOT_INITIALIZED = 1159 , AWS_ERROR_PKCS11_CKR_CRYPTOKI_ALREADY_INITIALIZED = 1160 , AWS_ERROR_PKCS11_CKR_MUTEX_BAD = 1161 , AWS_ERROR_PKCS11_CKR_MUTEX_NOT_LOCKED = 1162 , AWS_ERROR_PKCS11_CKR_NEW_PIN_MODE = 1163 , AWS_ERROR_PKCS11_CKR_NEXT_OTP = 1164 , AWS_ERROR_PKCS11_CKR_EXCEEDED_MAX_ITERATIONS = 1165 , AWS_ERROR_PKCS11_CKR_FIPS_SELF_TEST_FAILED = 1166 , AWS_ERROR_PKCS11_CKR_LIBRARY_LOAD_FAILED = 1167 , AWS_ERROR_PKCS11_CKR_PIN_TOO_WEAK = 1168 , AWS_ERROR_PKCS11_CKR_PUBLIC_KEY_INVALID = 1169 , AWS_ERROR_PKCS11_CKR_FUNCTION_REJECTED = 1170 , AWS_ERROR_IO_PINNED_EVENT_LOOP_MISMATCH = 1171 , AWS_ERROR_PKCS11_ENCODING_ERROR = 1172 , AWS_IO_TLS_ERROR_DEFAULT_TRUST_STORE_NOT_FOUND = 1173 , AWS_IO_STREAM_SEEK_FAILED = 1174 , AWS_IO_STREAM_GET_LENGTH_FAILED = 1175 , AWS_IO_STREAM_SEEK_UNSUPPORTED = 1176 , AWS_IO_STREAM_GET_LENGTH_UNSUPPORTED = 1177 , AWS_IO_TLS_ERROR_READ_FAILURE = 1178 , AWS_IO_ERROR_END_RANGE = 2047 , AWS_IO_INVALID_FILE_HANDLE = 50 , } extern "C" { # [doc = " Initializes internal datastructures used by aws-c-io.\n Must be called before using any functionality in aws-c-io."] pub fn aws_io_library_init (allocator : * mut aws_allocator) ; } extern "C" { # [doc = " Shuts down the internal datastructures used by aws-c-io."] pub fn aws_io_library_clean_up () ; } extern "C" { pub fn aws_io_fatal_assert_library_initialized () ; } # [doc = " struct aws_atomic_var represents an atomic variable - a value which can hold an integer or pointer\n that can be manipulated atomically. struct aws_atomic_vars should normally only be manipulated\n with atomics methods defined in this header."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_atomic_var { pub value : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_atomic_var () { const UNINIT : :: std :: mem :: MaybeUninit < aws_atomic_var > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_atomic_var > () , 8usize , concat ! ("Size of: " , stringify ! (aws_atomic_var))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_atomic_var > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_atomic_var))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_atomic_var) , "::" , stringify ! (value))) ; } impl Default for aws_atomic_var { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_memory_order { # [doc = " No particular ordering constraints are guaranteed relative to other\n operations at all; we merely ensure that the operation itself is atomic."] aws_memory_order_relaxed = 0 , # [doc = " Specifies acquire ordering. No reads or writes on the current thread can be\n reordered to happen before this operation. This is typically paired with a release\n ordering; any writes that happened on the releasing operation will be visible\n after the paired acquire operation.\n\n Acquire ordering is only meaningful on load or load-store operations."] aws_memory_order_acquire = 2 , # [doc = " Specifies release order. No reads or writes can be reordered to come after this\n operation. Typically paired with an acquire operation.\n\n Release ordering is only meaningful on store or load-store operations."] aws_memory_order_release = 3 , # [doc = " Specifies acquire-release order; if this operation acts as a load, it acts as an\n acquire operation; if it acts as a store, it acts as a release operation; if it's\n a load-store, it does both."] aws_memory_order_acq_rel = 4 , # [doc = " Specifies acquire-release order; if this operation acts as a load, it acts as an\n acquire operation; if it acts as a store, it acts as a release operation; if it's\n a load-store, it does both."] aws_memory_order_seq_cst = 5 , } extern "C" { # [doc = " Initializes an atomic variable with an integer value. This operation should be done before any\n other operations on this atomic variable, and must be done before attempting any parallel operations.\n\n This operation does not imply a barrier. Ensure that you use an acquire-release barrier (or stronger)\n when communicating the fact that initialization is complete to the other thread. Launching the thread\n implies a sufficiently strong barrier."] pub fn aws_atomic_init_int (var : * mut aws_atomic_var , n : usize) ; } extern "C" { # [doc = " Initializes an atomic variable with a pointer value. This operation should be done before any\n other operations on this atomic variable, and must be done before attempting any parallel operations.\n\n This operation does not imply a barrier. Ensure that you use an acquire-release barrier (or stronger)\n when communicating the fact that initialization is complete to the other thread. Launching the thread\n implies a sufficiently strong barrier."] pub fn aws_atomic_init_ptr (var : * mut aws_atomic_var , p : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Reads an atomic var as an integer, using the specified ordering, and returns the result."] pub fn aws_atomic_load_int_explicit (var : * const aws_atomic_var , memory_order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Reads an atomic var as an integer, using sequentially consistent ordering, and returns the result."] pub fn aws_atomic_load_int (var : * const aws_atomic_var) -> usize ; } extern "C" { # [doc = " Reads an atomic var as a pointer, using the specified ordering, and returns the result."] pub fn aws_atomic_load_ptr_explicit (var : * const aws_atomic_var , memory_order : aws_memory_order) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Reads an atomic var as a pointer, using sequentially consistent ordering, and returns the result."] pub fn aws_atomic_load_ptr (var : * const aws_atomic_var) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Stores an integer into an atomic var, using the specified ordering."] pub fn aws_atomic_store_int_explicit (var : * mut aws_atomic_var , n : usize , memory_order : aws_memory_order) ; } extern "C" { # [doc = " Stores an integer into an atomic var, using sequentially consistent ordering."] pub fn aws_atomic_store_int (var : * mut aws_atomic_var , n : usize) ; } extern "C" { # [doc = " Stores a pointer into an atomic var, using the specified ordering."] pub fn aws_atomic_store_ptr_explicit (var : * mut aws_atomic_var , p : * mut :: libc :: c_void , memory_order : aws_memory_order) ; } extern "C" { # [doc = " Stores a pointer into an atomic var, using sequentially consistent ordering."] pub fn aws_atomic_store_ptr (var : * mut aws_atomic_var , p : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Exchanges an integer with the value in an atomic_var, using the specified ordering.\n Returns the value that was previously in the atomic_var."] pub fn aws_atomic_exchange_int_explicit (var : * mut aws_atomic_var , n : usize , memory_order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Exchanges an integer with the value in an atomic_var, using sequentially consistent ordering.\n Returns the value that was previously in the atomic_var."] pub fn aws_atomic_exchange_int (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Exchanges a pointer with the value in an atomic_var, using the specified ordering.\n Returns the value that was previously in the atomic_var."] pub fn aws_atomic_exchange_ptr_explicit (var : * mut aws_atomic_var , p : * mut :: libc :: c_void , memory_order : aws_memory_order) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Exchanges an integer with the value in an atomic_var, using sequentially consistent ordering.\n Returns the value that was previously in the atomic_var."] pub fn aws_atomic_exchange_ptr (var : * mut aws_atomic_var , p : * mut :: libc :: c_void) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Atomically compares *var to *expected; if they are equal, atomically sets *var = desired. Otherwise, *expected is set\n to the value in *var. On success, the memory ordering used was order_success; otherwise, it was order_failure.\n order_failure must be no stronger than order_success, and must not be release or acq_rel.\n Returns true if the compare was successful and the variable updated to desired."] pub fn aws_atomic_compare_exchange_int_explicit (var : * mut aws_atomic_var , expected : * mut usize , desired : usize , order_success : aws_memory_order , order_failure : aws_memory_order) -> bool ; } extern "C" { # [doc = " Atomically compares *var to *expected; if they are equal, atomically sets *var = desired. Otherwise, *expected is set\n to the value in *var. Uses sequentially consistent memory ordering, regardless of success or failure.\n Returns true if the compare was successful and the variable updated to desired."] pub fn aws_atomic_compare_exchange_int (var : * mut aws_atomic_var , expected : * mut usize , desired : usize) -> bool ; } extern "C" { # [doc = " Atomically compares *var to *expected; if they are equal, atomically sets *var = desired. Otherwise, *expected is set\n to the value in *var. On success, the memory ordering used was order_success; otherwise, it was order_failure.\n order_failure must be no stronger than order_success, and must not be release or acq_rel.\n Returns true if the compare was successful and the variable updated to desired."] pub fn aws_atomic_compare_exchange_ptr_explicit (var : * mut aws_atomic_var , expected : * mut * mut :: libc :: c_void , desired : * mut :: libc :: c_void , order_success : aws_memory_order , order_failure : aws_memory_order) -> bool ; } extern "C" { # [doc = " Atomically compares *var to *expected; if they are equal, atomically sets *var = desired. Otherwise, *expected is set\n to the value in *var. Uses sequentially consistent memory ordering, regardless of success or failure.\n Returns true if the compare was successful and the variable updated to desired."] pub fn aws_atomic_compare_exchange_ptr (var : * mut aws_atomic_var , expected : * mut * mut :: libc :: c_void , desired : * mut :: libc :: c_void) -> bool ; } extern "C" { # [doc = " Atomically adds n to *var, and returns the previous value of *var."] pub fn aws_atomic_fetch_add_explicit (var : * mut aws_atomic_var , n : usize , order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Atomically subtracts n from *var, and returns the previous value of *var."] pub fn aws_atomic_fetch_sub_explicit (var : * mut aws_atomic_var , n : usize , order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Atomically ORs n with *var, and returns the previous value of *var."] pub fn aws_atomic_fetch_or_explicit (var : * mut aws_atomic_var , n : usize , order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Atomically ANDs n with *var, and returns the previous value of *var."] pub fn aws_atomic_fetch_and_explicit (var : * mut aws_atomic_var , n : usize , order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Atomically XORs n with *var, and returns the previous value of *var."] pub fn aws_atomic_fetch_xor_explicit (var : * mut aws_atomic_var , n : usize , order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Atomically adds n to *var, and returns the previous value of *var.\n Uses sequentially consistent ordering."] pub fn aws_atomic_fetch_add (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Atomically subtracts n from *var, and returns the previous value of *var.\n Uses sequentially consistent ordering."] pub fn aws_atomic_fetch_sub (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Atomically ands n into *var, and returns the previous value of *var.\n Uses sequentially consistent ordering."] pub fn aws_atomic_fetch_and (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Atomically ors n into *var, and returns the previous value of *var.\n Uses sequentially consistent ordering."] pub fn aws_atomic_fetch_or (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Atomically xors n into *var, and returns the previous value of *var.\n Uses sequentially consistent ordering."] pub fn aws_atomic_fetch_xor (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Provides the same reordering guarantees as an atomic operation with the specified memory order, without\n needing to actually perform an atomic operation."] pub fn aws_atomic_thread_fence (order : aws_memory_order) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_string { pub allocator : * mut aws_allocator , pub len : usize , pub bytes : [u8 ; 1usize] , } # [test] fn bindgen_test_layout_aws_string () { const UNINIT : :: std :: mem :: MaybeUninit < aws_string > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_string > () , 24usize , concat ! ("Size of: " , stringify ! (aws_string))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_string > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_string))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_string) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . len) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_string) , "::" , stringify ! (len))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bytes) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_string) , "::" , stringify ! (bytes))) ; } impl Default for aws_string { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Returns true if bytes of string are the same, false otherwise."] pub fn aws_string_eq (a : * const aws_string , b : * const aws_string) -> bool ; } extern "C" { # [doc = " Returns true if bytes of string are equivalent, using a case-insensitive comparison."] pub fn aws_string_eq_ignore_case (a : * const aws_string , b : * const aws_string) -> bool ; } extern "C" { # [doc = " Returns true if bytes of string and cursor are the same, false otherwise."] pub fn aws_string_eq_byte_cursor (str_ : * const aws_string , cur : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Returns true if bytes of string and cursor are equivalent, using a case-insensitive comparison."] pub fn aws_string_eq_byte_cursor_ignore_case (str_ : * const aws_string , cur : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Returns true if bytes of string and buffer are the same, false otherwise."] pub fn aws_string_eq_byte_buf (str_ : * const aws_string , buf : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Returns true if bytes of string and buffer are equivalent, using a case-insensitive comparison."] pub fn aws_string_eq_byte_buf_ignore_case (str_ : * const aws_string , buf : * const aws_byte_buf) -> bool ; } extern "C" { pub fn aws_string_eq_c_str (str_ : * const aws_string , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Returns true if bytes of strings are equivalent, using a case-insensitive comparison."] pub fn aws_string_eq_c_str_ignore_case (str_ : * const aws_string , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Constructor functions which copy data from null-terminated C-string or array of bytes."] pub fn aws_string_new_from_c_str (allocator : * mut aws_allocator , c_str : * const :: libc :: c_char) -> * mut aws_string ; } extern "C" { # [doc = " Allocate a new string with the same contents as array."] pub fn aws_string_new_from_array (allocator : * mut aws_allocator , bytes : * const u8 , len : usize) -> * mut aws_string ; } extern "C" { # [doc = " Allocate a new string with the same contents as another string."] pub fn aws_string_new_from_string (allocator : * mut aws_allocator , str_ : * const aws_string) -> * mut aws_string ; } extern "C" { # [doc = " Allocate a new string with the same contents as cursor."] pub fn aws_string_new_from_cursor (allocator : * mut aws_allocator , cursor : * const aws_byte_cursor) -> * mut aws_string ; } extern "C" { # [doc = " Allocate a new string with the same contents as buf."] pub fn aws_string_new_from_buf (allocator : * mut aws_allocator , buf : * const aws_byte_buf) -> * mut aws_string ; } extern "C" { # [doc = " Deallocate string."] pub fn aws_string_destroy (str_ : * mut aws_string) ; } extern "C" { # [doc = " Zeroes out the data bytes of string and then deallocates the memory.\n Not safe to run on a string created with AWS_STATIC_STRING_FROM_LITERAL."] pub fn aws_string_destroy_secure (str_ : * mut aws_string) ; } extern "C" { # [doc = " Compares lexicographical ordering of two strings. This is a binary\n byte-by-byte comparison, treating bytes as unsigned integers. It is suitable\n for either textual or binary data and is unaware of unicode or any other byte\n encoding. If both strings are identical in the bytes of the shorter string,\n then the longer string is lexicographically after the shorter.\n\n Returns a positive number if string a > string b. (i.e., string a is\n lexicographically after string b.) Returns zero if string a = string b.\n Returns negative number if string a < string b."] pub fn aws_string_compare (a : * const aws_string , b : * const aws_string) -> :: libc :: c_int ; } extern "C" { # [doc = " A convenience function for sorting lists of (const struct aws_string *) elements. This can be used as a\n comparator for aws_array_list_sort. It is just a simple wrapper around aws_string_compare."] pub fn aws_array_list_comparator_string (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies all bytes from string to buf.\n\n On success, returns true and updates the buf pointer/length\n accordingly. If there is insufficient space in the buf, returns\n false, leaving the buf unchanged."] pub fn aws_byte_buf_write_from_whole_string (buf : * mut aws_byte_buf , src : * const aws_string) -> bool ; } extern "C" { # [doc = " Creates an aws_byte_cursor from an existing string."] pub fn aws_byte_cursor_from_string (src : * const aws_string) -> aws_byte_cursor ; } extern "C" { # [doc = " If the string was dynamically allocated, clones it. If the string was statically allocated (i.e. has no allocator),\n returns the original string."] pub fn aws_string_clone_or_reuse (allocator : * mut aws_allocator , str_ : * const aws_string) -> * mut aws_string ; } extern "C" { # [doc = " Computes the length of a c string in bytes assuming the character set is either ASCII or UTF-8. If no NULL character\n is found within max_read_len of str, AWS_ERROR_C_STRING_BUFFER_NOT_NULL_TERMINATED is raised. Otherwise, str_len\n will contain the string length minus the NULL character, and AWS_OP_SUCCESS will be returned."] pub fn aws_secure_strlen (str_ : * const :: libc :: c_char , max_read_len : usize , str_len : * mut usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Equivalent to str->bytes."] pub fn aws_string_bytes (str_ : * const aws_string) -> * const u8 ; } extern "C" { # [doc = " Equivalent to `(const char *)str->bytes`."] pub fn aws_string_c_str (str_ : * const aws_string) -> * const :: libc :: c_char ; } extern "C" { # [doc = " Evaluates the set of properties that define the shape of all valid aws_string structures.\n It is also a cheap check, in the sense it run in constant time (i.e., no loops or recursion)."] pub fn aws_string_is_valid (str_ : * const aws_string) -> bool ; } extern "C" { # [doc = " Best-effort checks aws_string invariants, when the str->len is unknown"] pub fn aws_c_string_is_valid (str_ : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Evaluates if a char is a white character."] pub fn aws_char_is_space (c : u8) -> bool ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_thread_detach_state { AWS_THREAD_NOT_CREATED = 1 , AWS_THREAD_JOINABLE = 2 , AWS_THREAD_JOIN_COMPLETED = 3 , AWS_THREAD_MANAGED = 4 , } # [repr (u32)] # [non_exhaustive] # [doc = " Specifies the join strategy used on an aws_thread, which in turn controls whether or not a thread participates\n in the managed thread system. The managed thread system provides logic to guarantee a join on all participating\n threads at the cost of laziness (the user cannot control when joins happen).\n\n Manual - thread does not participate in the managed thread system; any joins must be done by the user. This\n is the default. The user must call aws_thread_clean_up(), but only after any desired join operation has completed.\n Not doing so will cause the windows handle to leak.\n\n Managed - the managed thread system will automatically perform a join some time after the thread's run function\n has completed. It is an error to call aws_thread_join on a thread configured with the managed join strategy. The\n managed thread system will call aws_thread_clean_up() on the thread after the background join has completed.\n\n Additionally, an API exists, aws_thread_join_all_managed(), which blocks and returns when all outstanding threads\n with the managed strategy have fully joined. This API is useful for tests (rather than waiting for many individual\n signals) and program shutdown or DLL unload. This API is automatically invoked by the common library clean up\n function. If the common library clean up is called from a managed thread, this will cause deadlock.\n\n Lazy thread joining is done only when threads finish their run function or when the user calls\n aws_thread_join_all_managed(). This means it may be a long time between thread function completion and the join\n being applied, but the queue of unjoined threads is always one or fewer so there is no critical resource\n backlog.\n\n Currently, only event loop group async cleanup and host resolver threads participate in the managed thread system.\n Additionally, event loop threads will increment and decrement the pending join count (they are manually joined\n internally) in order to have an accurate view of internal thread usage and also to prevent failure to release\n an event loop group fully from allowing aws_thread_join_all_managed() from running to completion when its\n intent is such that it should block instead."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_thread_join_strategy { AWS_TJS_MANUAL = 0 , AWS_TJS_MANAGED = 1 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_thread_options { pub stack_size : usize , pub cpu_id : i32 , pub join_strategy : aws_thread_join_strategy , # [doc = " Thread name, for debugging purpose.\n The length should not exceed AWS_THREAD_NAME_RECOMMENDED_STRLEN(15)\n if you want it to display properly on all platforms."] pub name : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_thread_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_thread_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_thread_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_thread_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_thread_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_thread_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . stack_size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_thread_options) , "::" , stringify ! (stack_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cpu_id) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_thread_options) , "::" , stringify ! (cpu_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . join_strategy) as usize - ptr as usize } , 12usize , concat ! ("Offset of field: " , stringify ! (aws_thread_options) , "::" , stringify ! (join_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . name) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_thread_options) , "::" , stringify ! (name))) ; } impl Default for aws_thread_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_thread_once = pthread_once_t ; pub type aws_thread_id_t = pthread_t ; # [repr (C)] pub struct aws_thread { pub allocator : * mut aws_allocator , pub detach_state : aws_thread_detach_state , pub thread_id : aws_thread_id_t , } # [test] fn bindgen_test_layout_aws_thread () { const UNINIT : :: std :: mem :: MaybeUninit < aws_thread > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_thread > () , 24usize , concat ! ("Size of: " , stringify ! (aws_thread))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_thread > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_thread))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_thread) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . detach_state) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_thread) , "::" , stringify ! (detach_state))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . thread_id) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_thread) , "::" , stringify ! (thread_id))) ; } impl Default for aws_thread { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Returns an instance of system default thread options."] pub fn aws_default_thread_options () -> * const aws_thread_options ; } extern "C" { pub fn aws_thread_call_once (flag : * mut aws_thread_once , call_once : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: libc :: c_void) > , user_data : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Initializes a new platform specific thread object struct (not the os-level\n thread itself)."] pub fn aws_thread_init (thread : * mut aws_thread , allocator : * mut aws_allocator) -> :: libc :: c_int ; } extern "C" { # [doc = " Creates an OS level thread and associates it with func. context will be passed to func when it is executed.\n options will be applied to the thread if they are applicable for the platform.\n\n After launch, you may join on the thread. A successfully launched thread must have clean_up called on it in order\n to avoid a handle leak. If you do not join before calling clean_up, the thread will become detached.\n\n Managed threads must not have join or clean_up called on them by external code."] pub fn aws_thread_launch (thread : * mut aws_thread , func : :: std :: option :: Option < unsafe extern "C" fn (arg : * mut :: libc :: c_void) > , arg : * mut :: libc :: c_void , options : * const aws_thread_options) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the id of thread"] pub fn aws_thread_get_id (thread : * mut aws_thread) -> aws_thread_id_t ; } extern "C" { # [doc = " Gets the detach state of the thread. For example, is it safe to call join on\n this thread? Has it been detached()?"] pub fn aws_thread_get_detach_state (thread : * mut aws_thread) -> aws_thread_detach_state ; } extern "C" { # [doc = " Joins the calling thread to a thread instance. Returns when thread is\n finished. Calling this from the associated OS thread will cause a deadlock."] pub fn aws_thread_join (thread : * mut aws_thread) -> :: libc :: c_int ; } extern "C" { # [doc = " Blocking call that waits for all managed threads to complete their join call. This can only be called\n from the main thread or a non-managed thread.\n\n This gets called automatically from library cleanup.\n\n By default the wait is unbounded, but that default can be overridden via aws_thread_set_managed_join_timeout_ns()"] pub fn aws_thread_join_all_managed () -> :: libc :: c_int ; } extern "C" { # [doc = " Overrides how long, in nanoseconds, that aws_thread_join_all_managed will wait for threads to complete.\n A value of zero will result in an unbounded wait."] pub fn aws_thread_set_managed_join_timeout_ns (timeout_in_ns : u64) ; } extern "C" { # [doc = " Cleans up the thread handle. Don't call this on a managed thread. If you wish to join the thread, you must join\n before calling this function."] pub fn aws_thread_clean_up (thread : * mut aws_thread) ; } extern "C" { # [doc = " Returns the thread id of the calling thread."] pub fn aws_thread_current_thread_id () -> aws_thread_id_t ; } extern "C" { # [doc = " Compare thread ids."] pub fn aws_thread_thread_id_equal (t1 : aws_thread_id_t , t2 : aws_thread_id_t) -> bool ; } extern "C" { # [doc = " Sleeps the current thread by nanos."] pub fn aws_thread_current_sleep (nanos : u64) ; } pub type aws_thread_atexit_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; extern "C" { # [doc = " Adds a callback to the chain to be called when the current thread joins.\n Callbacks are called from the current thread, in the reverse order they\n were added, after the thread function returns.\n If not called from within an aws_thread, has no effect."] pub fn aws_thread_current_at_exit (callback : aws_thread_atexit_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Increments the count of unjoined threads in the managed thread system. Used by managed threads and\n event loop threads. Additional usage requires the user to join corresponding threads themselves and\n correctly increment/decrement even in the face of launch/join errors.\n\n aws_thread_join_all_managed() will not return until this count has gone to zero."] pub fn aws_thread_increment_unjoined_count () ; } extern "C" { # [doc = " Decrements the count of unjoined threads in the managed thread system. Used by managed threads and\n event loop threads. Additional usage requires the user to join corresponding threads themselves and\n correctly increment/decrement even in the face of launch/join errors.\n\n aws_thread_join_all_managed() will not return until this count has gone to zero."] pub fn aws_thread_decrement_unjoined_count () ; } extern "C" { # [doc = " Gets name of the current thread.\n Caller is responsible for destroying returned string.\n If thread does not have a name, AWS_OP_SUCCESS is returned and out_name is\n set to NULL.\n If underlying OS call fails, AWS_ERROR_SYS_CALL_FAILURE will be raised\n If OS does not support getting thread name, AWS_ERROR_PLATFORM_NOT_SUPPORTED\n will be raised"] pub fn aws_thread_current_name (allocator : * mut aws_allocator , out_name : * mut * mut aws_string) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets name of the thread.\n Caller is responsible for destroying returned string.\n If thread does not have a name, AWS_OP_SUCCESS is returned and out_name is\n set to NULL.\n If underlying OS call fails, AWS_ERROR_SYS_CALL_FAILURE will be raised\n If OS does not support getting thread name, AWS_ERROR_PLATFORM_NOT_SUPPORTED\n will be raised"] pub fn aws_thread_name (allocator : * mut aws_allocator , thread_id : aws_thread_id_t , out_name : * mut * mut aws_string) -> :: libc :: c_int ; } pub mod aws_log_level { # [doc = " Controls what log calls pass through the logger and what log calls get filtered out.\n If a log level has a value of X, then all log calls using a level <= X will appear, while\n those using a value > X will not occur.\n\n You can filter both dynamically (by setting the log level on the logger object) or statically\n (by defining AWS_STATIC_LOG_LEVEL to be an appropriate integer module-wide). Statically filtered\n log calls will be completely compiled out but require a rebuild if you want to get more detail\n about what's happening."] pub type Type = :: libc :: c_uint ; pub const AWS_LL_NONE : Type = 0 ; pub const AWS_LL_FATAL : Type = 1 ; pub const AWS_LL_ERROR : Type = 2 ; pub const AWS_LL_WARN : Type = 3 ; pub const AWS_LL_INFO : Type = 4 ; pub const AWS_LL_DEBUG : Type = 5 ; pub const AWS_LL_TRACE : Type = 6 ; pub const AWS_LL_COUNT : Type = 7 ; } # [doc = " Log subject is a way of designating the topic of logging.\n\n The general idea is to support a finer-grained approach to log level control. The primary use case\n is for situations that require more detailed logging within a specific domain, where enabling that detail\n globally leads to an untenable flood of information.\n\n For example, enable TRACE logging for tls-related log statements (handshake binary payloads), but\n only WARN logging everywhere else (because http payloads would blow up the log files).\n\n Log subject is an enum similar to aws error: each library has its own value-space and someone is\n responsible for registering the value <-> string connections."] pub type aws_log_subject_t = u32 ; pub const AWS_LOG_SUBJECT_STRIDE_BITS : _bindgen_ty_20 = _bindgen_ty_20 :: AWS_LOG_SUBJECT_STRIDE_BITS ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_20 { AWS_LOG_SUBJECT_STRIDE_BITS = 10 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_subject_info { pub subject_id : aws_log_subject_t , pub subject_name : * const :: libc :: c_char , pub subject_description : * const :: libc :: c_char , } # [test] fn bindgen_test_layout_aws_log_subject_info () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_subject_info > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_subject_info > () , 24usize , concat ! ("Size of: " , stringify ! (aws_log_subject_info))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_subject_info > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_subject_info))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subject_id) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_subject_info) , "::" , stringify ! (subject_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subject_name) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_subject_info) , "::" , stringify ! (subject_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subject_description) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_log_subject_info) , "::" , stringify ! (subject_description))) ; } impl Default for aws_log_subject_info { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_subject_info_list { pub subject_list : * mut aws_log_subject_info , pub count : usize , } # [test] fn bindgen_test_layout_aws_log_subject_info_list () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_subject_info_list > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_subject_info_list > () , 16usize , concat ! ("Size of: " , stringify ! (aws_log_subject_info_list))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_subject_info_list > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_subject_info_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subject_list) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_subject_info_list) , "::" , stringify ! (subject_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . count) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_subject_info_list) , "::" , stringify ! (count))) ; } impl Default for aws_log_subject_info_list { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_common_log_subject { AWS_LS_COMMON_GENERAL = 0 , AWS_LS_COMMON_TASK_SCHEDULER = 1 , AWS_LS_COMMON_THREAD = 2 , AWS_LS_COMMON_MEMTRACE = 3 , AWS_LS_COMMON_XML_PARSER = 4 , AWS_LS_COMMON_IO = 5 , AWS_LS_COMMON_BUS = 6 , AWS_LS_COMMON_TEST = 7 , AWS_LS_COMMON_JSON_PARSER = 8 , AWS_LS_COMMON_LAST = 1023 , } # [doc = " We separate the log level function from the log call itself so that we can do the filter check in the macros (see\n below)\n\n By doing so, we make it so that the variadic format arguments are not even evaluated if the filter check does not\n succeed."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_logger_vtable { pub log : :: std :: option :: Option < unsafe extern "C" fn (logger : * mut aws_logger , log_level : aws_log_level :: Type , subject : aws_log_subject_t , format : * const :: libc :: c_char , ...) -> :: libc :: c_int > , pub get_log_level : :: std :: option :: Option < unsafe extern "C" fn (logger : * mut aws_logger , subject : aws_log_subject_t) -> aws_log_level :: Type > , pub clean_up : :: std :: option :: Option < unsafe extern "C" fn (logger : * mut aws_logger) > , pub set_log_level : :: std :: option :: Option < unsafe extern "C" fn (logger : * mut aws_logger , arg1 : aws_log_level :: Type) -> :: libc :: c_int > , } # [test] fn bindgen_test_layout_aws_logger_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_logger_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_logger_vtable > () , 32usize , concat ! ("Size of: " , stringify ! (aws_logger_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_logger_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_logger_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . log) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_logger_vtable) , "::" , stringify ! (log))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_log_level) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_logger_vtable) , "::" , stringify ! (get_log_level))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clean_up) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_logger_vtable) , "::" , stringify ! (clean_up))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . set_log_level) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_logger_vtable) , "::" , stringify ! (set_log_level))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_logger { pub vtable : * mut aws_logger_vtable , pub allocator : * mut aws_allocator , pub p_impl : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_logger () { const UNINIT : :: std :: mem :: MaybeUninit < aws_logger > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_logger > () , 24usize , concat ! ("Size of: " , stringify ! (aws_logger))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_logger > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_logger))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_logger) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_logger) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . p_impl) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_logger) , "::" , stringify ! (p_impl))) ; } impl Default for aws_logger { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_logger_pipeline { pub formatter : * mut aws_log_formatter , pub channel : * mut aws_log_channel , pub writer : * mut aws_log_writer , pub allocator : * mut aws_allocator , pub level : aws_atomic_var , } # [test] fn bindgen_test_layout_aws_logger_pipeline () { const UNINIT : :: std :: mem :: MaybeUninit < aws_logger_pipeline > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_logger_pipeline > () , 40usize , concat ! ("Size of: " , stringify ! (aws_logger_pipeline))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_logger_pipeline > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_logger_pipeline))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . formatter) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_logger_pipeline) , "::" , stringify ! (formatter))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . channel) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_logger_pipeline) , "::" , stringify ! (channel))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . writer) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_logger_pipeline) , "::" , stringify ! (writer))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_logger_pipeline) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . level) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_logger_pipeline) , "::" , stringify ! (level))) ; } impl Default for aws_logger_pipeline { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Options for aws_logger_init_standard().\n Set `filename` to open a file for logging and close it when the logger cleans up.\n Set `file` to use a file that is already open, such as `stderr` or `stdout`."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_logger_standard_options { pub level : aws_log_level :: Type , pub filename : * const :: libc :: c_char , pub file : * mut FILE , } # [test] fn bindgen_test_layout_aws_logger_standard_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_logger_standard_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_logger_standard_options > () , 24usize , concat ! ("Size of: " , stringify ! (aws_logger_standard_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_logger_standard_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_logger_standard_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . level) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_logger_standard_options) , "::" , stringify ! (level))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . filename) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_logger_standard_options) , "::" , stringify ! (filename))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . file) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_logger_standard_options) , "::" , stringify ! (file))) ; } impl Default for aws_logger_standard_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Sets the aws logger used globally across the process. Not thread-safe. Must only be called once."] pub fn aws_logger_set (logger : * mut aws_logger) ; } extern "C" { # [doc = " Gets the aws logger used globally across the process."] pub fn aws_logger_get () -> * mut aws_logger ; } extern "C" { # [doc = " Gets the aws logger used globally across the process if the logging level is at least the inputted level.\n\n @param subject log subject to perform the level check versus, not currently used\n @param level logging level to check against in order to return the logger\n @return the current logger if the current logging level is at or more detailed then the supplied logging level"] pub fn aws_logger_get_conditional (subject : aws_log_subject_t , level : aws_log_level :: Type) -> * mut aws_logger ; } extern "C" { # [doc = " Cleans up all resources used by the logger; simply invokes the clean_up v-function"] pub fn aws_logger_clean_up (logger : * mut aws_logger) ; } extern "C" { # [doc = " Sets the current logging level for the logger. Loggers are not require to support this.\n @param logger logger to set the log level for\n @param level new log level for the logger\n @return AWS_OP_SUCCESS if the level was successfully set, AWS_OP_ERR otherwise"] pub fn aws_logger_set_log_level (logger : * mut aws_logger , level : aws_log_level :: Type) -> :: libc :: c_int ; } extern "C" { # [doc = " Converts a log level to a c-string constant. Intended primarily to support building log lines that\n include the level in them, i.e.\n\n [ERROR] 10:34:54.642 01-31-19 - Json parse error...."] pub fn aws_log_level_to_string (log_level : aws_log_level :: Type , level_string : * mut * const :: libc :: c_char) -> :: libc :: c_int ; } extern "C" { # [doc = " Converts a c-string constant to a log level value. Uses case-insensitive comparison\n and simply iterates all possibilities until a match or nothing remains. If no match\n is found, AWS_OP_ERR is returned."] pub fn aws_string_to_log_level (level_string : * const :: libc :: c_char , log_level : * mut aws_log_level :: Type) -> :: libc :: c_int ; } extern "C" { # [doc = " Converts an aws_thread_id_t to a c-string. For portability, aws_thread_id_t\n must not be printed directly. Intended primarily to support building log\n lines that include the thread id in them. The parameter `buffer` must\n point-to a char buffer of length `bufsz == AWS_THREAD_ID_T_REPR_BUFSZ`. The\n thread id representation is returned in `buffer`."] pub fn aws_thread_id_t_to_string (thread_id : aws_thread_id_t , buffer : * mut :: libc :: c_char , bufsz : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Get subject name from log subject."] pub fn aws_log_subject_name (subject : aws_log_subject_t) -> * const :: libc :: c_char ; } extern "C" { # [doc = " Connects log subject strings with log subject integer values"] pub fn aws_register_log_subject_info_list (log_subject_list : * mut aws_log_subject_info_list) ; } extern "C" { # [doc = " Disconnects log subject strings with log subject integer values"] pub fn aws_unregister_log_subject_info_list (log_subject_list : * mut aws_log_subject_info_list) ; } extern "C" { pub fn aws_logger_init_standard (logger : * mut aws_logger , allocator : * mut aws_allocator , options : * mut aws_logger_standard_options) -> :: libc :: c_int ; } extern "C" { pub fn aws_logger_init_from_external (logger : * mut aws_logger , allocator : * mut aws_allocator , formatter : * mut aws_log_formatter , channel : * mut aws_log_channel , writer : * mut aws_log_writer , level : aws_log_level :: Type) -> :: libc :: c_int ; } extern "C" { pub static mut g_pipeline_logger_owned_vtable : aws_logger_vtable ; } extern "C" { pub fn aws_logger_init_noalloc (logger : * mut aws_logger , allocator : * mut aws_allocator , options : * mut aws_logger_standard_options) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_io_log_subject { AWS_LS_IO_GENERAL = 1024 , AWS_LS_IO_EVENT_LOOP = 1025 , AWS_LS_IO_SOCKET = 1026 , AWS_LS_IO_SOCKET_HANDLER = 1027 , AWS_LS_IO_TLS = 1028 , AWS_LS_IO_ALPN = 1029 , AWS_LS_IO_DNS = 1030 , AWS_LS_IO_PKI = 1031 , AWS_LS_IO_CHANNEL = 1032 , AWS_LS_IO_CHANNEL_BOOTSTRAP = 1033 , AWS_LS_IO_FILE_UTILS = 1034 , AWS_LS_IO_SHARED_LIBRARY = 1035 , AWS_LS_IO_EXPONENTIAL_BACKOFF_RETRY_STRATEGY = 1036 , AWS_LS_IO_STANDARD_RETRY_STRATEGY = 1037 , AWS_LS_IO_PKCS11 = 1038 , AWS_IO_LS_LAST = 2047 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_sdkutils_errors { AWS_ERROR_SDKUTILS_GENERAL = 15360 , AWS_ERROR_SDKUTILS_PARSE_FATAL = 15361 , AWS_ERROR_SDKUTILS_PARSE_RECOVERABLE = 15362 , AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_RULESET = 15363 , AWS_ERROR_SDKUTILS_ENDPOINTS_PARSE_FAILED = 15364 , AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_INIT_FAILED = 15365 , AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_FAILED = 15366 , AWS_ERROR_SDKUTILS_ENDPOINTS_EMPTY_RULESET = 15367 , AWS_ERROR_SDKUTILS_ENDPOINTS_RULESET_EXHAUSTED = 15368 , AWS_ERROR_SDKUTILS_PARTITIONS_UNSUPPORTED = 15369 , AWS_ERROR_SDKUTILS_PARTITIONS_PARSE_FAILED = 15370 , AWS_ERROR_SDKUTILS_END_RANGE = 16383 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_sdkutils_log_subject { AWS_LS_SDKUTILS_GENERAL = 15360 , AWS_LS_SDKUTILS_PROFILE = 15361 , AWS_LS_SDKUTILS_ENDPOINTS_PARSING = 15362 , AWS_LS_SDKUTILS_ENDPOINTS_RESOLVE = 15363 , AWS_LS_SDKUTILS_ENDPOINTS_GENERAL = 15364 , AWS_LS_SDKUTILS_PARTITIONS_PARSING = 15365 , AWS_LS_SDKUTILS_LAST = 16383 , } extern "C" { pub fn aws_sdkutils_library_init (allocator : * mut aws_allocator) ; } extern "C" { pub fn aws_sdkutils_library_clean_up () ; } # [repr (u32)] # [non_exhaustive] # [doc = " Auth-specific error codes"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_auth_errors { AWS_AUTH_PROFILE_PARSE_RECOVERABLE_ERROR = 15362 , AWS_AUTH_PROFILE_PARSE_FATAL_ERROR = 15361 , AWS_AUTH_SIGNING_UNSUPPORTED_ALGORITHM = 6144 , AWS_AUTH_SIGNING_MISMATCHED_CONFIGURATION = 6145 , AWS_AUTH_SIGNING_NO_CREDENTIALS = 6146 , AWS_AUTH_SIGNING_ILLEGAL_REQUEST_QUERY_PARAM = 6147 , AWS_AUTH_SIGNING_ILLEGAL_REQUEST_HEADER = 6148 , AWS_AUTH_SIGNING_INVALID_CONFIGURATION = 6149 , AWS_AUTH_CREDENTIALS_PROVIDER_INVALID_ENVIRONMENT = 6150 , AWS_AUTH_CREDENTIALS_PROVIDER_INVALID_DELEGATE = 6151 , AWS_AUTH_CREDENTIALS_PROVIDER_PROFILE_SOURCE_FAILURE = 6152 , AWS_AUTH_CREDENTIALS_PROVIDER_IMDS_SOURCE_FAILURE = 6153 , AWS_AUTH_CREDENTIALS_PROVIDER_STS_SOURCE_FAILURE = 6154 , AWS_AUTH_CREDENTIALS_PROVIDER_HTTP_STATUS_FAILURE = 6155 , AWS_AUTH_PROVIDER_PARSER_UNEXPECTED_RESPONSE = 6156 , AWS_AUTH_CREDENTIALS_PROVIDER_ECS_SOURCE_FAILURE = 6157 , AWS_AUTH_CREDENTIALS_PROVIDER_X509_SOURCE_FAILURE = 6158 , AWS_AUTH_CREDENTIALS_PROVIDER_PROCESS_SOURCE_FAILURE = 6159 , AWS_AUTH_CREDENTIALS_PROVIDER_STS_WEB_IDENTITY_SOURCE_FAILURE = 6160 , AWS_AUTH_SIGNING_UNSUPPORTED_SIGNATURE_TYPE = 6161 , AWS_AUTH_SIGNING_MISSING_PREVIOUS_SIGNATURE = 6162 , AWS_AUTH_SIGNING_INVALID_CREDENTIALS = 6163 , AWS_AUTH_CANONICAL_REQUEST_MISMATCH = 6164 , AWS_AUTH_SIGV4A_SIGNATURE_VALIDATION_FAILURE = 6165 , AWS_AUTH_CREDENTIALS_PROVIDER_COGNITO_SOURCE_FAILURE = 6166 , AWS_AUTH_CREDENTIALS_PROVIDER_DELEGATE_FAILURE = 6167 , AWS_AUTH_SSO_TOKEN_PROVIDER_SOURCE_FAILURE = 6168 , AWS_AUTH_SSO_TOKEN_INVALID = 6169 , AWS_AUTH_SSO_TOKEN_EXPIRED = 6170 , AWS_AUTH_CREDENTIALS_PROVIDER_SSO_SOURCE_FAILURE = 6171 , AWS_AUTH_ERROR_END_RANGE = 7167 , } # [repr (u32)] # [non_exhaustive] # [doc = " Auth-specific logging subjects"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_auth_log_subject { AWS_LS_AUTH_GENERAL = 6144 , AWS_LS_AUTH_PROFILE = 6145 , AWS_LS_AUTH_CREDENTIALS_PROVIDER = 6146 , AWS_LS_AUTH_SIGNING = 6147 , AWS_LS_IMDS_CLIENT = 6148 , AWS_LS_AUTH_LAST = 7167 , } extern "C" { # [doc = " Initializes internal datastructures used by aws-c-auth.\n Must be called before using any functionality in aws-c-auth.\n\n @param allocator memory allocator to use for any module-level memory allocation"] pub fn aws_auth_library_init (allocator : * mut aws_allocator) ; } extern "C" { # [doc = " Clean up internal datastructures used by aws-c-auth.\n Must not be called until application is done using functionality in aws-c-auth."] pub fn aws_auth_library_clean_up () ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_auth_http_system_vtable { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_ecc_key_pair { _unused : [u8 ; 0] , } extern "C" { pub static aws_sts_assume_role_default_duration_secs : u16 ; } pub type aws_on_get_credentials_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (credentials : * mut aws_credentials , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_credentials_provider_get_credentials_fn = :: std :: option :: Option < unsafe extern "C" fn (provider : * mut aws_credentials_provider , callback : aws_on_get_credentials_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; pub type aws_credentials_provider_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (provider : * mut aws_credentials_provider) > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_credentials_provider_vtable { pub get_credentials : aws_credentials_provider_get_credentials_fn , pub destroy : aws_credentials_provider_destroy_fn , } # [test] fn bindgen_test_layout_aws_credentials_provider_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_credentials) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_vtable) , "::" , stringify ! (get_credentials))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_vtable) , "::" , stringify ! (destroy))) ; } pub type aws_credentials_provider_shutdown_completed_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_shutdown_options { pub shutdown_callback : aws_credentials_provider_shutdown_completed_fn , pub shutdown_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_credentials_provider_shutdown_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_shutdown_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_shutdown_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_shutdown_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_shutdown_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_shutdown_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_user_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_shutdown_options) , "::" , stringify ! (shutdown_user_data))) ; } impl Default for aws_credentials_provider_shutdown_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " A baseclass for credentials providers. A credentials provider is an object that has an asynchronous\n query function for retrieving AWS credentials.\n\n Ref-counted. Thread-safe."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider { pub vtable : * mut aws_credentials_provider_vtable , pub allocator : * mut aws_allocator , pub shutdown_options : aws_credentials_provider_shutdown_options , pub impl_ : * mut :: libc :: c_void , pub ref_count : aws_atomic_var , } # [test] fn bindgen_test_layout_aws_credentials_provider () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider > () , 48usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider) , "::" , stringify ! (ref_count))) ; } impl Default for aws_credentials_provider { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for a provider that returns a fixed set of credentials"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_static_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub access_key_id : aws_byte_cursor , pub secret_access_key : aws_byte_cursor , pub session_token : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_credentials_provider_static_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_static_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_static_options > () , 64usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_static_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_static_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_static_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_static_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . access_key_id) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_static_options) , "::" , stringify ! (access_key_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . secret_access_key) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_static_options) , "::" , stringify ! (secret_access_key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . session_token) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_static_options) , "::" , stringify ! (session_token))) ; } impl Default for aws_credentials_provider_static_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for a provider that returns credentials based on environment variable values"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_environment_options { pub shutdown_options : aws_credentials_provider_shutdown_options , } # [test] fn bindgen_test_layout_aws_credentials_provider_environment_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_environment_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_environment_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_environment_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_environment_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_environment_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_environment_options) , "::" , stringify ! (shutdown_options))) ; } impl Default for aws_credentials_provider_environment_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for a provider that sources credentials from the aws config and credentials files\n (by default ~/.aws/config and ~/.aws/credentials)"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_profile_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub profile_name_override : aws_byte_cursor , pub config_file_name_override : aws_byte_cursor , pub credentials_file_name_override : aws_byte_cursor , # [doc = " (Optional)\n Use a cached merged profile collection. A merge collection has both config file\n (~/.aws/config) and credentials file based profile collection (~/.aws/credentials) using\n `aws_profile_collection_new_from_merge`.\n If this option is provided, `config_file_name_override` and `credentials_file_name_override` will be ignored."] pub profile_collection_cached : * mut aws_profile_collection , pub bootstrap : * mut aws_client_bootstrap , pub tls_ctx : * mut aws_tls_ctx , pub function_table : * mut aws_auth_http_system_vtable , } # [test] fn bindgen_test_layout_aws_credentials_provider_profile_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_profile_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_profile_options > () , 96usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_profile_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_profile_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_profile_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_name_override) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (profile_name_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_file_name_override) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (config_file_name_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . credentials_file_name_override) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (credentials_file_name_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_collection_cached) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (profile_collection_cached))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (function_table))) ; } impl Default for aws_credentials_provider_profile_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for a provider that functions as a caching decorator. Credentials sourced through this\n provider will be cached within it until their expiration time. When the cached credentials expire, new\n credentials will be fetched when next queried."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_cached_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub source : * mut aws_credentials_provider , pub refresh_time_in_milliseconds : u64 , pub high_res_clock_fn : aws_io_clock_fn , pub system_clock_fn : aws_io_clock_fn , } # [test] fn bindgen_test_layout_aws_credentials_provider_cached_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_cached_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_cached_options > () , 48usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_cached_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_cached_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_cached_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cached_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . source) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cached_options) , "::" , stringify ! (source))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . refresh_time_in_milliseconds) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cached_options) , "::" , stringify ! (refresh_time_in_milliseconds))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . high_res_clock_fn) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cached_options) , "::" , stringify ! (high_res_clock_fn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . system_clock_fn) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cached_options) , "::" , stringify ! (system_clock_fn))) ; } impl Default for aws_credentials_provider_cached_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for a provider that queries, in order, a list of providers. This provider uses the\n first set of credentials successfully queried. Providers are queried one at a time; a provider is not queried\n until the preceding provider has failed to source credentials."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_chain_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub providers : * mut * mut aws_credentials_provider , pub provider_count : usize , } # [test] fn bindgen_test_layout_aws_credentials_provider_chain_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_chain_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_chain_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_chain_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_chain_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_chain_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . providers) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_options) , "::" , stringify ! (providers))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . provider_count) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_options) , "::" , stringify ! (provider_count))) ; } impl Default for aws_credentials_provider_chain_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_imds_protocol_version { # [doc = " Defaults to IMDS_PROTOCOL_V2. It can be set to either one and IMDS Client\n will figure out (by looking at response code) which protocol an instance\n is using. But a more clear setting will reduce unnecessary network request."] IMDS_PROTOCOL_V2 = 0 , # [doc = " Defaults to IMDS_PROTOCOL_V2. It can be set to either one and IMDS Client\n will figure out (by looking at response code) which protocol an instance\n is using. But a more clear setting will reduce unnecessary network request."] IMDS_PROTOCOL_V1 = 1 , } # [doc = " Configuration options for the provider that sources credentials from ec2 instance metadata"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_imds_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , pub imds_version : aws_imds_protocol_version , pub function_table : * mut aws_auth_http_system_vtable , } # [test] fn bindgen_test_layout_aws_credentials_provider_imds_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_imds_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_imds_options > () , 40usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_imds_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_imds_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_imds_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_imds_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_imds_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . imds_version) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_imds_options) , "::" , stringify ! (imds_version))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_imds_options) , "::" , stringify ! (function_table))) ; } impl Default for aws_credentials_provider_imds_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_ecs_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , pub host : aws_byte_cursor , pub path_and_query : aws_byte_cursor , pub auth_token : aws_byte_cursor , pub tls_ctx : * mut aws_tls_ctx , pub function_table : * mut aws_auth_http_system_vtable , pub port : u16 , } # [test] fn bindgen_test_layout_aws_credentials_provider_ecs_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_ecs_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_ecs_options > () , 96usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_ecs_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_ecs_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_ecs_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . path_and_query) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (path_and_query))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . auth_token) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (auth_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (function_table))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (port))) ; } impl Default for aws_credentials_provider_ecs_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for the X509 credentials provider\n\n The x509 credentials provider sources temporary credentials from AWS IoT Core using TLS mutual authentication.\n See details: https://docs.aws.amazon.com/iot/latest/developerguide/authorizing-direct-aws.html\n An end to end demo with detailed steps can be found here:\n https://aws.amazon.com/blogs/security/how-to-eliminate-the-need-for-hardcoded-aws-credentials-in-devices-by-using-the-aws-iot-credentials-provider/"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_x509_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , pub tls_connection_options : * const aws_tls_connection_options , pub thing_name : aws_byte_cursor , pub role_alias : aws_byte_cursor , # [doc = " Per-account X509 credentials sourcing endpoint."] pub endpoint : aws_byte_cursor , # [doc = " (Optional) Http proxy configuration for the http request that fetches credentials"] pub proxy_options : * const aws_http_proxy_options , pub function_table : * mut aws_auth_http_system_vtable , } # [test] fn bindgen_test_layout_aws_credentials_provider_x509_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_x509_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_x509_options > () , 96usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_x509_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_x509_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_x509_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_connection_options) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (tls_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . thing_name) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (thing_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . role_alias) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (role_alias))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoint) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (endpoint))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_options) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (function_table))) ; } impl Default for aws_credentials_provider_x509_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for the STS web identity provider\n\n Sts with web identity credentials provider sources a set of temporary security credentials for users who have been\n authenticated in a mobile or web application with a web identity provider.\n Example providers include Amazon Cognito, Login with Amazon, Facebook, Google, or any OpenID Connect-compatible\n identity provider like Elastic Kubernetes Service\n https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html\n The required parameters used in the request (region, roleArn, sessionName, tokenFilePath) are automatically resolved\n by SDK from envrionment variables or config file.\n---------------------------------------------------------------------------------\n| Parameter | Environment Variable Name | Config File Property Name |\n----------------------------------------------------------------------------------\n| region | AWS_DEFAULT_REGION | region |\n| role_arn | AWS_ROLE_ARN | role_arn |\n| role_session_name | AWS_ROLE_SESSION_NAME | role_session_name |\n| token_file_path | AWS_WEB_IDENTITY_TOKEN_FILE | web_identity_token_file |\n|--------------------------------------------------------------------------------|"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_sts_web_identity_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , # [doc = " (Optional)\n Use a cached config profile collection. You can also pass a merged collection."] pub config_profile_collection_cached : * mut aws_profile_collection , pub tls_ctx : * mut aws_tls_ctx , pub function_table : * mut aws_auth_http_system_vtable , pub profile_name_override : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_credentials_provider_sts_web_identity_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_sts_web_identity_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_sts_web_identity_options > () , 64usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_sts_web_identity_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_sts_web_identity_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_sts_web_identity_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_profile_collection_cached) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (config_profile_collection_cached))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (function_table))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_name_override) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (profile_name_override))) ; } impl Default for aws_credentials_provider_sts_web_identity_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_sso_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub profile_name_override : aws_byte_cursor , pub config_file_name_override : aws_byte_cursor , # [doc = " (Optional)\n Use a cached config profile collection. You can also pass a merged collection.\n config_file_name_override will be ignored if this option is provided."] pub config_file_cached : * mut aws_profile_collection , pub bootstrap : * mut aws_client_bootstrap , pub tls_ctx : * mut aws_tls_ctx , pub function_table : * mut aws_auth_http_system_vtable , pub system_clock_fn : aws_io_clock_fn , } # [test] fn bindgen_test_layout_aws_credentials_provider_sso_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_sso_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_sso_options > () , 88usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_sso_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_sso_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_sso_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_name_override) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (profile_name_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_file_name_override) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (config_file_name_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_file_cached) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (config_file_cached))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (function_table))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . system_clock_fn) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (system_clock_fn))) ; } impl Default for aws_credentials_provider_sso_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for the STS credentials provider"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_sts_options { pub bootstrap : * mut aws_client_bootstrap , pub tls_ctx : * mut aws_tls_ctx , pub creds_provider : * mut aws_credentials_provider , pub role_arn : aws_byte_cursor , pub session_name : aws_byte_cursor , pub duration_seconds : u16 , # [doc = " (Optional) Http proxy configuration for the AssumeRole http request that fetches credentials"] pub http_proxy_options : * const aws_http_proxy_options , pub shutdown_options : aws_credentials_provider_shutdown_options , pub function_table : * mut aws_auth_http_system_vtable , pub system_clock_fn : aws_io_clock_fn , } # [test] fn bindgen_test_layout_aws_credentials_provider_sts_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_sts_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_sts_options > () , 104usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_sts_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_sts_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_sts_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . creds_provider) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (creds_provider))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . role_arn) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (role_arn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . session_name) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (session_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . duration_seconds) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (duration_seconds))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http_proxy_options) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (http_proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (function_table))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . system_clock_fn) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (system_clock_fn))) ; } impl Default for aws_credentials_provider_sts_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for the process credentials provider\n\n The process credentials provider sources credentials from running a command or process.\n The command to run is sourced from a profile in the AWS config file, using the standard\n profile selection rules. The profile key the command is read from is \"credential_process.\"\n E.g.:\n [default]\n credential_process=/opt/amazon/bin/my-credential-fetcher --argsA=abc\n On successfully running the command, the output should be a json data with the following\n format:\n {\n\"Version\": 1,\n\"AccessKeyId\": \"accesskey\",\n\"SecretAccessKey\": \"secretAccessKey\"\n\"SessionToken\": \"....\",\n\"Expiration\": \"2019-05-29T00:21:43Z\"\n}\n Version here identifies the command output format version."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_process_options { pub shutdown_options : aws_credentials_provider_shutdown_options , # [doc = " In which profile name to look for credential_process,\n if not provided, we will try environment variable: AWS_PROFILE."] pub profile_to_use : aws_byte_cursor , # [doc = " (Optional)\n Use a cached config profile collection. You can also pass a merged collection."] pub config_profile_collection_cached : * mut aws_profile_collection , } # [test] fn bindgen_test_layout_aws_credentials_provider_process_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_process_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_process_options > () , 40usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_process_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_process_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_process_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_process_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_to_use) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_process_options) , "::" , stringify ! (profile_to_use))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_profile_collection_cached) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_process_options) , "::" , stringify ! (config_profile_collection_cached))) ; } impl Default for aws_credentials_provider_process_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for the default credentials provider chain."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_chain_default_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , pub tls_ctx : * mut aws_tls_ctx , # [doc = " (Optional)\n Use a cached merged profile collection. A merge collection has both config file\n (~/.aws/config) and credentials file based profile collection (~/.aws/credentials) using\n `aws_profile_collection_new_from_merge`.\n If this option is provided, `config_file_name_override` and `credentials_file_name_override` will be ignored."] pub profile_collection_cached : * mut aws_profile_collection , pub profile_name_override : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_credentials_provider_chain_default_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_chain_default_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_chain_default_options > () , 56usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_chain_default_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_chain_default_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_chain_default_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_default_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_default_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_default_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_collection_cached) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_default_options) , "::" , stringify ! (profile_collection_cached))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_name_override) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_default_options) , "::" , stringify ! (profile_name_override))) ; } impl Default for aws_credentials_provider_chain_default_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_credentials_provider_delegate_get_credentials_fn = :: std :: option :: Option < unsafe extern "C" fn (delegate_user_data : * mut :: libc :: c_void , callback : aws_on_get_credentials_callback_fn , callback_user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Configuration options for the delegate credentials provider."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_delegate_options { pub shutdown_options : aws_credentials_provider_shutdown_options , # [doc = " Delegated get_credentials() callback."] pub get_credentials : aws_credentials_provider_delegate_get_credentials_fn , # [doc = " User data for delegated callbacks."] pub delegate_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_credentials_provider_delegate_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_delegate_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_delegate_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_delegate_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_delegate_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_delegate_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_delegate_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_credentials) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_delegate_options) , "::" , stringify ! (get_credentials))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . delegate_user_data) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_delegate_options) , "::" , stringify ! (delegate_user_data))) ; } impl Default for aws_credentials_provider_delegate_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " A (string) pair defining an identity provider and a valid login token sourced from it."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_cognito_identity_provider_token_pair { # [doc = " Name of an identity provider"] pub identity_provider_name : aws_byte_cursor , # [doc = " Valid login token source from the identity provider"] pub identity_provider_token : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_cognito_identity_provider_token_pair () { const UNINIT : :: std :: mem :: MaybeUninit < aws_cognito_identity_provider_token_pair > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_cognito_identity_provider_token_pair > () , 32usize , concat ! ("Size of: " , stringify ! (aws_cognito_identity_provider_token_pair))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_cognito_identity_provider_token_pair > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_cognito_identity_provider_token_pair))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . identity_provider_name) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_cognito_identity_provider_token_pair) , "::" , stringify ! (identity_provider_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . identity_provider_token) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_cognito_identity_provider_token_pair) , "::" , stringify ! (identity_provider_token))) ; } impl Default for aws_cognito_identity_provider_token_pair { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options needed to create a Cognito-based Credentials Provider"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_cognito_options { pub shutdown_options : aws_credentials_provider_shutdown_options , # [doc = " Cognito service regional endpoint to source credentials from."] pub endpoint : aws_byte_cursor , # [doc = " Cognito identity to fetch credentials relative to."] pub identity : aws_byte_cursor , # [doc = " Optional set of identity provider token pairs to allow for authenticated identity access."] pub logins : * mut aws_cognito_identity_provider_token_pair , pub login_count : usize , # [doc = " Optional ARN of the role to be assumed when multiple roles were received in the token from the identity provider."] pub custom_role_arn : * mut aws_byte_cursor , pub bootstrap : * mut aws_client_bootstrap , pub tls_ctx : * mut aws_tls_ctx , # [doc = " (Optional) Http proxy configuration for the http request that fetches credentials"] pub http_proxy_options : * const aws_http_proxy_options , pub function_table : * mut aws_auth_http_system_vtable , } # [test] fn bindgen_test_layout_aws_credentials_provider_cognito_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_cognito_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_cognito_options > () , 104usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_cognito_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_cognito_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_cognito_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoint) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (endpoint))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . identity) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (identity))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . logins) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (logins))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . login_count) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (login_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . custom_role_arn) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (custom_role_arn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http_proxy_options) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (http_proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (function_table))) ; } impl Default for aws_credentials_provider_cognito_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Creates a new set of aws credentials\n\n @param allocator memory allocator to use\n @param access_key_id_cursor value for the aws access key id field\n @param secret_access_key_cursor value for the secret access key field\n @param session_token_cursor (optional) security token associated with the credentials\n @param expiration_timepoint_seconds timepoint, in seconds since epoch, that the credentials will no longer\n be valid past. For credentials that do not expire, use UINT64_MAX\n\n @return a valid credentials object, or NULL"] pub fn aws_credentials_new (allocator : * mut aws_allocator , access_key_id_cursor : aws_byte_cursor , secret_access_key_cursor : aws_byte_cursor , session_token_cursor : aws_byte_cursor , expiration_timepoint_seconds : u64) -> * mut aws_credentials ; } extern "C" { # [doc = " Creates a new set of aws anonymous credentials.\n Use Anonymous credentials, when you want to skip the signing process.\n\n @param allocator memory allocator to use\n\n @return a valid credentials object, or NULL"] pub fn aws_credentials_new_anonymous (allocator : * mut aws_allocator) -> * mut aws_credentials ; } extern "C" { # [doc = " Creates a new set of AWS credentials\n\n @param allocator memory allocator to use\n @param access_key_id value for the aws access key id field\n @param secret_access_key value for the secret access key field\n @param session_token (optional) security token associated with the credentials\n @param expiration_timepoint_seconds timepoint, in seconds since epoch, that the credentials will no longer\n be valid past. For credentials that do not expire, use UINT64_MAX\n\n @return a valid credentials object, or NULL"] pub fn aws_credentials_new_from_string (allocator : * mut aws_allocator , access_key_id : * const aws_string , secret_access_key : * const aws_string , session_token : * const aws_string , expiration_timepoint_seconds : u64) -> * mut aws_credentials ; } extern "C" { # [doc = " Creates a set of AWS credentials that includes an ECC key pair. These credentials do not have a value for\n the secret access key; the ecc key takes over that field's role in sigv4a signing.\n\n @param allocator memory allocator to use for all memory allocation\n @param access_key_id access key id for the credential set\n @param ecc_key ecc key to use during signing when using these credentials\n @param session_token (optional) session token associated with the credentials\n @param expiration_timepoint_in_seconds (optional) if session-based, time at which these credentials expire\n @return a new pair of AWS credentials, or NULL"] pub fn aws_credentials_new_ecc (allocator : * mut aws_allocator , access_key_id : aws_byte_cursor , ecc_key : * mut aws_ecc_key_pair , session_token : aws_byte_cursor , expiration_timepoint_in_seconds : u64) -> * mut aws_credentials ; } extern "C" { pub fn aws_credentials_new_ecc_from_aws_credentials (allocator : * mut aws_allocator , credentials : * const aws_credentials) -> * mut aws_credentials ; } extern "C" { # [doc = " Add a reference to some credentials\n\n @param credentials credentials to increment the ref count on"] pub fn aws_credentials_acquire (credentials : * const aws_credentials) ; } extern "C" { # [doc = " Remove a reference to some credentials\n\n @param credentials credentials to decrement the ref count on"] pub fn aws_credentials_release (credentials : * const aws_credentials) ; } extern "C" { # [doc = " Get the AWS access key id from a set of credentials\n\n @param credentials credentials to get the access key id from\n @return a byte cursor to the access key id"] pub fn aws_credentials_get_access_key_id (credentials : * const aws_credentials) -> aws_byte_cursor ; } extern "C" { # [doc = " Get the AWS secret access key from a set of credentials\n\n @param credentials credentials to get the secret access key from\n @return a byte cursor to the secret access key"] pub fn aws_credentials_get_secret_access_key (credentials : * const aws_credentials) -> aws_byte_cursor ; } extern "C" { # [doc = " Get the AWS session token from a set of credentials\n\n @param credentials credentials to get the session token from\n @return a byte cursor to the session token or an empty byte cursor if there is no session token"] pub fn aws_credentials_get_session_token (credentials : * const aws_credentials) -> aws_byte_cursor ; } extern "C" { # [doc = " Get the expiration timepoint (in seconds since epoch) associated with a set of credentials\n\n @param credentials credentials to get the expiration timepoint for\n @return the time, in seconds since epoch, the credentials will expire; UINT64_MAX for credentials\n without a specific expiration time"] pub fn aws_credentials_get_expiration_timepoint_seconds (credentials : * const aws_credentials) -> u64 ; } extern "C" { # [doc = " Get the elliptic curve key associated with this set of credentials\n @param credentials credentials to get the the elliptic curve key for\n @return the elliptic curve key associated with the credentials, or NULL if no key is associated with\n these credentials"] pub fn aws_credentials_get_ecc_key_pair (credentials : * const aws_credentials) -> * mut aws_ecc_key_pair ; } extern "C" { # [doc = " If credentials are anonymous, then the signing process is skipped.\n\n @param credentials credentials to check\n\n @return true if the credentials are anonymous; false otherwise."] pub fn aws_credentials_is_anonymous (credentials : * const aws_credentials) -> bool ; } extern "C" { # [doc = " Derives an ecc key pair (based on the nist P256 curve) from the access key id and secret access key components\n of a set of AWS credentials using an internal key derivation specification. Used to perform sigv4a signing in\n the hybrid mode based on AWS credentials.\n\n @param allocator memory allocator to use for all memory allocation\n @param credentials AWS credentials to derive the ECC key from using the AWS sigv4a key deriviation specification\n @return a new ecc key pair or NULL on failure"] pub fn aws_ecc_key_pair_new_ecdsa_p256_key_from_aws_credentials (allocator : * mut aws_allocator , credentials : * const aws_credentials) -> * mut aws_ecc_key_pair ; } extern "C" { # [doc = " Release a reference to a credentials provider\n\n @param provider provider to decrement the ref count on"] pub fn aws_credentials_provider_release (provider : * mut aws_credentials_provider) -> * mut aws_credentials_provider ; } extern "C" { pub fn aws_credentials_provider_acquire (provider : * mut aws_credentials_provider) -> * mut aws_credentials_provider ; } extern "C" { pub fn aws_credentials_provider_get_credentials (provider : * mut aws_credentials_provider , callback : aws_on_get_credentials_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Creates a simple provider that just returns a fixed set of credentials\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_static (allocator : * mut aws_allocator , options : * const aws_credentials_provider_static_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a simple anonymous credentials provider\n\n @param allocator memory allocator to use for all memory allocation\n @param shutdown_options an optional shutdown callback that gets\n invoked when the resources used by the provider are no longer in use.\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_anonymous (allocator : * mut aws_allocator , shutdown_options : * const aws_credentials_provider_shutdown_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that returns credentials sourced from the environment variables:\n\n AWS_ACCESS_KEY_ID\n AWS_SECRET_ACCESS_KEY\n AWS_SESSION_TOKEN\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_environment (allocator : * mut aws_allocator , options : * const aws_credentials_provider_environment_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that functions as a caching decorating of another provider.\n\n For example, the default chain is implemented as:\n\n CachedProvider -> ProviderChain(EnvironmentProvider -> ProfileProvider -> ECS/EC2IMD etc...)\n\n A reference is taken on the target provider\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_cached (allocator : * mut aws_allocator , options : * const aws_credentials_provider_cached_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from key-value profiles loaded from the aws credentials\n file (\"~/.aws/credentials\" by default) and the aws config file (\"~/.aws/config\" by\n default)\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_profile (allocator : * mut aws_allocator , options : * const aws_credentials_provider_profile_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that assumes an IAM role via. STS AssumeRole() API. This provider will fetch new credentials\n upon each call to aws_credentials_provider_get_credentials().\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_sts (allocator : * mut aws_allocator , options : * const aws_credentials_provider_sts_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from an ordered sequence of providers, with the overall result\n being from the first provider to return a valid set of credentials\n\n References are taken on all supplied providers\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_chain (allocator : * mut aws_allocator , options : * const aws_credentials_provider_chain_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from the ec2 instance metadata service\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_imds (allocator : * mut aws_allocator , options : * const aws_credentials_provider_imds_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from the ecs role credentials service\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_ecs (allocator : * mut aws_allocator , options : * const aws_credentials_provider_ecs_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from IoT Core\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_x509 (allocator : * mut aws_allocator , options : * const aws_credentials_provider_x509_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from STS using AssumeRoleWithWebIdentity\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_sts_web_identity (allocator : * mut aws_allocator , options : * const aws_credentials_provider_sts_web_identity_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from SSO using a SSOToken.\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_sso (allocator : * mut aws_allocator , options : * const aws_credentials_provider_sso_options) -> * mut aws_credentials_provider ; } extern "C" { pub fn aws_credentials_provider_new_process (allocator : * mut aws_allocator , options : * const aws_credentials_provider_process_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Create a credentials provider depends on provided vtable to fetch the credentials.\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_delegate (allocator : * mut aws_allocator , options : * const aws_credentials_provider_delegate_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from the Cognito-Identity service via an\n invocation of the GetCredentialsForIdentity API call.\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_cognito (allocator : * mut aws_allocator , options : * const aws_credentials_provider_cognito_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a cognito-based provider that has a caching layer wrapped around it\n\n @param allocator memory allocator to use for all memory allocation\n @param options cognito-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_cognito_caching (allocator : * mut aws_allocator , options : * const aws_credentials_provider_cognito_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates the default provider chain used by most AWS SDKs.\n\n Generally:\n\n (1) Environment\n (2) Profile\n (3) STS web identity\n (4) (conditional, off by default) ECS\n (5) (conditional, on by default) EC2 Instance Metadata\n\n Support for environmental control of the default provider chain is not yet\n implemented.\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_chain_default (allocator : * mut aws_allocator , options : * const aws_credentials_provider_chain_default_options) -> * mut aws_credentials_provider ; } extern "C" { pub static mut g_aws_credentials_provider_http_function_table : * const aws_auth_http_system_vtable ; } pub const AWS_DATE_TIME_STR_MAX_LEN : _bindgen_ty_21 = _bindgen_ty_21 :: AWS_DATE_TIME_STR_MAX_LEN ; pub const AWS_DATE_TIME_STR_MAX_BASIC_LEN : _bindgen_ty_21 = _bindgen_ty_21 :: AWS_DATE_TIME_STR_MAX_BASIC_LEN ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_21 { AWS_DATE_TIME_STR_MAX_LEN = 100 , AWS_DATE_TIME_STR_MAX_BASIC_LEN = 20 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_date_format { AWS_DATE_FORMAT_RFC822 = 0 , AWS_DATE_FORMAT_ISO_8601 = 1 , AWS_DATE_FORMAT_ISO_8601_BASIC = 2 , AWS_DATE_FORMAT_AUTO_DETECT = 3 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_date_month { AWS_DATE_MONTH_JANUARY = 0 , AWS_DATE_MONTH_FEBRUARY = 1 , AWS_DATE_MONTH_MARCH = 2 , AWS_DATE_MONTH_APRIL = 3 , AWS_DATE_MONTH_MAY = 4 , AWS_DATE_MONTH_JUNE = 5 , AWS_DATE_MONTH_JULY = 6 , AWS_DATE_MONTH_AUGUST = 7 , AWS_DATE_MONTH_SEPTEMBER = 8 , AWS_DATE_MONTH_OCTOBER = 9 , AWS_DATE_MONTH_NOVEMBER = 10 , AWS_DATE_MONTH_DECEMBER = 11 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_date_day_of_week { AWS_DATE_DAY_OF_WEEK_SUNDAY = 0 , AWS_DATE_DAY_OF_WEEK_MONDAY = 1 , AWS_DATE_DAY_OF_WEEK_TUESDAY = 2 , AWS_DATE_DAY_OF_WEEK_WEDNESDAY = 3 , AWS_DATE_DAY_OF_WEEK_THURSDAY = 4 , AWS_DATE_DAY_OF_WEEK_FRIDAY = 5 , AWS_DATE_DAY_OF_WEEK_SATURDAY = 6 , } # [repr (C)] pub struct aws_date_time { pub timestamp : time_t , pub milliseconds : u16 , pub tz : [:: libc :: c_char ; 6usize] , pub gmt_time : tm , pub local_time : tm , pub utc_assumed : bool , } # [test] fn bindgen_test_layout_aws_date_time () { const UNINIT : :: std :: mem :: MaybeUninit < aws_date_time > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_date_time > () , 136usize , concat ! ("Size of: " , stringify ! (aws_date_time))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_date_time > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_date_time))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . timestamp) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (timestamp))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . milliseconds) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (milliseconds))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tz) as usize - ptr as usize } , 10usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (tz))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . gmt_time) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (gmt_time))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . local_time) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (local_time))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . utc_assumed) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (utc_assumed))) ; } impl Default for aws_date_time { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Initializes dt to be the current system time."] pub fn aws_date_time_init_now (dt : * mut aws_date_time) ; } extern "C" { # [doc = " Initializes dt to be the time represented in milliseconds since unix epoch."] pub fn aws_date_time_init_epoch_millis (dt : * mut aws_date_time , ms_since_epoch : u64) ; } extern "C" { # [doc = " Initializes dt to be the time represented in seconds.millis since unix epoch."] pub fn aws_date_time_init_epoch_secs (dt : * mut aws_date_time , sec_ms : f64) ; } extern "C" { # [doc = " Initializes dt to be the time represented by date_str in format 'fmt'. Returns AWS_OP_SUCCESS if the\n string was successfully parsed, returns AWS_OP_ERR if parsing failed.\n\n Notes for AWS_DATE_FORMAT_RFC822:\n If no time zone information is provided, it is assumed to be local time (please don't do this).\n\n If the time zone is something other than something indicating Universal Time (e.g. Z, UT, UTC, or GMT) or an offset\n from UTC (e.g. +0100, -0700), parsing will fail.\n\n Really, it's just better if you always use Universal Time."] pub fn aws_date_time_init_from_str (dt : * mut aws_date_time , date_str : * const aws_byte_buf , fmt : aws_date_format) -> :: libc :: c_int ; } extern "C" { # [doc = " aws_date_time_init variant that takes a byte_cursor rather than a byte_buf"] pub fn aws_date_time_init_from_str_cursor (dt : * mut aws_date_time , date_str_cursor : * const aws_byte_cursor , fmt : aws_date_format) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the current time as a formatted date string in local time into output_buf. If buffer is too small, it will\n return AWS_OP_ERR. A good size suggestion is AWS_DATE_TIME_STR_MAX_LEN bytes. AWS_DATE_FORMAT_AUTO_DETECT is not\n allowed."] pub fn aws_date_time_to_local_time_str (dt : * const aws_date_time , fmt : aws_date_format , output_buf : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the current time as a formatted date string in utc time into output_buf. If buffer is too small, it will\n return AWS_OP_ERR. A good size suggestion is AWS_DATE_TIME_STR_MAX_LEN bytes. AWS_DATE_FORMAT_AUTO_DETECT is not\n allowed."] pub fn aws_date_time_to_utc_time_str (dt : * const aws_date_time , fmt : aws_date_format , output_buf : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the current time as a formatted short date string in local time into output_buf. If buffer is too small, it\n will return AWS_OP_ERR. A good size suggestion is AWS_DATE_TIME_STR_MAX_LEN bytes. AWS_DATE_FORMAT_AUTO_DETECT is not\n allowed."] pub fn aws_date_time_to_local_time_short_str (dt : * const aws_date_time , fmt : aws_date_format , output_buf : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the current time as a formatted short date string in utc time into output_buf. If buffer is too small, it will\n return AWS_OP_ERR. A good size suggestion is AWS_DATE_TIME_STR_MAX_LEN bytes. AWS_DATE_FORMAT_AUTO_DETECT is not\n allowed."] pub fn aws_date_time_to_utc_time_short_str (dt : * const aws_date_time , fmt : aws_date_format , output_buf : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { pub fn aws_date_time_as_epoch_secs (dt : * const aws_date_time) -> f64 ; } extern "C" { pub fn aws_date_time_as_nanos (dt : * const aws_date_time) -> u64 ; } extern "C" { pub fn aws_date_time_as_millis (dt : * const aws_date_time) -> u64 ; } extern "C" { pub fn aws_date_time_year (dt : * const aws_date_time , local_time : bool) -> u16 ; } extern "C" { pub fn aws_date_time_month (dt : * const aws_date_time , local_time : bool) -> aws_date_month ; } extern "C" { pub fn aws_date_time_month_day (dt : * const aws_date_time , local_time : bool) -> u8 ; } extern "C" { pub fn aws_date_time_day_of_week (dt : * const aws_date_time , local_time : bool) -> aws_date_day_of_week ; } extern "C" { pub fn aws_date_time_hour (dt : * const aws_date_time , local_time : bool) -> u8 ; } extern "C" { pub fn aws_date_time_minute (dt : * const aws_date_time , local_time : bool) -> u8 ; } extern "C" { pub fn aws_date_time_second (dt : * const aws_date_time , local_time : bool) -> u8 ; } extern "C" { pub fn aws_date_time_dst (dt : * const aws_date_time , local_time : bool) -> bool ; } extern "C" { # [doc = " returns the difference of a and b (a - b) in seconds."] pub fn aws_date_time_diff (a : * const aws_date_time , b : * const aws_date_time) -> time_t ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_errors { AWS_ERROR_HTTP_UNKNOWN = 2048 , AWS_ERROR_HTTP_HEADER_NOT_FOUND = 2049 , AWS_ERROR_HTTP_INVALID_HEADER_FIELD = 2050 , AWS_ERROR_HTTP_INVALID_HEADER_NAME = 2051 , AWS_ERROR_HTTP_INVALID_HEADER_VALUE = 2052 , AWS_ERROR_HTTP_INVALID_METHOD = 2053 , AWS_ERROR_HTTP_INVALID_PATH = 2054 , AWS_ERROR_HTTP_INVALID_STATUS_CODE = 2055 , AWS_ERROR_HTTP_MISSING_BODY_STREAM = 2056 , AWS_ERROR_HTTP_INVALID_BODY_STREAM = 2057 , AWS_ERROR_HTTP_CONNECTION_CLOSED = 2058 , AWS_ERROR_HTTP_SWITCHED_PROTOCOLS = 2059 , AWS_ERROR_HTTP_UNSUPPORTED_PROTOCOL = 2060 , AWS_ERROR_HTTP_REACTION_REQUIRED = 2061 , AWS_ERROR_HTTP_DATA_NOT_AVAILABLE = 2062 , AWS_ERROR_HTTP_OUTGOING_STREAM_LENGTH_INCORRECT = 2063 , AWS_ERROR_HTTP_CALLBACK_FAILURE = 2064 , AWS_ERROR_HTTP_WEBSOCKET_UPGRADE_FAILURE = 2065 , AWS_ERROR_HTTP_WEBSOCKET_CLOSE_FRAME_SENT = 2066 , AWS_ERROR_HTTP_WEBSOCKET_IS_MIDCHANNEL_HANDLER = 2067 , AWS_ERROR_HTTP_CONNECTION_MANAGER_INVALID_STATE_FOR_ACQUIRE = 2068 , AWS_ERROR_HTTP_CONNECTION_MANAGER_VENDED_CONNECTION_UNDERFLOW = 2069 , AWS_ERROR_HTTP_SERVER_CLOSED = 2070 , AWS_ERROR_HTTP_PROXY_CONNECT_FAILED = 2071 , AWS_ERROR_HTTP_CONNECTION_MANAGER_SHUTTING_DOWN = 2072 , AWS_ERROR_HTTP_CHANNEL_THROUGHPUT_FAILURE = 2073 , AWS_ERROR_HTTP_PROTOCOL_ERROR = 2074 , AWS_ERROR_HTTP_STREAM_IDS_EXHAUSTED = 2075 , AWS_ERROR_HTTP_GOAWAY_RECEIVED = 2076 , AWS_ERROR_HTTP_RST_STREAM_RECEIVED = 2077 , AWS_ERROR_HTTP_RST_STREAM_SENT = 2078 , AWS_ERROR_HTTP_STREAM_NOT_ACTIVATED = 2079 , AWS_ERROR_HTTP_STREAM_HAS_COMPLETED = 2080 , AWS_ERROR_HTTP_PROXY_STRATEGY_NTLM_CHALLENGE_TOKEN_MISSING = 2081 , AWS_ERROR_HTTP_PROXY_STRATEGY_TOKEN_RETRIEVAL_FAILURE = 2082 , AWS_ERROR_HTTP_PROXY_CONNECT_FAILED_RETRYABLE = 2083 , AWS_ERROR_HTTP_PROTOCOL_SWITCH_FAILURE = 2084 , AWS_ERROR_HTTP_MAX_CONCURRENT_STREAMS_EXCEEDED = 2085 , AWS_ERROR_HTTP_STREAM_MANAGER_SHUTTING_DOWN = 2086 , AWS_ERROR_HTTP_STREAM_MANAGER_CONNECTION_ACQUIRE_FAILURE = 2087 , AWS_ERROR_HTTP_STREAM_MANAGER_UNEXPECTED_HTTP_VERSION = 2088 , AWS_ERROR_HTTP_WEBSOCKET_PROTOCOL_ERROR = 2089 , AWS_ERROR_HTTP_MANUAL_WRITE_NOT_ENABLED = 2090 , AWS_ERROR_HTTP_MANUAL_WRITE_HAS_COMPLETED = 2091 , AWS_ERROR_HTTP_END_RANGE = 3071 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http2_error_code { AWS_HTTP2_ERR_NO_ERROR = 0 , AWS_HTTP2_ERR_PROTOCOL_ERROR = 1 , AWS_HTTP2_ERR_INTERNAL_ERROR = 2 , AWS_HTTP2_ERR_FLOW_CONTROL_ERROR = 3 , AWS_HTTP2_ERR_SETTINGS_TIMEOUT = 4 , AWS_HTTP2_ERR_STREAM_CLOSED = 5 , AWS_HTTP2_ERR_FRAME_SIZE_ERROR = 6 , AWS_HTTP2_ERR_REFUSED_STREAM = 7 , AWS_HTTP2_ERR_CANCEL = 8 , AWS_HTTP2_ERR_COMPRESSION_ERROR = 9 , AWS_HTTP2_ERR_CONNECT_ERROR = 10 , AWS_HTTP2_ERR_ENHANCE_YOUR_CALM = 11 , AWS_HTTP2_ERR_INADEQUATE_SECURITY = 12 , AWS_HTTP2_ERR_HTTP_1_1_REQUIRED = 13 , AWS_HTTP2_ERR_COUNT = 14 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_log_subject { AWS_LS_HTTP_GENERAL = 2048 , AWS_LS_HTTP_CONNECTION = 2049 , AWS_LS_HTTP_ENCODER = 2050 , AWS_LS_HTTP_DECODER = 2051 , AWS_LS_HTTP_SERVER = 2052 , AWS_LS_HTTP_STREAM = 2053 , AWS_LS_HTTP_CONNECTION_MANAGER = 2054 , AWS_LS_HTTP_STREAM_MANAGER = 2055 , AWS_LS_HTTP_WEBSOCKET = 2056 , AWS_LS_HTTP_WEBSOCKET_SETUP = 2057 , AWS_LS_HTTP_PROXY_NEGOTIATION = 2058 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_version { AWS_HTTP_VERSION_UNKNOWN = 0 , AWS_HTTP_VERSION_1_0 = 1 , AWS_HTTP_VERSION_1_1 = 2 , AWS_HTTP_VERSION_2 = 3 , AWS_HTTP_VERSION_COUNT = 4 , } extern "C" { # [doc = " Initializes internal datastructures used by aws-c-http.\n Must be called before using any functionality in aws-c-http."] pub fn aws_http_library_init (alloc : * mut aws_allocator) ; } extern "C" { # [doc = " Clean up internal datastructures used by aws-c-http.\n Must not be called until application is done using functionality in aws-c-http."] pub fn aws_http_library_clean_up () ; } extern "C" { # [doc = " Returns the description of common status codes.\n Ex: 404 -> \"Not Found\"\n An empty string is returned if the status code is not recognized."] pub fn aws_http_status_text (status_code : :: libc :: c_int) -> * const :: libc :: c_char ; } extern "C" { # [doc = " Shortcuts for common HTTP request methods"] pub static aws_http_method_get : aws_byte_cursor ; } extern "C" { pub static aws_http_method_head : aws_byte_cursor ; } extern "C" { pub static aws_http_method_post : aws_byte_cursor ; } extern "C" { pub static aws_http_method_put : aws_byte_cursor ; } extern "C" { pub static aws_http_method_delete : aws_byte_cursor ; } extern "C" { pub static aws_http_method_connect : aws_byte_cursor ; } extern "C" { pub static aws_http_method_options : aws_byte_cursor ; } extern "C" { pub static aws_http_header_method : aws_byte_cursor ; } extern "C" { pub static aws_http_header_scheme : aws_byte_cursor ; } extern "C" { pub static aws_http_header_authority : aws_byte_cursor ; } extern "C" { pub static aws_http_header_path : aws_byte_cursor ; } extern "C" { pub static aws_http_header_status : aws_byte_cursor ; } extern "C" { pub static aws_http_scheme_http : aws_byte_cursor ; } extern "C" { pub static aws_http_scheme_https : aws_byte_cursor ; } # [doc = " An HTTP connection.\n This type is used by both server-side and client-side connections.\n This type is also used by all supported versions of HTTP."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_connection { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_connection_manager { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_socket_options { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_tls_connection_options { _unused : [u8 ; 0] , } pub type aws_http_connection_manager_on_connection_setup_fn = :: std :: option :: Option < unsafe extern "C" fn (connection : * mut aws_http_connection , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_http_connection_manager_shutdown_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [doc = " Metrics for logging and debugging purpose."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http_manager_metrics { # [doc = " The number of additional concurrent requests that can be supported by the HTTP manager without needing to\n establish additional connections to the target server.\n\n For connection manager, it equals to connections that's idle.\n For stream manager, it equals to the number of streams that are possible to be made without creating new\n connection, although the implementation can create new connection without fully filling it."] pub available_concurrency : usize , pub pending_concurrency_acquires : usize , pub leased_concurrency : usize , } # [test] fn bindgen_test_layout_aws_http_manager_metrics () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_manager_metrics > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_manager_metrics > () , 24usize , concat ! ("Size of: " , stringify ! (aws_http_manager_metrics))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_manager_metrics > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_manager_metrics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . available_concurrency) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_manager_metrics) , "::" , stringify ! (available_concurrency))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . pending_concurrency_acquires) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_manager_metrics) , "::" , stringify ! (pending_concurrency_acquires))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . leased_concurrency) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_manager_metrics) , "::" , stringify ! (leased_concurrency))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_connection_manager_options { pub bootstrap : * mut aws_client_bootstrap , pub initial_window_size : usize , pub socket_options : * const aws_socket_options , # [doc = " Options to create secure (HTTPS) connections.\n For secure connections, set \"h2\" in the ALPN string for HTTP/2, otherwise HTTP/1.1 is used.\n\n Leave NULL to create cleartext (HTTP) connections.\n For cleartext connections, use `http2_prior_knowledge` (RFC-7540 3.4)\n to control whether that are treated as HTTP/1.1 or HTTP/2."] pub tls_connection_options : * const aws_tls_connection_options , # [doc = " Specify whether you have prior knowledge that cleartext (HTTP) connections are HTTP/2 (RFC-7540 3.4).\n If false, then cleartext connections are treated as HTTP/1.1.\n It is illegal to set this true when secure connections are being used.\n Note that upgrading from HTTP/1.1 to HTTP/2 is not supported (RFC-7540 3.2)."] pub http2_prior_knowledge : bool , pub monitoring_options : * const aws_http_connection_monitoring_options , pub host : aws_byte_cursor , pub port : u16 , # [doc = " Optional.\n HTTP/2 specific configuration. Check `struct aws_http2_connection_options` for details of each config"] pub initial_settings_array : * const aws_http2_setting , pub num_initial_settings : usize , pub max_closed_streams : usize , pub http2_conn_manual_window_management : bool , pub proxy_options : * const aws_http_proxy_options , pub proxy_ev_settings : * const proxy_env_var_settings , pub max_connections : usize , pub shutdown_complete_user_data : * mut :: libc :: c_void , pub shutdown_complete_callback : aws_http_connection_manager_shutdown_complete_fn , # [doc = " If set to true, the read back pressure mechanism will be enabled."] pub enable_read_back_pressure : bool , # [doc = " If set to a non-zero value, then connections that stay in the pool longer than the specified\n timeout will be closed automatically."] pub max_connection_idle_in_milliseconds : u64 , } # [test] fn bindgen_test_layout_aws_http_connection_manager_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_connection_manager_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_connection_manager_options > () , 160usize , concat ! ("Size of: " , stringify ! (aws_http_connection_manager_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_connection_manager_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_connection_manager_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_window_size) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (initial_window_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . socket_options) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (socket_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_connection_options) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (tls_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http2_prior_knowledge) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (http2_prior_knowledge))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . monitoring_options) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (monitoring_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_settings_array) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (initial_settings_array))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_initial_settings) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (num_initial_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_closed_streams) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (max_closed_streams))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http2_conn_manual_window_management) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (http2_conn_manual_window_management))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_options) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_settings) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (proxy_ev_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_connections) as usize - ptr as usize } , 120usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (max_connections))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_complete_user_data) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (shutdown_complete_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_complete_callback) as usize - ptr as usize } , 136usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (shutdown_complete_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_back_pressure) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (enable_read_back_pressure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_connection_idle_in_milliseconds) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (max_connection_idle_in_milliseconds))) ; } impl Default for aws_http_connection_manager_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_http_connection_manager_acquire (manager : * mut aws_http_connection_manager) ; } extern "C" { pub fn aws_http_connection_manager_release (manager : * mut aws_http_connection_manager) ; } extern "C" { pub fn aws_http_connection_manager_new (allocator : * mut aws_allocator , options : * const aws_http_connection_manager_options) -> * mut aws_http_connection_manager ; } extern "C" { pub fn aws_http_connection_manager_acquire_connection (manager : * mut aws_http_connection_manager , callback : aws_http_connection_manager_on_connection_setup_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_http_connection_manager_release_connection (manager : * mut aws_http_connection_manager , connection : * mut aws_http_connection) -> :: libc :: c_int ; } extern "C" { # [doc = " Fetch the current manager metrics from connection manager."] pub fn aws_http_connection_manager_fetch_metrics (manager : * const aws_http_connection_manager , out_metrics : * mut aws_http_manager_metrics) ; } # [doc = " Invoked upon the acquisition, or failure to acquire a retry token. This function will always be invoked if and only\n if aws_retry_strategy_acquire_retry_token() returns AWS_OP_SUCCESS. It will never be invoked synchronously from\n aws_retry_strategy_acquire_retry_token(). Token will always be NULL if error_code is non-zero, and vice-versa. If\n token is non-null, it will have a reference count of 1, and you must call aws_retry_token_release() on it later. See\n the comments for aws_retry_strategy_on_retry_ready_fn for more info."] pub type aws_retry_strategy_on_retry_token_acquired_fn = :: std :: option :: Option < unsafe extern "C" fn (retry_strategy : * mut aws_retry_strategy , error_code : :: libc :: c_int , token : * mut aws_retry_token , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked after a successful call to aws_retry_strategy_schedule_retry(). This function will always be invoked if and\n only if aws_retry_strategy_schedule_retry() returns AWS_OP_SUCCESS. It will never be invoked synchronously from\n aws_retry_strategy_schedule_retry(). After attempting the operation, either call aws_retry_strategy_schedule_retry()\n with an aws_retry_error_type or call aws_retry_token_record_success() and then release the token via.\n aws_retry_token_release()."] pub type aws_retry_strategy_on_retry_ready_fn = :: std :: option :: Option < unsafe extern "C" fn (token : * mut aws_retry_token , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Optional function to supply your own generate random implementation"] pub type aws_generate_random_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) -> u64 > ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_retry_error_type { # [doc = " This is a connection level error such as a socket timeout, socket connect error, tls negotiation timeout etc...\n Typically these should never be applied for non-idempotent request types since in this scenario, it's impossible\n to know whether the operation had a side effect on the server."] AWS_RETRY_ERROR_TYPE_TRANSIENT = 0 , # [doc = " This is an error where the server explicitly told the client to back off, such as a 429 or 503 Http error."] AWS_RETRY_ERROR_TYPE_THROTTLING = 1 , # [doc = " This is a server error that isn't explicitly throttling but is considered by the client\n to be something that should be retried."] AWS_RETRY_ERROR_TYPE_SERVER_ERROR = 2 , # [doc = " Doesn't count against any budgets. This could be something like a 401 challenge in Http."] AWS_RETRY_ERROR_TYPE_CLIENT_ERROR = 3 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_retry_strategy_vtable { pub destroy : :: std :: option :: Option < unsafe extern "C" fn (retry_strategy : * mut aws_retry_strategy) > , pub acquire_token : :: std :: option :: Option < unsafe extern "C" fn (retry_strategy : * mut aws_retry_strategy , partition_id : * const aws_byte_cursor , on_acquired : aws_retry_strategy_on_retry_token_acquired_fn , user_data : * mut :: libc :: c_void , timeout_ms : u64) -> :: libc :: c_int > , pub schedule_retry : :: std :: option :: Option < unsafe extern "C" fn (token : * mut aws_retry_token , error_type : aws_retry_error_type , retry_ready : aws_retry_strategy_on_retry_ready_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > , pub record_success : :: std :: option :: Option < unsafe extern "C" fn (token : * mut aws_retry_token) -> :: libc :: c_int > , pub release_token : :: std :: option :: Option < unsafe extern "C" fn (token : * mut aws_retry_token) > , } # [test] fn bindgen_test_layout_aws_retry_strategy_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_retry_strategy_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_retry_strategy_vtable > () , 40usize , concat ! ("Size of: " , stringify ! (aws_retry_strategy_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_retry_strategy_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_retry_strategy_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . acquire_token) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy_vtable) , "::" , stringify ! (acquire_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . schedule_retry) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy_vtable) , "::" , stringify ! (schedule_retry))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . record_success) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy_vtable) , "::" , stringify ! (record_success))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . release_token) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy_vtable) , "::" , stringify ! (release_token))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_retry_strategy { pub allocator : * mut aws_allocator , pub vtable : * mut aws_retry_strategy_vtable , pub ref_count : aws_atomic_var , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_retry_strategy () { const UNINIT : :: std :: mem :: MaybeUninit < aws_retry_strategy > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_retry_strategy > () , 32usize , concat ! ("Size of: " , stringify ! (aws_retry_strategy))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_retry_strategy > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_retry_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy) , "::" , stringify ! (impl_))) ; } impl Default for aws_retry_strategy { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_retry_token { pub allocator : * mut aws_allocator , pub retry_strategy : * mut aws_retry_strategy , pub ref_count : aws_atomic_var , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_retry_token () { const UNINIT : :: std :: mem :: MaybeUninit < aws_retry_token > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_retry_token > () , 32usize , concat ! ("Size of: " , stringify ! (aws_retry_token))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_retry_token > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_retry_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_retry_token) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . retry_strategy) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_retry_token) , "::" , stringify ! (retry_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_retry_token) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_retry_token) , "::" , stringify ! (impl_))) ; } impl Default for aws_retry_token { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [doc = " Jitter mode for exponential backoff.\n\n For a great writeup on these options see:\n https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_exponential_backoff_jitter_mode { AWS_EXPONENTIAL_BACKOFF_JITTER_DEFAULT = 0 , AWS_EXPONENTIAL_BACKOFF_JITTER_NONE = 1 , AWS_EXPONENTIAL_BACKOFF_JITTER_FULL = 2 , AWS_EXPONENTIAL_BACKOFF_JITTER_DECORRELATED = 3 , } # [doc = " Options for exponential backoff retry strategy. el_group must be set, any other option, if set to 0 will signify\n \"use defaults\""] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_exponential_backoff_retry_options { # [doc = " Event loop group to use for scheduling tasks."] pub el_group : * mut aws_event_loop_group , # [doc = " Max retries to allow. The default value is 10"] pub max_retries : usize , # [doc = " Scaling factor to add for the backoff. Default is 25ms"] pub backoff_scale_factor_ms : u32 , # [doc = " Max retry backoff in seconds. Default is 20 seconds"] pub max_backoff_secs : u32 , # [doc = " Jitter mode to use, see comments for aws_exponential_backoff_jitter_mode.\n Default is AWS_EXPONENTIAL_BACKOFF_JITTER_DEFAULT"] pub jitter_mode : aws_exponential_backoff_jitter_mode , # [doc = " Deprecated. Use generate_random_impl instead\n By default this will be set to use aws_device_random. If you want something else, set it here."] pub generate_random : :: std :: option :: Option < unsafe extern "C" fn () -> u64 > , pub generate_random_impl : aws_generate_random_fn , # [doc = " Optional user data for the generate random generate_random_impl."] pub generate_random_user_data : * mut :: libc :: c_void , # [doc = " Optional shutdown callback that gets invoked, with appropriate user data,\n when the resources used by the retry_strategy are no longer in use."] pub shutdown_options : * const aws_shutdown_callback_options , } # [test] fn bindgen_test_layout_aws_exponential_backoff_retry_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_exponential_backoff_retry_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_exponential_backoff_retry_options > () , 64usize , concat ! ("Size of: " , stringify ! (aws_exponential_backoff_retry_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_exponential_backoff_retry_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_exponential_backoff_retry_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . el_group) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (el_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_retries) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (max_retries))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . backoff_scale_factor_ms) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (backoff_scale_factor_ms))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_backoff_secs) as usize - ptr as usize } , 20usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (max_backoff_secs))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . jitter_mode) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (jitter_mode))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . generate_random) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (generate_random))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . generate_random_impl) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (generate_random_impl))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . generate_random_user_data) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (generate_random_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (shutdown_options))) ; } impl Default for aws_exponential_backoff_retry_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_standard_retry_options { pub backoff_retry_options : aws_exponential_backoff_retry_options , # [doc = " capacity for partitions. Defaults to 500"] pub initial_bucket_capacity : usize , } # [test] fn bindgen_test_layout_aws_standard_retry_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_standard_retry_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_standard_retry_options > () , 72usize , concat ! ("Size of: " , stringify ! (aws_standard_retry_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_standard_retry_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_standard_retry_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . backoff_retry_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_standard_retry_options) , "::" , stringify ! (backoff_retry_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_bucket_capacity) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_standard_retry_options) , "::" , stringify ! (initial_bucket_capacity))) ; } impl Default for aws_standard_retry_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Acquire a reference count on retry_strategy."] pub fn aws_retry_strategy_acquire (retry_strategy : * mut aws_retry_strategy) ; } extern "C" { # [doc = " Releases a reference count on retry_strategy."] pub fn aws_retry_strategy_release (retry_strategy : * mut aws_retry_strategy) ; } extern "C" { # [doc = " Attempts to acquire a retry token for use with retries. On success, on_acquired will be invoked when a token is\n available, or an error will be returned if the timeout expires. partition_id identifies operations that should be\n grouped together. This allows for more sophisticated strategies such as AIMD and circuit breaker patterns. Pass NULL\n to use the global partition."] pub fn aws_retry_strategy_acquire_retry_token (retry_strategy : * mut aws_retry_strategy , partition_id : * const aws_byte_cursor , on_acquired : aws_retry_strategy_on_retry_token_acquired_fn , user_data : * mut :: libc :: c_void , timeout_ms : u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Schedules a retry based on the backoff and token based strategies. retry_ready is invoked when the retry is either\n ready for execution or if it has been canceled due to application shutdown.\n\n This function can return an error to reject the retry attempt if, for example, a circuit breaker has opened. If this\n occurs users should fail their calls back to their callers.\n\n error_type is used for book keeping. See the comments above for aws_retry_error_type."] pub fn aws_retry_strategy_schedule_retry (token : * mut aws_retry_token , error_type : aws_retry_error_type , retry_ready : aws_retry_strategy_on_retry_ready_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Records a successful retry. This is used for making future decisions to open up token buckets, AIMD breakers etc...\n some strategies such as exponential backoff will ignore this, but you should always call it after a successful\n operation or your system will never recover during an outage."] pub fn aws_retry_token_record_success (token : * mut aws_retry_token) -> :: libc :: c_int ; } extern "C" { # [doc = " Increments reference count for token. This should be called any time you seat the token to a pointer you own."] pub fn aws_retry_token_acquire (token : * mut aws_retry_token) ; } extern "C" { # [doc = " Releases the reference count for token. This should always be invoked after either calling\n aws_retry_strategy_schedule_retry() and failing, or after calling aws_retry_token_record_success()."] pub fn aws_retry_token_release (token : * mut aws_retry_token) ; } extern "C" { # [doc = " Creates a retry strategy using exponential backoff. This strategy does not perform any bookkeeping on error types and\n success. There is no circuit breaker functionality in here. See the comments above for\n aws_exponential_backoff_retry_options."] pub fn aws_retry_strategy_new_exponential_backoff (allocator : * mut aws_allocator , config : * const aws_exponential_backoff_retry_options) -> * mut aws_retry_strategy ; } extern "C" { # [doc = " This is a retry implementation that cuts off traffic if it's\n detected that an endpoint partition is having availability\n problems. This is necessary to keep from making outages worse\n by scheduling work that's unlikely to succeed yet increases\n load on an already ailing system.\n\n We do this by creating a bucket for each partition. A partition\n is an arbitrary specifier. It can be anything: a region, a service,\n a combination of region and service, a literal dns name.... doesn't matter.\n\n Each bucket has a budget for maximum allowed retries. Different types of events\n carry different weights. Things that indicate an unhealthy partition such as\n transient errors (timeouts, unhealthy connection etc...) cost more.\n A retry for any other reason (service sending a 5xx response code) cost a bit less.\n When a retry is attempted this capacity is leased out to the retry. On success it is\n released back to the capacity pool. On failure, it remains leased.\n Operations that succeed without a retry slowly restore the capacity pool.\n\n If a partition runs out of capacity it is assumed unhealthy and retries will be blocked\n until capacity returns to the pool. To prevent a partition from staying unhealthy after\n an outage has recovered, new requests that succeed without a retry will increase the capacity\n slowly ( a new request gets a payback lease of 1, but the lease is never actually deducted from the capacity pool)."] pub fn aws_retry_strategy_new_standard (allocator : * mut aws_allocator , config : * const aws_standard_retry_options) -> * mut aws_retry_strategy ; } pub type aws_imds_client_shutdown_completed_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [doc = " Optional callback and user data to be invoked when an imds client has fully shut down"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_imds_client_shutdown_options { pub shutdown_callback : aws_imds_client_shutdown_completed_fn , pub shutdown_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_imds_client_shutdown_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_imds_client_shutdown_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_imds_client_shutdown_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_imds_client_shutdown_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_imds_client_shutdown_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_imds_client_shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_shutdown_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_user_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_shutdown_options) , "::" , stringify ! (shutdown_user_data))) ; } impl Default for aws_imds_client_shutdown_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options when creating an imds client"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_imds_client_options { pub shutdown_options : aws_imds_client_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , pub retry_strategy : * mut aws_retry_strategy , pub imds_version : aws_imds_protocol_version , pub function_table : * mut aws_auth_http_system_vtable , } # [test] fn bindgen_test_layout_aws_imds_client_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_imds_client_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_imds_client_options > () , 48usize , concat ! ("Size of: " , stringify ! (aws_imds_client_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_imds_client_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_imds_client_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . retry_strategy) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_options) , "::" , stringify ! (retry_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . imds_version) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_options) , "::" , stringify ! (imds_version))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_options) , "::" , stringify ! (function_table))) ; } impl Default for aws_imds_client_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_imds_client_on_get_resource_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (resource : * const aws_byte_buf , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-categories.html"] # [repr (C)] pub struct aws_imds_iam_profile { pub last_updated : aws_date_time , pub instance_profile_arn : aws_byte_cursor , pub instance_profile_id : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_imds_iam_profile () { const UNINIT : :: std :: mem :: MaybeUninit < aws_imds_iam_profile > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_imds_iam_profile > () , 168usize , concat ! ("Size of: " , stringify ! (aws_imds_iam_profile))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_imds_iam_profile > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_imds_iam_profile))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . last_updated) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_imds_iam_profile) , "::" , stringify ! (last_updated))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . instance_profile_arn) as usize - ptr as usize } , 136usize , concat ! ("Offset of field: " , stringify ! (aws_imds_iam_profile) , "::" , stringify ! (instance_profile_arn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . instance_profile_id) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_imds_iam_profile) , "::" , stringify ! (instance_profile_id))) ; } impl Default for aws_imds_iam_profile { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Block of per-instance EC2-specific data\n\n https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-identity-documents.html"] # [repr (C)] pub struct aws_imds_instance_info { pub marketplace_product_codes : aws_array_list , pub availability_zone : aws_byte_cursor , pub private_ip : aws_byte_cursor , pub version : aws_byte_cursor , pub instance_id : aws_byte_cursor , pub billing_products : aws_array_list , pub instance_type : aws_byte_cursor , pub account_id : aws_byte_cursor , pub image_id : aws_byte_cursor , pub pending_time : aws_date_time , pub architecture : aws_byte_cursor , pub kernel_id : aws_byte_cursor , pub ramdisk_id : aws_byte_cursor , pub region : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_imds_instance_info () { const UNINIT : :: std :: mem :: MaybeUninit < aws_imds_instance_info > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_imds_instance_info > () , 392usize , concat ! ("Size of: " , stringify ! (aws_imds_instance_info))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_imds_instance_info > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_imds_instance_info))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . marketplace_product_codes) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (marketplace_product_codes))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . availability_zone) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (availability_zone))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . private_ip) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (private_ip))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . version) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (version))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . instance_id) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (instance_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . billing_products) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (billing_products))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . instance_type) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (instance_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . account_id) as usize - ptr as usize } , 160usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (account_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . image_id) as usize - ptr as usize } , 176usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (image_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . pending_time) as usize - ptr as usize } , 192usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (pending_time))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . architecture) as usize - ptr as usize } , 328usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (architecture))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . kernel_id) as usize - ptr as usize } , 344usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (kernel_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ramdisk_id) as usize - ptr as usize } , 360usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (ramdisk_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . region) as usize - ptr as usize } , 376usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (region))) ; } impl Default for aws_imds_instance_info { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_imds_client_on_get_array_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (array : * const aws_array_list , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_imds_client_on_get_credentials_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (credentials : * const aws_credentials , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_imds_client_on_get_iam_profile_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (iam_profile_info : * const aws_imds_iam_profile , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_imds_client_on_get_instance_info_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (instance_info : * const aws_imds_instance_info , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " AWS EC2 Metadata Client is used to retrieve AWS EC2 Instance Metadata info."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_imds_client { _unused : [u8 ; 0] , } extern "C" { # [doc = " Creates a new imds client\n\n @param allocator memory allocator to use for creation and queries\n @param options configuration options for the imds client\n\n @return a newly-constructed imds client, or NULL on failure"] pub fn aws_imds_client_new (allocator : * mut aws_allocator , options : * const aws_imds_client_options) -> * mut aws_imds_client ; } extern "C" { # [doc = " Increments the ref count on the client\n\n @param client imds client to acquire a reference to"] pub fn aws_imds_client_acquire (client : * mut aws_imds_client) ; } extern "C" { # [doc = " Decrements the ref count on the client\n\n @param client imds client to release a reference to"] pub fn aws_imds_client_release (client : * mut aws_imds_client) ; } extern "C" { # [doc = " Queries a generic resource (string) from the ec2 instance metadata document\n\n @param client imds client to use for the query\n @param resource_path path of the resource to query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_resource_async (client : * mut aws_imds_client , resource_path : aws_byte_cursor , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the ami id of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_ami_id (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the ami launch index of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_ami_launch_index (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the ami manifest path of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_ami_manifest_path (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the list of ancestor ami ids of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_ancestor_ami_ids (client : * mut aws_imds_client , callback : aws_imds_client_on_get_array_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the instance-action of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_instance_action (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the instance id of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_instance_id (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the instance type of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_instance_type (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the mac address of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_mac_address (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the private ip address of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_private_ip_address (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the availability zone of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_availability_zone (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the product codes of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_product_codes (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the public key of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_public_key (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the ramdisk id of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_ramdisk_id (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the reservation id of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_reservation_id (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the list of the security groups of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_security_groups (client : * mut aws_imds_client , callback : aws_imds_client_on_get_array_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the list of block device mappings of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_block_device_mapping (client : * mut aws_imds_client , callback : aws_imds_client_on_get_array_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the attached iam role of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_attached_iam_role (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets temporary credentials based on the attached iam role of the ec2 instance\n\n @param client imds client to use for the query\n @param iam_role_name iam role name to get temporary credentials through\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_credentials (client : * mut aws_imds_client , iam_role_name : aws_byte_cursor , callback : aws_imds_client_on_get_credentials_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the iam profile information of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_iam_profile (client : * mut aws_imds_client , callback : aws_imds_client_on_get_iam_profile_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the user data of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_user_data (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the signature of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_instance_signature (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the instance information data block of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_instance_info (client : * mut aws_imds_client , callback : aws_imds_client_on_get_instance_info_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " The entry point function to perform a CRC32 (Ethernet, gzip) computation.\n Selects a suitable implementation based on hardware capabilities.\n Pass 0 in the previousCrc32 parameter as an initial value unless continuing\n to update a running crc in a subsequent call."] pub fn aws_checksums_crc32 (input : * const u8 , length : :: libc :: c_int , previousCrc32 : u32) -> u32 ; } extern "C" { # [doc = " The entry point function to perform a Castagnoli CRC32c (iSCSI) computation.\n Selects a suitable implementation based on hardware capabilities.\n Pass 0 in the previousCrc32 parameter as an initial value unless continuing\n to update a running crc in a subsequent call."] pub fn aws_checksums_crc32c (input : * const u8 , length : :: libc :: c_int , previousCrc32 : u32) -> u32 ; } pub type aws_log_channel_send_fn = :: std :: option :: Option < unsafe extern "C" fn (channel : * mut aws_log_channel , output : * mut aws_string) -> :: libc :: c_int > ; pub type aws_log_channel_clean_up_fn = :: std :: option :: Option < unsafe extern "C" fn (channel : * mut aws_log_channel) > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_log_channel_vtable { pub send : aws_log_channel_send_fn , pub clean_up : aws_log_channel_clean_up_fn , } # [test] fn bindgen_test_layout_aws_log_channel_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_channel_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_channel_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_log_channel_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_channel_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_channel_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . send) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel_vtable) , "::" , stringify ! (send))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clean_up) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel_vtable) , "::" , stringify ! (clean_up))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_channel { pub vtable : * mut aws_log_channel_vtable , pub allocator : * mut aws_allocator , pub writer : * mut aws_log_writer , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_log_channel () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_channel > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_channel > () , 32usize , concat ! ("Size of: " , stringify ! (aws_log_channel))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_channel > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_channel))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . writer) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel) , "::" , stringify ! (writer))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel) , "::" , stringify ! (impl_))) ; } impl Default for aws_log_channel { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_log_channel_init_foreground (channel : * mut aws_log_channel , allocator : * mut aws_allocator , writer : * mut aws_log_writer) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_channel_init_background (channel : * mut aws_log_channel , allocator : * mut aws_allocator , writer : * mut aws_log_writer) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_channel_clean_up (channel : * mut aws_log_channel) ; } pub type aws_log_formatter_format_fn = :: std :: option :: Option < unsafe extern "C" fn (formatter : * mut aws_log_formatter , formatted_output : * mut * mut aws_string , level : aws_log_level :: Type , subject : aws_log_subject_t , format : * const :: libc :: c_char , args : * mut __va_list_tag) -> :: libc :: c_int > ; pub type aws_log_formatter_clean_up_fn = :: std :: option :: Option < unsafe extern "C" fn (logger : * mut aws_log_formatter) > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_log_formatter_vtable { pub format : aws_log_formatter_format_fn , pub clean_up : aws_log_formatter_clean_up_fn , } # [test] fn bindgen_test_layout_aws_log_formatter_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_formatter_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_formatter_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_log_formatter_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_formatter_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_formatter_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . format) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter_vtable) , "::" , stringify ! (format))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clean_up) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter_vtable) , "::" , stringify ! (clean_up))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_formatter { pub vtable : * mut aws_log_formatter_vtable , pub allocator : * mut aws_allocator , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_log_formatter () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_formatter > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_formatter > () , 24usize , concat ! ("Size of: " , stringify ! (aws_log_formatter))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_formatter > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_formatter))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter) , "::" , stringify ! (impl_))) ; } impl Default for aws_log_formatter { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_formatter_standard_options { pub date_format : aws_date_format , } # [test] fn bindgen_test_layout_aws_log_formatter_standard_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_formatter_standard_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_formatter_standard_options > () , 4usize , concat ! ("Size of: " , stringify ! (aws_log_formatter_standard_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_formatter_standard_options > () , 4usize , concat ! ("Alignment of " , stringify ! (aws_log_formatter_standard_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . date_format) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter_standard_options) , "::" , stringify ! (date_format))) ; } impl Default for aws_log_formatter_standard_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_logging_standard_formatting_data { pub log_line_buffer : * mut :: libc :: c_char , pub total_length : usize , pub level : aws_log_level :: Type , pub subject_name : * const :: libc :: c_char , pub format : * const :: libc :: c_char , pub date_format : aws_date_format , pub allocator : * mut aws_allocator , pub amount_written : usize , } # [test] fn bindgen_test_layout_aws_logging_standard_formatting_data () { const UNINIT : :: std :: mem :: MaybeUninit < aws_logging_standard_formatting_data > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_logging_standard_formatting_data > () , 64usize , concat ! ("Size of: " , stringify ! (aws_logging_standard_formatting_data))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_logging_standard_formatting_data > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_logging_standard_formatting_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . log_line_buffer) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (log_line_buffer))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . total_length) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (total_length))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . level) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (level))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subject_name) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (subject_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . format) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (format))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . date_format) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (date_format))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . amount_written) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (amount_written))) ; } impl Default for aws_logging_standard_formatting_data { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_log_formatter_init_default (formatter : * mut aws_log_formatter , allocator : * mut aws_allocator , options : * mut aws_log_formatter_standard_options) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_formatter_clean_up (formatter : * mut aws_log_formatter) ; } extern "C" { pub fn aws_format_standard_log_line (formatting_data : * mut aws_logging_standard_formatting_data , args : * mut __va_list_tag) -> :: libc :: c_int ; } pub type aws_log_writer_write_fn = :: std :: option :: Option < unsafe extern "C" fn (writer : * mut aws_log_writer , output : * const aws_string) -> :: libc :: c_int > ; pub type aws_log_writer_clean_up_fn = :: std :: option :: Option < unsafe extern "C" fn (writer : * mut aws_log_writer) > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_log_writer_vtable { pub write : aws_log_writer_write_fn , pub clean_up : aws_log_writer_clean_up_fn , } # [test] fn bindgen_test_layout_aws_log_writer_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_writer_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_writer_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_log_writer_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_writer_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_writer_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . write) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer_vtable) , "::" , stringify ! (write))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clean_up) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer_vtable) , "::" , stringify ! (clean_up))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_writer { pub vtable : * mut aws_log_writer_vtable , pub allocator : * mut aws_allocator , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_log_writer () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_writer > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_writer > () , 24usize , concat ! ("Size of: " , stringify ! (aws_log_writer))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_writer > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_writer))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer) , "::" , stringify ! (impl_))) ; } impl Default for aws_log_writer { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_writer_file_options { pub filename : * const :: libc :: c_char , pub file : * mut FILE , } # [test] fn bindgen_test_layout_aws_log_writer_file_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_writer_file_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_writer_file_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_log_writer_file_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_writer_file_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_writer_file_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . filename) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer_file_options) , "::" , stringify ! (filename))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . file) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer_file_options) , "::" , stringify ! (file))) ; } impl Default for aws_log_writer_file_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_log_writer_init_stdout (writer : * mut aws_log_writer , allocator : * mut aws_allocator) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_writer_init_stderr (writer : * mut aws_log_writer , allocator : * mut aws_allocator) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_writer_init_file (writer : * mut aws_log_writer , allocator : * mut aws_allocator , options : * mut aws_log_writer_file_options) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_writer_clean_up (writer : * mut aws_log_writer) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_socket_endpoint { _unused : [u8 ; 0] , } # [doc = " Invoked when connect completes.\n\n If unsuccessful, error_code will be set, connection will be NULL,\n and the on_shutdown callback will never be invoked.\n\n If successful, error_code will be 0 and connection will be valid.\n The user is now responsible for the connection and must\n call aws_http_connection_release() when they are done with it.\n\n The connection uses one event-loop thread to do all its work.\n The thread invoking this callback will be the same thread that invokes all\n future callbacks for this connection and its streams."] pub type aws_http_on_client_connection_setup_fn = :: std :: option :: Option < unsafe extern "C" fn (connection : * mut aws_http_connection , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when the connection has finished shutting down.\n Never invoked if on_setup failed.\n This is always invoked on connection's event-loop thread.\n Note that the connection is not completely done until on_shutdown has been invoked\n AND aws_http_connection_release() has been called."] pub type aws_http_on_client_connection_shutdown_fn = :: std :: option :: Option < unsafe extern "C" fn (connection : * mut aws_http_connection , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when the HTTP/2 settings change is complete.\n If connection setup successfully this will always be invoked whether settings change successfully or unsuccessfully.\n If error_code is AWS_ERROR_SUCCESS (0), then the peer has acknowledged the settings and the change has been applied.\n If error_code is non-zero, then a connection error occurred before the settings could be fully acknowledged and\n applied. This is always invoked on the connection's event-loop thread."] pub type aws_http2_on_change_settings_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (http2_connection : * mut aws_http_connection , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when the HTTP/2 PING completes, whether peer has acknowledged it or not.\n If error_code is AWS_ERROR_SUCCESS (0), then the peer has acknowledged the PING and round_trip_time_ns will be the\n round trip time in nano seconds for the connection.\n If error_code is non-zero, then a connection error occurred before the PING get acknowledgment and round_trip_time_ns\n will be useless in this case."] pub type aws_http2_on_ping_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (http2_connection : * mut aws_http_connection , round_trip_time_ns : u64 , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when an HTTP/2 GOAWAY frame is received from peer.\n Implies that the peer has initiated shutdown, or encountered a serious error.\n Once a GOAWAY is received, no further streams may be created on this connection.\n\n @param http2_connection This HTTP/2 connection.\n @param last_stream_id ID of the last locally-initiated stream that peer will\n process. Any locally-initiated streams with a higher ID are ignored by\n peer, and are safe to retry on another connection.\n @param http2_error_code The HTTP/2 error code (RFC-7540 section 7) sent by peer.\n `enum aws_http2_error_code` lists official codes.\n @param debug_data The debug data sent by peer. It can be empty. (NOTE: this data is only valid for the lifetime of\n the callback. Make a deep copy if you wish to keep it longer.)\n @param user_data User-data passed to the callback."] pub type aws_http2_on_goaway_received_fn = :: std :: option :: Option < unsafe extern "C" fn (http2_connection : * mut aws_http_connection , last_stream_id : u32 , http2_error_code : u32 , debug_data : aws_byte_cursor , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when new HTTP/2 settings from peer have been applied.\n Settings_array is the array of aws_http2_settings that contains all the settings we just changed in the order we\n applied (the order settings arrived). Num_settings is the number of elements in that array."] pub type aws_http2_on_remote_settings_change_fn = :: std :: option :: Option < unsafe extern "C" fn (http2_connection : * mut aws_http_connection , settings_array : * const aws_http2_setting , num_settings : usize , user_data : * mut :: libc :: c_void) > ; # [doc = " Callback invoked on each statistics sample.\n\n connection_nonce is unique to each connection for disambiguation of each callback per connection."] pub type aws_http_statistics_observer_fn = :: std :: option :: Option < unsafe extern "C" fn (connection_nonce : usize , stats_list : * const aws_array_list , user_data : * mut :: libc :: c_void) > ; # [doc = " Configuration options for connection monitoring"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_connection_monitoring_options { # [doc = " minimum required throughput of the connection. Throughput is only measured against the interval of time where\n there is actual io to perform. Read and write throughput are measured and checked independently of one another."] pub minimum_throughput_bytes_per_second : u64 , pub allowable_throughput_failure_interval_seconds : u32 , # [doc = " invoked on each statistics publish by the underlying IO channel. Install this callback to receive the statistics\n for observation. This field is optional."] pub statistics_observer_fn : aws_http_statistics_observer_fn , # [doc = " user_data to be passed to statistics_observer_fn."] pub statistics_observer_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_http_connection_monitoring_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_connection_monitoring_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_connection_monitoring_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_http_connection_monitoring_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_connection_monitoring_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_connection_monitoring_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . minimum_throughput_bytes_per_second) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_monitoring_options) , "::" , stringify ! (minimum_throughput_bytes_per_second))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allowable_throughput_failure_interval_seconds) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_monitoring_options) , "::" , stringify ! (allowable_throughput_failure_interval_seconds))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . statistics_observer_fn) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_monitoring_options) , "::" , stringify ! (statistics_observer_fn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . statistics_observer_user_data) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_monitoring_options) , "::" , stringify ! (statistics_observer_user_data))) ; } impl Default for aws_http_connection_monitoring_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Options specific to HTTP/1.x connections."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http1_connection_options { # [doc = " Optional\n Capacity in bytes of the HTTP/1 connection's read buffer.\n The buffer grows if the flow-control window of the incoming HTTP-stream\n reaches zero. If the buffer reaches capacity, no further socket data is\n read until the HTTP-stream's window opens again, allowing data to resume flowing.\n\n Ignored if `manual_window_management` is false.\n If zero is specified (the default) then a default capacity is chosen.\n A capacity that is too small may hinder throughput.\n A capacity that is too big may waste memory without helping throughput."] pub read_buffer_capacity : usize , } # [test] fn bindgen_test_layout_aws_http1_connection_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http1_connection_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http1_connection_options > () , 8usize , concat ! ("Size of: " , stringify ! (aws_http1_connection_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http1_connection_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http1_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . read_buffer_capacity) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http1_connection_options) , "::" , stringify ! (read_buffer_capacity))) ; } # [doc = " Options specific to HTTP/2 connections."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http2_connection_options { # [doc = " Optional\n The data of settings to change for initial settings.\n Note: each setting has its boundary. If settings_array is not set, num_settings has to be 0 to send an empty\n SETTINGS frame."] pub initial_settings_array : * mut aws_http2_setting , # [doc = " Required\n The num of settings to change (Length of the initial_settings_array)."] pub num_initial_settings : usize , # [doc = " Optional.\n Invoked when the HTTP/2 initial settings change is complete.\n If failed to setup the connection, this will not be invoked.\n Otherwise, this will be invoked, whether settings change successfully or unsuccessfully.\n See `aws_http2_on_change_settings_complete_fn`."] pub on_initial_settings_completed : aws_http2_on_change_settings_complete_fn , # [doc = " Optional\n The max number of recently-closed streams to remember.\n Set it to zero to use the default setting, AWS_HTTP2_DEFAULT_MAX_CLOSED_STREAMS\n\n If the connection receives a frame for a closed stream,\n the frame will be ignored or cause a connection error,\n depending on the frame type and how the stream was closed.\n Remembering more streams reduces the chances that a late frame causes\n a connection error, but costs some memory."] pub max_closed_streams : usize , # [doc = " Optional.\n Invoked when a valid GOAWAY frame received.\n See `aws_http2_on_goaway_received_fn`."] pub on_goaway_received : aws_http2_on_goaway_received_fn , # [doc = " Optional.\n Invoked when new settings from peer have been applied.\n See `aws_http2_on_remote_settings_change_fn`."] pub on_remote_settings_change : aws_http2_on_remote_settings_change_fn , # [doc = " Optional.\n Set to true to manually manage the flow-control window of whole HTTP/2 connection.\n\n If false, the connection will maintain its flow-control windows such that\n no back-pressure is applied and data arrives as fast as possible.\n\n If true, the flow-control window of the whole connection will shrink as body data\n is received (headers, padding, and other metadata do not affect the window) for every streams\n created on this connection.\n The initial connection flow-control window is 65,535.\n Once the connection's flow-control window reaches to 0, all the streams on the connection stop receiving any\n further data.\n The user must call aws_http2_connection_update_window() to increment the connection's\n window and keep data flowing.\n Note: the padding of data frame counts to the flow-control window.\n But, the client will always automatically update the window for padding even for manual window update."] pub conn_manual_window_management : bool , } # [test] fn bindgen_test_layout_aws_http2_connection_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http2_connection_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http2_connection_options > () , 56usize , concat ! ("Size of: " , stringify ! (aws_http2_connection_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http2_connection_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http2_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_settings_array) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (initial_settings_array))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_initial_settings) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (num_initial_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_initial_settings_completed) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (on_initial_settings_completed))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_closed_streams) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (max_closed_streams))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_goaway_received) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (on_goaway_received))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_remote_settings_change) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (on_remote_settings_change))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . conn_manual_window_management) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (conn_manual_window_management))) ; } impl Default for aws_http2_connection_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Options for creating an HTTP client connection.\n Initialize with AWS_HTTP_CLIENT_CONNECTION_OPTIONS_INIT to set default values."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_client_connection_options { # [doc = " The sizeof() this struct, used for versioning.\n Set by AWS_HTTP_CLIENT_CONNECTION_OPTIONS_INIT."] pub self_size : usize , # [doc = " Required.\n Must outlive the connection."] pub allocator : * mut aws_allocator , # [doc = " Required.\n The connection keeps the bootstrap alive via ref-counting."] pub bootstrap : * mut aws_client_bootstrap , # [doc = " Required.\n aws_http_client_connect() makes a copy."] pub host_name : aws_byte_cursor , # [doc = " Required."] pub port : u16 , # [doc = " Required.\n aws_http_client_connect() makes a copy."] pub socket_options : * const aws_socket_options , # [doc = " Optional.\n aws_http_client_connect() deep-copies all contents,\n and keeps `aws_tls_ctx` alive via ref-counting."] pub tls_options : * const aws_tls_connection_options , # [doc = " Optional\n Configuration options related to http proxy usage.\n Relevant fields are copied internally."] pub proxy_options : * const aws_http_proxy_options , pub proxy_ev_settings : * const proxy_env_var_settings , # [doc = " Optional\n Configuration options related to connection health monitoring"] pub monitoring_options : * const aws_http_connection_monitoring_options , # [doc = " Set to true to manually manage the flow-control window of each stream.\n\n If false, the connection will maintain its flow-control windows such that\n no back-pressure is applied and data arrives as fast as possible.\n\n If true, the flow-control window of each stream will shrink as body data\n is received (headers, padding, and other metadata do not affect the window).\n `initial_window_size` determines the starting size of each stream's window for HTTP/1 stream, while HTTP/2 stream\n will use the settings AWS_HTTP2_SETTINGS_INITIAL_WINDOW_SIZE to inform the other side about read back pressure\n\n If a stream's flow-control window reaches 0, no further data will be received. The user must call\n aws_http_stream_update_window() to increment the stream's window and keep data flowing.\n\n If a HTTP/2 connection created, it will ONLY control the stream window\n management. Connection window management is controlled by\n conn_manual_window_management. Note: the padding of data frame counts to the flow-control window.\n But, the client will always automatically update the window for padding even for manual window update."] pub manual_window_management : bool , # [doc = " The starting size of each HTTP stream's flow-control window for HTTP/1 connection.\n Required if `manual_window_management` is true,\n ignored if `manual_window_management` is false.\n\n Always ignored when HTTP/2 connection created. The initial window size is controlled by the settings,\n `AWS_HTTP2_SETTINGS_INITIAL_WINDOW_SIZE`"] pub initial_window_size : usize , # [doc = " User data for callbacks\n Optional."] pub user_data : * mut :: libc :: c_void , # [doc = " Invoked when connect completes.\n Required.\n See `aws_http_on_client_connection_setup_fn`."] pub on_setup : aws_http_on_client_connection_setup_fn , # [doc = " Invoked when the connection has finished shutting down.\n Never invoked if setup failed.\n Optional.\n See `aws_http_on_client_connection_shutdown_fn`."] pub on_shutdown : aws_http_on_client_connection_shutdown_fn , # [doc = " Optional.\n When true, use prior knowledge to set up an HTTP/2 connection on a cleartext\n connection.\n When TLS is set and this is true, the connection will failed to be established,\n as prior knowledge only works for cleartext TLS.\n Refer to RFC7540 3.4"] pub prior_knowledge_http2 : bool , # [doc = " Optional.\n Pointer to the hash map containing the ALPN string to protocol to use.\n Hash from `struct aws_string *` to `enum aws_http_version`.\n If not set, only the predefined string `h2` and `http/1.1` will be recognized. Other negotiated ALPN string will\n result in a HTTP1/1 connection\n Note: Connection will keep a deep copy of the table and the strings."] pub alpn_string_map : * mut aws_hash_table , # [doc = " Options specific to HTTP/1.x connections.\n Optional.\n Ignored if connection is not HTTP/1.x.\n If connection is HTTP/1.x and options were not specified, default values are used."] pub http1_options : * const aws_http1_connection_options , # [doc = " Options specific to HTTP/2 connections.\n Optional.\n Ignored if connection is not HTTP/2.\n If connection is HTTP/2 and options were not specified, default values are used."] pub http2_options : * const aws_http2_connection_options , # [doc = " Optional.\n Requests the channel/connection be bound to a specific event loop rather than chosen sequentially from the\n event loop group associated with the client bootstrap."] pub requested_event_loop : * mut aws_event_loop , # [doc = " Optional\n Host resolution override that allows the user to override DNS behavior for this particular connection."] pub host_resolution_config : * const aws_host_resolution_config , } # [test] fn bindgen_test_layout_aws_http_client_connection_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_client_connection_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_client_connection_options > () , 176usize , concat ! ("Size of: " , stringify ! (aws_http_client_connection_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_client_connection_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_client_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . self_size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (self_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . socket_options) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (socket_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_options) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (tls_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_options) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_settings) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (proxy_ev_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . monitoring_options) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (monitoring_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . manual_window_management) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (manual_window_management))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_window_size) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (initial_window_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_setup) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (on_setup))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_shutdown) as usize - ptr as usize } , 120usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (on_shutdown))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . prior_knowledge_http2) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (prior_knowledge_http2))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alpn_string_map) as usize - ptr as usize } , 136usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (alpn_string_map))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http1_options) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (http1_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http2_options) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (http2_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . requested_event_loop) as usize - ptr as usize } , 160usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (requested_event_loop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolution_config) as usize - ptr as usize } , 168usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (host_resolution_config))) ; } impl Default for aws_http_client_connection_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } impl aws_http2_settings_id { pub const AWS_HTTP2_SETTINGS_HEADER_TABLE_SIZE : aws_http2_settings_id = aws_http2_settings_id :: AWS_HTTP2_SETTINGS_BEGIN_RANGE ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http2_settings_id { AWS_HTTP2_SETTINGS_BEGIN_RANGE = 1 , AWS_HTTP2_SETTINGS_ENABLE_PUSH = 2 , AWS_HTTP2_SETTINGS_MAX_CONCURRENT_STREAMS = 3 , AWS_HTTP2_SETTINGS_INITIAL_WINDOW_SIZE = 4 , AWS_HTTP2_SETTINGS_MAX_FRAME_SIZE = 5 , AWS_HTTP2_SETTINGS_MAX_HEADER_LIST_SIZE = 6 , AWS_HTTP2_SETTINGS_END_RANGE = 7 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http2_setting { pub id : aws_http2_settings_id , pub value : u32 , } # [test] fn bindgen_test_layout_aws_http2_setting () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http2_setting > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http2_setting > () , 8usize , concat ! ("Size of: " , stringify ! (aws_http2_setting))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http2_setting > () , 4usize , concat ! ("Alignment of " , stringify ! (aws_http2_setting))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . id) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http2_setting) , "::" , stringify ! (id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (aws_http2_setting) , "::" , stringify ! (value))) ; } impl Default for aws_http2_setting { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Asynchronously establish a client connection.\n The on_setup callback is invoked when the operation has created a connection or failed."] pub fn aws_http_client_connect (options : * const aws_http_client_connection_options) -> :: libc :: c_int ; } extern "C" { # [doc = " Users must release the connection when they are done with it.\n The connection's memory cannot be reclaimed until this is done.\n If the connection was not already shutting down, it will be shut down.\n\n Users should always wait for the on_shutdown() callback to be called before releasing any data passed to the\n http_connection (Eg aws_tls_connection_options, aws_socket_options) otherwise there will be race conditions between\n http_connection shutdown tasks and memory release tasks, causing Segfaults."] pub fn aws_http_connection_release (connection : * mut aws_http_connection) ; } extern "C" { # [doc = " Begin shutdown sequence of the connection if it hasn't already started. This will schedule shutdown tasks on the\n EventLoop that may send HTTP/TLS/TCP shutdown messages to peers if necessary, and will eventually cause internal\n connection memory to stop being accessed and on_shutdown() callback to be called.\n\n It's safe to call this function regardless of the connection state as long as you hold a reference to the connection."] pub fn aws_http_connection_close (connection : * mut aws_http_connection) ; } extern "C" { # [doc = " Stop accepting new requests for the connection. It will NOT start the shutdown process for the connection. The\n requests that are already open can still wait to be completed, but new requests will fail to be created,"] pub fn aws_http_connection_stop_new_requests (connection : * mut aws_http_connection) ; } extern "C" { # [doc = " Returns true unless the connection is closed or closing."] pub fn aws_http_connection_is_open (connection : * const aws_http_connection) -> bool ; } extern "C" { # [doc = " Return whether the connection can make a new requests.\n If false, then a new connection must be established to make further requests."] pub fn aws_http_connection_new_requests_allowed (connection : * const aws_http_connection) -> bool ; } extern "C" { # [doc = " Returns true if this is a client connection."] pub fn aws_http_connection_is_client (connection : * const aws_http_connection) -> bool ; } extern "C" { pub fn aws_http_connection_get_version (connection : * const aws_http_connection) -> aws_http_version ; } extern "C" { # [doc = " Returns the channel hosting the HTTP connection.\n Do not expose this function to language bindings."] pub fn aws_http_connection_get_channel (connection : * mut aws_http_connection) -> * mut aws_channel ; } extern "C" { # [doc = " Returns the remote endpoint of the HTTP connection."] pub fn aws_http_connection_get_remote_endpoint (connection : * const aws_http_connection) -> * const aws_socket_endpoint ; } extern "C" { # [doc = " Initialize an map copied from the *src map, which maps `struct aws_string *` to `enum aws_http_version`."] pub fn aws_http_alpn_map_init_copy (allocator : * mut aws_allocator , dest : * mut aws_hash_table , src : * mut aws_hash_table) -> :: libc :: c_int ; } extern "C" { # [doc = " Initialize an empty hash-table that maps `struct aws_string *` to `enum aws_http_version`.\n This map can used in aws_http_client_connections_options.alpn_string_map."] pub fn aws_http_alpn_map_init (allocator : * mut aws_allocator , map : * mut aws_hash_table) -> :: libc :: c_int ; } extern "C" { # [doc = " Checks http proxy options for correctness"] pub fn aws_http_options_validate_proxy_configuration (options : * const aws_http_client_connection_options) -> :: libc :: c_int ; } extern "C" { # [doc = " Send a SETTINGS frame (HTTP/2 only).\n SETTINGS will be applied locally when SETTINGS ACK is received from peer.\n\n @param http2_connection HTTP/2 connection.\n @param settings_array The array of settings to change. Note: each setting has its boundary.\n @param num_settings The num of settings to change in settings_array.\n @param on_completed Optional callback, see `aws_http2_on_change_settings_complete_fn`.\n @param user_data User-data pass to on_completed callback."] pub fn aws_http2_connection_change_settings (http2_connection : * mut aws_http_connection , settings_array : * const aws_http2_setting , num_settings : usize , on_completed : aws_http2_on_change_settings_complete_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Send a PING frame (HTTP/2 only).\n Round-trip-time is calculated when PING ACK is received from peer.\n\n @param http2_connection HTTP/2 connection.\n @param optional_opaque_data Optional payload for PING frame.\n Must be NULL, or exactly 8 bytes (AWS_HTTP2_PING_DATA_SIZE).\n If NULL, the 8 byte payload will be all zeroes.\n @param on_completed Optional callback, invoked when PING ACK is received from peer,\n or when a connection error prevents the PING ACK from being received.\n Callback always fires on the connection's event-loop thread.\n @param user_data User-data pass to on_completed callback."] pub fn aws_http2_connection_ping (http2_connection : * mut aws_http_connection , optional_opaque_data : * const aws_byte_cursor , on_completed : aws_http2_on_ping_complete_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the local settings we are using to affect the decoding.\n\n @param http2_connection HTTP/2 connection.\n @param out_settings fixed size array of aws_http2_setting gets set to the local settings"] pub fn aws_http2_connection_get_local_settings (http2_connection : * const aws_http_connection , out_settings : * mut aws_http2_setting) ; } extern "C" { # [doc = " Get the settings received from remote peer, which we are using to restricts the message to send.\n\n @param http2_connection HTTP/2 connection.\n @param out_settings fixed size array of aws_http2_setting gets set to the remote settings"] pub fn aws_http2_connection_get_remote_settings (http2_connection : * const aws_http_connection , out_settings : * mut aws_http2_setting) ; } extern "C" { # [doc = " Send a custom GOAWAY frame (HTTP/2 only).\n\n Note that the connection automatically attempts to send a GOAWAY during\n shutdown (unless a GOAWAY with a valid Last-Stream-ID has already been sent).\n\n This call can be used to gracefully warn the peer of an impending shutdown\n (http2_error=0, allow_more_streams=true), or to customize the final GOAWAY\n frame that is sent by this connection.\n\n The other end may not receive the goaway, if the connection already closed.\n\n @param http2_connection HTTP/2 connection.\n @param http2_error The HTTP/2 error code (RFC-7540 section 7) to send.\n `enum aws_http2_error_code` lists official codes.\n @param allow_more_streams If true, new peer-initiated streams will continue\n to be acknowledged and the GOAWAY's Last-Stream-ID will be set to a max value.\n If false, new peer-initiated streams will be ignored and the GOAWAY's\n Last-Stream-ID will be set to the latest acknowledged stream.\n @param optional_debug_data Optional debug data to send. Size must not exceed 16KB."] pub fn aws_http2_connection_send_goaway (http2_connection : * mut aws_http_connection , http2_error : u32 , allow_more_streams : bool , optional_debug_data : * const aws_byte_cursor) ; } extern "C" { # [doc = " Get data about the latest GOAWAY frame sent to peer (HTTP/2 only).\n If no GOAWAY has been sent, AWS_ERROR_HTTP_DATA_NOT_AVAILABLE will be raised.\n Note that GOAWAY frames are typically sent automatically by the connection\n during shutdown.\n\n @param http2_connection HTTP/2 connection.\n @param out_http2_error Gets set to HTTP/2 error code sent in most recent GOAWAY.\n @param out_last_stream_id Gets set to Last-Stream-ID sent in most recent GOAWAY."] pub fn aws_http2_connection_get_sent_goaway (http2_connection : * mut aws_http_connection , out_http2_error : * mut u32 , out_last_stream_id : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Get data about the latest GOAWAY frame received from peer (HTTP/2 only).\n If no GOAWAY has been received, or the GOAWAY payload is still in transmitting,\n AWS_ERROR_HTTP_DATA_NOT_AVAILABLE will be raised.\n\n @param http2_connection HTTP/2 connection.\n @param out_http2_error Gets set to HTTP/2 error code received in most recent GOAWAY.\n @param out_last_stream_id Gets set to Last-Stream-ID received in most recent GOAWAY."] pub fn aws_http2_connection_get_received_goaway (http2_connection : * mut aws_http_connection , out_http2_error : * mut u32 , out_last_stream_id : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Increment the connection's flow-control window to keep data flowing (HTTP/2 only).\n\n If the connection was created with `conn_manual_window_management` set true,\n the flow-control window of the connection will shrink as body data is received for all the streams created on it.\n (headers, padding, and other metadata do not affect the window).\n The initial connection flow-control window is 65,535.\n Once the connection's flow-control window reaches to 0, all the streams on the connection stop receiving any further\n data.\n\n If `conn_manual_window_management` is false, this call will have no effect.\n The connection maintains its flow-control windows such that\n no back-pressure is applied and data arrives as fast as possible.\n\n If you are not connected, this call will have no effect.\n\n Crashes when the connection is not http2 connection.\n The limit of the Maximum Size is 2**31 - 1. If the increment size cause the connection flow window exceeds the\n Maximum size, this call will result in the connection lost.\n\n @param http2_connection HTTP/2 connection.\n @param increment_size The size to increment for the connection's flow control window"] pub fn aws_http2_connection_update_window (http2_connection : * mut aws_http_connection , increment_size : u32) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_future_impl { _unused : [u8 ; 0] , } `# [doc = " Completion callback for aws_future"]` pub type aws_future_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; pub type aws_future_impl_result_clean_up_fn = :: std :: option :: Option < unsafe extern "C" fn (result_addr : * mut :: libc :: c_void) > ; pub type aws_future_impl_result_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (result : * mut :: libc :: c_void) > ; pub type aws_future_impl_result_release_fn = :: std :: option :: Option < unsafe extern "C" fn (result : * mut :: libc :: c_void) -> * mut :: libc :: c_void > ; extern "C" { pub fn aws_future_impl_new_by_value (alloc : * mut aws_allocator , sizeof_result : usize) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_new_by_value_with_clean_up (alloc : * mut aws_allocator , sizeof_result : usize , result_clean_up : aws_future_impl_result_clean_up_fn) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_new_pointer (alloc : * mut aws_allocator) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_new_pointer_with_destroy (alloc : * mut aws_allocator , result_destroy : aws_future_impl_result_destroy_fn) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_new_pointer_with_release (alloc : * mut aws_allocator , result_release : aws_future_impl_result_release_fn) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_release (promise : * mut aws_future_impl) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_acquire (promise : * mut aws_future_impl) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_set_error (promise : * mut aws_future_impl , error_code : :: libc :: c_int) ; } extern "C" { pub fn aws_future_impl_set_result_by_move (promise : * mut aws_future_impl , src_address : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_impl_is_done (future : * const aws_future_impl) -> bool ; } extern "C" { pub fn aws_future_impl_register_callback (future : * mut aws_future_impl , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_impl_register_callback_if_not_done (future : * mut aws_future_impl , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) -> bool ; } extern "C" { pub fn aws_future_impl_register_event_loop_callback (future : * mut aws_future_impl , event_loop : * mut aws_event_loop , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_impl_register_channel_callback (future : * mut aws_future_impl , channel : * mut aws_channel , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_impl_wait (future : * const aws_future_impl , timeout_ns : u64) -> bool ; } extern "C" { pub fn aws_future_impl_get_error (future : * const aws_future_impl) -> :: libc :: c_int ; } extern "C" { pub fn aws_future_impl_get_result_address (future : * const aws_future_impl) -> * mut :: libc :: c_void ; } extern "C" { pub fn aws_future_impl_get_result_by_move (future : * mut aws_future_impl , dst_address : * mut :: libc :: c_void) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_future_size { _unused : [u8 ; 0] , } extern "C" { pub fn aws_future_size_new (alloc : * mut aws_allocator) -> * mut aws_future_size ; } extern "C" { pub fn aws_future_size_set_result (future : * mut aws_future_size , result : usize) ; } extern "C" { pub fn aws_future_size_get_result (future : * const aws_future_size) -> usize ; } extern "C" { pub fn aws_future_size_acquire (future : * mut aws_future_size) -> * mut aws_future_size ; } extern "C" { pub fn aws_future_size_release (future : * mut aws_future_size) -> * mut aws_future_size ; } extern "C" { pub fn aws_future_size_set_error (future : * mut aws_future_size , error_code : :: libc :: c_int) ; } extern "C" { pub fn aws_future_size_is_done (future : * const aws_future_size) -> bool ; } extern "C" { pub fn aws_future_size_get_error (future : * const aws_future_size) -> :: libc :: c_int ; } extern "C" { pub fn aws_future_size_register_callback (future : * mut aws_future_size , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_size_register_callback_if_not_done (future : * mut aws_future_size , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) -> bool ; } extern "C" { pub fn aws_future_size_register_event_loop_callback (future : * mut aws_future_size , event_loop : * mut aws_event_loop , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_size_register_channel_callback (future : * mut aws_future_size , channel : * mut aws_channel , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_size_wait (future : * mut aws_future_size , timeout_ns : u64) -> bool ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_future_bool { _unused : [u8 ; 0] , } extern "C" { pub fn aws_future_bool_new (alloc : * mut aws_allocator) -> * mut aws_future_bool ; } extern "C" { pub fn aws_future_bool_set_result (future : * mut aws_future_bool , result : bool) ; } extern "C" { pub fn aws_future_bool_get_result (future : * const aws_future_bool) -> bool ; } extern "C" { pub fn aws_future_bool_acquire (future : * mut aws_future_bool) -> * mut aws_future_bool ; } extern "C" { pub fn aws_future_bool_release (future : * mut aws_future_bool) -> * mut aws_future_bool ; } extern "C" { pub fn aws_future_bool_set_error (future : * mut aws_future_bool , error_code : :: libc :: c_int) ; } extern "C" { pub fn aws_future_bool_is_done (future : * const aws_future_bool) -> bool ; } extern "C" { pub fn aws_future_bool_get_error (future : * const aws_future_bool) -> :: libc :: c_int ; } extern "C" { pub fn aws_future_bool_register_callback (future : * mut aws_future_bool , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_bool_register_callback_if_not_done (future : * mut aws_future_bool , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) -> bool ; } extern "C" { pub fn aws_future_bool_register_event_loop_callback (future : * mut aws_future_bool , event_loop : * mut aws_event_loop , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_bool_register_channel_callback (future : * mut aws_future_bool , channel : * mut aws_channel , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_bool_wait (future : * mut aws_future_bool , timeout_ns : u64) -> bool ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_future_void { _unused : [u8 ; 0] , } extern "C" { # [doc = " aws_future"] pub fn aws_future_void_new (alloc : * mut aws_allocator) -> * mut aws_future_void ; } extern "C" { pub fn aws_future_void_set_result (future : * mut aws_future_void) ; } extern "C" { pub fn aws_future_void_acquire (future : * mut aws_future_void) -> * mut aws_future_void ; } extern "C" { pub fn aws_future_void_release (future : * mut aws_future_void) -> * mut aws_future_void ; } extern "C" { pub fn aws_future_void_set_error (future : * mut aws_future_void , error_code : :: libc :: c_int) ; } extern "C" { pub fn aws_future_void_is_done (future : * const aws_future_void) -> bool ; } extern "C" { pub fn aws_future_void_get_error (future : * const aws_future_void) -> :: libc :: c_int ; } extern "C" { pub fn aws_future_void_register_callback (future : * mut aws_future_void , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_void_register_callback_if_not_done (future : * mut aws_future_void , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) -> bool ; } extern "C" { pub fn aws_future_void_register_event_loop_callback (future : * mut aws_future_void , event_loop : * mut aws_event_loop , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_void_register_channel_callback (future : * mut aws_future_void , channel : * mut aws_channel , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_void_wait (future : * mut aws_future_void , timeout_ns : u64) -> bool ; } # [doc = " A stream exists for the duration of a request/response exchange.\n A client creates a stream to send a request and receive a response.\n A server creates a stream to receive a request and send a response.\n In http/2, a push-promise stream can be sent by a server and received by a client."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_stream { _unused : [u8 ; 0] , } # [repr (u32)] # [non_exhaustive] # [doc = " Controls whether a header's strings may be compressed by encoding the index of\n strings in a cache, rather than encoding the literal string.\n\n This setting has no effect on HTTP/1.x connections.\n On HTTP/2 connections this controls HPACK behavior.\n See RFC-7541 Section 7.1 for security considerations."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_header_compression { # [doc = " Compress header by encoding the cached index of its strings,\n or by updating the cache to contain these strings for future reference.\n Best for headers that are sent repeatedly.\n This is the default setting."] AWS_HTTP_HEADER_COMPRESSION_USE_CACHE = 0 , # [doc = " Encode header strings literally.\n If an intermediary re-broadcasts the headers, it is permitted to use cache.\n Best for unique headers that are unlikely to repeat."] AWS_HTTP_HEADER_COMPRESSION_NO_CACHE = 1 , # [doc = " Encode header strings literally and forbid all intermediaries from using\n cache when re-broadcasting.\n Best for header fields that are highly valuable or sensitive to recovery."] AWS_HTTP_HEADER_COMPRESSION_NO_FORWARD_CACHE = 2 , } # [doc = " A lightweight HTTP header struct.\n Note that the underlying strings are not owned by the byte cursors."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_header { pub name : aws_byte_cursor , pub value : aws_byte_cursor , pub compression : aws_http_header_compression , } # [test] fn bindgen_test_layout_aws_http_header () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_header > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_header > () , 40usize , concat ! ("Size of: " , stringify ! (aws_http_header))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_header > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_header))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . name) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_header) , "::" , stringify ! (name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_header) , "::" , stringify ! (value))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . compression) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_header) , "::" , stringify ! (compression))) ; } impl Default for aws_http_header { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " A transformable block of HTTP headers.\n Provides a nice API for getting/setting header names and values.\n\n All strings are copied and stored within this datastructure.\n The index of a given header may change any time headers are modified.\n When iterating headers, the following ordering rules apply:\n\n - Headers with the same name will always be in the same order, relative to one another.\n If \"A: one\" is added before \"A: two\", then \"A: one\" will always precede \"A: two\".\n\n - Headers with different names could be in any order, relative to one another.\n If \"A: one\" is seen before \"B: bee\" in one iteration, you might see \"B: bee\" before \"A: one\" on the next."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_headers { _unused : [u8 ; 0] , } # [repr (u32)] # [non_exhaustive] # [doc = " Header block type.\n INFORMATIONAL: Header block for 1xx informational (interim) responses.\n MAIN: Main header block sent with request or response.\n TRAILING: Headers sent after the body of a request or response."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_header_block { AWS_HTTP_HEADER_BLOCK_MAIN = 0 , AWS_HTTP_HEADER_BLOCK_INFORMATIONAL = 1 , AWS_HTTP_HEADER_BLOCK_TRAILING = 2 , } # [doc = " The definition for an outgoing HTTP request or response.\n The message may be transformed (ex: signing the request) before its data is eventually sent.\n\n The message keeps internal copies of its trivial strings (method, path, headers)\n but does NOT take ownership of its body stream.\n\n A language binding would likely present this as an HttpMessage base class with\n HttpRequest and HttpResponse subclasses."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_message { _unused : [u8 ; 0] , } # [doc = " Function to invoke when a message transformation completes.\n This function MUST be invoked or the application will soft-lock.\n `message` and `complete_ctx` must be the same pointers provided to the `aws_http_message_transform_fn`.\n `error_code` should should be AWS_ERROR_SUCCESS if transformation was successful,\n otherwise pass a different AWS_ERROR_X value."] pub type aws_http_message_transform_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (message : * mut aws_http_message , error_code : :: libc :: c_int , complete_ctx : * mut :: libc :: c_void) > ; # [doc = " A function that may modify a request or response before it is sent.\n The transformation may be asynchronous or immediate.\n The user MUST invoke the `complete_fn` when transformation is complete or the application will soft-lock.\n When invoking the `complete_fn`, pass along the `message` and `complete_ctx` provided here and an error code.\n The error code should be AWS_ERROR_SUCCESS if transformation was successful,\n otherwise pass a different AWS_ERROR_X value."] pub type aws_http_message_transform_fn = :: std :: option :: Option < unsafe extern "C" fn (message : * mut aws_http_message , user_data : * mut :: libc :: c_void , complete_fn : aws_http_message_transform_complete_fn , complete_ctx : * mut :: libc :: c_void) > ; # [doc = " Invoked repeatedly times as headers are received.\n At this point, aws_http_stream_get_incoming_response_status() can be called for the client.\n And aws_http_stream_get_incoming_request_method() and aws_http_stream_get_incoming_request_uri() can be called for\n the server.\n This is always invoked on the HTTP connection's event-loop thread.\n\n Return AWS_OP_SUCCESS to continue processing the stream.\n Return AWS_OP_ERR to indicate failure and cancel the stream."] pub type aws_http_on_incoming_headers_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , header_block : aws_http_header_block , header_array : * const aws_http_header , num_headers : usize , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Invoked when the incoming header block of this type(informational/main/trailing) has been completely read.\n This is always invoked on the HTTP connection's event-loop thread.\n\n Return AWS_OP_SUCCESS to continue processing the stream.\n Return AWS_OP_ERR to indicate failure and cancel the stream."] pub type aws_http_on_incoming_header_block_done_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , header_block : aws_http_header_block , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Called repeatedly as body data is received.\n The data must be copied immediately if you wish to preserve it.\n This is always invoked on the HTTP connection's event-loop thread.\n\n Note that, if the connection is using manual_window_management then the window\n size has shrunk by the amount of body data received. If the window size\n reaches 0 no further data will be received. Increment the window size with\n aws_http_stream_update_window().\n\n Return AWS_OP_SUCCESS to continue processing the stream.\n Return AWS_OP_ERR to indicate failure and cancel the stream."] pub type aws_http_on_incoming_body_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , data : * const aws_byte_cursor , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Invoked when request has been completely read.\n This is always invoked on the HTTP connection's event-loop thread.\n\n Return AWS_OP_SUCCESS to continue processing the stream.\n Return AWS_OP_ERR to indicate failure and cancel the stream."] pub type aws_http_on_incoming_request_done_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Invoked when request/response stream is completely destroyed.\n This may be invoked synchronously when aws_http_stream_release() is called.\n This is invoked even if the stream is never activated."] pub type aws_http_on_stream_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when request/response stream destroy completely.\n This can be invoked within the same thead who release the refcount on http stream."] pub type aws_http_on_stream_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [doc = " Tracing metrics for aws_http_stream.\n Data maybe not be available if the data of stream was never sent/received before it completes."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http_stream_metrics { pub send_start_timestamp_ns : i64 , pub send_end_timestamp_ns : i64 , pub sending_duration_ns : i64 , pub receive_start_timestamp_ns : i64 , pub receive_end_timestamp_ns : i64 , pub receiving_duration_ns : i64 , pub stream_id : u32 , } # [test] fn bindgen_test_layout_aws_http_stream_metrics () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_stream_metrics > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_stream_metrics > () , 56usize , concat ! ("Size of: " , stringify ! (aws_http_stream_metrics))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_stream_metrics > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_stream_metrics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . send_start_timestamp_ns) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (send_start_timestamp_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . send_end_timestamp_ns) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (send_end_timestamp_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . sending_duration_ns) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (sending_duration_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . receive_start_timestamp_ns) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (receive_start_timestamp_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . receive_end_timestamp_ns) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (receive_end_timestamp_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . receiving_duration_ns) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (receiving_duration_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . stream_id) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (stream_id))) ; } # [doc = " Invoked right before request/response stream is complete to report the tracing metrics for aws_http_stream.\n This may be invoked synchronously when aws_http_stream_release() is called.\n This is invoked even if the stream is never activated.\n See `aws_http_stream_metrics` for details."] pub type aws_http_on_stream_metrics_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , metrics : * const aws_http_stream_metrics , user_data : * mut :: libc :: c_void) > ; # [doc = " Options for creating a stream which sends a request from the client and receives a response from the server."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_make_request_options { # [doc = " The sizeof() this struct, used for versioning.\n Required."] pub self_size : usize , # [doc = " Definition for outgoing request.\n Required.\n The request will be kept alive via refcounting until the request completes."] pub request : * mut aws_http_message , pub user_data : * mut :: libc :: c_void , # [doc = " Invoked repeatedly times as headers are received.\n Optional.\n See `aws_http_on_incoming_headers_fn`."] pub on_response_headers : aws_http_on_incoming_headers_fn , # [doc = " Invoked when response header block has been completely read.\n Optional.\n See `aws_http_on_incoming_header_block_done_fn`."] pub on_response_header_block_done : aws_http_on_incoming_header_block_done_fn , # [doc = " Invoked repeatedly as body data is received.\n Optional.\n See `aws_http_on_incoming_body_fn`."] pub on_response_body : aws_http_on_incoming_body_fn , # [doc = " Invoked right before stream is complete, whether successful or unsuccessful\n Optional.\n See `aws_http_on_stream_metrics_fn`"] pub on_metrics : aws_http_on_stream_metrics_fn , # [doc = " Invoked when request/response stream is complete, whether successful or unsuccessful\n Optional.\n See `aws_http_on_stream_complete_fn`."] pub on_complete : aws_http_on_stream_complete_fn , pub on_destroy : aws_http_on_stream_destroy_fn , # [doc = " When using HTTP/2, request body data will be provided over time. The stream will only be polled for writing\n when data has been supplied via `aws_http2_stream_write_data`"] pub http2_use_manual_data_writes : bool , } # [test] fn bindgen_test_layout_aws_http_make_request_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_make_request_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_make_request_options > () , 80usize , concat ! ("Size of: " , stringify ! (aws_http_make_request_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_make_request_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_make_request_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . self_size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (self_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . request) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (request))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_response_headers) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_response_headers))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_response_header_block_done) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_response_header_block_done))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_response_body) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_response_body))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_metrics) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_metrics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_complete) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_destroy) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http2_use_manual_data_writes) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (http2_use_manual_data_writes))) ; } impl Default for aws_http_make_request_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_request_handler_options { pub self_size : usize , # [doc = " Required."] pub server_connection : * mut aws_http_connection , # [doc = " user_data passed to callbacks.\n Optional."] pub user_data : * mut :: libc :: c_void , # [doc = " Invoked repeatedly times as headers are received.\n Optional.\n See `aws_http_on_incoming_headers_fn`."] pub on_request_headers : aws_http_on_incoming_headers_fn , # [doc = " Invoked when the request header block has been completely read.\n Optional.\n See `aws_http_on_incoming_header_block_done_fn`."] pub on_request_header_block_done : aws_http_on_incoming_header_block_done_fn , # [doc = " Invoked as body data is received.\n Optional.\n See `aws_http_on_incoming_body_fn`."] pub on_request_body : aws_http_on_incoming_body_fn , # [doc = " Invoked when request has been completely read.\n Optional.\n See `aws_http_on_incoming_request_done_fn`."] pub on_request_done : aws_http_on_incoming_request_done_fn , # [doc = " Invoked when request/response stream is complete, whether successful or unsuccessful\n Optional.\n See `aws_http_on_stream_complete_fn`."] pub on_complete : aws_http_on_stream_complete_fn , pub on_destroy : aws_http_on_stream_destroy_fn , } # [test] fn bindgen_test_layout_aws_http_request_handler_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_request_handler_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_request_handler_options > () , 72usize , concat ! ("Size of: " , stringify ! (aws_http_request_handler_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_request_handler_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_request_handler_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . self_size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (self_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . server_connection) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (server_connection))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_request_headers) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_request_headers))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_request_header_block_done) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_request_header_block_done))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_request_body) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_request_body))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_request_done) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_request_done))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_complete) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_destroy) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_destroy))) ; } impl Default for aws_http_request_handler_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Invoked when the data stream of an outgoing HTTP write operation is no longer in use.\n This is always invoked on the HTTP connection's event-loop thread.\n\n @param stream HTTP-stream this write operation was submitted to.\n @param error_code If error_code is AWS_ERROR_SUCCESS (0), the data was successfully sent.\n Any other error_code indicates that the HTTP-stream is in the process of terminating.\n If the error_code is AWS_ERROR_HTTP_STREAM_HAS_COMPLETED,\n the stream's termination has nothing to do with this write operation.\n Any other non-zero error code indicates a problem with this particular write\n operation's data.\n @param user_data User data for this write operation."] pub type aws_http_stream_write_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when the data of an outgoing HTTP/1.1 chunk is no longer in use.\n This is always invoked on the HTTP connection's event-loop thread.\n\n @param stream HTTP-stream this chunk was submitted to.\n @param error_code If error_code is AWS_ERROR_SUCCESS (0), the data was successfully sent.\n Any other error_code indicates that the HTTP-stream is in the process of terminating.\n If the error_code is AWS_ERROR_HTTP_STREAM_HAS_COMPLETED,\n the stream's termination has nothing to do with this chunk.\n Any other non-zero error code indicates a problem with this particular chunk's data.\n @param user_data User data for this chunk."] pub type aws_http1_stream_write_chunk_complete_fn = aws_http_stream_write_complete_fn ; # [doc = " HTTP/1.1 chunk extension for chunked encoding.\n Note that the underlying strings are not owned by the byte cursors."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http1_chunk_extension { pub key : aws_byte_cursor , pub value : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_http1_chunk_extension () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http1_chunk_extension > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http1_chunk_extension > () , 32usize , concat ! ("Size of: " , stringify ! (aws_http1_chunk_extension))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http1_chunk_extension > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http1_chunk_extension))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . key) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_extension) , "::" , stringify ! (key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_extension) , "::" , stringify ! (value))) ; } impl Default for aws_http1_chunk_extension { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Encoding options for an HTTP/1.1 chunked transfer encoding chunk."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http1_chunk_options { pub chunk_data : * mut aws_input_stream , pub chunk_data_size : u64 , # [doc = " A pointer to an array of chunked extensions.\n The num_extensions must match the length of the array.\n This data is deep-copied by aws_http1_stream_write_chunk(),\n it does not need to remain valid until on_complete is invoked."] pub extensions : * mut aws_http1_chunk_extension , # [doc = " The number of elements defined in the extensions array."] pub num_extensions : usize , # [doc = " Invoked when the chunk data is no longer in use, whether or not it was successfully sent.\n Optional.\n See `aws_http1_stream_write_chunk_complete_fn`."] pub on_complete : aws_http1_stream_write_chunk_complete_fn , # [doc = " User provided data passed to the on_complete callback on its invocation."] pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_http1_chunk_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http1_chunk_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http1_chunk_options > () , 48usize , concat ! ("Size of: " , stringify ! (aws_http1_chunk_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http1_chunk_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http1_chunk_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . chunk_data) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (chunk_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . chunk_data_size) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (chunk_data_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . extensions) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (extensions))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_extensions) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (num_extensions))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_complete) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (on_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (user_data))) ; } impl Default for aws_http1_chunk_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Invoked when the data of an outgoing HTTP2 data frame is no longer in use.\n This is always invoked on the HTTP connection's event-loop thread.\n\n @param stream HTTP2-stream this write was submitted to.\n @param error_code If error_code is AWS_ERROR_SUCCESS (0), the data was successfully sent.\n Any other error_code indicates that the HTTP-stream is in the process of terminating.\n If the error_code is AWS_ERROR_HTTP_STREAM_HAS_COMPLETED,\n the stream's termination has nothing to do with this write.\n Any other non-zero error code indicates a problem with this particular write's data.\n @param user_data User data for this write."] pub type aws_http2_stream_write_data_complete_fn = aws_http_stream_write_complete_fn ; # [doc = " Encoding options for manual H2 data frame writes"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http2_stream_write_data_options { # [doc = " The data to be sent.\n Optional.\n If not set, input stream with length 0 will be used."] pub data : * mut aws_input_stream , # [doc = " Set true when it's the last chunk to be sent.\n After a write with end_stream, no more data write will be accepted."] pub end_stream : bool , # [doc = " Invoked when the data stream is no longer in use, whether or not it was successfully sent.\n Optional.\n See `aws_http2_stream_write_data_complete_fn`."] pub on_complete : aws_http2_stream_write_data_complete_fn , # [doc = " User provided data passed to the on_complete callback on its invocation."] pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_http2_stream_write_data_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http2_stream_write_data_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http2_stream_write_data_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_http2_stream_write_data_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http2_stream_write_data_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http2_stream_write_data_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . data) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http2_stream_write_data_options) , "::" , stringify ! (data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . end_stream) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http2_stream_write_data_options) , "::" , stringify ! (end_stream))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_complete) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http2_stream_write_data_options) , "::" , stringify ! (on_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http2_stream_write_data_options) , "::" , stringify ! (user_data))) ; } impl Default for aws_http2_stream_write_data_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Return whether both names are equivalent.\n This is a case-insensitive string comparison.\n\n Example Matches:\n \"Content-Length\" == \"content-length\" // upper or lower case ok\n\n Example Mismatches:\n \"Content-Length\" != \" Content-Length\" // leading whitespace bad"] pub fn aws_http_header_name_eq (name_a : aws_byte_cursor , name_b : aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Create a new headers object.\n The caller has a hold on the object and must call aws_http_headers_release() when they are done with it."] pub fn aws_http_headers_new (allocator : * mut aws_allocator) -> * mut aws_http_headers ; } extern "C" { # [doc = " Acquire a hold on the object, preventing it from being deleted until\n aws_http_headers_release() is called by all those with a hold on it."] pub fn aws_http_headers_acquire (headers : * mut aws_http_headers) ; } extern "C" { # [doc = " Release a hold on the object.\n The object is deleted when all holds on it are released."] pub fn aws_http_headers_release (headers : * mut aws_http_headers) ; } extern "C" { # [doc = " Add a header.\n The underlying strings are copied."] pub fn aws_http_headers_add_header (headers : * mut aws_http_headers , header : * const aws_http_header) -> :: libc :: c_int ; } extern "C" { # [doc = " Add a header.\n The underlying strings are copied."] pub fn aws_http_headers_add (headers : * mut aws_http_headers , name : aws_byte_cursor , value : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Add an array of headers.\n The underlying strings are copied."] pub fn aws_http_headers_add_array (headers : * mut aws_http_headers , array : * const aws_http_header , count : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Set a header value.\n The header is added if necessary and any existing values for this name are removed.\n The underlying strings are copied."] pub fn aws_http_headers_set (headers : * mut aws_http_headers , name : aws_byte_cursor , value : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the total number of headers."] pub fn aws_http_headers_count (headers : * const aws_http_headers) -> usize ; } extern "C" { # [doc = " Get the header at the specified index.\n The index of a given header may change any time headers are modified.\n When iterating headers, the following ordering rules apply:\n\n - Headers with the same name will always be in the same order, relative to one another.\n If \"A: one\" is added before \"A: two\", then \"A: one\" will always precede \"A: two\".\n\n - Headers with different names could be in any order, relative to one another.\n If \"A: one\" is seen before \"B: bee\" in one iteration, you might see \"B: bee\" before \"A: one\" on the next.\n\n AWS_ERROR_INVALID_INDEX is raised if the index is invalid."] pub fn aws_http_headers_get_index (headers : * const aws_http_headers , index : usize , out_header : * mut aws_http_header) -> :: libc :: c_int ; } extern "C" { # [doc = " Get all values with this name, combined into one new aws_string that you are responsible for destroying.\n If there are multiple headers with this name, their values are appended with comma-separators.\n If there are no headers with this name, NULL is returned and AWS_ERROR_HTTP_HEADER_NOT_FOUND is raised."] pub fn aws_http_headers_get_all (headers : * const aws_http_headers , name : aws_byte_cursor) -> * mut aws_string ; } extern "C" { # [doc = " Get the first value for this name, ignoring any additional values.\n AWS_ERROR_HTTP_HEADER_NOT_FOUND is raised if the name is not found."] pub fn aws_http_headers_get (headers : * const aws_http_headers , name : aws_byte_cursor , out_value : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Test if header name exists or not in headers"] pub fn aws_http_headers_has (headers : * const aws_http_headers , name : aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Remove all headers with this name.\n AWS_ERROR_HTTP_HEADER_NOT_FOUND is raised if no headers with this name are found."] pub fn aws_http_headers_erase (headers : * mut aws_http_headers , name : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Remove the first header found with this name and value.\n AWS_ERROR_HTTP_HEADER_NOT_FOUND is raised if no such header is found."] pub fn aws_http_headers_erase_value (headers : * mut aws_http_headers , name : aws_byte_cursor , value : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Remove the header at the specified index.\n\n AWS_ERROR_INVALID_INDEX is raised if the index is invalid."] pub fn aws_http_headers_erase_index (headers : * mut aws_http_headers , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Clear all headers."] pub fn aws_http_headers_clear (headers : * mut aws_http_headers) ; } extern "C" { # [doc = " Get the `:method` value (HTTP/2 headers only)."] pub fn aws_http2_headers_get_request_method (h2_headers : * const aws_http_headers , out_method : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set `:method` (HTTP/2 headers only).\n The headers makes its own copy of the underlying string."] pub fn aws_http2_headers_set_request_method (h2_headers : * mut aws_http_headers , method : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_http2_headers_get_request_scheme (h2_headers : * const aws_http_headers , out_scheme : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set `:scheme` (request pseudo headers only).\n The pseudo headers makes its own copy of the underlying string."] pub fn aws_http2_headers_set_request_scheme (h2_headers : * mut aws_http_headers , scheme : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_http2_headers_get_request_authority (h2_headers : * const aws_http_headers , out_authority : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set `:authority` (request pseudo headers only).\n The pseudo headers makes its own copy of the underlying string."] pub fn aws_http2_headers_set_request_authority (h2_headers : * mut aws_http_headers , authority : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_http2_headers_get_request_path (h2_headers : * const aws_http_headers , out_path : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set `:path` (request pseudo headers only).\n The pseudo headers makes its own copy of the underlying string."] pub fn aws_http2_headers_set_request_path (h2_headers : * mut aws_http_headers , path : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Get `:status` (response pseudo headers only).\n If no status is set, AWS_ERROR_HTTP_DATA_NOT_AVAILABLE is raised."] pub fn aws_http2_headers_get_response_status (h2_headers : * const aws_http_headers , out_status_code : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Set `:status` (response pseudo headers only)."] pub fn aws_http2_headers_set_response_status (h2_headers : * mut aws_http_headers , status_code : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Create a new HTTP/1.1 request message.\n The message is blank, all properties (method, path, etc) must be set individually.\n If HTTP/1.1 message used in HTTP/2 connection, the transformation will be automatically applied.\n A HTTP/2 message will created and sent based on the HTTP/1.1 message.\n\n The caller has a hold on the object and must call aws_http_message_release() when they are done with it."] pub fn aws_http_message_new_request (allocator : * mut aws_allocator) -> * mut aws_http_message ; } extern "C" { # [doc = " Like aws_http_message_new_request(), but uses existing aws_http_headers instead of creating a new one.\n Acquires a hold on the headers, and releases it when the request is destroyed."] pub fn aws_http_message_new_request_with_headers (allocator : * mut aws_allocator , existing_headers : * mut aws_http_headers) -> * mut aws_http_message ; } extern "C" { # [doc = " Create a new HTTP/1.1 response message.\n The message is blank, all properties (status, headers, etc) must be set individually.\n\n The caller has a hold on the object and must call aws_http_message_release() when they are done with it."] pub fn aws_http_message_new_response (allocator : * mut aws_allocator) -> * mut aws_http_message ; } extern "C" { # [doc = " Create a new HTTP/2 request message.\n pseudo headers need to be set from aws_http2_headers_set_request_* to the headers of the aws_http_message.\n Will be errored out if used in HTTP/1.1 connection.\n\n The caller has a hold on the object and must call aws_http_message_release() when they are done with it."] pub fn aws_http2_message_new_request (allocator : * mut aws_allocator) -> * mut aws_http_message ; } extern "C" { # [doc = " Create a new HTTP/2 response message.\n pseudo headers need to be set from aws_http2_headers_set_response_status to the headers of the aws_http_message.\n Will be errored out if used in HTTP/1.1 connection.\n\n The caller has a hold on the object and must call aws_http_message_release() when they are done with it."] pub fn aws_http2_message_new_response (allocator : * mut aws_allocator) -> * mut aws_http_message ; } extern "C" { # [doc = " Create an HTTP/2 message from HTTP/1.1 message.\n pseudo headers will be created from the context and added to the headers of new message.\n Normal headers will be copied to the headers of new message.\n Note:\n - if `host` exist, it will be removed and `:authority` will be added using the information.\n - `:scheme` always defaults to \"https\". To use a different scheme create the HTTP/2 message directly"] pub fn aws_http2_message_new_from_http1 (alloc : * mut aws_allocator , http1_msg : * const aws_http_message) -> * mut aws_http_message ; } extern "C" { # [doc = " Acquire a hold on the object, preventing it from being deleted until\n aws_http_message_release() is called by all those with a hold on it.\n\n This function returns the passed in message (possibly NULL) so that acquire-and-assign can be done with a single\n statement."] pub fn aws_http_message_acquire (message : * mut aws_http_message) -> * mut aws_http_message ; } extern "C" { # [doc = " Release a hold on the object.\n The object is deleted when all holds on it are released.\n\n This function always returns NULL so that release-and-assign-NULL can be done with a single statement."] pub fn aws_http_message_release (message : * mut aws_http_message) -> * mut aws_http_message ; } extern "C" { # [doc = " Deprecated. This is equivalent to aws_http_message_release()."] pub fn aws_http_message_destroy (message : * mut aws_http_message) ; } extern "C" { pub fn aws_http_message_is_request (message : * const aws_http_message) -> bool ; } extern "C" { pub fn aws_http_message_is_response (message : * const aws_http_message) -> bool ; } extern "C" { # [doc = " Get the protocol version of the http message."] pub fn aws_http_message_get_protocol_version (message : * const aws_http_message) -> aws_http_version ; } extern "C" { # [doc = " Get the method (request messages only)."] pub fn aws_http_message_get_request_method (request_message : * const aws_http_message , out_method : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set the method (request messages only).\n The request makes its own copy of the underlying string."] pub fn aws_http_message_set_request_method (request_message : * mut aws_http_message , method : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_http_message_get_request_path (request_message : * const aws_http_message , out_path : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set the path-and-query value (request messages only).\n The request makes its own copy of the underlying string."] pub fn aws_http_message_set_request_path (request_message : * mut aws_http_message , path : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the status code (response messages only).\n If no status is set, AWS_ERROR_HTTP_DATA_NOT_AVAILABLE is raised."] pub fn aws_http_message_get_response_status (response_message : * const aws_http_message , out_status_code : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Set the status code (response messages only)."] pub fn aws_http_message_set_response_status (response_message : * mut aws_http_message , status_code : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the body stream.\n Returns NULL if no body stream is set."] pub fn aws_http_message_get_body_stream (message : * const aws_http_message) -> * mut aws_input_stream ; } extern "C" { # [doc = " Set the body stream.\n NULL is an acceptable value for messages with no body.\n Note: The message does NOT take ownership of the body stream.\n The stream must not be destroyed until the message is complete."] pub fn aws_http_message_set_body_stream (message : * mut aws_http_message , body_stream : * mut aws_input_stream) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_future_http_message { _unused : [u8 ; 0] , } extern "C" { pub fn aws_future_http_message_new (alloc : * mut aws_allocator) -> * mut aws_future_http_message ; } extern "C" { pub fn aws_future_http_message_set_result_by_move (future : * mut aws_future_http_message , pointer_address : * mut * mut aws_http_message) ; } extern "C" { pub fn aws_future_http_message_get_result_by_move (future : * mut aws_future_http_message) -> * mut aws_http_message ; } extern "C" { pub fn aws_future_http_message_peek_result (future : * const aws_future_http_message) -> * mut aws_http_message ; } extern "C" { pub fn aws_future_http_message_acquire (future : * mut aws_future_http_message) -> * mut aws_future_http_message ; } extern "C" { pub fn aws_future_http_message_release (future : * mut aws_future_http_message) -> * mut aws_future_http_message ; } extern "C" { pub fn aws_future_http_message_set_error (future : * mut aws_future_http_message , error_code : :: libc :: c_int) ; } extern "C" { pub fn aws_future_http_message_is_done (future : * const aws_future_http_message) -> bool ; } extern "C" { pub fn aws_future_http_message_get_error (future : * const aws_future_http_message) -> :: libc :: c_int ; } extern "C" { pub fn aws_future_http_message_register_callback (future : * mut aws_future_http_message , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_http_message_register_callback_if_not_done (future : * mut aws_future_http_message , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) -> bool ; } extern "C" { pub fn aws_future_http_message_register_event_loop_callback (future : * mut aws_future_http_message , event_loop : * mut aws_event_loop , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_http_message_register_channel_callback (future : * mut aws_future_http_message , channel : * mut aws_channel , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_http_message_wait (future : * mut aws_future_http_message , timeout_ns : u64) -> bool ; } extern "C" { # [doc = " Submit a chunk of data to be sent on an HTTP/1.1 stream.\n The stream must have specified \"chunked\" in a \"transfer-encoding\" header.\n For client streams, activate() must be called before any chunks are submitted.\n For server streams, the response must be submitted before any chunks.\n A final chunk with size 0 must be submitted to successfully complete the HTTP-stream.\n\n Returns AWS_OP_SUCCESS if the chunk has been submitted. The chunk's completion\n callback will be invoked when the HTTP-stream is done with the chunk data,\n whether or not it was successfully sent (see `aws_http1_stream_write_chunk_complete_fn`).\n The chunk data must remain valid until the completion callback is invoked.\n\n Returns AWS_OP_ERR and raises an error if the chunk could not be submitted.\n In this case, the chunk's completion callback will never be invoked.\n Note that it is always possible for the HTTP-stream to terminate unexpectedly\n prior to this call being made, in which case the error raised is\n AWS_ERROR_HTTP_STREAM_HAS_COMPLETED."] pub fn aws_http1_stream_write_chunk (http1_stream : * mut aws_http_stream , options : * const aws_http1_chunk_options) -> :: libc :: c_int ; } extern "C" { # [doc = " The stream must have specified `http2_use_manual_data_writes` during request creation.\n For client streams, activate() must be called before any frames are submitted.\n For server streams, the response headers must be submitted before any frames.\n A write with options that has end_stream set to be true will end the stream and prevent any further write.\n\n @return AWS_OP_SUCCESS if the write was queued\n AWS_OP_ERROR indicating the attempt raised an error code.\n AWS_ERROR_INVALID_STATE will be raised for invalid usage.\n AWS_ERROR_HTTP_STREAM_HAS_COMPLETED will be raised if the stream ended for reasons behind the scenes.\n\n Typical usage will be something like:\n options.http2_use_manual_data_writes = true;\n stream = aws_http_connection_make_request(connection, &options);\n aws_http_stream_activate(stream);\n ...\n struct aws_http2_stream_write_data_options write;\n aws_http2_stream_write_data(stream, &write);\n ...\n struct aws_http2_stream_write_data_options last_write;\n last_write.end_stream = true;\n aws_http2_stream_write_data(stream, &write);\n ...\n aws_http_stream_release(stream);"] pub fn aws_http2_stream_write_data (http2_stream : * mut aws_http_stream , options : * const aws_http2_stream_write_data_options) -> :: libc :: c_int ; } extern "C" { # [doc = " Add a list of headers to be added as trailing headers sent after the last chunk is sent.\n a \"Trailer\" header field which indicates the fields present in the trailer.\n\n Certain headers are forbidden in the trailer (e.g., Transfer-Encoding, Content-Length, Host). See RFC-7541\n Section 4.1.2 for more details.\n\n For client streams, activate() must be called before any chunks are submitted.\n\n For server streams, the response must be submitted before the trailer can be added\n\n aws_http1_stream_add_chunked_trailer must be called before the final size 0 chunk, and at the moment can only\n be called once, though this could change if need be.\n\n Returns AWS_OP_SUCCESS if the chunk has been submitted."] pub fn aws_http1_stream_add_chunked_trailer (http1_stream : * mut aws_http_stream , trailing_headers : * const aws_http_headers) -> :: libc :: c_int ; } extern "C" { # [doc = " This datastructure has more functions for inspecting and modifying headers than\n are available on the aws_http_message datastructure."] pub fn aws_http_message_get_headers (message : * const aws_http_message) -> * mut aws_http_headers ; } extern "C" { # [doc = " Get the message's const aws_http_headers."] pub fn aws_http_message_get_const_headers (message : * const aws_http_message) -> * const aws_http_headers ; } extern "C" { # [doc = " Get the number of headers."] pub fn aws_http_message_get_header_count (message : * const aws_http_message) -> usize ; } extern "C" { # [doc = " Get the header at the specified index.\n This function cannot fail if a valid index is provided.\n Otherwise, AWS_ERROR_INVALID_INDEX will be raised.\n\n The underlying strings are stored within the message."] pub fn aws_http_message_get_header (message : * const aws_http_message , out_header : * mut aws_http_header , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Add a header to the end of the array.\n The message makes its own copy of the underlying strings."] pub fn aws_http_message_add_header (message : * mut aws_http_message , header : aws_http_header) -> :: libc :: c_int ; } extern "C" { # [doc = " Add an array of headers to the end of the header array.\n The message makes its own copy of the underlying strings.\n\n This is a helper function useful when it's easier to define headers as a stack array, rather than calling add_header\n repeatedly."] pub fn aws_http_message_add_header_array (message : * mut aws_http_message , headers : * const aws_http_header , num_headers : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Remove the header at the specified index.\n Headers after this index are all shifted back one position.\n\n This function cannot fail if a valid index is provided.\n Otherwise, AWS_ERROR_INVALID_INDEX will be raised."] pub fn aws_http_message_erase_header (message : * mut aws_http_message , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Create a stream, with a client connection sending a request.\n The request does not start sending automatically once the stream is created. You must call\n aws_http_stream_activate to begin execution of the request.\n\n The `options` are copied during this call.\n\n Tip for language bindings: Do not bind the `options` struct. Use something more natural for your language,\n such as Builder Pattern in Java, or Python's ability to take many optional arguments by name.\n\n Note: The header of the request will be sent as it is when the message to send protocol matches the protocol of the\n connection.\n - No `user-agent` will be added.\n - No security check will be enforced. eg: `referer` header privacy should be enforced by the user-agent who adds the\n header\n - When HTTP/1 message sent on HTTP/2 connection, `aws_http2_message_new_from_http1` will be applied under the hood.\n - When HTTP/2 message sent on HTTP/1 connection, no change will be made."] pub fn aws_http_connection_make_request (client_connection : * mut aws_http_connection , options : * const aws_http_make_request_options) -> * mut aws_http_stream ; } extern "C" { # [doc = " Create a stream, with a server connection receiving and responding to a request.\n This function can only be called from the `aws_http_on_incoming_request_fn` callback.\n aws_http_stream_send_response() should be used to send a response."] pub fn aws_http_stream_new_server_request_handler (options : * const aws_http_request_handler_options) -> * mut aws_http_stream ; } extern "C" { # [doc = " Acquire refcount on the stream to prevent it from being cleaned up until it is released."] pub fn aws_http_stream_acquire (stream : * mut aws_http_stream) -> * mut aws_http_stream ; } extern "C" { # [doc = " Users must release the stream when they are done with it, or its memory will never be cleaned up.\n This will not cancel the stream, its callbacks will still fire if the stream is still in progress.\n\n Tips for language bindings:\n - Invoke this from the wrapper class's finalizer/destructor.\n - Do not let the wrapper class be destroyed until on_complete() has fired."] pub fn aws_http_stream_release (stream : * mut aws_http_stream) ; } extern "C" { # [doc = " Only used for client initiated streams (immediately following a call to aws_http_connection_make_request).\n\n Activates the request's outgoing stream processing."] pub fn aws_http_stream_activate (stream : * mut aws_http_stream) -> :: libc :: c_int ; } extern "C" { pub fn aws_http_stream_get_connection (stream : * const aws_http_stream) -> * mut aws_http_connection ; } extern "C" { pub fn aws_http_stream_get_incoming_response_status (stream : * const aws_http_stream , out_status : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { pub fn aws_http_stream_get_incoming_request_method (stream : * const aws_http_stream , out_method : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_http_stream_get_incoming_request_uri (stream : * const aws_http_stream , out_uri : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Send response (only callable from \"request handler\" streams)\n The response object must stay alive at least until the stream's on_complete is called."] pub fn aws_http_stream_send_response (stream : * mut aws_http_stream , response : * mut aws_http_message) -> :: libc :: c_int ; } extern "C" { # [doc = " Increment the stream's flow-control window to keep data flowing.\n\n If the connection was created with `manual_window_management` set true,\n the flow-control window of each stream will shrink as body data is received\n (headers, padding, and other metadata do not affect the window).\n The connection's `initial_window_size` determines the starting size of each stream's window.\n If a stream's flow-control window reaches 0, no further data will be received.\n\n If `manual_window_management` is false, this call will have no effect.\n The connection maintains its flow-control windows such that\n no back-pressure is applied and data arrives as fast as possible."] pub fn aws_http_stream_update_window (stream : * mut aws_http_stream , increment_size : usize) ; } extern "C" { # [doc = " Gets the HTTP/2 id associated with a stream. Even h1 streams have an id (using the same allocation procedure\n as http/2) for easier tracking purposes. For client streams, this will only be non-zero after a successful call\n to aws_http_stream_activate()"] pub fn aws_http_stream_get_id (stream : * const aws_http_stream) -> u32 ; } extern "C" { # [doc = " Reset the HTTP/2 stream (HTTP/2 only).\n Note that if the stream closes before this async call is fully processed, the RST_STREAM frame will not be sent.\n\n @param http2_stream HTTP/2 stream.\n @param http2_error aws_http2_error_code. Reason to reset the stream."] pub fn aws_http2_stream_reset (http2_stream : * mut aws_http_stream , http2_error : u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the error code received in rst_stream.\n Only valid if the stream has completed, and an RST_STREAM frame has received.\n\n @param http2_stream HTTP/2 stream.\n @param out_http2_error Gets to set to HTTP/2 error code received in rst_stream."] pub fn aws_http2_stream_get_received_reset_error_code (http2_stream : * mut aws_http_stream , out_http2_error : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the HTTP/2 error code sent in the RST_STREAM frame (HTTP/2 only).\n Only valid if the stream has completed, and has sent an RST_STREAM frame.\n\n @param http2_stream HTTP/2 stream.\n @param out_http2_error Gets to set to HTTP/2 error code sent in rst_stream."] pub fn aws_http2_stream_get_sent_reset_error_code (http2_stream : * mut aws_http_stream , out_http2_error : * mut u32) -> :: libc :: c_int ; } pub type aws_simple_completion_callback = :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_ref_count { pub ref_count : aws_atomic_var , pub object : * mut :: libc :: c_void , pub on_zero_fn : aws_simple_completion_callback , } # [test] fn bindgen_test_layout_aws_ref_count () { const UNINIT : :: std :: mem :: MaybeUninit < aws_ref_count > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_ref_count > () , 24usize , concat ! ("Size of: " , stringify ! (aws_ref_count))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_ref_count > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_ref_count) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . object) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_ref_count) , "::" , stringify ! (object))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_zero_fn) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_ref_count) , "::" , stringify ! (on_zero_fn))) ; } impl Default for aws_ref_count { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_shutdown_callback_options { pub shutdown_callback_fn : aws_simple_completion_callback , pub shutdown_callback_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_shutdown_callback_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_shutdown_callback_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_shutdown_callback_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_shutdown_callback_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_shutdown_callback_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_shutdown_callback_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback_fn) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_shutdown_callback_options) , "::" , stringify ! (shutdown_callback_fn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback_user_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_shutdown_callback_options) , "::" , stringify ! (shutdown_callback_user_data))) ; } impl Default for aws_shutdown_callback_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Initializes a ref-counter structure. After initialization, the ref count will be 1.\n\n @param ref_count ref-counter to initialize\n @param object object being ref counted\n @param on_zero_fn function to invoke when the ref count reaches zero"] pub fn aws_ref_count_init (ref_count : * mut aws_ref_count , object : * mut :: libc :: c_void , on_zero_fn : aws_simple_completion_callback) ; } extern "C" { # [doc = " Increments a ref-counter's ref count\n\n @param ref_count ref-counter to increment the count for\n @return the object being ref-counted"] pub fn aws_ref_count_acquire (ref_count : * mut aws_ref_count) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Decrements a ref-counter's ref count. Invokes the on_zero callback if the ref count drops to zero\n @param ref_count ref-counter to decrement the count for\n @return the value of the decremented ref count"] pub fn aws_ref_count_release (ref_count : * mut aws_ref_count) -> usize ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_async_input_stream { pub vtable : * const aws_async_input_stream_vtable , pub alloc : * mut aws_allocator , pub ref_count : aws_ref_count , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_async_input_stream () { const UNINIT : :: std :: mem :: MaybeUninit < aws_async_input_stream > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_async_input_stream > () , 48usize , concat ! ("Size of: " , stringify ! (aws_async_input_stream))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_async_input_stream > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_async_input_stream))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream) , "::" , stringify ! (impl_))) ; } impl Default for aws_async_input_stream { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_async_input_stream_vtable { # [doc = " Destroy the stream, its refcount has reached 0."] pub destroy : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_async_input_stream) > , # [doc = " Read once into the buffer.\n Complete the read when at least 1 byte is read, the buffer is full, or EOF is reached.\n Do not resize the buffer (do not use \"aws_byte_buf_xyz_dynamic()\" functions)\n Do not assume that buffer len starts at 0.\n You may assume that read() won't be called again until the current one completes.\n You may assume that the buffer has some space available.\n Return a future, which will contain an error code if something went wrong,\n or a result bool indicating whether EOF has been reached."] pub read : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_async_input_stream , dest : * mut aws_byte_buf) -> * mut aws_future_bool > , } # [test] fn bindgen_test_layout_aws_async_input_stream_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_async_input_stream_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_async_input_stream_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_async_input_stream_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_async_input_stream_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_async_input_stream_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . read) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream_vtable) , "::" , stringify ! (read))) ; } extern "C" { # [doc = " Initialize aws_async_input_stream \"base class\""] pub fn aws_async_input_stream_init_base (stream : * mut aws_async_input_stream , alloc : * mut aws_allocator , vtable : * const aws_async_input_stream_vtable , impl_ : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Increment reference count.\n You may pass in NULL (has no effect).\n Returns whatever pointer was passed in."] pub fn aws_async_input_stream_acquire (stream : * mut aws_async_input_stream) -> * mut aws_async_input_stream ; } extern "C" { # [doc = " Decrement reference count.\n You may pass in NULL (has no effect).\n Always returns NULL."] pub fn aws_async_input_stream_release (stream : * mut aws_async_input_stream) -> * mut aws_async_input_stream ; } extern "C" { # [doc = " Read once from the async stream into the buffer.\n The read completes when at least 1 byte is read, the buffer is full, or EOF is reached.\n Depending on implementation, the read could complete at any time.\n It may complete synchronously. It may complete on another thread.\n Returns a future, which will contain an error code if something went wrong,\n or a result bool indicating whether EOF has been reached.\n\n WARNING: The buffer must have space available.\n WARNING: Do not read again until the previous read is complete."] pub fn aws_async_input_stream_read (stream : * mut aws_async_input_stream , dest : * mut aws_byte_buf) -> * mut aws_future_bool ; } extern "C" { # [doc = " Read repeatedly from the async stream until the buffer is full, or EOF is reached.\n Depending on implementation, this could complete at any time.\n It may complete synchronously. It may complete on another thread.\n Returns a future, which will contain an error code if something went wrong,\n or a result bool indicating whether EOF has been reached.\n\n WARNING: The buffer must have space available.\n WARNING: Do not read again until the previous read is complete."] pub fn aws_async_input_stream_read_to_fill (stream : * mut aws_async_input_stream , dest : * mut aws_byte_buf) -> * mut aws_future_bool ; } pub type aws_crt_statistics_category_t = u32 ; pub const AWS_CRT_STATISTICS_CATEGORY_STRIDE_BITS : _bindgen_ty_22 = _bindgen_ty_22 :: AWS_CRT_STATISTICS_CATEGORY_STRIDE_BITS ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_22 { AWS_CRT_STATISTICS_CATEGORY_STRIDE_BITS = 8 , } # [repr (u32)] # [non_exhaustive] # [doc = " The common-specific range of the aws_crt_statistics_category cross-library enum.\n\n This enum functions as an RTTI value that lets statistics handler's interpret (via cast) a\n specific statistics structure if the RTTI value is understood.\n\n Common doesn't have any statistics structures presently, so its range is essentially empty.\n"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_crt_common_statistics_category { AWSCRT_STAT_CAT_INVALID = 0 , } # [doc = " Pattern-struct that functions as a base \"class\" for all statistics structures. To conform\n to the pattern, a statistics structure must have its first member be the category. In that\n case it becomes \"safe\" to cast from aws_crt_statistics_base to the specific statistics structure\n based on the category value."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_crt_statistics_base { pub category : aws_crt_statistics_category_t , } # [test] fn bindgen_test_layout_aws_crt_statistics_base () { const UNINIT : :: std :: mem :: MaybeUninit < aws_crt_statistics_base > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_crt_statistics_base > () , 4usize , concat ! ("Size of: " , stringify ! (aws_crt_statistics_base))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_crt_statistics_base > () , 4usize , concat ! ("Alignment of " , stringify ! (aws_crt_statistics_base))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . category) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_base) , "::" , stringify ! (category))) ; } # [doc = " The start and end time, in milliseconds-since-epoch, that a set of statistics was gathered over."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_crt_statistics_sample_interval { pub begin_time_ms : u64 , pub end_time_ms : u64 , } # [test] fn bindgen_test_layout_aws_crt_statistics_sample_interval () { const UNINIT : :: std :: mem :: MaybeUninit < aws_crt_statistics_sample_interval > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_crt_statistics_sample_interval > () , 16usize , concat ! ("Size of: " , stringify ! (aws_crt_statistics_sample_interval))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_crt_statistics_sample_interval > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_crt_statistics_sample_interval))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . begin_time_ms) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_sample_interval) , "::" , stringify ! (begin_time_ms))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . end_time_ms) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_sample_interval) , "::" , stringify ! (end_time_ms))) ; } pub type aws_crt_statistics_handler_process_statistics_fn = :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_crt_statistics_handler , interval : * mut aws_crt_statistics_sample_interval , stats : * mut aws_array_list , context : * mut :: libc :: c_void) > ; pub type aws_crt_statistics_handler_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_crt_statistics_handler) > ; pub type aws_crt_statistics_handler_get_report_interval_ms_fn = :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut aws_crt_statistics_handler) -> u64 > ; # [doc = " Vtable for functions that all statistics handlers must implement"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_crt_statistics_handler_vtable { pub process_statistics : aws_crt_statistics_handler_process_statistics_fn , pub destroy : aws_crt_statistics_handler_destroy_fn , pub get_report_interval_ms : aws_crt_statistics_handler_get_report_interval_ms_fn , } # [test] fn bindgen_test_layout_aws_crt_statistics_handler_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_crt_statistics_handler_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_crt_statistics_handler_vtable > () , 24usize , concat ! ("Size of: " , stringify ! (aws_crt_statistics_handler_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_crt_statistics_handler_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_crt_statistics_handler_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_statistics) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler_vtable) , "::" , stringify ! (process_statistics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_report_interval_ms) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler_vtable) , "::" , stringify ! (get_report_interval_ms))) ; } # [doc = " Base structure for all statistics handler implementations.\n\n A statistics handler is an object that listens to a stream of polymorphic (via the category RTTI enum) statistics\n structures emitted from some arbitrary source. In the initial implementation, statistics handlers are primarily\n attached to channels, where they monitor IO throughput and state data (from channel handlers) to determine a\n connection's health.\n\n Statistics handlers are a generalization of the timeout and bandwidth filters that are often associated with\n SDK network connections. Configurable, default implementations are defined at the protocol level (http, etc...)\n where they can be attached at connection (channel) creation time."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_crt_statistics_handler { pub vtable : * mut aws_crt_statistics_handler_vtable , pub allocator : * mut aws_allocator , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_crt_statistics_handler () { const UNINIT : :: std :: mem :: MaybeUninit < aws_crt_statistics_handler > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_crt_statistics_handler > () , 24usize , concat ! ("Size of: " , stringify ! (aws_crt_statistics_handler))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_crt_statistics_handler > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_crt_statistics_handler))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler) , "::" , stringify ! (impl_))) ; } impl Default for aws_crt_statistics_handler { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Submits a list of statistics objects to a statistics handler for processing\n\n handler - the statistics handler that will process the statistics objects\n interval - time period over which the statistics were gathered\n stats - list of pointers to structures that can be case to aws_crt_statistics_base (i.e. have category as a first\n member)\n context - (optional) additional context specific to where the statistics handler has been attached"] pub fn aws_crt_statistics_handler_process_statistics (handler : * mut aws_crt_statistics_handler , interval : * mut aws_crt_statistics_sample_interval , stats : * mut aws_array_list , context : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Queries the frequency (via an interval in milliseconds) which a statistics handler would like to be informed\n of statistics."] pub fn aws_crt_statistics_handler_get_report_interval_ms (handler : * mut aws_crt_statistics_handler) -> u64 ; } extern "C" { # [doc = " completely destroys a statistics handler. The handler's cleanup function must clean up the impl portion completely\n (including its allocation, if done separately)."] pub fn aws_crt_statistics_handler_destroy (handler : * mut aws_crt_statistics_handler) ; } pub type aws_priority_queue_compare_fn = :: std :: option :: Option < unsafe extern "C" fn (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> :: libc :: c_int > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_priority_queue { # [doc = " predicate that determines the priority of the elements in the queue."] pub pred : aws_priority_queue_compare_fn , # [doc = " The underlying container storing the queue elements."] pub container : aws_array_list , # [doc = " An array of pointers to backpointer elements. This array is initialized when\n the first call to aws_priority_queue_push_bp is made, and is subsequently maintained\n through any heap node manipulations.\n\n Each element is a struct aws_priority_queue_node *, pointing to a backpointer field\n owned by the calling code, or a NULL. The backpointer field is continually updated\n with information needed to locate and remove a specific node later on."] pub backpointers : aws_array_list , } # [test] fn bindgen_test_layout_aws_priority_queue () { const UNINIT : :: std :: mem :: MaybeUninit < aws_priority_queue > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_priority_queue > () , 88usize , concat ! ("Size of: " , stringify ! (aws_priority_queue))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_priority_queue > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_priority_queue))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . pred) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_priority_queue) , "::" , stringify ! (pred))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . container) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_priority_queue) , "::" , stringify ! (container))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . backpointers) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_priority_queue) , "::" , stringify ! (backpointers))) ; } impl Default for aws_priority_queue { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_priority_queue_node { # [doc = " The current index of the node in question, or SIZE_MAX if the node has been removed."] pub current_index : usize , } # [test] fn bindgen_test_layout_aws_priority_queue_node () { const UNINIT : :: std :: mem :: MaybeUninit < aws_priority_queue_node > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_priority_queue_node > () , 8usize , concat ! ("Size of: " , stringify ! (aws_priority_queue_node))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_priority_queue_node > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_priority_queue_node))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . current_index) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_priority_queue_node) , "::" , stringify ! (current_index))) ; } extern "C" { # [doc = " Initializes a priority queue struct for use. This mode will grow memory automatically (exponential model)\n Default size is the inital size of the queue\n item_size is the size of each element in bytes. Mixing items types is not supported by this API.\n pred is the function that will be used to determine priority."] pub fn aws_priority_queue_init_dynamic (queue : * mut aws_priority_queue , alloc : * mut aws_allocator , default_size : usize , item_size : usize , pred : aws_priority_queue_compare_fn) -> :: libc :: c_int ; } extern "C" { # [doc = " Initializes a priority queue struct for use. This mode will not allocate any additional memory. When the heap fills\n new enqueue operations will fail with AWS_ERROR_PRIORITY_QUEUE_FULL.\n\n Heaps initialized using this call do not support the aws_priority_queue_push_ref call with a non-NULL backpointer\n parameter.\n\n heap is the raw memory allocated for this priority_queue\n item_count is the maximum number of elements the raw heap can contain\n item_size is the size of each element in bytes. Mixing items types is not supported by this API.\n pred is the function that will be used to determine priority."] pub fn aws_priority_queue_init_static (queue : * mut aws_priority_queue , heap : * mut :: libc :: c_void , item_count : usize , item_size : usize , pred : aws_priority_queue_compare_fn) ; } extern "C" { # [doc = " Checks that the backpointer at a specific index of the queue is\n NULL or points to a correctly allocated aws_priority_queue_node."] pub fn aws_priority_queue_backpointer_index_valid (queue : * const aws_priority_queue , index : usize) -> bool ; } extern "C" { # [doc = " Checks that the backpointers of the priority queue are either NULL\n or correctly allocated to point at aws_priority_queue_nodes. This\n check is O(n), as it accesses every backpointer in a loop, and thus\n shouldn't be used carelessly."] pub fn aws_priority_queue_backpointers_valid_deep (queue : * const aws_priority_queue) -> bool ; } extern "C" { # [doc = " Checks that the backpointers of the priority queue satisfy validity\n constraints."] pub fn aws_priority_queue_backpointers_valid (queue : * const aws_priority_queue) -> bool ; } extern "C" { # [doc = " Set of properties of a valid aws_priority_queue."] pub fn aws_priority_queue_is_valid (queue : * const aws_priority_queue) -> bool ; } extern "C" { # [doc = " Cleans up any internally allocated memory and resets the struct for reuse or deletion."] pub fn aws_priority_queue_clean_up (queue : * mut aws_priority_queue) ; } extern "C" { # [doc = " Copies item into the queue and places it in the proper priority order. Complexity: O(log(n))."] pub fn aws_priority_queue_push (queue : * mut aws_priority_queue , item : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies item into the queue and places it in the proper priority order. Complexity: O(log(n)).\n\n If the backpointer parameter is non-null, the heap will continually update the pointed-to field\n with information needed to remove the node later on. *backpointer must remain valid until the node\n is removed from the heap, and may be updated on any mutating operation on the priority queue.\n\n If the node is removed, the backpointer will be set to a sentinel value that indicates that the\n node has already been removed. It is safe (and a no-op) to call aws_priority_queue_remove with\n such a sentinel value."] pub fn aws_priority_queue_push_ref (queue : * mut aws_priority_queue , item : * mut :: libc :: c_void , backpointer : * mut aws_priority_queue_node) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the element of the highest priority, and removes it from the queue.. Complexity: O(log(n)).\n If queue is empty, AWS_ERROR_PRIORITY_QUEUE_EMPTY will be raised."] pub fn aws_priority_queue_pop (queue : * mut aws_priority_queue , item : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes a specific node from the priority queue. Complexity: O(log(n))\n After removing a node (using either _remove or _pop), the backpointer set at push_ref time is set\n to a sentinel value. If this sentinel value is passed to aws_priority_queue_remove,\n AWS_ERROR_PRIORITY_QUEUE_BAD_NODE will be raised. Note, however, that passing uninitialized\n aws_priority_queue_nodes, or ones from different priority queues, results in undefined behavior."] pub fn aws_priority_queue_remove (queue : * mut aws_priority_queue , item : * mut :: libc :: c_void , node : * const aws_priority_queue_node) -> :: libc :: c_int ; } extern "C" { # [doc = " Obtains a pointer to the element of the highest priority. Complexity: constant time.\n If queue is empty, AWS_ERROR_PRIORITY_QUEUE_EMPTY will be raised."] pub fn aws_priority_queue_top (queue : * const aws_priority_queue , item : * mut * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Current number of elements in the queue"] pub fn aws_priority_queue_size (queue : * const aws_priority_queue) -> usize ; } extern "C" { # [doc = " Current allocated capacity for the queue, in dynamic mode this grows over time, in static mode, this will never\n change."] pub fn aws_priority_queue_capacity (queue : * const aws_priority_queue) -> usize ; } impl aws_task_status { pub const AWS_TASK_STATUS_RUN_READY : aws_task_status = aws_task_status (0) ; } impl aws_task_status { pub const AWS_TASK_STATUS_CANCELED : aws_task_status = aws_task_status (1) ; } # [repr (transparent)] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub struct aws_task_status (pub :: libc :: c_uint) ; # [doc = " A scheduled function."] pub type aws_task_fn = :: std :: option :: Option < unsafe extern "C" fn (task : * mut aws_task , arg : * mut :: libc :: c_void , arg1 : aws_task_status) > ; # [repr (C)] # [derive (Copy , Clone)] pub struct aws_task { pub fn_ : aws_task_fn , pub arg : * mut :: libc :: c_void , pub timestamp : u64 , pub node : aws_linked_list_node , pub priority_queue_node : aws_priority_queue_node , pub type_tag : * const :: libc :: c_char , pub abi_extension : aws_task__bindgen_ty_1 , } # [repr (C)] # [derive (Copy , Clone)] pub union aws_task__bindgen_ty_1 { pub scheduled : bool , pub reserved : usize , } # [test] fn bindgen_test_layout_aws_task__bindgen_ty_1 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_task__bindgen_ty_1 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_task__bindgen_ty_1 > () , 8usize , concat ! ("Size of: " , stringify ! (aws_task__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_task__bindgen_ty_1 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_task__bindgen_ty_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . scheduled) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_task__bindgen_ty_1) , "::" , stringify ! (scheduled))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . reserved) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_task__bindgen_ty_1) , "::" , stringify ! (reserved))) ; } impl Default for aws_task__bindgen_ty_1 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [test] fn bindgen_test_layout_aws_task () { const UNINIT : :: std :: mem :: MaybeUninit < aws_task > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_task > () , 64usize , concat ! ("Size of: " , stringify ! (aws_task))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_task > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_task))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . fn_) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (fn_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . arg) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (arg))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . timestamp) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (timestamp))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . node) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (node))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . priority_queue_node) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (priority_queue_node))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . type_tag) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (type_tag))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . abi_extension) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (abi_extension))) ; } impl Default for aws_task { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_task_scheduler { pub alloc : * mut aws_allocator , pub timed_queue : aws_priority_queue , pub timed_list : aws_linked_list , pub asap_list : aws_linked_list , } # [test] fn bindgen_test_layout_aws_task_scheduler () { const UNINIT : :: std :: mem :: MaybeUninit < aws_task_scheduler > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_task_scheduler > () , 160usize , concat ! ("Size of: " , stringify ! (aws_task_scheduler))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_task_scheduler > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_task_scheduler))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_task_scheduler) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . timed_queue) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_task_scheduler) , "::" , stringify ! (timed_queue))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . timed_list) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_task_scheduler) , "::" , stringify ! (timed_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . asap_list) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_task_scheduler) , "::" , stringify ! (asap_list))) ; } impl Default for aws_task_scheduler { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Init an aws_task"] pub fn aws_task_init (task : * mut aws_task , fn_ : aws_task_fn , arg : * mut :: libc :: c_void , type_tag : * const :: libc :: c_char) ; } extern "C" { pub fn aws_task_run (task : * mut aws_task , status : aws_task_status) ; } extern "C" { # [doc = " Initializes a task scheduler instance."] pub fn aws_task_scheduler_init (scheduler : * mut aws_task_scheduler , alloc : * mut aws_allocator) -> :: libc :: c_int ; } extern "C" { # [doc = " Empties and executes all queued tasks, passing the AWS_TASK_STATUS_CANCELED status to the task function.\n Cleans up any memory allocated, and prepares the instance for reuse or deletion."] pub fn aws_task_scheduler_clean_up (scheduler : * mut aws_task_scheduler) ; } extern "C" { pub fn aws_task_scheduler_is_valid (scheduler : * const aws_task_scheduler) -> bool ; } extern "C" { # [doc = " Returns whether the scheduler has any scheduled tasks.\n next_task_time (optional) will be set to time of the next task, note that 0 will be set if tasks were\n added via aws_task_scheduler_schedule_now() and UINT64_MAX will be set if no tasks are scheduled at all."] pub fn aws_task_scheduler_has_tasks (scheduler : * const aws_task_scheduler , next_task_time : * mut u64) -> bool ; } extern "C" { # [doc = " Schedules a task to run immediately.\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_task_scheduler_schedule_now (scheduler : * mut aws_task_scheduler , task : * mut aws_task) ; } extern "C" { # [doc = " Schedules a task to run at time_to_run.\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_task_scheduler_schedule_future (scheduler : * mut aws_task_scheduler , task : * mut aws_task , time_to_run : u64) ; } extern "C" { # [doc = " Removes task from the scheduler and invokes the task with the AWS_TASK_STATUS_CANCELED status."] pub fn aws_task_scheduler_cancel_task (scheduler : * mut aws_task_scheduler , task : * mut aws_task) ; } extern "C" { # [doc = " Sequentially execute all tasks scheduled to run at, or before current_time.\n AWS_TASK_STATUS_RUN_READY will be passed to the task function as the task status.\n\n If a task schedules another task, the new task will not be executed until the next call to this function."] pub fn aws_task_scheduler_run_all (scheduler : * mut aws_task_scheduler , current_time : u64) ; } extern "C" { # [doc = " Convert a status value to a c-string suitable for logging"] pub fn aws_task_status_to_c_str (status : aws_task_status) -> * const :: libc :: c_char ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_channel_direction { AWS_CHANNEL_DIR_READ = 0 , AWS_CHANNEL_DIR_WRITE = 1 , } pub type aws_channel_on_setup_completed_fn = :: std :: option :: Option < unsafe extern "C" fn (channel : * mut aws_channel , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_channel_on_shutdown_completed_fn = :: std :: option :: Option < unsafe extern "C" fn (channel : * mut aws_channel , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_channel_slot { pub alloc : * mut aws_allocator , pub channel : * mut aws_channel , pub adj_left : * mut aws_channel_slot , pub adj_right : * mut aws_channel_slot , pub handler : * mut aws_channel_handler , pub window_size : usize , pub upstream_message_overhead : usize , pub current_window_update_batch_size : usize , } # [test] fn bindgen_test_layout_aws_channel_slot () { const UNINIT : :: std :: mem :: MaybeUninit < aws_channel_slot > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_channel_slot > () , 64usize , concat ! ("Size of: " , stringify ! (aws_channel_slot))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_channel_slot > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_channel_slot))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . channel) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (channel))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . adj_left) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (adj_left))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . adj_right) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (adj_right))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . handler) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (handler))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . window_size) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (window_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . upstream_message_overhead) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (upstream_message_overhead))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . current_window_update_batch_size) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (current_window_update_batch_size))) ; } impl Default for aws_channel_slot { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_channel_task_fn = :: std :: option :: Option < unsafe extern "C" fn (channel_task : * mut aws_channel_task , arg : * mut :: libc :: c_void , status : aws_task_status) > ; # [repr (C)] # [derive (Copy , Clone)] pub struct aws_channel_task { pub wrapper_task : aws_task , pub task_fn : aws_channel_task_fn , pub arg : * mut :: libc :: c_void , pub type_tag : * const :: libc :: c_char , pub node : aws_linked_list_node , } # [test] fn bindgen_test_layout_aws_channel_task () { const UNINIT : :: std :: mem :: MaybeUninit < aws_channel_task > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_channel_task > () , 104usize , concat ! ("Size of: " , stringify ! (aws_channel_task))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_channel_task > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_channel_task))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . wrapper_task) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_channel_task) , "::" , stringify ! (wrapper_task))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . task_fn) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_channel_task) , "::" , stringify ! (task_fn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . arg) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_channel_task) , "::" , stringify ! (arg))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . type_tag) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_channel_task) , "::" , stringify ! (type_tag))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . node) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_channel_task) , "::" , stringify ! (node))) ; } impl Default for aws_channel_task { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_channel_handler_vtable { # [doc = " Called by the channel when a message is available for processing in the read direction. It is your\n responsibility to call aws_mem_release(message->allocator, message); on message when you are finished with it.\n\n Also keep in mind that your slot's internal window has been decremented. You'll want to call\n aws_channel_slot_increment_read_window() at some point in the future if you want to keep receiving data."] pub process_read_message : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , message : * mut aws_io_message) -> :: libc :: c_int > , # [doc = " Called by the channel when a message is available for processing in the write direction. It is your\n responsibility to call aws_mem_release(message->allocator, message); on message when you are finished with it."] pub process_write_message : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , message : * mut aws_io_message) -> :: libc :: c_int > , # [doc = " Called by the channel when a downstream handler has issued a window increment. You'll want to update your\n internal state and likely propagate a window increment message of your own by calling\n 'aws_channel_slot_increment_read_window()'"] pub increment_read_window : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , size : usize) -> :: libc :: c_int > , # [doc = " The channel calls shutdown on all handlers twice, once to shut down reading, and once to shut down writing.\n Shutdown always begins with the left-most handler, and proceeds to the right with dir set to\n AWS_CHANNEL_DIR_READ. Then shutdown is called on handlers from right to left with dir set to\n AWS_CHANNEL_DIR_WRITE.\n\n The shutdown process does not need to complete immediately and may rely on scheduled tasks.\n The handler must call aws_channel_slot_on_handler_shutdown_complete() when it is finished,\n which propagates shutdown to the next handler. If 'free_scarce_resources_immediately' is true,\n then resources vulnerable to denial-of-service attacks (such as sockets and file handles)\n must be closed immediately before the shutdown() call returns."] pub shutdown : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , dir : aws_channel_direction , error_code : :: libc :: c_int , free_scarce_resources_immediately : bool) -> :: libc :: c_int > , # [doc = " Called by the channel when the handler is added to a slot, to get the initial window size."] pub initial_window_size : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler) -> usize > , # [doc = " Called by the channel anytime a handler is added or removed, provides a hint for downstream\n handlers to avoid message fragmentation due to message overhead."] pub message_overhead : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler) -> usize > , # [doc = " Clean up any resources and deallocate yourself. The shutdown process will already be completed before this\n function is called."] pub destroy : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler) > , # [doc = " Directs the channel handler to reset all of the internal statistics it tracks about itself."] pub reset_statistics : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler) > , # [doc = " Adds a pointer to the handler's internal statistics (if they exist) to a list of statistics structures\n associated with the channel's handler chain."] pub gather_statistics : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler , stats_list : * mut aws_array_list) > , pub trigger_read : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler) > , } # [test] fn bindgen_test_layout_aws_channel_handler_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_channel_handler_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_channel_handler_vtable > () , 80usize , concat ! ("Size of: " , stringify ! (aws_channel_handler_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_channel_handler_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_channel_handler_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_read_message) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (process_read_message))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_write_message) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (process_write_message))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . increment_read_window) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (increment_read_window))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (shutdown))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_window_size) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (initial_window_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . message_overhead) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (message_overhead))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . reset_statistics) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (reset_statistics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . gather_statistics) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (gather_statistics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . trigger_read) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (trigger_read))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_channel_handler { pub vtable : * mut aws_channel_handler_vtable , pub alloc : * mut aws_allocator , pub slot : * mut aws_channel_slot , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_channel_handler () { const UNINIT : :: std :: mem :: MaybeUninit < aws_channel_handler > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_channel_handler > () , 32usize , concat ! ("Size of: " , stringify ! (aws_channel_handler))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_channel_handler > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_channel_handler))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . slot) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler) , "::" , stringify ! (slot))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler) , "::" , stringify ! (impl_))) ; } impl Default for aws_channel_handler { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Args for creating a new channel.\n event_loop to use for IO and tasks. on_setup_completed will be invoked when\n the setup process is finished It will be executed in the event loop's thread.\n on_shutdown_completed will be executed upon channel shutdown.\n\n enable_read_back_pressure toggles whether or not back pressure will be applied in the channel.\n Leave this option off unless you're using something like reactive-streams, since it is a slight throughput\n penalty.\n\n Unless otherwise\n specified all functions for channels and channel slots must be executed within that channel's event-loop's thread."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_channel_options { pub event_loop : * mut aws_event_loop , pub on_setup_completed : aws_channel_on_setup_completed_fn , pub on_shutdown_completed : aws_channel_on_shutdown_completed_fn , pub setup_user_data : * mut :: libc :: c_void , pub shutdown_user_data : * mut :: libc :: c_void , pub enable_read_back_pressure : bool , } # [test] fn bindgen_test_layout_aws_channel_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_channel_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_channel_options > () , 48usize , concat ! ("Size of: " , stringify ! (aws_channel_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_channel_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_channel_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . event_loop) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (event_loop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_setup_completed) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (on_setup_completed))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_shutdown_completed) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (on_shutdown_completed))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . setup_user_data) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (setup_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_user_data) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (shutdown_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_back_pressure) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (enable_read_back_pressure))) ; } impl Default for aws_channel_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub static mut g_aws_channel_max_fragment_size : usize ; } extern "C" { # [doc = " Initializes channel_task for use."] pub fn aws_channel_task_init (channel_task : * mut aws_channel_task , task_fn : aws_channel_task_fn , arg : * mut :: libc :: c_void , type_tag : * const :: libc :: c_char) ; } extern "C" { # [doc = " Allocates new channel, Unless otherwise specified all functions for channels and channel slots must be executed\n within that channel's event-loop's thread. channel_options are copied."] pub fn aws_channel_new (allocator : * mut aws_allocator , creation_args : * const aws_channel_options) -> * mut aws_channel ; } extern "C" { # [doc = " Mark the channel, along with all slots and handlers, for destruction.\n Must be called after shutdown has completed.\n Can be called from any thread assuming 'aws_channel_shutdown()' has completed.\n Note that memory will not be freed until all users which acquired holds on the channel via\n aws_channel_acquire_hold(), release them via aws_channel_release_hold()."] pub fn aws_channel_destroy (channel : * mut aws_channel) ; } extern "C" { # [doc = " Initiates shutdown of the channel. Shutdown will begin with the left-most slot. Each handler will invoke\n 'aws_channel_slot_on_handler_shutdown_complete' once they've finished their shutdown process for the read direction.\n Once the right-most slot has shutdown in the read direction, the process will start shutting down starting on the\n right-most slot. Once the left-most slot has shutdown in the write direction, 'callbacks->shutdown_completed' will be\n invoked in the event loop's thread.\n\n This function can be called from any thread."] pub fn aws_channel_shutdown (channel : * mut aws_channel , error_code : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Prevent a channel's memory from being freed.\n Any number of users may acquire a hold to prevent a channel and its handlers from being unexpectedly freed.\n Any user which acquires a hold must release it via aws_channel_release_hold().\n Memory will be freed once all holds are released and aws_channel_destroy() has been called."] pub fn aws_channel_acquire_hold (channel : * mut aws_channel) ; } extern "C" { # [doc = " Release a hold on the channel's memory, allowing it to be freed.\n This may be called before or after aws_channel_destroy()."] pub fn aws_channel_release_hold (channel : * mut aws_channel) ; } extern "C" { # [doc = " Allocates and initializes a new slot for use with the channel. If this is the first slot in the channel, it will\n automatically be added to the channel as the first slot. For all subsequent calls on a given channel, the slot will\n need to be added to the channel via. the aws_channel_slot_insert_right(), aws_channel_slot_insert_end(), and\n aws_channel_slot_insert_left() APIs."] pub fn aws_channel_slot_new (channel : * mut aws_channel) -> * mut aws_channel_slot ; } extern "C" { # [doc = " Fetches the event loop the channel is a part of."] pub fn aws_channel_get_event_loop (channel : * mut aws_channel) -> * mut aws_event_loop ; } extern "C" { # [doc = " Fetches the current timestamp from the event-loop's clock, in nanoseconds."] pub fn aws_channel_current_clock_time (channel : * mut aws_channel , time_nanos : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Retrieves an object by key from the event loop's local storage."] pub fn aws_channel_fetch_local_object (channel : * mut aws_channel , key : * const :: libc :: c_void , obj : * mut aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Stores an object by key in the event loop's local storage."] pub fn aws_channel_put_local_object (channel : * mut aws_channel , key : * const :: libc :: c_void , obj : * const aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes an object by key from the event loop's local storage."] pub fn aws_channel_remove_local_object (channel : * mut aws_channel , key : * const :: libc :: c_void , removed_obj : * mut aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Acquires a message from the event loop's message pool. size_hint is merely a hint, it may be smaller than you\n requested and you are responsible for checking the bounds of it. If the returned message is not large enough, you\n must send multiple messages."] pub fn aws_channel_acquire_message_from_pool (channel : * mut aws_channel , message_type : aws_io_message_type , size_hint : usize) -> * mut aws_io_message ; } extern "C" { # [doc = " Schedules a task to run on the event loop as soon as possible.\n This is the ideal way to move a task into the correct thread. It's also handy for context switches.\n This function is safe to call from any thread.\n\n If called from the channel's event loop, the task will get directly added to the run-now list.\n If called from outside the channel's event loop, the task will go into a cross-thread task queue.\n\n If tasks must be serialized relative to some source synchronization, you may not want to use this API\n because tasks submitted from the event loop thread can \"jump ahead\" of tasks submitted from external threads\n due to this optimization. If this is a problem, you can either refactor your submission logic or use\n the aws_channel_schedule_task_now_serialized variant which does not perform this optimization.\n\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_channel_schedule_task_now (channel : * mut aws_channel , task : * mut aws_channel_task) ; } extern "C" { # [doc = " Schedules a task to run on the event loop as soon as possible.\n\n This variant always uses the cross thread queue rather than conditionally skipping it when already in\n the destination event loop. While not \"optimal\", this allows us to serialize task execution no matter where\n the task was submitted from: if you are submitting tasks from a critical section, the serialized order that you\n submit is guaranteed to be the order that they execute on the event loop.\n\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_channel_schedule_task_now_serialized (channel : * mut aws_channel , task : * mut aws_channel_task) ; } extern "C" { # [doc = " Schedules a task to run on the event loop at the specified time.\n This is the ideal way to move a task into the correct thread. It's also handy for context switches.\n Use aws_channel_current_clock_time() to get the current time in nanoseconds.\n This function is safe to call from any thread.\n\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_channel_schedule_task_future (channel : * mut aws_channel , task : * mut aws_channel_task , run_at_nanos : u64) ; } extern "C" { # [doc = " Instrument a channel with a statistics handler. While instrumented with a statistics handler, the channel\n will periodically report per-channel-handler-specific statistics about handler performance and state.\n\n Assigning a statistics handler to a channel is a transfer of ownership -- the channel will clean up\n the handler appropriately. Statistics handlers may be changed dynamically (for example, the upgrade\n from a vanilla http channel to a websocket channel), but this function may only be called from the\n event loop thread that the channel is a part of.\n\n The first possible hook to set a statistics handler is the channel's creation callback."] pub fn aws_channel_set_statistics_handler (channel : * mut aws_channel , handler : * mut aws_crt_statistics_handler) -> :: libc :: c_int ; } extern "C" { # [doc = " Returns true if the caller is on the event loop's thread. If false, you likely need to use\n aws_channel_schedule_task(). This function is safe to call from any thread."] pub fn aws_channel_thread_is_callers_thread (channel : * mut aws_channel) -> bool ; } extern "C" { # [doc = " Sets the handler for a slot, the slot will also call get_current_window_size() and propagate a window update\n upstream."] pub fn aws_channel_slot_set_handler (slot : * mut aws_channel_slot , handler : * mut aws_channel_handler) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes slot from the channel and deallocates the slot and its handler."] pub fn aws_channel_slot_remove (slot : * mut aws_channel_slot) -> :: libc :: c_int ; } extern "C" { # [doc = " Replaces remove with new_slot. Deallocates remove and its handler."] pub fn aws_channel_slot_replace (remove : * mut aws_channel_slot , new_slot : * mut aws_channel_slot) -> :: libc :: c_int ; } extern "C" { # [doc = " inserts 'to_add' to the position immediately to the right of slot. Note that the first call to\n aws_channel_slot_new() adds it to the channel implicitly."] pub fn aws_channel_slot_insert_right (slot : * mut aws_channel_slot , to_add : * mut aws_channel_slot) -> :: libc :: c_int ; } extern "C" { # [doc = " Inserts to 'to_add' the end of the channel. Note that the first call to\n aws_channel_slot_new() adds it to the channel implicitly."] pub fn aws_channel_slot_insert_end (channel : * mut aws_channel , to_add : * mut aws_channel_slot) -> :: libc :: c_int ; } extern "C" { # [doc = " inserts 'to_add' to the position immediately to the left of slot. Note that the first call to\n aws_channel_slot_new() adds it to the channel implicitly."] pub fn aws_channel_slot_insert_left (slot : * mut aws_channel_slot , to_add : * mut aws_channel_slot) -> :: libc :: c_int ; } extern "C" { # [doc = " Sends a message to the adjacent slot in the channel based on dir. Also does window size checking.\n\n NOTE: if this function returns an error code, it is the caller's responsibility to release message\n back to the pool. If this function returns AWS_OP_SUCCESS, the recipient of the message has taken\n ownership of the message. So, for example, don't release a message to the pool and then return an error.\n If you encounter an error condition in this case, shutdown the channel with the appropriate error code."] pub fn aws_channel_slot_send_message (slot : * mut aws_channel_slot , message : * mut aws_io_message , dir : aws_channel_direction) -> :: libc :: c_int ; } extern "C" { # [doc = " Convenience function that invokes aws_channel_acquire_message_from_pool(),\n asking for the largest reasonable DATA message that can be sent in the write direction,\n with upstream overhead accounted for."] pub fn aws_channel_slot_acquire_max_message_for_write (slot : * mut aws_channel_slot) -> * mut aws_io_message ; } extern "C" { # [doc = " Issues a window update notification upstream (to the left.)"] pub fn aws_channel_slot_increment_read_window (slot : * mut aws_channel_slot , window : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Called by handlers once they have finished their shutdown in the 'dir' direction. Propagates the shutdown process\n to the next handler in the channel."] pub fn aws_channel_slot_on_handler_shutdown_complete (slot : * mut aws_channel_slot , dir : aws_channel_direction , err_code : :: libc :: c_int , free_scarce_resources_immediately : bool) -> :: libc :: c_int ; } extern "C" { # [doc = " Initiates shutdown on slot. callbacks->on_shutdown_completed will be called\n once the shutdown process is completed."] pub fn aws_channel_slot_shutdown (slot : * mut aws_channel_slot , dir : aws_channel_direction , err_code : :: libc :: c_int , free_scarce_resources_immediately : bool) -> :: libc :: c_int ; } extern "C" { # [doc = " Fetches the downstream read window. This gives you the information necessary to honor the read window. If you call\n send_message() and it exceeds this window, the message will be rejected."] pub fn aws_channel_slot_downstream_read_window (slot : * mut aws_channel_slot) -> usize ; } extern "C" { # [doc = " Fetches the current overhead of upstream handlers. This provides a hint to avoid fragmentation if you care."] pub fn aws_channel_slot_upstream_message_overhead (slot : * mut aws_channel_slot) -> usize ; } extern "C" { # [doc = " Calls destroy on handler's vtable"] pub fn aws_channel_handler_destroy (handler : * mut aws_channel_handler) ; } extern "C" { # [doc = " Calls process_read_message on handler's vtable"] pub fn aws_channel_handler_process_read_message (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , message : * mut aws_io_message) -> :: libc :: c_int ; } extern "C" { # [doc = " Calls process_write_message on handler's vtable."] pub fn aws_channel_handler_process_write_message (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , message : * mut aws_io_message) -> :: libc :: c_int ; } extern "C" { # [doc = " Calls on_window_update on handler's vtable."] pub fn aws_channel_handler_increment_read_window (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , size : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " calls shutdown_direction on handler's vtable."] pub fn aws_channel_handler_shutdown (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , dir : aws_channel_direction , error_code : :: libc :: c_int , free_scarce_resources_immediately : bool) -> :: libc :: c_int ; } extern "C" { # [doc = " Calls initial_window_size on handler's vtable."] pub fn aws_channel_handler_initial_window_size (handler : * mut aws_channel_handler) -> usize ; } extern "C" { pub fn aws_channel_get_first_slot (channel : * mut aws_channel) -> * mut aws_channel_slot ; } extern "C" { # [doc = " A way for external processes to force a read by the data-source channel handler. Necessary in certain cases, like\n when a server channel finishes setting up its initial handlers, a read may have already been triggered on the\n socket (the client's CLIENT_HELLO tls payload, for example) and absent further data/notifications, this data\n would never get processed."] pub fn aws_channel_trigger_read (channel : * mut aws_channel) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_address_record_type { AWS_ADDRESS_RECORD_TYPE_A = 0 , AWS_ADDRESS_RECORD_TYPE_AAAA = 1 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_get_host_address_flags { AWS_GET_HOST_ADDRESS_COUNT_RECORD_TYPE_A = 1 , AWS_GET_HOST_ADDRESS_COUNT_RECORD_TYPE_AAAA = 2 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_address { pub allocator : * mut aws_allocator , pub host : * const aws_string , pub address : * const aws_string , pub record_type : aws_address_record_type , pub expiry : u64 , pub use_count : usize , pub connection_failure_count : usize , pub weight : u8 , } # [test] fn bindgen_test_layout_aws_host_address () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_address > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_address > () , 64usize , concat ! ("Size of: " , stringify ! (aws_host_address))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_address > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_address))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . address) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (address))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . record_type) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (record_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . expiry) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (expiry))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . use_count) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (use_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connection_failure_count) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (connection_failure_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . weight) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (weight))) ; } impl Default for aws_host_address { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Invoked once an address has been resolved for host. The type in host_addresses is struct aws_host_address (by-value).\n The caller does not own this memory and you must copy the host address before returning from this function if you\n plan to use it later. For convenience, we've provided the aws_host_address_copy() and aws_host_address_clean_up()\n functions."] pub type aws_on_host_resolved_result_fn = :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , host_name : * const aws_string , err_code : :: libc :: c_int , host_addresses : * const aws_array_list , user_data : * mut :: libc :: c_void) > ; # [doc = " Function signature for configuring your own resolver (the default just uses getaddrinfo()). The type in\n output_addresses is struct aws_host_address (by-value). We assume this function blocks, hence this absurdly\n complicated design."] pub type aws_resolve_host_implementation_fn = :: std :: option :: Option < unsafe extern "C" fn (allocator : * mut aws_allocator , host_name : * const aws_string , output_addresses : * mut aws_array_list , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_resolution_config { pub impl_ : aws_resolve_host_implementation_fn , pub max_ttl : usize , pub impl_data : * mut :: libc :: c_void , pub resolve_frequency_ns : u64 , } # [test] fn bindgen_test_layout_aws_host_resolution_config () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_resolution_config > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_resolution_config > () , 32usize , concat ! ("Size of: " , stringify ! (aws_host_resolution_config))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_resolution_config > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_resolution_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolution_config) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_ttl) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolution_config) , "::" , stringify ! (max_ttl))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_data) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolution_config) , "::" , stringify ! (impl_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . resolve_frequency_ns) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolution_config) , "::" , stringify ! (resolve_frequency_ns))) ; } impl Default for aws_host_resolution_config { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_listener { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_listener_options { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_resolver_purge_host_options { pub host : * const aws_string , pub on_host_purge_complete_callback : aws_simple_completion_callback , pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_host_resolver_purge_host_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_resolver_purge_host_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_resolver_purge_host_options > () , 24usize , concat ! ("Size of: " , stringify ! (aws_host_resolver_purge_host_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_resolver_purge_host_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_resolver_purge_host_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_purge_host_options) , "::" , stringify ! (host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_host_purge_complete_callback) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_purge_host_options) , "::" , stringify ! (on_host_purge_complete_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_purge_host_options) , "::" , stringify ! (user_data))) ; } impl Default for aws_host_resolver_purge_host_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " should you absolutely disdain the default implementation, feel free to implement your own."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_host_resolver_vtable { # [doc = " clean up everything you allocated, but not resolver itself."] pub destroy : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver) > , # [doc = " resolve the host by host_name, the user owns host_name, so it needs to be copied if you persist it,\n invoke res with the result. This function should never block."] pub resolve_host : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , host_name : * const aws_string , res : aws_on_host_resolved_result_fn , config : * const aws_host_resolution_config , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > , # [doc = " gives your implementation a hint that an address has some failed connections occuring. Do whatever you want (or\n nothing) about it."] pub record_connection_failure : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , address : * const aws_host_address) -> :: libc :: c_int > , # [doc = " @Deprecated Use purge_cache_with_callback instead\n wipe out anything you have cached."] pub purge_cache : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver) -> :: libc :: c_int > , # [doc = " wipe out anything you have cached."] pub purge_cache_with_callback : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , on_purge_cache_complete_callback : aws_simple_completion_callback , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > , # [doc = " wipe out anything cached for a specific host"] pub purge_host_cache : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , options : * const aws_host_resolver_purge_host_options) -> :: libc :: c_int > , # [doc = " get number of addresses for a given host."] pub get_host_address_count : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , host_name : * const aws_string , flags : u32) -> usize > , } # [test] fn bindgen_test_layout_aws_host_resolver_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_resolver_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_resolver_vtable > () , 56usize , concat ! ("Size of: " , stringify ! (aws_host_resolver_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_resolver_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_resolver_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . resolve_host) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (resolve_host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . record_connection_failure) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (record_connection_failure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . purge_cache) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (purge_cache))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . purge_cache_with_callback) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (purge_cache_with_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . purge_host_cache) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (purge_host_cache))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_host_address_count) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (get_host_address_count))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_resolver { pub allocator : * mut aws_allocator , pub impl_ : * mut :: libc :: c_void , pub vtable : * mut aws_host_resolver_vtable , pub ref_count : aws_ref_count , pub shutdown_options : aws_shutdown_callback_options , } # [test] fn bindgen_test_layout_aws_host_resolver () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_resolver > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_resolver > () , 64usize , concat ! ("Size of: " , stringify ! (aws_host_resolver))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_resolver > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_resolver))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver) , "::" , stringify ! (shutdown_options))) ; } impl Default for aws_host_resolver { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_resolver_default_options { pub max_entries : usize , pub el_group : * mut aws_event_loop_group , pub shutdown_options : * const aws_shutdown_callback_options , pub system_clock_override_fn : aws_io_clock_fn , } # [test] fn bindgen_test_layout_aws_host_resolver_default_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_resolver_default_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_resolver_default_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_host_resolver_default_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_resolver_default_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_resolver_default_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_entries) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_default_options) , "::" , stringify ! (max_entries))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . el_group) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_default_options) , "::" , stringify ! (el_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_default_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . system_clock_override_fn) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_default_options) , "::" , stringify ! (system_clock_override_fn))) ; } impl Default for aws_host_resolver_default_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Copies `from` to `to`."] pub fn aws_host_address_copy (from : * const aws_host_address , to : * mut aws_host_address) -> :: libc :: c_int ; } extern "C" { # [doc = " Moves `from` to `to`. After this call, from is no longer usable. Though, it could be resused for another\n move or copy operation."] pub fn aws_host_address_move (from : * mut aws_host_address , to : * mut aws_host_address) ; } extern "C" { # [doc = " Cleans up the memory for `address`"] pub fn aws_host_address_clean_up (address : * mut aws_host_address) ; } extern "C" { # [doc = " WARNING! do not call this function directly (getaddrinfo()): it blocks. Provide a pointer to this function for other\n resolution functions."] pub fn aws_default_dns_resolve (allocator : * mut aws_allocator , host_name : * const aws_string , output_addresses : * mut aws_array_list , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Creates a host resolver with the default behavior. Here's the behavior:\n\n Since there's not a reliable way to do non-blocking DNS without a ton of risky work that would need years of testing\n on every Unix system in existence, we work around it by doing a threaded implementation.\n\n When you request an address, it checks the cache. If the entry isn't in the cache it creates a new one.\n Each entry has a potentially short lived back-ground thread based on ttl for the records. Once we've populated the\n cache and you keep the resolver active, the resolution callback will be invoked immediately. When it's idle, it will\n take a little while in the background thread to fetch more, evaluate TTLs etc... In that case your callback will be\n invoked from the background thread.\n\n --------------------------------------------------------------------------------------------------------------------\n\n A few things to note about TTLs and connection failures.\n\n We attempt to honor your max ttl but will not honor it if dns queries are failing or all of your connections are\n marked as failed. Once we are able to query dns again, we will re-evaluate the TTLs.\n\n Upon notification connection failures, we move them to a separate list. Eventually we retry them when it's likely\n that the endpoint is healthy again or we don't really have another choice, but we try to keep them out of your\n hot path.\n\n ---------------------------------------------------------------------------------------------------------------------\n\n Finally, this entire design attempts to prevent problems where developers have to choose between large TTLs and thus\n sticky hosts or short TTLs and good fleet utilization but now higher latencies. In this design, we resolve every\n second in the background (only while you're actually using the record), but we do not expire the earlier resolved\n addresses until max ttl has passed.\n\n This for example, should enable you to hit thousands of hosts in the Amazon S3 fleet instead of just one or two."] pub fn aws_host_resolver_new_default (allocator : * mut aws_allocator , options : * const aws_host_resolver_default_options) -> * mut aws_host_resolver ; } extern "C" { # [doc = " Increments the reference count on the host resolver, allowing the caller to take a reference to it.\n\n Returns the same host resolver passed in."] pub fn aws_host_resolver_acquire (resolver : * mut aws_host_resolver) -> * mut aws_host_resolver ; } extern "C" { # [doc = " Decrements a host resolver's ref count. When the ref count drops to zero, the resolver will be destroyed."] pub fn aws_host_resolver_release (resolver : * mut aws_host_resolver) ; } extern "C" { # [doc = " calls resolve_host on the vtable. config will be copied."] pub fn aws_host_resolver_resolve_host (resolver : * mut aws_host_resolver , host_name : * const aws_string , res : aws_on_host_resolved_result_fn , config : * const aws_host_resolution_config , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " calls record_connection_failure on the vtable."] pub fn aws_host_resolver_record_connection_failure (resolver : * mut aws_host_resolver , address : * const aws_host_address) -> :: libc :: c_int ; } extern "C" { # [doc = " @Deprecated Use purge_cache_with_callback instead\n calls purge_cache on the vtable."] pub fn aws_host_resolver_purge_cache (resolver : * mut aws_host_resolver) -> :: libc :: c_int ; } extern "C" { # [doc = " Calls aws_host_resolver_purge_cache_with_callback on the vtable which will wipe out everything host resolver has\n cached."] pub fn aws_host_resolver_purge_cache_with_callback (resolver : * mut aws_host_resolver , on_purge_cache_complete_callback : aws_simple_completion_callback , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes the cache for a host asynchronously."] pub fn aws_host_resolver_purge_host_cache (resolver : * mut aws_host_resolver , options : * const aws_host_resolver_purge_host_options) -> :: libc :: c_int ; } extern "C" { # [doc = " get number of addresses for a given host."] pub fn aws_host_resolver_get_host_address_count (resolver : * mut aws_host_resolver , host_name : * const aws_string , flags : u32) -> usize ; } extern "C" { # [doc = " Returns the default host resolution config used internally if none specified.\n\n @return default host resolution config"] pub fn aws_host_resolver_init_default_resolution_config () -> aws_host_resolution_config ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_socket { _unused : [u8 ; 0] , } # [doc = " Generic event function for channel lifecycle events.\n\n Callbacks are provided for:\n (1) Channel creation\n (2) Channel setup - If TLS is being used, this function is called once the socket has connected, the channel has\n been initialized, and TLS has been successfully negotiated. A TLS handler has already been added to the channel. If\n TLS negotiation fails, this function will be called with the corresponding error code. If TLS is not being used, this\n function is called once the socket has connected and the channel has been initialized.\n (3) Channel shutdown\n\n These callbacks are always invoked within the thread of the event-loop that the channel is assigned to.\n\n This function does NOT always imply \"success\" -- if error_code is AWS_OP_SUCCESS then everything was successful,\n otherwise an error condition occurred."] pub type aws_client_bootstrap_on_channel_event_fn = :: std :: option :: Option < unsafe extern "C" fn (bootstrap : * mut aws_client_bootstrap , error_code : :: libc :: c_int , channel : * mut aws_channel , user_data : * mut :: libc :: c_void) > ; # [doc = " If ALPN is being used this function will be invoked by the channel once an ALPN message is received. The returned\n channel_handler will be added to, and managed by, the channel."] pub type aws_channel_on_protocol_negotiated_fn = :: std :: option :: Option < unsafe extern "C" fn (new_slot : * mut aws_channel_slot , protocol : * mut aws_byte_buf , user_data : * mut :: libc :: c_void) -> * mut aws_channel_handler > ; # [doc = " Called after client bootstrap has been completely cleaned up, after its last refcount is released."] pub type aws_client_bootstrap_shutdown_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [doc = " aws_client_bootstrap handles creation and setup of channels that communicate via socket with a specific endpoint."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_client_bootstrap { pub allocator : * mut aws_allocator , pub event_loop_group : * mut aws_event_loop_group , pub host_resolver : * mut aws_host_resolver , pub host_resolver_config : aws_host_resolution_config , pub on_protocol_negotiated : aws_channel_on_protocol_negotiated_fn , pub ref_count : aws_ref_count , pub on_shutdown_complete : aws_client_bootstrap_shutdown_complete_fn , pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_client_bootstrap () { const UNINIT : :: std :: mem :: MaybeUninit < aws_client_bootstrap > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_client_bootstrap > () , 104usize , concat ! ("Size of: " , stringify ! (aws_client_bootstrap))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_client_bootstrap > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_client_bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . event_loop_group) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (event_loop_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolver) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (host_resolver))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolver_config) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (host_resolver_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_protocol_negotiated) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (on_protocol_negotiated))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_shutdown_complete) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (on_shutdown_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (user_data))) ; } impl Default for aws_client_bootstrap { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " aws_client_bootstrap creation options."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_client_bootstrap_options { pub event_loop_group : * mut aws_event_loop_group , pub host_resolver : * mut aws_host_resolver , pub host_resolution_config : * const aws_host_resolution_config , pub on_shutdown_complete : aws_client_bootstrap_shutdown_complete_fn , pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_client_bootstrap_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_client_bootstrap_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_client_bootstrap_options > () , 40usize , concat ! ("Size of: " , stringify ! (aws_client_bootstrap_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_client_bootstrap_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_client_bootstrap_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . event_loop_group) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap_options) , "::" , stringify ! (event_loop_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolver) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap_options) , "::" , stringify ! (host_resolver))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolution_config) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap_options) , "::" , stringify ! (host_resolution_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_shutdown_complete) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap_options) , "::" , stringify ! (on_shutdown_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap_options) , "::" , stringify ! (user_data))) ; } impl Default for aws_client_bootstrap_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " If TLS is being used, this function is called once the socket has received an incoming connection, the channel has\n been initialized, and TLS has been successfully negotiated. A TLS handler has already been added to the channel. If\n TLS negotiation fails, this function will be called with the corresponding error code.\n\n If TLS is not being used, this function is called once the socket has received an incoming connection and the channel\n has been initialized.\n\n This function is always called within the thread of the event-loop that the new channel is assigned to upon success.\n\n On failure, the channel might not be assigned to an event loop yet, and will thus be invoked on the listener's\n event-loop thread.\n\n This function does NOT mean \"success\", if error_code is AWS_OP_SUCCESS then everything was successful, otherwise an\n error condition occurred.\n\n If an error occurred, you do not need to shutdown the channel. The `aws_channel_client_shutdown_callback` will be\n invoked once the channel has finished shutting down."] pub type aws_server_bootstrap_on_accept_channel_setup_fn = :: std :: option :: Option < unsafe extern "C" fn (bootstrap : * mut aws_server_bootstrap , error_code : :: libc :: c_int , channel : * mut aws_channel , user_data : * mut :: libc :: c_void) > ; # [doc = " Once the channel shuts down, this function will be invoked within the thread of\n the event-loop that the channel is assigned to.\n\n Note: this function is only invoked if the channel was successfully setup,\n e.g. aws_server_bootstrap_on_accept_channel_setup_fn() was invoked without an error code."] pub type aws_server_bootstrap_on_accept_channel_shutdown_fn = :: std :: option :: Option < unsafe extern "C" fn (bootstrap : * mut aws_server_bootstrap , error_code : :: libc :: c_int , channel : * mut aws_channel , user_data : * mut :: libc :: c_void) > ; # [doc = " Once the server listener socket is finished destroying, and all the existing connections are closed, this fuction\n will be invoked."] pub type aws_server_bootstrap_on_server_listener_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (bootstrap : * mut aws_server_bootstrap , user_data : * mut :: libc :: c_void) > ; # [doc = " aws_server_bootstrap manages listening sockets, creating and setting up channels to handle each incoming connection."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_server_bootstrap { pub allocator : * mut aws_allocator , pub event_loop_group : * mut aws_event_loop_group , pub on_protocol_negotiated : aws_channel_on_protocol_negotiated_fn , pub ref_count : aws_ref_count , } # [test] fn bindgen_test_layout_aws_server_bootstrap () { const UNINIT : :: std :: mem :: MaybeUninit < aws_server_bootstrap > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_server_bootstrap > () , 48usize , concat ! ("Size of: " , stringify ! (aws_server_bootstrap))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_server_bootstrap > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_server_bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_server_bootstrap) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . event_loop_group) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_server_bootstrap) , "::" , stringify ! (event_loop_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_protocol_negotiated) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_server_bootstrap) , "::" , stringify ! (on_protocol_negotiated))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_server_bootstrap) , "::" , stringify ! (ref_count))) ; } impl Default for aws_server_bootstrap { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Socket-based channel creation options.\n\n bootstrap - configs name resolution and which event loop group the connection will be seated into\n host_name - host to connect to; if a dns address, will be resolved prior to connecting\n port - port to connect to\n socket_options - socket properties, including type (tcp vs. udp vs. unix domain) and connect timeout. TLS\n connections are currently restricted to tcp (AWS_SOCKET_STREAM) only.\n tls_options - (optional) tls context to apply after connection establishment. If NULL, the connection will\n not be protected by TLS.\n creation_callback - (optional) callback invoked when the channel is first created. This is always right after\n the connection was successfully established. *Does NOT* get called if the initial connect failed.\n setup_callback - callback invoked once the channel is ready for use and TLS has been negotiated or if an error\n is encountered\n shutdown_callback - callback invoked once the channel has shutdown.\n enable_read_back_pressure - controls whether or not back pressure will be applied in the channel\n user_data - arbitrary data to pass back to the various callbacks\n requested_event_loop - if set, the connection will be placed on the requested event loop rather than one\n chosen internally from the bootstrap's associated event loop group. It is an error to pass in an event loop\n that is not associated with the bootstrap's event loop group.\n\n Immediately after the `shutdown_callback` returns, the channel is cleaned up automatically. All callbacks are invoked\n in the thread of the event-loop that the new channel is assigned to.\n"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_socket_channel_bootstrap_options { pub bootstrap : * mut aws_client_bootstrap , pub host_name : * const :: libc :: c_char , pub port : u16 , pub socket_options : * const aws_socket_options , pub tls_options : * const aws_tls_connection_options , pub creation_callback : aws_client_bootstrap_on_channel_event_fn , pub setup_callback : aws_client_bootstrap_on_channel_event_fn , pub shutdown_callback : aws_client_bootstrap_on_channel_event_fn , pub enable_read_back_pressure : bool , pub user_data : * mut :: libc :: c_void , pub requested_event_loop : * mut aws_event_loop , pub host_resolution_override_config : * const aws_host_resolution_config , } # [test] fn bindgen_test_layout_aws_socket_channel_bootstrap_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_socket_channel_bootstrap_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_socket_channel_bootstrap_options > () , 96usize , concat ! ("Size of: " , stringify ! (aws_socket_channel_bootstrap_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_socket_channel_bootstrap_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_socket_channel_bootstrap_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . socket_options) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (socket_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_options) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (tls_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . creation_callback) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (creation_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . setup_callback) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (setup_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_back_pressure) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (enable_read_back_pressure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . requested_event_loop) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (requested_event_loop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolution_override_config) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (host_resolution_override_config))) ; } impl Default for aws_socket_channel_bootstrap_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Arguments to setup a server socket listener which will also negotiate and configure TLS.\n This creates a socket listener bound to `host` and 'port' using socket options `options`, and TLS options\n `tls_options`. `incoming_callback` will be invoked once an incoming channel is ready for use and TLS is\n finished negotiating, or if an error is encountered. `shutdown_callback` will be invoked once the channel has\n shutdown. `destroy_callback` will be invoked after the server socket listener is destroyed, and all associated\n connections and channels have finished shutting down. Immediately after the `shutdown_callback` returns, the channel\n is cleaned up automatically. All callbacks are invoked in the thread of the event-loop that listener is assigned to.\n\n Upon shutdown of your application, you'll want to call `aws_server_bootstrap_destroy_socket_listener` with the return\n value from this function.\n\n The socket type in `options` must be AWS_SOCKET_STREAM if tls_options is set.\n DTLS is not currently supported for tls."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_server_socket_channel_bootstrap_options { pub bootstrap : * mut aws_server_bootstrap , pub host_name : * const :: libc :: c_char , pub port : u16 , pub socket_options : * const aws_socket_options , pub tls_options : * const aws_tls_connection_options , pub incoming_callback : aws_server_bootstrap_on_accept_channel_setup_fn , pub shutdown_callback : aws_server_bootstrap_on_accept_channel_shutdown_fn , pub destroy_callback : aws_server_bootstrap_on_server_listener_destroy_fn , pub enable_read_back_pressure : bool , pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_server_socket_channel_bootstrap_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_server_socket_channel_bootstrap_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_server_socket_channel_bootstrap_options > () , 80usize , concat ! ("Size of: " , stringify ! (aws_server_socket_channel_bootstrap_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_server_socket_channel_bootstrap_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_server_socket_channel_bootstrap_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . socket_options) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (socket_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_options) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (tls_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . incoming_callback) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (incoming_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy_callback) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (destroy_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_back_pressure) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (enable_read_back_pressure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (user_data))) ; } impl Default for aws_server_socket_channel_bootstrap_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Create the client bootstrap."] pub fn aws_client_bootstrap_new (allocator : * mut aws_allocator , options : * const aws_client_bootstrap_options) -> * mut aws_client_bootstrap ; } extern "C" { # [doc = " Increments a client bootstrap's ref count, allowing the caller to take a reference to it.\n\n Returns the same client bootstrap passed in."] pub fn aws_client_bootstrap_acquire (bootstrap : * mut aws_client_bootstrap) -> * mut aws_client_bootstrap ; } extern "C" { # [doc = " Decrements a client bootstrap's ref count. When the ref count drops to zero, the bootstrap will be destroyed."] pub fn aws_client_bootstrap_release (bootstrap : * mut aws_client_bootstrap) ; } extern "C" { # [doc = " When using TLS, if ALPN is used, this callback will be invoked from the channel. The returned handler will be added\n to the channel."] pub fn aws_client_bootstrap_set_alpn_callback (bootstrap : * mut aws_client_bootstrap , on_protocol_negotiated : aws_channel_on_protocol_negotiated_fn) -> :: libc :: c_int ; } extern "C" { # [doc = " Sets up a client socket channel."] pub fn aws_client_bootstrap_new_socket_channel (options : * mut aws_socket_channel_bootstrap_options) -> :: libc :: c_int ; } extern "C" { # [doc = " Initializes the server bootstrap with `allocator` and `el_group`. This object manages listeners, server connections,\n and channels."] pub fn aws_server_bootstrap_new (allocator : * mut aws_allocator , el_group : * mut aws_event_loop_group) -> * mut aws_server_bootstrap ; } extern "C" { # [doc = " Increments a server bootstrap's ref count, allowing the caller to take a reference to it.\n\n Returns the same server bootstrap passed in."] pub fn aws_server_bootstrap_acquire (bootstrap : * mut aws_server_bootstrap) -> * mut aws_server_bootstrap ; } extern "C" { # [doc = " Decrements a server bootstrap's ref count. When the ref count drops to zero, the bootstrap will be destroyed."] pub fn aws_server_bootstrap_release (bootstrap : * mut aws_server_bootstrap) ; } extern "C" { # [doc = " When using TLS, if ALPN is used, this callback will be invoked from the channel. The returned handler will be added\n to the channel."] pub fn aws_server_bootstrap_set_alpn_callback (bootstrap : * mut aws_server_bootstrap , on_protocol_negotiated : aws_channel_on_protocol_negotiated_fn) -> :: libc :: c_int ; } extern "C" { # [doc = " Sets up a server socket listener. If you are planning on using TLS, use\n `aws_server_bootstrap_new_tls_socket_listener` instead. This creates a socket listener bound to `local_endpoint`\n using socket options `options`. `incoming_callback` will be invoked once an incoming channel is ready for use or if\n an error is encountered. `shutdown_callback` will be invoked once the channel has shutdown. `destroy_callback` will\n be invoked after the server socket listener is destroyed, and all associated connections and channels have finished\n shutting down. Immediately after the `shutdown_callback` returns, the channel is cleaned up automatically. All\n callbacks are invoked the thread of the event-loop that the listening socket is assigned to\n\n Upon shutdown of your application, you'll want to call `aws_server_bootstrap_destroy_socket_listener` with the return\n value from this function.\n\n bootstrap_options is copied."] pub fn aws_server_bootstrap_new_socket_listener (bootstrap_options : * const aws_server_socket_channel_bootstrap_options) -> * mut aws_socket ; } extern "C" { # [doc = " Shuts down 'listener' and cleans up any resources associated with it. Any incoming channels on `listener` will still\n be active. `destroy_callback` will be invoked after the server socket listener is destroyed, and all associated\n connections and channels have finished shutting down."] pub fn aws_server_bootstrap_destroy_socket_listener (bootstrap : * mut aws_server_bootstrap , listener : * mut aws_socket) ; } pub const AWS_COMMON_HASH_TABLE_ITER_CONTINUE : _bindgen_ty_23 = _bindgen_ty_23 :: AWS_COMMON_HASH_TABLE_ITER_CONTINUE ; pub const AWS_COMMON_HASH_TABLE_ITER_DELETE : _bindgen_ty_23 = _bindgen_ty_23 :: AWS_COMMON_HASH_TABLE_ITER_DELETE ; pub const AWS_COMMON_HASH_TABLE_ITER_ERROR : _bindgen_ty_23 = _bindgen_ty_23 :: AWS_COMMON_HASH_TABLE_ITER_ERROR ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_23 { AWS_COMMON_HASH_TABLE_ITER_CONTINUE = 1 , AWS_COMMON_HASH_TABLE_ITER_DELETE = 2 , AWS_COMMON_HASH_TABLE_ITER_ERROR = 4 , } # [doc = " Hash table data structure. This module provides an automatically resizing\n hash table implementation for general purpose use. The hash table stores a\n mapping between void * keys and values; it is expected that in most cases,\n these will point to a structure elsewhere in the heap, instead of inlining a\n key or value into the hash table element itself.\n\n Currently, this hash table implements a variant of robin hood hashing, but\n we do not guarantee that this won't change in the future.\n\n Associated with each hash function are four callbacks:\n\n hash_fn - A hash function from the keys to a uint64_t. It is critical that\n the hash function for a key does not change while the key is in the hash\n table; violating this results in undefined behavior. Collisions are\n tolerated, though naturally with reduced performance.\n\n equals_fn - An equality comparison function. This function must be\n reflexive and consistent with hash_fn.\n\n destroy_key_fn, destroy_value_fn - Optional callbacks invoked when the\n table is cleared or cleaned up and at the caller's option when an element\n is removed from the table. Either or both may be set to NULL, which\n has the same effect as a no-op destroy function.\n\n This datastructure can be safely moved between threads, subject to the\n requirements of the underlying allocator. It is also safe to invoke\n non-mutating operations on the hash table from multiple threads. A suitable\n memory barrier must be used when transitioning from single-threaded mutating\n usage to multithreaded usage."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct hash_table_state { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_hash_table { pub p_impl : * mut hash_table_state , } # [test] fn bindgen_test_layout_aws_hash_table () { const UNINIT : :: std :: mem :: MaybeUninit < aws_hash_table > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_hash_table > () , 8usize , concat ! ("Size of: " , stringify ! (aws_hash_table))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_hash_table > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_hash_table))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . p_impl) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_hash_table) , "::" , stringify ! (p_impl))) ; } impl Default for aws_hash_table { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Represents an element in the hash table. Various operations on the hash\n table may provide pointers to elements stored within the hash table;\n generally, calling code may alter value, but must not alter key (or any\n information used to compute key's hash code).\n\n Pointers to elements within the hash are invalidated whenever an operation\n which may change the number of elements in the hash is invoked (i.e. put,\n delete, clear, and clean_up), regardless of whether the number of elements\n actually changes."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_hash_element { pub key : * const :: libc :: c_void , pub value : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_hash_element () { const UNINIT : :: std :: mem :: MaybeUninit < aws_hash_element > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_hash_element > () , 16usize , concat ! ("Size of: " , stringify ! (aws_hash_element))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_hash_element > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_hash_element))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . key) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_hash_element) , "::" , stringify ! (key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_hash_element) , "::" , stringify ! (value))) ; } impl Default for aws_hash_element { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_hash_iter_status { AWS_HASH_ITER_STATUS_DONE = 0 , AWS_HASH_ITER_STATUS_DELETE_CALLED = 1 , AWS_HASH_ITER_STATUS_READY_FOR_USE = 2 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_hash_iter { pub map : * const aws_hash_table , pub element : aws_hash_element , pub slot : usize , pub limit : usize , pub status : aws_hash_iter_status , pub unused_0 : :: libc :: c_int , pub unused_1 : * mut :: libc :: c_void , pub unused_2 : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_hash_iter () { const UNINIT : :: std :: mem :: MaybeUninit < aws_hash_iter > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_hash_iter > () , 64usize , concat ! ("Size of: " , stringify ! (aws_hash_iter))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_hash_iter > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_hash_iter))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . map) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (map))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . element) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (element))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . slot) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (slot))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . limit) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (limit))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . status) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (status))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . unused_0) as usize - ptr as usize } , 44usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (unused_0))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . unused_1) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (unused_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . unused_2) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (unused_2))) ; } impl Default for aws_hash_iter { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Prototype for a key hashing function pointer."] pub type aws_hash_fn = :: std :: option :: Option < unsafe extern "C" fn (key : * const :: libc :: c_void) -> u64 > ; # [doc = " Prototype for a hash table equality check function pointer.\n\n This type is usually used for a function that compares two hash table\n keys, but note that the same type is used for a function that compares\n two hash table values in aws_hash_table_eq.\n\n Equality functions used in a hash table must be reflexive (i.e., a == b if\n and only if b == a), and must be consistent with the hash function in use."] pub type aws_hash_callback_eq_fn = :: std :: option :: Option < unsafe extern "C" fn (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> bool > ; # [doc = " Prototype for a hash table key or value destructor function pointer.\n\n This function is used to destroy elements in the hash table when the\n table is cleared or cleaned up.\n\n Note that functions which remove individual elements from the hash\n table provide options of whether or not to invoke the destructors\n on the key and value of a removed element."] pub type aws_hash_callback_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (key_or_value : * mut :: libc :: c_void) > ; extern "C" { # [doc = " Initializes a hash map with initial capacity for 'size' elements\n without resizing. Uses hash_fn to compute the hash of each element.\n equals_fn to compute equality of two keys. Whenever an element is\n removed without being returned, destroy_key_fn is run on the pointer\n to the key and destroy_value_fn is run on the pointer to the value.\n Either or both may be NULL if a callback is not desired in this case."] pub fn aws_hash_table_init (map : * mut aws_hash_table , alloc : * mut aws_allocator , size : usize , hash_fn : aws_hash_fn , equals_fn : aws_hash_callback_eq_fn , destroy_key_fn : aws_hash_callback_destroy_fn , destroy_value_fn : aws_hash_callback_destroy_fn) -> :: libc :: c_int ; } extern "C" { # [doc = " Deletes every element from map and frees all associated memory.\n destroy_fn will be called for each element. aws_hash_table_init\n must be called before reusing the hash table.\n\n This method is idempotent."] pub fn aws_hash_table_clean_up (map : * mut aws_hash_table) ; } extern "C" { # [doc = " Safely swaps two hash tables. Note that we swap the entirety of the hash\n table, including which allocator is associated.\n\n Neither hash table is required to be initialized; if one or both is\n uninitialized, then the uninitialized state is also swapped."] pub fn aws_hash_table_swap (a : * mut aws_hash_table , b : * mut aws_hash_table) ; } extern "C" { # [doc = " Moves the hash table in 'from' to 'to'. After this move, 'from' will\n be identical to the state of the original 'to' hash table, and 'to'\n will be in the same state as if it had been passed to aws_hash_table_clean_up\n (that is, it will have no memory allocated, and it will be safe to\n either discard it or call aws_hash_table_clean_up again).\n\n Note that 'to' will not be cleaned up. You should make sure that 'to'\n is either uninitialized or cleaned up before moving a hashtable into\n it."] pub fn aws_hash_table_move (to : * mut aws_hash_table , from : * mut aws_hash_table) ; } extern "C" { # [doc = " Returns the current number of entries in the table."] pub fn aws_hash_table_get_entry_count (map : * const aws_hash_table) -> usize ; } extern "C" { # [doc = " Returns an iterator to be used for iterating through a hash table.\n Iterator will already point to the first element of the table it finds,\n which can be accessed as iter.element.\n\n This function cannot fail, but if there are no elements in the table,\n the returned iterator will return true for aws_hash_iter_done(&iter)."] pub fn aws_hash_iter_begin (map : * const aws_hash_table) -> aws_hash_iter ; } extern "C" { # [doc = " Returns true if iterator is done iterating through table, false otherwise.\n If this is true, the iterator will not include an element of the table."] pub fn aws_hash_iter_done (iter : * const aws_hash_iter) -> bool ; } extern "C" { # [doc = " Updates iterator so that it points to next element of hash table.\n\n This and the two previous functions are designed to be used together with\n the following idiom:\n\n for (struct aws_hash_iter iter = aws_hash_iter_begin(&map);\n !aws_hash_iter_done(&iter); aws_hash_iter_next(&iter)) {\n const key_type key = *(const key_type *)iter.element.key;\n value_type value = *(value_type *)iter.element.value;\n // etc.\n }\n\n Note that calling this on an iter which is \"done\" is idempotent:\n i.e. it will return another iter which is \"done\"."] pub fn aws_hash_iter_next (iter : * mut aws_hash_iter) ; } extern "C" { # [doc = " Deletes the element currently pointed-to by the hash iterator.\n After calling this method, the element member of the iterator\n should not be accessed until the next call to aws_hash_iter_next.\n\n @param destroy_contents If true, the destructors for the key and value\n will be called."] pub fn aws_hash_iter_delete (iter : * mut aws_hash_iter , destroy_contents : bool) ; } extern "C" { # [doc = " Attempts to locate an element at key. If the element is found, a\n pointer to the value is placed in *p_elem; if it is not found,\n *pElem is set to NULL. Either way, AWS_OP_SUCCESS is returned.\n\n This method does not change the state of the hash table. Therefore, it\n is safe to call _find from multiple threads on the same hash table,\n provided no mutating operations happen in parallel.\n\n Calling code may update the value in the hash table by modifying **pElem\n after a successful find. However, this pointer is not guaranteed to\n remain usable after a subsequent call to _put, _delete, _clear, or\n _clean_up."] pub fn aws_hash_table_find (map : * const aws_hash_table , key : * const :: libc :: c_void , p_elem : * mut * mut aws_hash_element) -> :: libc :: c_int ; } extern "C" { # [doc = " Attempts to locate an element at key. If no such element was found,\n creates a new element, with value initialized to NULL. In either case, a\n pointer to the element is placed in *p_elem.\n\n If was_created is non-NULL, *was_created is set to 0 if an existing\n element was found, or 1 is a new element was created.\n\n Returns AWS_OP_SUCCESS if an item was found or created.\n Raises AWS_ERROR_OOM if hash table expansion was required and memory\n allocation failed."] pub fn aws_hash_table_create (map : * mut aws_hash_table , key : * const :: libc :: c_void , p_elem : * mut * mut aws_hash_element , was_created : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Inserts a new element at key, with the given value. If another element\n exists at that key, the old element will be overwritten; both old key and\n value objects will be destroyed.\n\n If was_created is non-NULL, *was_created is set to 0 if an existing\n element was found, or 1 is a new element was created.\n\n Returns AWS_OP_SUCCESS if an item was found or created.\n Raises AWS_ERROR_OOM if hash table expansion was required and memory"] pub fn aws_hash_table_put (map : * mut aws_hash_table , key : * const :: libc :: c_void , value : * mut :: libc :: c_void , was_created : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes element at key. Always returns AWS_OP_SUCCESS.\n\n If pValue is non-NULL, the existing value (if any) is moved into\n (*value) before removing from the table, and destroy_fn is _not_\n invoked. If pValue is NULL, then (if the element existed) destroy_fn\n will be invoked on the element being removed.\n\n If was_present is non-NULL, it is set to 0 if the element was\n not present, or 1 if it was present (and is now removed)."] pub fn aws_hash_table_remove (map : * mut aws_hash_table , key : * const :: libc :: c_void , p_value : * mut aws_hash_element , was_present : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes element already known (typically by find()).\n\n p_value should point to a valid element returned by create() or find().\n\n NOTE: DO NOT call this method from inside of a aws_hash_table_foreach callback, return\n AWS_COMMON_HASH_TABLE_ITER_DELETE instead."] pub fn aws_hash_table_remove_element (map : * mut aws_hash_table , p_value : * mut aws_hash_element) -> :: libc :: c_int ; } extern "C" { # [doc = " Iterates through every element in the map and invokes the callback on\n that item. Iteration is performed in an arbitrary, implementation-defined\n order, and is not guaranteed to be consistent across invocations.\n\n The callback may change the value associated with the key by overwriting\n the value pointed-to by value. In this case, the on_element_removed\n callback will not be invoked, unless the callback invokes\n AWS_COMMON_HASH_TABLE_ITER_DELETE (in which case the on_element_removed\n is given the updated value).\n\n The callback must return a bitmask of zero or more of the following values\n ORed together:\n\n # AWS_COMMON_HASH_TABLE_ITER_CONTINUE - Continues iteration to the next\n element (if not set, iteration stops)\n # AWS_COMMON_HASH_TABLE_ITER_DELETE - Deletes the current value and\n continues iteration. destroy_fn will NOT be invoked.\n # AWS_COMMON_HASH_TABLE_ITER_ERROR - Stop iteration with error.\n No action will be taken for the current value and the value before this.\n No rolling back. The deleted value before will NOT be back.\n aws_hash_table_foreach returns AWS_OP_ERR after stropping the iteration.\n\n Invoking any method which may change the contents of the hashtable\n during iteration results in undefined behavior. However, you may safely\n invoke non-mutating operations during an iteration.\n\n This operation is mutating only if AWS_COMMON_HASH_TABLE_ITER_DELETE\n is returned at some point during iteration. Otherwise, it is non-mutating\n and is safe to invoke in parallel with other non-mutating operations."] pub fn aws_hash_table_foreach (map : * mut aws_hash_table , callback : :: std :: option :: Option < unsafe extern "C" fn (context : * mut :: libc :: c_void , p_element : * mut aws_hash_element) -> :: libc :: c_int > , context : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Compares two hash tables for equality. Both hash tables must have equivalent\n key comparators; values will be compared using the comparator passed into this\n function. The key hash function does not need to be equivalent between the\n two hash tables."] pub fn aws_hash_table_eq (a : * const aws_hash_table , b : * const aws_hash_table , value_eq : aws_hash_callback_eq_fn) -> bool ; } extern "C" { # [doc = " Removes every element from the hash map. destroy_fn will be called for\n each element."] pub fn aws_hash_table_clear (map : * mut aws_hash_table) ; } extern "C" { # [doc = " Convenience hash function for NULL-terminated C-strings"] pub fn aws_hash_c_string (item : * const :: libc :: c_void) -> u64 ; } extern "C" { # [doc = " Convenience hash function for struct aws_strings.\n Hash is same as used on the string bytes by aws_hash_c_string."] pub fn aws_hash_string (item : * const :: libc :: c_void) -> u64 ; } extern "C" { # [doc = " Convenience hash function for struct aws_byte_cursor.\n Hash is same as used on the string bytes by aws_hash_c_string."] pub fn aws_hash_byte_cursor_ptr (item : * const :: libc :: c_void) -> u64 ; } extern "C" { # [doc = " Convenience hash function which hashes the pointer value directly,\n without dereferencing. This can be used in cases where pointer identity\n is desired, or where a uintptr_t is encoded into a const void *."] pub fn aws_hash_ptr (item : * const :: libc :: c_void) -> u64 ; } extern "C" { pub fn aws_hash_combine (item1 : u64 , item2 : u64) -> u64 ; } extern "C" { # [doc = " Convenience eq callback for NULL-terminated C-strings"] pub fn aws_hash_callback_c_str_eq (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> bool ; } extern "C" { # [doc = " Convenience eq callback for AWS strings"] pub fn aws_hash_callback_string_eq (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> bool ; } extern "C" { # [doc = " Convenience destroy callback for AWS strings"] pub fn aws_hash_callback_string_destroy (a : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Equality function which compares pointer equality."] pub fn aws_ptr_eq (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> bool ; } extern "C" { # [doc = " Best-effort check of hash_table_state data-structure invariants"] pub fn aws_hash_table_is_valid (map : * const aws_hash_table) -> bool ; } extern "C" { # [doc = " Given a pointer to a hash_iter, checks that it is well-formed, with all data-structure invariants."] pub fn aws_hash_iter_is_valid (iter : * const aws_hash_iter) -> bool ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_io_event_type { AWS_IO_EVENT_TYPE_READABLE = 1 , AWS_IO_EVENT_TYPE_WRITABLE = 2 , AWS_IO_EVENT_TYPE_REMOTE_HANG_UP = 4 , AWS_IO_EVENT_TYPE_CLOSED = 8 , AWS_IO_EVENT_TYPE_ERROR = 16 , } pub type aws_event_loop_on_event_fn = :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle , events : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_event_loop_vtable { pub destroy : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop) > , pub run : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop) -> :: libc :: c_int > , pub stop : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop) -> :: libc :: c_int > , pub wait_for_stop_completion : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop) -> :: libc :: c_int > , pub schedule_task_now : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , task : * mut aws_task) > , pub schedule_task_future : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , task : * mut aws_task , run_at_nanos : u64) > , pub cancel_task : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , task : * mut aws_task) > , pub subscribe_to_io_events : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle , events : :: libc :: c_int , on_event : aws_event_loop_on_event_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > , pub unsubscribe_from_io_events : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle) -> :: libc :: c_int > , pub free_io_event_resources : :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > , pub is_on_callers_thread : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop) -> bool > , } # [test] fn bindgen_test_layout_aws_event_loop_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_event_loop_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_event_loop_vtable > () , 88usize , concat ! ("Size of: " , stringify ! (aws_event_loop_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_event_loop_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_event_loop_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . run) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (run))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . stop) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (stop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . wait_for_stop_completion) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (wait_for_stop_completion))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . schedule_task_now) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (schedule_task_now))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . schedule_task_future) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (schedule_task_future))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cancel_task) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (cancel_task))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subscribe_to_io_events) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (subscribe_to_io_events))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . unsubscribe_from_io_events) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (unsubscribe_from_io_events))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . free_io_event_resources) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (free_io_event_resources))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . is_on_callers_thread) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (is_on_callers_thread))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_event_loop { pub vtable : * mut aws_event_loop_vtable , pub alloc : * mut aws_allocator , pub clock : aws_io_clock_fn , pub local_data : aws_hash_table , pub current_load_factor : aws_atomic_var , pub latest_tick_start : u64 , pub current_tick_latency_sum : usize , pub next_flush_time : aws_atomic_var , pub impl_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_event_loop () { const UNINIT : :: std :: mem :: MaybeUninit < aws_event_loop > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_event_loop > () , 72usize , concat ! ("Size of: " , stringify ! (aws_event_loop))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_event_loop > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_event_loop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clock) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (clock))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . local_data) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (local_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . current_load_factor) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (current_load_factor))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . latest_tick_start) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (latest_tick_start))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . current_tick_latency_sum) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (current_tick_latency_sum))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . next_flush_time) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (next_flush_time))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_data) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (impl_data))) ; } impl Default for aws_event_loop { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_event_loop_on_local_object_removed_fn = :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut aws_event_loop_local_object) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_event_loop_local_object { pub key : * const :: libc :: c_void , pub object : * mut :: libc :: c_void , pub on_object_removed : aws_event_loop_on_local_object_removed_fn , } # [test] fn bindgen_test_layout_aws_event_loop_local_object () { const UNINIT : :: std :: mem :: MaybeUninit < aws_event_loop_local_object > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_event_loop_local_object > () , 24usize , concat ! ("Size of: " , stringify ! (aws_event_loop_local_object))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_event_loop_local_object > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_event_loop_local_object))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . key) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_local_object) , "::" , stringify ! (key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . object) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_local_object) , "::" , stringify ! (object))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_object_removed) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_local_object) , "::" , stringify ! (on_object_removed))) ; } impl Default for aws_event_loop_local_object { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_event_loop_options { pub clock : aws_io_clock_fn , pub thread_options : * mut aws_thread_options , } # [test] fn bindgen_test_layout_aws_event_loop_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_event_loop_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_event_loop_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_event_loop_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_event_loop_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_event_loop_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clock) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_options) , "::" , stringify ! (clock))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . thread_options) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_options) , "::" , stringify ! (thread_options))) ; } impl Default for aws_event_loop_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_new_event_loop_fn = :: std :: option :: Option < unsafe extern "C" fn (alloc : * mut aws_allocator , options : * const aws_event_loop_options , new_loop_user_data : * mut :: libc :: c_void) -> * mut aws_event_loop > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_event_loop_group { pub allocator : * mut aws_allocator , pub event_loops : aws_array_list , pub ref_count : aws_ref_count , pub shutdown_options : aws_shutdown_callback_options , } # [test] fn bindgen_test_layout_aws_event_loop_group () { const UNINIT : :: std :: mem :: MaybeUninit < aws_event_loop_group > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_event_loop_group > () , 88usize , concat ! ("Size of: " , stringify ! (aws_event_loop_group))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_event_loop_group > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_event_loop_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_group) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . event_loops) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_group) , "::" , stringify ! (event_loops))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_group) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_group) , "::" , stringify ! (shutdown_options))) ; } impl Default for aws_event_loop_group { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Creates an instance of the default event loop implementation for the current architecture and operating system."] pub fn aws_event_loop_new_default (alloc : * mut aws_allocator , clock : aws_io_clock_fn) -> * mut aws_event_loop ; } extern "C" { # [doc = " Creates an instance of the default event loop implementation for the current architecture and operating system using\n extendable options."] pub fn aws_event_loop_new_default_with_options (alloc : * mut aws_allocator , options : * const aws_event_loop_options) -> * mut aws_event_loop ; } extern "C" { # [doc = " Invokes the destroy() fn for the event loop implementation.\n If the event loop is still in a running state, this function will block waiting on the event loop to shutdown.\n If you do not want this function to block, call aws_event_loop_stop() manually first.\n If the event loop is shared by multiple threads then destroy must be called by exactly one thread. All other threads\n must ensure their API calls to the event loop happen-before the call to destroy."] pub fn aws_event_loop_destroy (event_loop : * mut aws_event_loop) ; } extern "C" { # [doc = " Initializes common event-loop data structures.\n This is only called from the *new() function of event loop implementations."] pub fn aws_event_loop_init_base (event_loop : * mut aws_event_loop , alloc : * mut aws_allocator , clock : aws_io_clock_fn) -> :: libc :: c_int ; } extern "C" { # [doc = " Common cleanup code for all implementations.\n This is only called from the *destroy() function of event loop implementations."] pub fn aws_event_loop_clean_up_base (event_loop : * mut aws_event_loop) ; } extern "C" { # [doc = " Fetches an object from the event-loop's data store. Key will be taken as the memory address of the memory pointed to\n by key. This function is not thread safe and should be called inside the event-loop's thread."] pub fn aws_event_loop_fetch_local_object (event_loop : * mut aws_event_loop , key : * mut :: libc :: c_void , obj : * mut aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Puts an item object the event-loop's data store. Key will be taken as the memory address of the memory pointed to by\n key. The lifetime of item must live until remove or a put item overrides it. This function is not thread safe and\n should be called inside the event-loop's thread."] pub fn aws_event_loop_put_local_object (event_loop : * mut aws_event_loop , obj : * mut aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes an object from the event-loop's data store. Key will be taken as the memory address of the memory pointed to\n by key. If removed_item is not null, the removed item will be moved to it if it exists. Otherwise, the default\n deallocation strategy will be used. This function is not thread safe and should be called inside the event-loop's\n thread."] pub fn aws_event_loop_remove_local_object (event_loop : * mut aws_event_loop , key : * mut :: libc :: c_void , removed_obj : * mut aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Triggers the running of the event loop. This function must not block. The event loop is not active until this\n function is invoked. This function can be called again on an event loop after calling aws_event_loop_stop() and\n aws_event_loop_wait_for_stop_completion()."] pub fn aws_event_loop_run (event_loop : * mut aws_event_loop) -> :: libc :: c_int ; } extern "C" { # [doc = " Triggers the event loop to stop, but does not wait for the loop to stop completely.\n This function may be called from outside or inside the event loop thread. It is safe to call multiple times.\n This function is called from destroy().\n\n If you do not call destroy(), an event loop can be run again by calling stop(), wait_for_stop_completion(), run()."] pub fn aws_event_loop_stop (event_loop : * mut aws_event_loop) -> :: libc :: c_int ; } extern "C" { # [doc = " For event-loop implementations to use for providing metrics info to the base event-loop. This enables the\n event-loop load balancer to take into account load when vending another event-loop to a caller.\n\n Call this function at the beginning of your event-loop tick: after wake-up, but before processing any IO or tasks."] pub fn aws_event_loop_register_tick_start (event_loop : * mut aws_event_loop) ; } extern "C" { # [doc = " For event-loop implementations to use for providing metrics info to the base event-loop. This enables the\n event-loop load balancer to take into account load when vending another event-loop to a caller.\n\n Call this function at the end of your event-loop tick: after processing IO and tasks."] pub fn aws_event_loop_register_tick_end (event_loop : * mut aws_event_loop) ; } extern "C" { # [doc = " Returns the current load factor (however that may be calculated). If the event-loop is not invoking\n aws_event_loop_register_tick_start() and aws_event_loop_register_tick_end(), this value will always be 0."] pub fn aws_event_loop_get_load_factor (event_loop : * mut aws_event_loop) -> usize ; } extern "C" { # [doc = " Blocks until the event loop stops completely.\n If you want to call aws_event_loop_run() again, you must call this after aws_event_loop_stop().\n It is not safe to call this function from inside the event loop thread."] pub fn aws_event_loop_wait_for_stop_completion (event_loop : * mut aws_event_loop) -> :: libc :: c_int ; } extern "C" { # [doc = " The event loop will schedule the task and run it on the event loop thread as soon as possible.\n Note that cancelled tasks may execute outside the event loop thread.\n This function may be called from outside or inside the event loop thread.\n\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_event_loop_schedule_task_now (event_loop : * mut aws_event_loop , task : * mut aws_task) ; } extern "C" { # [doc = " The event loop will schedule the task and run it at the specified time.\n Use aws_event_loop_current_clock_time() to query the current time in nanoseconds.\n Note that cancelled tasks may execute outside the event loop thread.\n This function may be called from outside or inside the event loop thread.\n\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_event_loop_schedule_task_future (event_loop : * mut aws_event_loop , task : * mut aws_task , run_at_nanos : u64) ; } extern "C" { # [doc = " Cancels task.\n This function must be called from the event loop's thread, and is only guaranteed\n to work properly on tasks scheduled from within the event loop's thread.\n The task will be executed with the AWS_TASK_STATUS_CANCELED status inside this call."] pub fn aws_event_loop_cancel_task (event_loop : * mut aws_event_loop , task : * mut aws_task) ; } extern "C" { # [doc = " Subscribes on_event to events on the event-loop for handle. events is a bitwise concatenation of the events that were\n received. The definition for these values can be found in aws_io_event_type. Currently, only\n AWS_IO_EVENT_TYPE_READABLE and AWS_IO_EVENT_TYPE_WRITABLE are honored. You always are registered for error conditions\n and closure. This function may be called from outside or inside the event loop thread. However, the unsubscribe\n function must be called inside the event-loop's thread."] pub fn aws_event_loop_subscribe_to_io_events (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle , events : :: libc :: c_int , on_event : aws_event_loop_on_event_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Unsubscribes handle from event-loop notifications.\n This function is not thread safe and should be called inside the event-loop's thread.\n\n NOTE: if you are using io completion ports, this is a risky call. We use it in places, but only when we're certain\n there's no pending events. If you want to use it, it's your job to make sure you don't have pending events before\n calling it."] pub fn aws_event_loop_unsubscribe_from_io_events (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle) -> :: libc :: c_int ; } extern "C" { # [doc = " Cleans up resources (user_data) associated with the I/O eventing subsystem for a given handle. This should only\n ever be necessary in the case where you are cleaning up an event loop during shutdown and its thread has already\n been joined."] pub fn aws_event_loop_free_io_event_resources (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle) ; } extern "C" { # [doc = " Returns true if the event loop's thread is the same thread that called this function, otherwise false."] pub fn aws_event_loop_thread_is_callers_thread (event_loop : * mut aws_event_loop) -> bool ; } extern "C" { # [doc = " Gets the current timestamp for the event loop's clock, in nanoseconds. This function is thread-safe."] pub fn aws_event_loop_current_clock_time (event_loop : * mut aws_event_loop , time_nanos : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Creates an event loop group, with clock, number of loops to manage, and the function to call for creating a new\n event loop."] pub fn aws_event_loop_group_new (alloc : * mut aws_allocator , clock : aws_io_clock_fn , el_count : u16 , new_loop_fn : aws_new_event_loop_fn , new_loop_user_data : * mut :: libc :: c_void , shutdown_options : * const aws_shutdown_callback_options) -> * mut aws_event_loop_group ; } extern "C" { # [doc = " Creates an event loop group, with clock, number of loops to manage, the function to call for creating a new\n event loop, and also pins all loops to hw threads on the same cpu_group (e.g. NUMA nodes). Note:\n If el_count exceeds the number of hw threads in the cpu_group it will be ignored on the assumption that if you\n care about NUMA, you don't want hyper-threads doing your IO and you especially don't want IO on a different node."] pub fn aws_event_loop_group_new_pinned_to_cpu_group (alloc : * mut aws_allocator , clock : aws_io_clock_fn , el_count : u16 , cpu_group : u16 , new_loop_fn : aws_new_event_loop_fn , new_loop_user_data : * mut :: libc :: c_void , shutdown_options : * const aws_shutdown_callback_options) -> * mut aws_event_loop_group ; } extern "C" { # [doc = " Initializes an event loop group with platform defaults. If max_threads == 0, then the\n loop count will be the number of available processors on the machine / 2 (to exclude hyper-threads).\n Otherwise, max_threads will be the number of event loops in the group."] pub fn aws_event_loop_group_new_default (alloc : * mut aws_allocator , max_threads : u16 , shutdown_options : * const aws_shutdown_callback_options) -> * mut aws_event_loop_group ; } extern "C" { # [doc = " Creates an event loop group, with clock, number of loops to manage, the function to call for creating a new\n event loop, and also pins all loops to hw threads on the same cpu_group (e.g. NUMA nodes). Note:\n If el_count exceeds the number of hw threads in the cpu_group it will be clamped to the number of hw threads\n on the assumption that if you care about NUMA, you don't want hyper-threads doing your IO and you especially\n don't want IO on a different node.\n\n If max_threads == 0, then the\n loop count will be the number of available processors in the cpu_group / 2 (to exclude hyper-threads)"] pub fn aws_event_loop_group_new_default_pinned_to_cpu_group (alloc : * mut aws_allocator , max_threads : u16 , cpu_group : u16 , shutdown_options : * const aws_shutdown_callback_options) -> * mut aws_event_loop_group ; } extern "C" { # [doc = " Increments the reference count on the event loop group, allowing the caller to take a reference to it.\n\n Returns the same event loop group passed in."] pub fn aws_event_loop_group_acquire (el_group : * mut aws_event_loop_group) -> * mut aws_event_loop_group ; } extern "C" { # [doc = " Decrements an event loop group's ref count. When the ref count drops to zero, the event loop group will be\n destroyed."] pub fn aws_event_loop_group_release (el_group : * mut aws_event_loop_group) ; } extern "C" { pub fn aws_event_loop_group_get_loop_at (el_group : * mut aws_event_loop_group , index : usize) -> * mut aws_event_loop ; } extern "C" { pub fn aws_event_loop_group_get_loop_count (el_group : * mut aws_event_loop_group) -> usize ; } extern "C" { # [doc = " Fetches the next loop for use. The purpose is to enable load balancing across loops. You should not depend on how\n this load balancing is done as it is subject to change in the future. Currently it uses the \"best-of-two\" algorithm\n based on the load factor of each loop."] pub fn aws_event_loop_group_get_next_loop (el_group : * mut aws_event_loop_group) -> * mut aws_event_loop ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_stream_seek_basis { AWS_SSB_BEGIN = 0 , AWS_SSB_END = 2 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_stream_status { pub is_end_of_stream : bool , pub is_valid : bool , } # [test] fn bindgen_test_layout_aws_stream_status () { const UNINIT : :: std :: mem :: MaybeUninit < aws_stream_status > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_stream_status > () , 2usize , concat ! ("Size of: " , stringify ! (aws_stream_status))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_stream_status > () , 1usize , concat ! ("Alignment of " , stringify ! (aws_stream_status))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . is_end_of_stream) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_stream_status) , "::" , stringify ! (is_end_of_stream))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . is_valid) as usize - ptr as usize } , 1usize , concat ! ("Offset of field: " , stringify ! (aws_stream_status) , "::" , stringify ! (is_valid))) ; } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_input_stream_vtable { pub seek : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream , offset : i64 , basis : aws_stream_seek_basis) -> :: libc :: c_int > , # [doc = " Stream as much data as will fit into the destination buffer and update its length.\n The destination buffer's capacity MUST NOT be changed.\n\n Return AWS_OP_SUCCESS if the read is successful.\n If AWS_OP_ERR is returned, the stream is assumed to be invalid and any data written to the buffer is ignored.\n\n If no more data is currently available, or the end of the stream has been reached, simply return AWS_OP_SUCCESS\n without touching the destination buffer."] pub read : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream , dest : * mut aws_byte_buf) -> :: libc :: c_int > , pub get_status : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream , status : * mut aws_stream_status) -> :: libc :: c_int > , pub get_length : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream , out_length : * mut i64) -> :: libc :: c_int > , # [doc = " Optional.\n If not set, the default aws_ref_count_acquire/release will be used.\n Set for high level language binding that has its own refcounting implementation and needs to be kept alive from\n C.\n If set, ref_count member will not be used."] pub acquire : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream) > , pub release : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream) > , } # [test] fn bindgen_test_layout_aws_input_stream_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_input_stream_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_input_stream_vtable > () , 48usize , concat ! ("Size of: " , stringify ! (aws_input_stream_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_input_stream_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_input_stream_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . seek) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (seek))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . read) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (read))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_status) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (get_status))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_length) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (get_length))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . acquire) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (acquire))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . release) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (release))) ; } # [doc = " Base class for input streams.\n Note: when you implement one input stream, the ref_count needs to be initialized to clean up the resource when\n reaches to zero."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_input_stream { pub impl_ : * mut :: libc :: c_void , pub vtable : * const aws_input_stream_vtable , pub ref_count : aws_ref_count , } # [test] fn bindgen_test_layout_aws_input_stream () { const UNINIT : :: std :: mem :: MaybeUninit < aws_input_stream > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_input_stream > () , 40usize , concat ! ("Size of: " , stringify ! (aws_input_stream))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_input_stream > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_input_stream))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream) , "::" , stringify ! (ref_count))) ; } impl Default for aws_input_stream { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Increments the reference count on the input stream, allowing the caller to take a reference to it.\n\n Returns the same input stream passed in."] pub fn aws_input_stream_acquire (stream : * mut aws_input_stream) -> * mut aws_input_stream ; } extern "C" { # [doc = " Decrements a input stream's ref count. When the ref count drops to zero, the input stream will be destroyed.\n\n Returns NULL always."] pub fn aws_input_stream_release (stream : * mut aws_input_stream) -> * mut aws_input_stream ; } extern "C" { pub fn aws_input_stream_seek (stream : * mut aws_input_stream , offset : i64 , basis : aws_stream_seek_basis) -> :: libc :: c_int ; } extern "C" { pub fn aws_input_stream_read (stream : * mut aws_input_stream , dest : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { pub fn aws_input_stream_get_status (stream : * mut aws_input_stream , status : * mut aws_stream_status) -> :: libc :: c_int ; } extern "C" { pub fn aws_input_stream_get_length (stream : * mut aws_input_stream , out_length : * mut i64) -> :: libc :: c_int ; } extern "C" { pub fn aws_input_stream_destroy (stream : * mut aws_input_stream) ; } extern "C" { pub fn aws_input_stream_new_from_cursor (allocator : * mut aws_allocator , cursor : * const aws_byte_cursor) -> * mut aws_input_stream ; } extern "C" { pub fn aws_input_stream_new_from_file (allocator : * mut aws_allocator , file_name : * const :: libc :: c_char) -> * mut aws_input_stream ; } extern "C" { pub fn aws_input_stream_new_from_open_file (allocator : * mut aws_allocator , file : * mut FILE) -> * mut aws_input_stream ; } # [doc = " Data representing a URI. uri_str is always allocated and filled in.\n The other portions are merely storing offsets into uri_str."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_uri { pub self_size : usize , pub allocator : * mut aws_allocator , pub uri_str : aws_byte_buf , pub scheme : aws_byte_cursor , pub authority : aws_byte_cursor , pub userinfo : aws_byte_cursor , pub user : aws_byte_cursor , pub password : aws_byte_cursor , pub host_name : aws_byte_cursor , pub port : u16 , pub path : aws_byte_cursor , pub query_string : aws_byte_cursor , pub path_and_query : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_uri () { const UNINIT : :: std :: mem :: MaybeUninit < aws_uri > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_uri > () , 200usize , concat ! ("Size of: " , stringify ! (aws_uri))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_uri > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_uri))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . self_size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (self_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . uri_str) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (uri_str))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . scheme) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (scheme))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . authority) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (authority))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . userinfo) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (userinfo))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (user))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . password) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (password))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . path) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (path))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . query_string) as usize - ptr as usize } , 168usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (query_string))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . path_and_query) as usize - ptr as usize } , 184usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (path_and_query))) ; } impl Default for aws_uri { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " key/value pairs for a query string. If the query fragment was not in format key=value, the fragment value\n will be stored in key"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_uri_param { pub key : aws_byte_cursor , pub value : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_uri_param () { const UNINIT : :: std :: mem :: MaybeUninit < aws_uri_param > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_uri_param > () , 32usize , concat ! ("Size of: " , stringify ! (aws_uri_param))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_uri_param > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_uri_param))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . key) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_uri_param) , "::" , stringify ! (key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_uri_param) , "::" , stringify ! (value))) ; } impl Default for aws_uri_param { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Arguments for building a URI instance. All members must\n be initialized before passing them to aws_uri_init().\n\n query_string and query_params are exclusive to each other. If you set\n query_string, do not prepend it with '?'"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_uri_builder_options { pub scheme : aws_byte_cursor , pub path : aws_byte_cursor , pub host_name : aws_byte_cursor , pub port : u16 , pub query_params : * mut aws_array_list , pub query_string : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_uri_builder_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_uri_builder_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_uri_builder_options > () , 80usize , concat ! ("Size of: " , stringify ! (aws_uri_builder_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_uri_builder_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_uri_builder_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . scheme) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (scheme))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . path) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (path))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . query_params) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (query_params))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . query_string) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (query_string))) ; } impl Default for aws_uri_builder_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Parses 'uri_str' and initializes uri. Returns AWS_OP_SUCCESS, on success, AWS_OP_ERR on failure.\n After calling this function, the parts can be accessed."] pub fn aws_uri_init_parse (uri : * mut aws_uri , allocator : * mut aws_allocator , uri_str : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Initializes uri to values specified in options. Returns AWS_OP_SUCCESS, on success, AWS_OP_ERR on failure.\n After calling this function, the parts can be accessed."] pub fn aws_uri_init_from_builder_options (uri : * mut aws_uri , allocator : * mut aws_allocator , options : * mut aws_uri_builder_options) -> :: libc :: c_int ; } extern "C" { pub fn aws_uri_clean_up (uri : * mut aws_uri) ; } extern "C" { # [doc = " Returns the scheme portion of the uri (e.g. http, https, ftp, ftps, etc...). If the scheme was not present\n in the uri, the returned value will be empty. It is the users job to determine the appropriate defaults\n if this field is empty, based on protocol, port, etc..."] pub fn aws_uri_scheme (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " Returns the authority portion of the uri (host[:port]). If it was not present, this was a request uri. In that\n case, the value will be empty."] pub fn aws_uri_authority (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " Returns the path portion of the uri, including any leading '/'. If not present, this value will be empty."] pub fn aws_uri_path (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " Returns the query string portion of the uri, minus the '?'. If not present, this value will be empty."] pub fn aws_uri_query_string (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " Returns the 'host_name' portion of the authority. If no authority was present, this value will be empty."] pub fn aws_uri_host_name (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " Returns the port portion of the authority if it was present, otherwise, returns 0.\n If this is 0, it is the users job to determine the correct port based on scheme and protocol."] pub fn aws_uri_port (uri : * const aws_uri) -> u16 ; } extern "C" { # [doc = " Returns the path and query portion of the uri (i.e., the thing you send across the wire)."] pub fn aws_uri_path_and_query (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " For iterating over the params in the uri query string.\n `param` is an in/out argument used to track progress, it MUST be zeroed out to start.\n If true is returned, `param` contains the value of the next param.\n If false is returned, there are no further params.\n\n Edge cases:\n 1) Entries without '=' sign are treated as having a key and no value.\n Example: First param in query string \"a&b=c\" has key=\"a\" value=\"\"\n\n 2) Blank entries are skipped.\n Example: The only param in query string \"&&a=b\" is key=\"a\" value=\"b\""] pub fn aws_uri_query_string_next_param (uri : * const aws_uri , param : * mut aws_uri_param) -> bool ; } extern "C" { # [doc = " Parses query string and stores the parameters in 'out_params'. Returns AWS_OP_SUCCESS on success and\n AWS_OP_ERR on failure. The user is responsible for initializing out_params with item size of struct aws_query_param.\n The user is also responsible for cleaning up out_params when finished."] pub fn aws_uri_query_string_params (uri : * const aws_uri , out_params : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Writes the uri path encoding of a cursor to a buffer. This is the modified version of rfc3986 used by\n sigv4 signing."] pub fn aws_byte_buf_append_encoding_uri_path (buffer : * mut aws_byte_buf , cursor : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Writes the uri query param encoding (passthrough alnum + '-' '_' '~' '.') of a UTF-8 cursor to a buffer\n For example, reading \"a b_c\" would write \"a%20b_c\"."] pub fn aws_byte_buf_append_encoding_uri_param (buffer : * mut aws_byte_buf , cursor : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Writes the uri decoding of a UTF-8 cursor to a buffer,\n replacing %xx escapes by their single byte equivalent.\n For example, reading \"a%20b_c\" would write \"a b_c\"."] pub fn aws_byte_buf_append_decoding_uri (buffer : * mut aws_byte_buf , cursor : * const aws_byte_cursor) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_errors { AWS_ERROR_S3_MISSING_CONTENT_RANGE_HEADER = 14336 , AWS_ERROR_S3_INVALID_CONTENT_RANGE_HEADER = 14337 , AWS_ERROR_S3_MISSING_CONTENT_LENGTH_HEADER = 14338 , AWS_ERROR_S3_INVALID_CONTENT_LENGTH_HEADER = 14339 , AWS_ERROR_S3_MISSING_ETAG = 14340 , AWS_ERROR_S3_INTERNAL_ERROR = 14341 , AWS_ERROR_S3_SLOW_DOWN = 14342 , AWS_ERROR_S3_INVALID_RESPONSE_STATUS = 14343 , AWS_ERROR_S3_MISSING_UPLOAD_ID = 14344 , AWS_ERROR_S3_PROXY_PARSE_FAILED = 14345 , AWS_ERROR_S3_UNSUPPORTED_PROXY_SCHEME = 14346 , AWS_ERROR_S3_CANCELED = 14347 , AWS_ERROR_S3_INVALID_RANGE_HEADER = 14348 , AWS_ERROR_S3_MULTIRANGE_HEADER_UNSUPPORTED = 14349 , AWS_ERROR_S3_RESPONSE_CHECKSUM_MISMATCH = 14350 , AWS_ERROR_S3_CHECKSUM_CALCULATION_FAILED = 14351 , AWS_ERROR_S3_PAUSED = 14352 , AWS_ERROR_S3_LIST_PARTS_PARSE_FAILED = 14353 , AWS_ERROR_S3_RESUMED_PART_CHECKSUM_MISMATCH = 14354 , AWS_ERROR_S3_RESUME_FAILED = 14355 , AWS_ERROR_S3_OBJECT_MODIFIED = 14356 , AWS_ERROR_S3_NON_RECOVERABLE_ASYNC_ERROR = 14357 , AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE = 14358 , AWS_ERROR_S3_INCORRECT_CONTENT_LENGTH = 14359 , AWS_ERROR_S3_END_RANGE = 15359 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_subject { AWS_LS_S3_GENERAL = 14336 , AWS_LS_S3_CLIENT = 14337 , AWS_LS_S3_CLIENT_STATS = 14338 , AWS_LS_S3_REQUEST = 14339 , AWS_LS_S3_META_REQUEST = 14340 , AWS_LS_S3_ENDPOINT = 14341 , AWS_LS_S3_LAST = 15359 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_cpu_group_info { pub cpu_group : u16 , pub nic_name_array : * const aws_byte_cursor , pub nic_name_array_length : usize , } # [test] fn bindgen_test_layout_aws_s3_cpu_group_info () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_cpu_group_info > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_cpu_group_info > () , 24usize , concat ! ("Size of: " , stringify ! (aws_s3_cpu_group_info))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_cpu_group_info > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_cpu_group_info))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cpu_group) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_cpu_group_info) , "::" , stringify ! (cpu_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . nic_name_array) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_cpu_group_info) , "::" , stringify ! (nic_name_array))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . nic_name_array_length) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_cpu_group_info) , "::" , stringify ! (nic_name_array_length))) ; } impl Default for aws_s3_cpu_group_info { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_compute_platform_info { pub instance_type : aws_byte_cursor , pub max_throughput_gbps : u16 , pub cpu_group_info_array : * const aws_s3_cpu_group_info , pub cpu_group_info_array_length : usize , } # [test] fn bindgen_test_layout_aws_s3_compute_platform_info () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_compute_platform_info > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_compute_platform_info > () , 40usize , concat ! ("Size of: " , stringify ! (aws_s3_compute_platform_info))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_compute_platform_info > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_compute_platform_info))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . instance_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_compute_platform_info) , "::" , stringify ! (instance_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_throughput_gbps) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_compute_platform_info) , "::" , stringify ! (max_throughput_gbps))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cpu_group_info_array) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_compute_platform_info) , "::" , stringify ! (cpu_group_info_array))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cpu_group_info_array_length) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_compute_platform_info) , "::" , stringify ! (cpu_group_info_array_length))) ; } impl Default for aws_s3_compute_platform_info { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Initializes internal datastructures used by aws-c-s3.\n Must be called before using any functionality in aws-c-s3."] pub fn aws_s3_library_init (allocator : * mut aws_allocator) ; } extern "C" { # [doc = " Retrieves the pre-configured metadata for an ec2 instance type. If no such pre-configuration exists, returns NULL."] pub fn aws_s3_get_compute_platform_info_for_instance_type (instance_type_name : aws_byte_cursor) -> * mut aws_s3_compute_platform_info ; } extern "C" { # [doc = " Shuts down the internal datastructures used by aws-c-s3."] pub fn aws_s3_library_clean_up () ; } pub type aws_should_sign_header_fn = :: std :: option :: Option < unsafe extern "C" fn (name : * const aws_byte_cursor , userdata : * mut :: libc :: c_void) -> bool > ; # [repr (u32)] # [non_exhaustive] # [doc = " A primitive RTTI indicator for signing configuration structs\n\n There must be one entry per config structure type and it's a fatal error\n to put the wrong value in the \"config_type\" member of your config structure."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_signing_config_type { AWS_SIGNING_CONFIG_AWS = 1 , } # [doc = " All signing configuration structs must match this by having\n the config_type member as the first member."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_signing_config_base { pub config_type : aws_signing_config_type , } # [test] fn bindgen_test_layout_aws_signing_config_base () { const UNINIT : :: std :: mem :: MaybeUninit < aws_signing_config_base > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_signing_config_base > () , 4usize , concat ! ("Size of: " , stringify ! (aws_signing_config_base))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_signing_config_base > () , 4usize , concat ! ("Alignment of " , stringify ! (aws_signing_config_base))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_base) , "::" , stringify ! (config_type))) ; } impl Default for aws_signing_config_base { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [doc = " What version of the AWS signing process should we use."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_signing_algorithm { AWS_SIGNING_ALGORITHM_V4 = 0 , AWS_SIGNING_ALGORITHM_V4_ASYMMETRIC = 1 , } # [repr (u32)] # [non_exhaustive] # [doc = " What sort of signature should be computed from the signable?"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_signature_type { # [doc = " A signature for a full http request should be computed, with header updates applied to the signing result."] AWS_ST_HTTP_REQUEST_HEADERS = 0 , # [doc = " A signature for a full http request should be computed, with query param updates applied to the signing result."] AWS_ST_HTTP_REQUEST_QUERY_PARAMS = 1 , # [doc = " Compute a signature for a payload chunk. The signable's input stream should be the chunk data and the\n signable should contain the most recent signature value (either the original http request or the most recent\n chunk) in the \"previous-signature\" property."] AWS_ST_HTTP_REQUEST_CHUNK = 2 , # [doc = " Compute a signature for an event stream event. The signable's input stream should be the encoded event-stream\n message (headers + payload), the signable should contain the most recent signature value (either the original\n http request or the most recent event) in the \"previous-signature\" property.\n\n This option is only supported for Sigv4 for now."] AWS_ST_HTTP_REQUEST_EVENT = 3 , # [doc = " Compute a signature for an http request via it's already-computed canonical request. Only the authorization\n signature header is added to the signing result."] AWS_ST_CANONICAL_REQUEST_HEADERS = 4 , # [doc = " Compute a signature for an http request via it's already-computed canonical request. Only the authorization\n signature query param is added to the signing result."] AWS_ST_CANONICAL_REQUEST_QUERY_PARAMS = 5 , # [doc = " Compute a signature for the trailing headers.\n the signable should contain the most recent signature value (either the original http request or the most recent\n chunk) in the \"previous-signature\" property."] AWS_ST_HTTP_REQUEST_TRAILING_HEADERS = 6 , } extern "C" { # [doc = " The SHA-256 of an empty string:\n 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_empty_sha256 : aws_byte_cursor ; } extern "C" { # [doc = " 'UNSIGNED-PAYLOAD'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_unsigned_payload : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-UNSIGNED-PAYLOAD-TRAILER'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_streaming_unsigned_payload_trailer : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-AWS4-HMAC-SHA256-PAYLOAD'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_streaming_aws4_hmac_sha256_payload : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-AWS4-HMAC-SHA256-PAYLOAD-TRAILER'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_streaming_aws4_hmac_sha256_payload_trailer : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-AWS4-ECDSA-P256-SHA256-PAYLOAD'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_streaming_aws4_ecdsa_p256_sha256_payload : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-AWS4-ECDSA-P256-SHA256-PAYLOAD-TRAILER'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_streaming_aws4_ecdsa_p256_sha256_payload_trailer : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-AWS4-HMAC-SHA256-EVENTS'\n For use with `aws_signing_config_aws.signed_body_value`.\n\n Event signing is only supported for Sigv4 for now."] pub static g_aws_signed_body_value_streaming_aws4_hmac_sha256_events : aws_byte_cursor ; } # [repr (u32)] # [non_exhaustive] # [doc = " Controls if signing adds a header containing the canonical request's body value"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_signed_body_header_type { # [doc = " Do not add a header"] AWS_SBHT_NONE = 0 , # [doc = " Add the \"x-amz-content-sha256\" header with the canonical request's body value"] AWS_SBHT_X_AMZ_CONTENT_SHA256 = 1 , } # [doc = " A configuration structure for use in AWS-related signing. Currently covers sigv4 only, but is not required to."] # [repr (C)] pub struct aws_signing_config_aws { # [doc = " What kind of config structure is this?"] pub config_type : aws_signing_config_type , # [doc = " What signing algorithm to use."] pub algorithm : aws_signing_algorithm , # [doc = " What sort of signature should be computed?"] pub signature_type : aws_signature_type , pub region : aws_byte_cursor , # [doc = " name of service to sign a request for"] pub service : aws_byte_cursor , # [doc = " Raw date to use during the signing process."] pub date : aws_date_time , # [doc = " Optional function to control which headers are a part of the canonical request.\n Skipping auth-required headers will result in an unusable signature. Headers injected by the signing process\n are not skippable.\n\n This function does not override the internal check function (x-amzn-trace-id, user-agent), but rather\n supplements it. In particular, a header will get signed if and only if it returns true to both\n the internal check (skips x-amzn-trace-id, user-agent) and this function (if defined)."] pub should_sign_header : aws_should_sign_header_fn , pub should_sign_header_ud : * mut :: libc :: c_void , pub flags : aws_signing_config_aws__bindgen_ty_1 , # [doc = " Optional string to use as the canonical request's body value.\n If string is empty, a value will be calculated from the payload during signing.\n Typically, this is the SHA-256 of the (request/chunk/event) payload, written as lowercase hex.\n If this has been precalculated, it can be set here. Special values used by certain services can also be set\n (e.g. \"UNSIGNED-PAYLOAD\" \"STREAMING-AWS4-HMAC-SHA256-PAYLOAD\" \"STREAMING-AWS4-HMAC-SHA256-EVENTS\")."] pub signed_body_value : aws_byte_cursor , # [doc = " Controls what body \"hash\" header, if any, should be added to the canonical request and the signed request:\n AWS_SBHT_NONE - no header should be added\n AWS_SBHT_X_AMZ_CONTENT_SHA256 - the body \"hash\" should be added in the X-Amz-Content-Sha256 header"] pub signed_body_header : aws_signed_body_header_type , pub credentials : * const aws_credentials , pub credentials_provider : * mut aws_credentials_provider , # [doc = " If non-zero and the signing transform is query param, then signing will add X-Amz-Expires to the query\n string, equal to the value specified here. If this value is zero or if header signing is being used then\n this parameter has no effect."] pub expiration_in_seconds : u64 , } # [repr (C)] # [repr (align (4))] # [derive (Debug , Default , Copy , Clone)] pub struct aws_signing_config_aws__bindgen_ty_1 { pub _bitfield_align_1 : [u8 ; 0] , pub _bitfield_1 : __BindgenBitfieldUnit < [u8 ; 1usize] > , pub __bindgen_padding_0 : [u8 ; 3usize] , } # [test] fn bindgen_test_layout_aws_signing_config_aws__bindgen_ty_1 () { assert_eq ! (:: std :: mem :: size_of :: < aws_signing_config_aws__bindgen_ty_1 > () , 4usize , concat ! ("Size of: " , stringify ! (aws_signing_config_aws__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_signing_config_aws__bindgen_ty_1 > () , 4usize , concat ! ("Alignment of " , stringify ! (aws_signing_config_aws__bindgen_ty_1))) ; } impl aws_signing_config_aws__bindgen_ty_1 { # [inline] pub fn use_double_uri_encode (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (0usize , 1u8) as u32) } } # [inline] pub fn set_use_double_uri_encode (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (0usize , 1u8 , val as u64) } } # [inline] pub fn should_normalize_uri_path (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (1usize , 1u8) as u32) } } # [inline] pub fn set_should_normalize_uri_path (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (1usize , 1u8 , val as u64) } } # [inline] pub fn omit_session_token (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (2usize , 1u8) as u32) } } # [inline] pub fn set_omit_session_token (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (2usize , 1u8 , val as u64) } } # [inline] pub fn new_bitfield_1 (use_double_uri_encode : u32 , should_normalize_uri_path : u32 , omit_session_token : u32) -> __BindgenBitfieldUnit < [u8 ; 1usize] > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [u8 ; 1usize] > = Default :: default () ; __bindgen_bitfield_unit . set (0usize , 1u8 , { let use_double_uri_encode : u32 = unsafe { :: std :: mem :: transmute (use_double_uri_encode) } ; use_double_uri_encode as u64 }) ; __bindgen_bitfield_unit . set (1usize , 1u8 , { let should_normalize_uri_path : u32 = unsafe { :: std :: mem :: transmute (should_normalize_uri_path) } ; should_normalize_uri_path as u64 }) ; __bindgen_bitfield_unit . set (2usize , 1u8 , { let omit_session_token : u32 = unsafe { :: std :: mem :: transmute (omit_session_token) } ; omit_session_token as u64 }) ; __bindgen_bitfield_unit } } # [test] fn bindgen_test_layout_aws_signing_config_aws () { const UNINIT : :: std :: mem :: MaybeUninit < aws_signing_config_aws > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_signing_config_aws > () , 256usize , concat ! ("Size of: " , stringify ! (aws_signing_config_aws))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_signing_config_aws > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_signing_config_aws))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (config_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . algorithm) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (algorithm))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . signature_type) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (signature_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . region) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (region))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . service) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (service))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . date) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (date))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . should_sign_header) as usize - ptr as usize } , 184usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (should_sign_header))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . should_sign_header_ud) as usize - ptr as usize } , 192usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (should_sign_header_ud))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . flags) as usize - ptr as usize } , 200usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (flags))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . signed_body_value) as usize - ptr as usize } , 208usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (signed_body_value))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . signed_body_header) as usize - ptr as usize } , 224usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (signed_body_header))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . credentials) as usize - ptr as usize } , 232usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (credentials))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . credentials_provider) as usize - ptr as usize } , 240usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (credentials_provider))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . expiration_in_seconds) as usize - ptr as usize } , 248usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (expiration_in_seconds))) ; } impl Default for aws_signing_config_aws { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Returns a c-string that describes the supplied signing algorithm\n\n @param algorithm signing algorithm to get a friendly string name for\n\n @return friendly string name of the supplied algorithm, or \"Unknown\" if the algorithm is not recognized"] pub fn aws_signing_algorithm_to_string (algorithm : aws_signing_algorithm) -> * const :: libc :: c_char ; } extern "C" { # [doc = " Checks a signing configuration for invalid settings combinations.\n\n @param config signing configuration to validate\n\n @return - AWS_OP_SUCCESS if the configuration is valid, AWS_OP_ERR otherwise"] pub fn aws_validate_aws_signing_config_aws (config : * const aws_signing_config_aws) -> :: libc :: c_int ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_request { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_meta_request { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_request_metrics { _unused : [u8 ; 0] , } # [repr (u32)] # [non_exhaustive] # [doc = " A Meta Request represents a group of generated requests that are being done on behalf of the\n original request. For example, one large GetObject request can be transformed into a series\n of ranged GetObject requests that are executed in parallel to improve throughput.\n\n The aws_s3_meta_request_type is a hint of transformation to be applied."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_meta_request_type { # [doc = " The Default meta request type sends any request to S3 as-is (with no transformation). For example,\n it can be used to pass a CreateBucket request."] AWS_S3_META_REQUEST_TYPE_DEFAULT = 0 , # [doc = " The GetObject request will be split into a series of ranged GetObject requests that are\n executed in parallel to improve throughput, when possible."] AWS_S3_META_REQUEST_TYPE_GET_OBJECT = 1 , # [doc = " The PutObject request will be split into MultiPart uploads that are executed in parallel\n to improve throughput, when possible.\n Note: put object supports both known and unknown body length. The client\n relies on Content-Length header to determine length of the body.\n Request with unknown content length are always sent using multipart\n upload regardless of final number of parts and do have the following limitations:\n - multipart threshold is ignored and all request are made through mpu,\n even if they only need one part\n - pause/resume is not supported\n - meta request will throw error if checksum header is provider (due to\n general limitation of checksum not being usable if meta request is\n getting split)"] AWS_S3_META_REQUEST_TYPE_PUT_OBJECT = 2 , # [doc = " The CopyObject meta request performs a multi-part copy\n using multiple S3 UploadPartCopy requests in parallel, or bypasses\n a CopyObject request to S3 if the object size is not large enough for\n a multipart upload.\n Note: copy support is still in development and has following limitations:\n - host header must use virtual host addressing style (path style is not\n supported) and both source and dest buckets must have dns compliant name\n - only {bucket}/{key} format is supported for source and passing arn as\n source will not work\n - source bucket is assumed to be in the same region as dest"] AWS_S3_META_REQUEST_TYPE_COPY_OBJECT = 3 , # [doc = " The CopyObject meta request performs a multi-part copy\n using multiple S3 UploadPartCopy requests in parallel, or bypasses\n a CopyObject request to S3 if the object size is not large enough for\n a multipart upload.\n Note: copy support is still in development and has following limitations:\n - host header must use virtual host addressing style (path style is not\n supported) and both source and dest buckets must have dns compliant name\n - only {bucket}/{key} format is supported for source and passing arn as\n source will not work\n - source bucket is assumed to be in the same region as dest"] AWS_S3_META_REQUEST_TYPE_MAX = 4 , } # [repr (u32)] # [non_exhaustive] # [doc = " The type of S3 request made. Used by metrics."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_request_type { AWS_S3_REQUEST_TYPE_DEFAULT = 0 , AWS_S3_REQUEST_TYPE_HEAD_OBJECT = 1 , AWS_S3_REQUEST_TYPE_GET_OBJECT = 2 , AWS_S3_REQUEST_TYPE_LIST_PARTS = 3 , AWS_S3_REQUEST_TYPE_CREATE_MULTIPART_UPLOAD = 4 , AWS_S3_REQUEST_TYPE_UPLOAD_PART = 5 , AWS_S3_REQUEST_TYPE_ABORT_MULTIPART_UPLOAD = 6 , AWS_S3_REQUEST_TYPE_COMPLETE_MULTIPART_UPLOAD = 7 , AWS_S3_REQUEST_TYPE_UPLOAD_PART_COPY = 8 , AWS_S3_REQUEST_TYPE_MAX = 9 , } # [doc = " Invoked to provide response headers received during execution of the meta request, both for\n success and error HTTP status codes.\n\n Return AWS_OP_SUCCESS to continue processing the request.\n\n Return aws_raise_error(E) to cancel the request.\n The error you raise will be reflected in `aws_s3_meta_request_result.error_code`.\n If you're not sure which error to raise, use AWS_ERROR_S3_CANCELED."] pub type aws_s3_meta_request_headers_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , headers : * const aws_http_headers , response_status : :: libc :: c_int , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Invoked to provide the response body as it is received.\n\n Note: If you set `enable_read_backpressure` true on the S3 client,\n you must maintain the flow-control window.\n The flow-control window shrinks as you receive body data via this callback.\n Whenever the flow-control window reaches 0 you will stop downloading data.\n Use aws_s3_meta_request_increment_read_window() to increment the window and keep data flowing.\n Maintain a larger window to keep up a high download throughput,\n parts cannot download in parallel unless the window is large enough to hold multiple parts.\n Maintain a smaller window to limit the amount of data buffered in memory.\n\n If `manual_window_management` is false, you do not need to maintain the flow-control window.\n No back-pressure is applied and data arrives as fast as possible.\n\n Return AWS_OP_SUCCESS to continue processing the request.\n\n Return aws_raise_error(E) to cancel the request.\n The error you raise will be reflected in `aws_s3_meta_request_result.error_code`.\n If you're not sure which error to raise, use AWS_ERROR_S3_CANCELED."] pub type aws_s3_meta_request_receive_body_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , body : * const aws_byte_cursor , range_start : u64 , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Invoked when the entire meta request execution is complete."] pub type aws_s3_meta_request_finish_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , meta_request_result : * const aws_s3_meta_request_result , user_data : * mut :: libc :: c_void) > ; # [doc = " Information sent in the meta_request progress callback."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_s3_meta_request_progress { pub bytes_transferred : u64 , pub content_length : u64 , } # [test] fn bindgen_test_layout_aws_s3_meta_request_progress () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_meta_request_progress > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_meta_request_progress > () , 16usize , concat ! ("Size of: " , stringify ! (aws_s3_meta_request_progress))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_meta_request_progress > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_meta_request_progress))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bytes_transferred) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_progress) , "::" , stringify ! (bytes_transferred))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . content_length) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_progress) , "::" , stringify ! (content_length))) ; } # [doc = " Invoked to report progress of a meta-request.\n For PutObject, progress refers to bytes uploaded.\n For CopyObject, progress refers to bytes copied.\n For GetObject, progress refers to bytes downloaded.\n For anything else, progress refers to response body bytes received."] pub type aws_s3_meta_request_progress_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , progress : * const aws_s3_meta_request_progress , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked to report the telemetry of the meta request once a single request finishes. Invoked from the thread of the\n connection that request made from.\n Note: *metrics is only valid for the duration of the callback. If you need to keep it around, use\n `aws_s3_request_metrics_acquire`"] pub type aws_s3_meta_request_telemetry_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , metrics : * mut aws_s3_request_metrics , user_data : * mut :: libc :: c_void) > ; pub type aws_s3_meta_request_shutdown_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; pub type aws_s3_client_shutdown_complete_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_meta_request_tls_mode { AWS_MR_TLS_ENABLED = 0 , AWS_MR_TLS_DISABLED = 1 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_meta_request_compute_content_md5 { AWS_MR_CONTENT_MD5_DISABLED = 0 , AWS_MR_CONTENT_MD5_ENABLED = 1 , } impl aws_s3_checksum_algorithm { pub const AWS_SCA_CRC32C : aws_s3_checksum_algorithm = aws_s3_checksum_algorithm :: AWS_SCA_INIT ; } impl aws_s3_checksum_algorithm { pub const AWS_SCA_END : aws_s3_checksum_algorithm = aws_s3_checksum_algorithm :: AWS_SCA_SHA256 ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_checksum_algorithm { AWS_SCA_NONE = 0 , AWS_SCA_INIT = 1 , AWS_SCA_CRC32 = 2 , AWS_SCA_SHA1 = 3 , AWS_SCA_SHA256 = 4 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_checksum_location { AWS_SCL_NONE = 0 , AWS_SCL_HEADER = 1 , AWS_SCL_TRAILER = 2 , } # [doc = " Info about a single part, for you to review before the upload completes."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_upload_part_review { pub size : u64 , pub checksum : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_s3_upload_part_review () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_upload_part_review > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_upload_part_review > () , 24usize , concat ! ("Size of: " , stringify ! (aws_s3_upload_part_review))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_upload_part_review > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_upload_part_review))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_part_review) , "::" , stringify ! (size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . checksum) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_part_review) , "::" , stringify ! (checksum))) ; } impl Default for aws_s3_upload_part_review { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Info for you to review before an upload completes.\n\n WARNING: This feature is experimental/unstable.\n At this time, review is only available for multipart upload\n (when Content-Length is above the `multipart_upload_threshold`,\n or Content-Length not specified)."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_upload_review { pub checksum_algorithm : aws_s3_checksum_algorithm , pub part_count : usize , pub part_array : * mut aws_s3_upload_part_review , } # [test] fn bindgen_test_layout_aws_s3_upload_review () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_upload_review > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_upload_review > () , 24usize , concat ! ("Size of: " , stringify ! (aws_s3_upload_review))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_upload_review > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_upload_review))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . checksum_algorithm) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_review) , "::" , stringify ! (checksum_algorithm))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_count) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_review) , "::" , stringify ! (part_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_array) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_review) , "::" , stringify ! (part_array))) ; } impl Default for aws_s3_upload_review { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Optional callback, for you to review an upload before it completes.\n For example, you can review each part's checksum and fail the upload if\n you do not agree with them.\n\n @param meta_request pointer to the aws_s3_meta_request of the upload.\n @param info Detailed info about the upload.\n\n Return AWS_OP_SUCCESS to continue processing the request.\n\n Return aws_raise_error(E) to cancel the request.\n The error you raise will be reflected in `aws_s3_meta_request_result.error_code`.\n If you're not sure which error to raise, use AWS_ERROR_S3_CANCELED.\n\n WARNING: This feature is experimental/unstable.\n At this time, the callback is only invoked for multipart upload\n (when Content-Length is above the `multipart_upload_threshold`,\n or Content-Length not specified)."] pub type aws_s3_meta_request_upload_review_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , review : * const aws_s3_upload_review , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_s3_tcp_keep_alive_options { pub keep_alive_interval_sec : u16 , pub keep_alive_timeout_sec : u16 , pub keep_alive_max_failed_probes : u16 , } # [test] fn bindgen_test_layout_aws_s3_tcp_keep_alive_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_tcp_keep_alive_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_tcp_keep_alive_options > () , 6usize , concat ! ("Size of: " , stringify ! (aws_s3_tcp_keep_alive_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_tcp_keep_alive_options > () , 2usize , concat ! ("Alignment of " , stringify ! (aws_s3_tcp_keep_alive_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . keep_alive_interval_sec) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_tcp_keep_alive_options) , "::" , stringify ! (keep_alive_interval_sec))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . keep_alive_timeout_sec) as usize - ptr as usize } , 2usize , concat ! ("Offset of field: " , stringify ! (aws_s3_tcp_keep_alive_options) , "::" , stringify ! (keep_alive_timeout_sec))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . keep_alive_max_failed_probes) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (aws_s3_tcp_keep_alive_options) , "::" , stringify ! (keep_alive_max_failed_probes))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_client_config { pub max_active_connections_override : u32 , pub region : aws_byte_cursor , pub client_bootstrap : * mut aws_client_bootstrap , pub tls_mode : aws_s3_meta_request_tls_mode , pub tls_connection_options : * mut aws_tls_connection_options , pub signing_config : * mut aws_signing_config_aws , pub part_size : u64 , pub max_part_size : u64 , pub multipart_upload_threshold : u64 , pub throughput_target_gbps : f64 , pub retry_strategy : * mut aws_retry_strategy , # [doc = " TODO: move MD5 config to checksum config.\n For multi-part upload, content-md5 will be calculated if the AWS_MR_CONTENT_MD5_ENABLED is specified\n or initial request has content-md5 header.\n For single-part upload, keep the content-md5 in the initial request unchanged."] pub compute_content_md5 : aws_s3_meta_request_compute_content_md5 , pub shutdown_callback : aws_s3_client_shutdown_complete_callback_fn , pub shutdown_callback_user_data : * mut :: libc :: c_void , # [doc = " Optional.\n Proxy configuration for http connection.\n If the connection_type is AWS_HPCT_HTTP_LEGACY, it will be converted to AWS_HPCT_HTTP_TUNNEL if tls_mode is\n ENABLED. Otherwise, it will be converted to AWS_HPCT_HTTP_FORWARD."] pub proxy_options : * mut aws_http_proxy_options , # [doc = " Optional.\n Configuration for fetching proxy configuration from environment.\n By Default proxy_ev_settings.aws_http_proxy_env_var_type is set to AWS_HPEV_ENABLE which means read proxy\n configuration from environment.\n Only works when proxy_options is not set. If both are set, configuration from proxy_options is used."] pub proxy_ev_settings : * mut proxy_env_var_settings , # [doc = " Optional.\n If set to 0, default value is used."] pub connect_timeout_ms : u32 , # [doc = " Optional.\n Set keepalive to periodically transmit messages for detecting a disconnected peer."] pub tcp_keep_alive_options : * mut aws_s3_tcp_keep_alive_options , # [doc = " Optional.\n Configuration options for connection monitoring.\n If the transfer speed falls below the specified minimum_throughput_bytes_per_second, the operation is aborted.\n If set to NULL, default values are used."] pub monitoring_options : * mut aws_http_connection_monitoring_options , # [doc = " Enable backpressure and prevent response data from downloading faster than you can handle it.\n\n If false (default), no backpressure is applied and data will download as fast as possible.\n\n If true, each meta request has a flow-control window that shrinks as\n response body data is downloaded (headers do not affect the window).\n `initial_read_window` determines the starting size of each meta request's window.\n You will stop downloading data whenever the flow-control window reaches 0\n You must call aws_s3_meta_request_increment_read_window() to keep data flowing.\n\n WARNING: This feature is experimental.\n Currently, backpressure is only applied to GetObject requests which are split into multiple parts,\n and you may still receive some data after the window reaches 0."] pub enable_read_backpressure : bool , # [doc = " The starting size of each meta request's flow-control window, in bytes.\n Ignored unless `enable_read_backpressure` is true."] pub initial_read_window : usize , } # [test] fn bindgen_test_layout_aws_s3_client_config () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client_config > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client_config > () , 176usize , concat ! ("Size of: " , stringify ! (aws_s3_client_config))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client_config > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_active_connections_override) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (max_active_connections_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . region) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (region))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client_bootstrap) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (client_bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_mode) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (tls_mode))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_connection_options) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (tls_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . signing_config) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (signing_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_size) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_part_size) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (max_part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . multipart_upload_threshold) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (multipart_upload_threshold))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . throughput_target_gbps) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (throughput_target_gbps))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . retry_strategy) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (retry_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . compute_content_md5) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (compute_content_md5))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback_user_data) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (shutdown_callback_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_options) as usize - ptr as usize } , 120usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_settings) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (proxy_ev_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connect_timeout_ms) as usize - ptr as usize } , 136usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (connect_timeout_ms))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tcp_keep_alive_options) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (tcp_keep_alive_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . monitoring_options) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (monitoring_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_backpressure) as usize - ptr as usize } , 160usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (enable_read_backpressure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_read_window) as usize - ptr as usize } , 168usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (initial_read_window))) ; } impl Default for aws_s3_client_config { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_checksum_config { # [doc = " The location of client added checksum header.\n\n If AWS_SCL_NONE. No request payload checksum will be add and calculated.\n\n If AWS_SCL_HEADER, the checksum will be calculated by client and added related header to the request sent.\n\n If AWS_SCL_TRAILER, the payload will be aws_chunked encoded, The checksum will be calculate while reading the\n payload by client. Related header will be added to the trailer part of the encoded payload. Note the payload of\n the original request cannot be aws-chunked encoded already. Otherwise, error will be raised."] pub location : aws_s3_checksum_location , # [doc = " The checksum algorithm used.\n Must be set if location is not AWS_SCL_NONE. Must be AWS_SCA_NONE if location is AWS_SCL_NONE."] pub checksum_algorithm : aws_s3_checksum_algorithm , # [doc = " Enable checksum mode header will be attached to GET requests, this will tell s3 to send back checksums headers if\n they exist. Calculate the corresponding checksum on the response bodies. The meta request will finish with a did\n validate field and set the error code to AWS_ERROR_S3_RESPONSE_CHECKSUM_MISMATCH if the calculated\n checksum, and checksum found in the response header do not match."] pub validate_response_checksum : bool , # [doc = " Optional array of `enum aws_s3_checksum_algorithm`.\n\n Ignored when validate_response_checksum is not set.\n If not set all the algorithms will be selected as default behavior.\n Owned by the caller.\n\n The list of algorithms for user to pick up when validate the checksum. Client will pick up the algorithm from the\n list with the priority based on performance, and the algorithm sent by server. The priority based on performance\n is [CRC32C, CRC32, SHA1, SHA256].\n\n If the response checksum was validated by client, the result will indicate which algorithm was picked."] pub validate_checksum_algorithms : * mut aws_array_list , } # [test] fn bindgen_test_layout_aws_s3_checksum_config () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_checksum_config > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_checksum_config > () , 24usize , concat ! ("Size of: " , stringify ! (aws_s3_checksum_config))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_checksum_config > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_checksum_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . location) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_checksum_config) , "::" , stringify ! (location))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . checksum_algorithm) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (aws_s3_checksum_config) , "::" , stringify ! (checksum_algorithm))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . validate_response_checksum) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_checksum_config) , "::" , stringify ! (validate_response_checksum))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . validate_checksum_algorithms) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_checksum_config) , "::" , stringify ! (validate_checksum_algorithms))) ; } impl Default for aws_s3_checksum_config { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Options for a new meta request, ie, file transfer that will be handled by the high performance client.\n\n There are several ways to pass the request's body data:\n 1) If the data is already in memory, set the body-stream on `message`.\n 2) If the data is on disk, set `send_filepath` for best performance.\n 3) If the data will be be produced in asynchronous chunks, set `send_async_stream`."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_meta_request_options { pub type_ : aws_s3_meta_request_type , pub signing_config : * const aws_signing_config_aws , pub message : * mut aws_http_message , # [doc = " Optional.\n If set, this file is sent as the request body.\n This gives the best performance when sending data from a file.\n Do not set if the body is being passed by other means (see note above)."] pub send_filepath : aws_byte_cursor , # [doc = " Optional - EXPERIMENTAL/UNSTABLE\n If set, the request body comes from this async stream.\n Use this when outgoing data will be produced in asynchronous chunks.\n Do not set if the body is being passed by other means (see note above)."] pub send_async_stream : * mut aws_async_input_stream , # [doc = " Optional.\n if set, the flexible checksum will be performed by client based on the config."] pub checksum_config : * const aws_s3_checksum_config , pub user_data : * mut :: libc :: c_void , # [doc = " Optional.\n Invoked to provide response headers received during execution of the meta request.\n Note: this callback will not be fired for cases when resuming an\n operation that was already completed (ex. pausing put object after it\n uploaded all data and then resuming it)\n See `aws_s3_meta_request_headers_callback_fn`."] pub headers_callback : aws_s3_meta_request_headers_callback_fn , # [doc = " Invoked to provide the response body as it is received.\n See `aws_s3_meta_request_receive_body_callback_fn`."] pub body_callback : aws_s3_meta_request_receive_body_callback_fn , # [doc = " Invoked when the entire meta request execution is complete.\n See `aws_s3_meta_request_finish_fn`."] pub finish_callback : aws_s3_meta_request_finish_fn , pub shutdown_callback : aws_s3_meta_request_shutdown_fn , # [doc = " Invoked to report progress of the meta request execution.\n See `aws_s3_meta_request_progress_fn`."] pub progress_callback : aws_s3_meta_request_progress_fn , # [doc = " Optional.\n To get telemetry metrics when a single request finishes.\n If set the request will keep track of the metrics from `aws_s3_request_metrics`, and fire the callback when the\n request finishes receiving response.\n See `aws_s3_meta_request_telemetry_fn`\n\n Notes:\n - The callback will be invoked multiple times from different threads."] pub telemetry_callback : aws_s3_meta_request_telemetry_fn , # [doc = " Optional.\n Callback for reviewing an upload before it completes.\n WARNING: experimental/unstable\n See `aws_s3_upload_review_fn`"] pub upload_review_callback : aws_s3_meta_request_upload_review_fn , # [doc = " Optional.\n Endpoint override for request. Can be used to override scheme and port of\n the endpoint.\n There is some overlap between Host header and Endpoint and corner cases\n are handled as follows:\n - Only Host header is set - Host is used to construct endpoint. https is\n default with corresponding port\n - Only endpoint is set - Host header is created from endpoint. Port and\n Scheme from endpoint is used.\n - Both Host and Endpoint is set - Host header must match Authority of\n Endpoint uri. Port and Scheme from endpoint is used."] pub endpoint : * mut aws_uri , # [doc = " Optional.\n For meta requests that support pause/resume (e.g. PutObject), serialized resume token returned by\n aws_s3_meta_request_pause() can be provided here.\n Note: If PutObject request specifies a checksum algorithm, client will calculate checksums while skipping parts\n from the buffer and compare them them to previously uploaded part checksums."] pub resume_token : * mut aws_s3_meta_request_resume_token , } # [test] fn bindgen_test_layout_aws_s3_meta_request_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_meta_request_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_meta_request_options > () , 136usize , concat ! ("Size of: " , stringify ! (aws_s3_meta_request_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_meta_request_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_meta_request_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . type_) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (type_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . signing_config) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (signing_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . message) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (message))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . send_filepath) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (send_filepath))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . send_async_stream) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (send_async_stream))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . checksum_config) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (checksum_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . headers_callback) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (headers_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . body_callback) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (body_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . finish_callback) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (finish_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . progress_callback) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (progress_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . telemetry_callback) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (telemetry_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . upload_review_callback) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (upload_review_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoint) as usize - ptr as usize } , 120usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (endpoint))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . resume_token) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (resume_token))) ; } impl Default for aws_s3_meta_request_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_meta_request_result { pub error_response_headers : * mut aws_http_headers , pub error_response_body : * mut aws_byte_buf , pub response_status : :: libc :: c_int , pub did_validate : bool , pub validation_algorithm : aws_s3_checksum_algorithm , pub error_code : :: libc :: c_int , } # [test] fn bindgen_test_layout_aws_s3_meta_request_result () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_meta_request_result > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_meta_request_result > () , 32usize , concat ! ("Size of: " , stringify ! (aws_s3_meta_request_result))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_meta_request_result > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_meta_request_result))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_response_headers) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (error_response_headers))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_response_body) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (error_response_body))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . response_status) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (response_status))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . did_validate) as usize - ptr as usize } , 20usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (did_validate))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . validation_algorithm) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (validation_algorithm))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_code) as usize - ptr as usize } , 28usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (error_code))) ; } impl Default for aws_s3_meta_request_result { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_s3_client_new (allocator : * mut aws_allocator , client_config : * const aws_s3_client_config) -> * mut aws_s3_client ; } extern "C" { # [doc = " Add a reference, keeping this object alive.\n The reference must be released when you are done with it, or it's memory will never be cleaned up.\n You must not pass in NULL.\n Always returns the same pointer that was passed in."] pub fn aws_s3_client_acquire (client : * mut aws_s3_client) -> * mut aws_s3_client ; } extern "C" { # [doc = " Release a reference.\n When the reference count drops to 0, this object will be cleaned up.\n It's OK to pass in NULL (nothing happens).\n Always returns NULL."] pub fn aws_s3_client_release (client : * mut aws_s3_client) -> * mut aws_s3_client ; } extern "C" { pub fn aws_s3_client_make_meta_request (client : * mut aws_s3_client , options : * const aws_s3_meta_request_options) -> * mut aws_s3_meta_request ; } extern "C" { # [doc = " Increment the flow-control window, so that response data continues downloading.\n\n If the client was created with `enable_read_backpressure` set true,\n each meta request has a flow-control window that shrinks as response\n body data is downloaded (headers do not affect the size of the window).\n The client's `initial_read_window` determines the starting size of each meta request's window.\n If a meta request's flow-control window reaches 0, no further data will be downloaded.\n If the `initial_read_window` is 0, the request will not start until the window is incremented.\n Maintain a larger window to keep up a high download throughput,\n parts cannot download in parallel unless the window is large enough to hold multiple parts.\n Maintain a smaller window to limit the amount of data buffered in memory.\n\n If `enable_read_backpressure` is false this call will have no effect,\n no backpressure is being applied and data is being downloaded as fast as possible.\n\n WARNING: This feature is experimental.\n Currently, backpressure is only applied to GetObject requests which are split into multiple parts,\n and you may still receive some data after the window reaches 0."] pub fn aws_s3_meta_request_increment_read_window (meta_request : * mut aws_s3_meta_request , bytes : u64) ; } extern "C" { pub fn aws_s3_meta_request_cancel (meta_request : * mut aws_s3_meta_request) ; } extern "C" { # [doc = " Note: pause is currently only supported on upload requests.\n In order to pause an ongoing upload, call aws_s3_meta_request_pause() that\n will return resume token. Token can be used to query the state of operation\n at the pausing time.\n To resume an upload that was paused, supply resume token in the meta\n request options structure member aws_s3_meta_request_options.resume_token.\n The upload can be resumed either from the same client or a different one.\n Corner cases for resume upload are as follows:\n - upload is not MPU - fail with AWS_ERROR_UNSUPPORTED_OPERATION\n - pausing before MPU is created - NULL resume token returned. NULL resume\n token is equivalent to restarting upload\n - pausing in the middle of part transfer - return resume token. scheduling of\n new part uploads stops.\n - pausing after completeMPU started - return resume token. if s3 cannot find\n find associated MPU id when resuming with that token and num of parts\n uploaded equals to total num parts, then operation is a no op. Otherwise\n operation fails.\n Note: for no op case the call will succeed and finish/shutdown request callbacks will\n fire, but on headers callback will not fire.\n Note: similar to cancel pause does not cancel requests already in flight and\n and parts might complete after pause is requested.\n @param meta_request pointer to the aws_s3_meta_request of the upload to be paused\n @param resume_token resume token\n @return either AWS_OP_ERR or AWS_OP_SUCCESS"] pub fn aws_s3_meta_request_pause (meta_request : * mut aws_s3_meta_request , out_resume_token : * mut * mut aws_s3_meta_request_resume_token) -> :: libc :: c_int ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_upload_resume_token_options { pub upload_id : aws_byte_cursor , pub part_size : u64 , pub total_num_parts : usize , # [doc = " Optional.\n\n Note: during resume num_parts_uploaded is used for sanity checking against\n uploads on s3 side.\n In cases where upload id does not exist (already resumed using this token\n or pause called after upload completes, etc...) and num_parts_uploaded\n equals to total num parts, resume will become a noop."] pub num_parts_completed : usize , } # [test] fn bindgen_test_layout_aws_s3_upload_resume_token_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_upload_resume_token_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_upload_resume_token_options > () , 40usize , concat ! ("Size of: " , stringify ! (aws_s3_upload_resume_token_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_upload_resume_token_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_upload_resume_token_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . upload_id) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_resume_token_options) , "::" , stringify ! (upload_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_size) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_resume_token_options) , "::" , stringify ! (part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . total_num_parts) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_resume_token_options) , "::" , stringify ! (total_num_parts))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_parts_completed) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_resume_token_options) , "::" , stringify ! (num_parts_completed))) ; } impl Default for aws_s3_upload_resume_token_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Create upload resume token from persisted data.\n Note: Data required for resume token varies per operation."] pub fn aws_s3_meta_request_resume_token_new_upload (allocator : * mut aws_allocator , options : * const aws_s3_upload_resume_token_options) -> * mut aws_s3_meta_request_resume_token ; } extern "C" { pub fn aws_s3_meta_request_resume_token_acquire (resume_token : * mut aws_s3_meta_request_resume_token) -> * mut aws_s3_meta_request_resume_token ; } extern "C" { pub fn aws_s3_meta_request_resume_token_release (resume_token : * mut aws_s3_meta_request_resume_token) -> * mut aws_s3_meta_request_resume_token ; } extern "C" { pub fn aws_s3_meta_request_resume_token_type (resume_token : * mut aws_s3_meta_request_resume_token) -> aws_s3_meta_request_type ; } extern "C" { pub fn aws_s3_meta_request_resume_token_part_size (resume_token : * mut aws_s3_meta_request_resume_token) -> u64 ; } extern "C" { pub fn aws_s3_meta_request_resume_token_total_num_parts (resume_token : * mut aws_s3_meta_request_resume_token) -> usize ; } extern "C" { pub fn aws_s3_meta_request_resume_token_num_parts_completed (resume_token : * mut aws_s3_meta_request_resume_token) -> usize ; } extern "C" { pub fn aws_s3_meta_request_resume_token_upload_id (resume_token : * mut aws_s3_meta_request_resume_token) -> aws_byte_cursor ; } extern "C" { # [doc = " Add a reference, keeping this object alive.\n The reference must be released when you are done with it, or it's memory will never be cleaned up.\n You must not pass in NULL.\n Always returns the same pointer that was passed in."] pub fn aws_s3_meta_request_acquire (meta_request : * mut aws_s3_meta_request) -> * mut aws_s3_meta_request ; } extern "C" { # [doc = " Release a reference.\n When the reference count drops to 0, this object will be cleaned up.\n It's OK to pass in NULL (nothing happens).\n Always returns NULL."] pub fn aws_s3_meta_request_release (meta_request : * mut aws_s3_meta_request) -> * mut aws_s3_meta_request ; } extern "C" { # [doc = " Initialize the configuration for a default S3 signing."] pub fn aws_s3_init_default_signing_config (signing_config : * mut aws_signing_config_aws , region : aws_byte_cursor , credentials_provider : * mut aws_credentials_provider) ; } extern "C" { # [doc = " Add a reference, keeping this object alive.\n The reference must be released when you are done with it, or it's memory will never be cleaned up.\n Always returns the same pointer that was passed in."] pub fn aws_s3_request_metrics_acquire (metrics : * mut aws_s3_request_metrics) -> * mut aws_s3_request_metrics ; } extern "C" { # [doc = " Release a reference.\n When the reference count drops to 0, this object will be cleaned up.\n It's OK to pass in NULL (nothing happens).\n Always returns NULL."] pub fn aws_s3_request_metrics_release (metrics : * mut aws_s3_request_metrics) -> * mut aws_s3_request_metrics ; } extern "C" { # [doc = " Getters for s3 request metrics ************************************************/\n/**\n Get the request ID from aws_s3_request_metrics.\n If unavailable, AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE will be raised.\n If available, out_request_id will be set to a string. Be warned this string's lifetime is tied to the metrics\n object."] pub fn aws_s3_request_metrics_get_request_id (metrics : * const aws_s3_request_metrics , out_request_id : * mut * const aws_string) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_start_timestamp_ns (metrics : * const aws_s3_request_metrics , out_start_time : * mut u64) ; } extern "C" { pub fn aws_s3_request_metrics_get_end_timestamp_ns (metrics : * const aws_s3_request_metrics , out_end_time : * mut u64) ; } extern "C" { pub fn aws_s3_request_metrics_get_total_duration_ns (metrics : * const aws_s3_request_metrics , out_total_duration : * mut u64) ; } extern "C" { pub fn aws_s3_request_metrics_get_send_start_timestamp_ns (metrics : * const aws_s3_request_metrics , out_send_start_time : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_send_end_timestamp_ns (metrics : * const aws_s3_request_metrics , out_send_end_time : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_sending_duration_ns (metrics : * const aws_s3_request_metrics , out_sending_duration : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_receive_start_timestamp_ns (metrics : * const aws_s3_request_metrics , out_receive_start_time : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_receive_end_timestamp_ns (metrics : * const aws_s3_request_metrics , out_receive_end_time : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_receiving_duration_ns (metrics : * const aws_s3_request_metrics , out_receiving_duration : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_response_status_code (metrics : * const aws_s3_request_metrics , out_response_status : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_response_headers (metrics : * const aws_s3_request_metrics , out_response_headers : * mut * mut aws_http_headers) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the path and query of the request.\n If unavailable, AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE will be raised.\n If available, out_request_path_query will be set to a string. Be warned this string's lifetime is tied to the metrics\n object."] pub fn aws_s3_request_metrics_get_request_path_query (metrics : * const aws_s3_request_metrics , out_request_path_query : * mut * const aws_string) ; } extern "C" { # [doc = " Get the host_address of the request.\n If unavailable, AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE will be raised.\n If available, out_host_address will be set to a string. Be warned this string's lifetime is tied to the metrics\n object."] pub fn aws_s3_request_metrics_get_host_address (metrics : * const aws_s3_request_metrics , out_host_address : * mut * const aws_string) ; } extern "C" { # [doc = " Get the IP address of the request connected to.\n If unavailable, AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE will be raised.\n If available, out_ip_address will be set to a string. Be warned this string's lifetime is tied to the metrics object."] pub fn aws_s3_request_metrics_get_ip_address (metrics : * const aws_s3_request_metrics , out_ip_address : * mut * const aws_string) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_connection_id (metrics : * const aws_s3_request_metrics , out_connection_id : * mut usize) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_thread_id (metrics : * const aws_s3_request_metrics , out_thread_id : * mut aws_thread_id_t) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_request_stream_id (metrics : * const aws_s3_request_metrics , out_stream_id : * mut u32) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_request_type (metrics : * const aws_s3_request_metrics , out_request_type : * mut aws_s3_request_type) ; } extern "C" { pub fn aws_s3_request_metrics_get_error_code (metrics : * const aws_s3_request_metrics) -> :: libc :: c_int ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_endpoints_request_context { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_endpoints_rule_engine { _unused : [u8 ; 0] , } extern "C" { # [doc = " Creates a new S3 endpoint resolver.\n Warning: Before using this header, you have to enable it by\n setting cmake config AWS_ENABLE_S3_ENDPOINT_RESOLVER=ON"] pub fn aws_s3_endpoint_resolver_new (allocator : * mut aws_allocator) -> * mut aws_endpoints_rule_engine ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_endpoints_ruleset { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_partitions_config { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_endpoints_parameter { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_endpoints_resolved_endpoint { _unused : [u8 ; 0] , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_endpoints_parameter_type { AWS_ENDPOINTS_PARAMETER_STRING = 0 , AWS_ENDPOINTS_PARAMETER_BOOLEAN = 1 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_endpoints_resolved_endpoint_type { AWS_ENDPOINTS_RESOLVED_ENDPOINT = 0 , AWS_ENDPOINTS_RESOLVED_ERROR = 1 , } extern "C" { pub fn aws_endpoints_get_supported_ruleset_version () -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_parameter_get_type (parameter : * const aws_endpoints_parameter) -> aws_endpoints_parameter_type ; } extern "C" { pub fn aws_endpoints_parameter_get_built_in (parameter : * const aws_endpoints_parameter) -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_parameter_get_default_string (parameter : * const aws_endpoints_parameter , out_cursor : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_parameter_get_default_boolean (parameter : * const aws_endpoints_parameter , out_bool : * mut * const bool) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_parameter_get_is_required (parameter : * const aws_endpoints_parameter) -> bool ; } extern "C" { pub fn aws_endpoints_parameter_get_documentation (parameter : * const aws_endpoints_parameter) -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_parameters_get_is_deprecated (parameter : * const aws_endpoints_parameter) -> bool ; } extern "C" { pub fn aws_endpoints_parameter_get_deprecated_message (parameter : * const aws_endpoints_parameter) -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_parameter_get_deprecated_since (parameter : * const aws_endpoints_parameter) -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_ruleset_new_from_string (allocator : * mut aws_allocator , ruleset_json : aws_byte_cursor) -> * mut aws_endpoints_ruleset ; } extern "C" { pub fn aws_endpoints_ruleset_acquire (ruleset : * mut aws_endpoints_ruleset) -> * mut aws_endpoints_ruleset ; } extern "C" { pub fn aws_endpoints_ruleset_release (ruleset : * mut aws_endpoints_ruleset) -> * mut aws_endpoints_ruleset ; } extern "C" { pub fn aws_endpoints_ruleset_get_parameters (ruleset : * mut aws_endpoints_ruleset) -> * const aws_hash_table ; } extern "C" { pub fn aws_endpoints_ruleset_get_version (ruleset : * const aws_endpoints_ruleset) -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_ruleset_get_service_id (ruleset : * const aws_endpoints_ruleset) -> aws_byte_cursor ; } extern "C" { # [doc = " Create new rule engine for a given ruleset.\n In cases of failure NULL is returned and last error is set."] pub fn aws_endpoints_rule_engine_new (allocator : * mut aws_allocator , ruleset : * mut aws_endpoints_ruleset , partitions_config : * mut aws_partitions_config) -> * mut aws_endpoints_rule_engine ; } extern "C" { pub fn aws_endpoints_rule_engine_acquire (rule_engine : * mut aws_endpoints_rule_engine) -> * mut aws_endpoints_rule_engine ; } extern "C" { pub fn aws_endpoints_rule_engine_release (rule_engine : * mut aws_endpoints_rule_engine) -> * mut aws_endpoints_rule_engine ; } extern "C" { pub fn aws_endpoints_request_context_new (allocator : * mut aws_allocator) -> * mut aws_endpoints_request_context ; } extern "C" { pub fn aws_endpoints_request_context_acquire (request_context : * mut aws_endpoints_request_context) -> * mut aws_endpoints_request_context ; } extern "C" { pub fn aws_endpoints_request_context_release (request_context : * mut aws_endpoints_request_context) -> * mut aws_endpoints_request_context ; } extern "C" { pub fn aws_endpoints_request_context_add_string (allocator : * mut aws_allocator , context : * mut aws_endpoints_request_context , name : aws_byte_cursor , value : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_request_context_add_boolean (allocator : * mut aws_allocator , context : * mut aws_endpoints_request_context , name : aws_byte_cursor , value : bool) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_rule_engine_resolve (engine : * mut aws_endpoints_rule_engine , context : * const aws_endpoints_request_context , out_resolved_endpoint : * mut * mut aws_endpoints_resolved_endpoint) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_acquire (resolved_endpoint : * mut aws_endpoints_resolved_endpoint) -> * mut aws_endpoints_resolved_endpoint ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_release (resolved_endpoint : * mut aws_endpoints_resolved_endpoint) -> * mut aws_endpoints_resolved_endpoint ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_get_type (resolved_endpoint : * const aws_endpoints_resolved_endpoint) -> aws_endpoints_resolved_endpoint_type ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_get_url (resolved_endpoint : * const aws_endpoints_resolved_endpoint , out_url : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_get_properties (resolved_endpoint : * const aws_endpoints_resolved_endpoint , out_properties : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_get_headers (resolved_endpoint : * const aws_endpoints_resolved_endpoint , out_headers : * mut * const aws_hash_table) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_get_error (resolved_endpoint : * const aws_endpoints_resolved_endpoint , out_error : * mut aws_byte_cursor) -> :: libc :: c_int ; } # [repr (C)] pub struct aws_mutex { pub mutex_handle : pthread_mutex_t , pub initialized : bool , } # [test] fn bindgen_test_layout_aws_mutex () { const UNINIT : :: std :: mem :: MaybeUninit < aws_mutex > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_mutex > () , 48usize , concat ! ("Size of: " , stringify ! (aws_mutex))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_mutex > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_mutex))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . mutex_handle) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_mutex) , "::" , stringify ! (mutex_handle))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initialized) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_mutex) , "::" , stringify ! (initialized))) ; } impl Default for aws_mutex { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Initializes a new platform instance of mutex."] pub fn aws_mutex_init (mutex : * mut aws_mutex) -> :: libc :: c_int ; } extern "C" { # [doc = " Cleans up internal resources."] pub fn aws_mutex_clean_up (mutex : * mut aws_mutex) ; } extern "C" { # [doc = " Blocks until it acquires the lock. While on some platforms such as Windows,\n this may behave as a reentrant mutex, you should not treat it like one. On\n platforms it is possible for it to be non-reentrant, it will be."] pub fn aws_mutex_lock (mutex : * mut aws_mutex) -> :: libc :: c_int ; } extern "C" { # [doc = " Attempts to acquire the lock but returns immediately if it can not.\n While on some platforms such as Windows, this may behave as a reentrant mutex,\n you should not treat it like one. On platforms it is possible for it to be non-reentrant, it will be.\n Note: For windows, minimum support server version is Windows Server 2008 R2 [desktop apps | UWP apps]"] pub fn aws_mutex_try_lock (mutex : * mut aws_mutex) -> :: libc :: c_int ; } extern "C" { # [doc = " Releases the lock."] pub fn aws_mutex_unlock (mutex : * mut aws_mutex) -> :: libc :: c_int ; } # [repr (i32)] # [non_exhaustive] # [doc = " Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n SPDX-License-Identifier: Apache-2.0."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_status_code { AWS_HTTP_STATUS_CODE_UNKNOWN = - 1 , AWS_HTTP_STATUS_CODE_100_CONTINUE = 100 , AWS_HTTP_STATUS_CODE_101_SWITCHING_PROTOCOLS = 101 , AWS_HTTP_STATUS_CODE_102_PROCESSING = 102 , AWS_HTTP_STATUS_CODE_103_EARLY_HINTS = 103 , AWS_HTTP_STATUS_CODE_200_OK = 200 , AWS_HTTP_STATUS_CODE_201_CREATED = 201 , AWS_HTTP_STATUS_CODE_202_ACCEPTED = 202 , AWS_HTTP_STATUS_CODE_203_NON_AUTHORITATIVE_INFORMATION = 203 , AWS_HTTP_STATUS_CODE_204_NO_CONTENT = 204 , AWS_HTTP_STATUS_CODE_205_RESET_CONTENT = 205 , AWS_HTTP_STATUS_CODE_206_PARTIAL_CONTENT = 206 , AWS_HTTP_STATUS_CODE_207_MULTI_STATUS = 207 , AWS_HTTP_STATUS_CODE_208_ALREADY_REPORTED = 208 , AWS_HTTP_STATUS_CODE_226_IM_USED = 226 , AWS_HTTP_STATUS_CODE_300_MULTIPLE_CHOICES = 300 , AWS_HTTP_STATUS_CODE_301_MOVED_PERMANENTLY = 301 , AWS_HTTP_STATUS_CODE_302_FOUND = 302 , AWS_HTTP_STATUS_CODE_303_SEE_OTHER = 303 , AWS_HTTP_STATUS_CODE_304_NOT_MODIFIED = 304 , AWS_HTTP_STATUS_CODE_305_USE_PROXY = 305 , AWS_HTTP_STATUS_CODE_307_TEMPORARY_REDIRECT = 307 , AWS_HTTP_STATUS_CODE_308_PERMANENT_REDIRECT = 308 , AWS_HTTP_STATUS_CODE_400_BAD_REQUEST = 400 , AWS_HTTP_STATUS_CODE_401_UNAUTHORIZED = 401 , AWS_HTTP_STATUS_CODE_402_PAYMENT_REQUIRED = 402 , AWS_HTTP_STATUS_CODE_403_FORBIDDEN = 403 , AWS_HTTP_STATUS_CODE_404_NOT_FOUND = 404 , AWS_HTTP_STATUS_CODE_405_METHOD_NOT_ALLOWED = 405 , AWS_HTTP_STATUS_CODE_406_NOT_ACCEPTABLE = 406 , AWS_HTTP_STATUS_CODE_407_PROXY_AUTHENTICATION_REQUIRED = 407 , AWS_HTTP_STATUS_CODE_408_REQUEST_TIMEOUT = 408 , AWS_HTTP_STATUS_CODE_409_CONFLICT = 409 , AWS_HTTP_STATUS_CODE_410_GONE = 410 , AWS_HTTP_STATUS_CODE_411_LENGTH_REQUIRED = 411 , AWS_HTTP_STATUS_CODE_412_PRECONDITION_FAILED = 412 , AWS_HTTP_STATUS_CODE_413_REQUEST_ENTITY_TOO_LARGE = 413 , AWS_HTTP_STATUS_CODE_414_REQUEST_URI_TOO_LONG = 414 , AWS_HTTP_STATUS_CODE_415_UNSUPPORTED_MEDIA_TYPE = 415 , AWS_HTTP_STATUS_CODE_416_REQUESTED_RANGE_NOT_SATISFIABLE = 416 , AWS_HTTP_STATUS_CODE_417_EXPECTATION_FAILED = 417 , AWS_HTTP_STATUS_CODE_421_MISDIRECTED_REQUEST = 421 , AWS_HTTP_STATUS_CODE_422_UNPROCESSABLE_ENTITY = 422 , AWS_HTTP_STATUS_CODE_423_LOCKED = 423 , AWS_HTTP_STATUS_CODE_424_FAILED_DEPENDENCY = 424 , AWS_HTTP_STATUS_CODE_425_TOO_EARLY = 425 , AWS_HTTP_STATUS_CODE_426_UPGRADE_REQUIRED = 426 , AWS_HTTP_STATUS_CODE_428_PRECONDITION_REQUIRED = 428 , AWS_HTTP_STATUS_CODE_429_TOO_MANY_REQUESTS = 429 , AWS_HTTP_STATUS_CODE_431_REQUEST_HEADER_FIELDS_TOO_LARGE = 431 , AWS_HTTP_STATUS_CODE_451_UNAVAILABLE_FOR_LEGAL_REASON = 451 , AWS_HTTP_STATUS_CODE_500_INTERNAL_SERVER_ERROR = 500 , AWS_HTTP_STATUS_CODE_501_NOT_IMPLEMENTED = 501 , AWS_HTTP_STATUS_CODE_502_BAD_GATEWAY = 502 , AWS_HTTP_STATUS_CODE_503_SERVICE_UNAVAILABLE = 503 , AWS_HTTP_STATUS_CODE_504_GATEWAY_TIMEOUT = 504 , AWS_HTTP_STATUS_CODE_505_HTTP_VERSION_NOT_SUPPORTED = 505 , AWS_HTTP_STATUS_CODE_506_VARIANT_ALSO_NEGOTIATES = 506 , AWS_HTTP_STATUS_CODE_507_INSUFFICIENT_STORAGE = 507 , AWS_HTTP_STATUS_CODE_508_LOOP_DETECTED = 508 , AWS_HTTP_STATUS_CODE_510_NOT_EXTENDED = 510 , AWS_HTTP_STATUS_CODE_511_NETWORK_AUTHENTICATION_REQUIRED = 511 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_config { _unused : [u8 ; 0] , } # [repr (u32)] # [non_exhaustive] # [doc = " @Deprecated - Supported proxy authentication modes. Superceded by proxy strategy."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_proxy_authentication_type { AWS_HPAT_NONE = 0 , AWS_HPAT_BASIC = 1 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_proxy_env_var_type { # [doc = " Default.\n Disable reading from environment variable for proxy."] AWS_HPEV_DISABLE = 0 , # [doc = " Enable get proxy URL from environment variable, when the manual proxy options of connection manager is not set.\n env HTTPS_PROXY/https_proxy will be checked when the main connection use tls.\n env HTTP_PROXY/http_proxy will be checked when the main connection NOT use tls.\n The lower case version has precedence."] AWS_HPEV_ENABLE = 1 , } # [repr (u32)] # [non_exhaustive] # [doc = " Supported proxy connection types"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_proxy_connection_type { # [doc = " Deprecated, but 0-valued for backwards compatibility\n\n If tls options are provided (for the main connection) then treat the proxy as a tunneling proxy\n If tls options are not provided (for the main connection), then treat the proxy as a forwarding proxy"] AWS_HPCT_HTTP_LEGACY = 0 , # [doc = " Use the proxy to forward http requests. Attempting to use both this mode and TLS on the tunnel destination\n is a configuration error."] AWS_HPCT_HTTP_FORWARD = 1 , # [doc = " Use the proxy to establish a connection to a remote endpoint via a CONNECT request through the proxy.\n Works for both plaintext and tls connections."] AWS_HPCT_HTTP_TUNNEL = 2 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct proxy_env_var_settings { pub env_var_type : aws_http_proxy_env_var_type , pub connection_type : aws_http_proxy_connection_type , pub tls_options : * const aws_tls_connection_options , } # [test] fn bindgen_test_layout_proxy_env_var_settings () { const UNINIT : :: std :: mem :: MaybeUninit < proxy_env_var_settings > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < proxy_env_var_settings > () , 16usize , concat ! ("Size of: " , stringify ! (proxy_env_var_settings))) ; assert_eq ! (:: std :: mem :: align_of :: < proxy_env_var_settings > () , 8usize , concat ! ("Alignment of " , stringify ! (proxy_env_var_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . env_var_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (proxy_env_var_settings) , "::" , stringify ! (env_var_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connection_type) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (proxy_env_var_settings) , "::" , stringify ! (connection_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_options) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (proxy_env_var_settings) , "::" , stringify ! (tls_options))) ; } impl Default for proxy_env_var_settings { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Options for http proxy server usage"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_options { # [doc = " Type of proxy connection to make"] pub connection_type : aws_http_proxy_connection_type , # [doc = " Proxy host to connect to"] pub host : aws_byte_cursor , # [doc = " Port to make the proxy connection to"] pub port : u16 , # [doc = " Optional.\n TLS configuration for the Local <-> Proxy connection\n Must be distinct from the the TLS options in the parent aws_http_connection_options struct"] pub tls_options : * const aws_tls_connection_options , # [doc = " Optional\n Advanced option that allows the user to create a custom strategy that gives low-level control of\n certain logical flows within the proxy logic.\n\n For tunneling proxies it allows custom retry and adaptive negotiation of CONNECT requests.\n For forwarding proxies it allows custom request transformations."] pub proxy_strategy : * mut aws_http_proxy_strategy , # [doc = " @Deprecated - What type of proxy authentication to use, if any.\n Replaced by instantiating a proxy_strategy"] pub auth_type : aws_http_proxy_authentication_type , # [doc = " @Deprecated - Optional user name to use for basic authentication\n Replaced by instantiating a proxy_strategy via aws_http_proxy_strategy_new_basic_auth()"] pub auth_username : aws_byte_cursor , # [doc = " @Deprecated - Optional password to use for basic authentication\n Replaced by instantiating a proxy_strategy via aws_http_proxy_strategy_new_basic_auth()"] pub auth_password : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_http_proxy_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_options > () , 88usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connection_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (connection_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_options) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (tls_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_strategy) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (proxy_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . auth_type) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (auth_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . auth_username) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (auth_username))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . auth_password) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (auth_password))) ; } impl Default for aws_http_proxy_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Synchronous (for now) callback function to fetch a token used in modifying CONNECT requests"] pub type aws_http_proxy_negotiation_get_token_sync_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void , out_error_code : * mut :: libc :: c_int) -> * mut aws_string > ; # [doc = " Synchronous (for now) callback function to fetch a token used in modifying CONNECT request. Includes a (byte string)\n context intended to be used as part of a challenge-response flow."] pub type aws_http_proxy_negotiation_get_challenge_token_sync_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void , challenge_context : * const aws_byte_cursor , out_error_code : * mut :: libc :: c_int) -> * mut aws_string > ; # [doc = " Proxy negotiation logic must call this function to indicate an unsuccessful outcome"] pub type aws_http_proxy_negotiation_terminate_fn = :: std :: option :: Option < unsafe extern "C" fn (message : * mut aws_http_message , error_code : :: libc :: c_int , internal_proxy_user_data : * mut :: libc :: c_void) > ; # [doc = " Proxy negotiation logic must call this function to forward the potentially-mutated request back to the proxy\n connection logic."] pub type aws_http_proxy_negotiation_http_request_forward_fn = :: std :: option :: Option < unsafe extern "C" fn (message : * mut aws_http_message , internal_proxy_user_data : * mut :: libc :: c_void) > ; # [doc = " User-supplied transform callback which implements the proxy request flow and ultimately, across all execution\n pathways, invokes either the terminate function or the forward function appropriately.\n\n For tunneling proxy connections, this request flow transform only applies to the CONNECT stage of proxy\n connection establishment.\n\n For forwarding proxy connections, this request flow transform applies to every single http request that goes\n out on the connection.\n\n Forwarding proxy connections cannot yet support a truly async request transform without major surgery on http\n stream creation, so for now, we split into an async version (for tunneling proxies) and a separate\n synchronous version for forwarding proxies. Also forwarding proxies are a kind of legacy dead-end in some\n sense.\n"] pub type aws_http_proxy_negotiation_http_request_transform_async_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator , message : * mut aws_http_message , negotiation_termination_callback : aws_http_proxy_negotiation_terminate_fn , negotiation_http_request_forward_callback : aws_http_proxy_negotiation_http_request_forward_fn , internal_proxy_user_data : * mut :: libc :: c_void) > ; pub type aws_http_proxy_negotiation_http_request_transform_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator , message : * mut aws_http_message) -> :: libc :: c_int > ; # [doc = " Tunneling proxy connections only. A callback that lets the negotiator examine the headers in the\n response to the most recent CONNECT request as they arrive."] pub type aws_http_proxy_negotiation_connect_on_incoming_headers_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator , header_block : aws_http_header_block , header_array : * const aws_http_header , num_headers : usize) -> :: libc :: c_int > ; # [doc = " Tunneling proxy connections only. A callback that lets the negotiator examine the status code of the\n response to the most recent CONNECT request."] pub type aws_http_proxy_negotiator_connect_status_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator , status_code : aws_http_status_code) -> :: libc :: c_int > ; # [doc = " Tunneling proxy connections only. A callback that lets the negotiator examine the body of the response\n to the most recent CONNECT request."] pub type aws_http_proxy_negotiator_connect_on_incoming_body_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator , data : * const aws_byte_cursor) -> :: libc :: c_int > ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_proxy_negotiation_retry_directive { AWS_HPNRD_STOP = 0 , AWS_HPNRD_NEW_CONNECTION = 1 , AWS_HPNRD_CURRENT_CONNECTION = 2 , } pub type aws_http_proxy_negotiator_get_retry_directive_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator) -> aws_http_proxy_negotiation_retry_directive > ; # [doc = " Vtable for forwarding-based proxy negotiators"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http_proxy_negotiator_forwarding_vtable { pub forward_request_transform : aws_http_proxy_negotiation_http_request_transform_fn , } # [test] fn bindgen_test_layout_aws_http_proxy_negotiator_forwarding_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_negotiator_forwarding_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_negotiator_forwarding_vtable > () , 8usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_negotiator_forwarding_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_negotiator_forwarding_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_negotiator_forwarding_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . forward_request_transform) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_forwarding_vtable) , "::" , stringify ! (forward_request_transform))) ; } # [doc = " Vtable for tunneling-based proxy negotiators"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http_proxy_negotiator_tunnelling_vtable { pub connect_request_transform : aws_http_proxy_negotiation_http_request_transform_async_fn , pub on_incoming_headers_callback : aws_http_proxy_negotiation_connect_on_incoming_headers_fn , pub on_status_callback : aws_http_proxy_negotiator_connect_status_fn , pub on_incoming_body_callback : aws_http_proxy_negotiator_connect_on_incoming_body_fn , pub get_retry_directive : aws_http_proxy_negotiator_get_retry_directive_fn , } # [test] fn bindgen_test_layout_aws_http_proxy_negotiator_tunnelling_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_negotiator_tunnelling_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_negotiator_tunnelling_vtable > () , 40usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_negotiator_tunnelling_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connect_request_transform) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable) , "::" , stringify ! (connect_request_transform))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_incoming_headers_callback) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable) , "::" , stringify ! (on_incoming_headers_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_status_callback) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable) , "::" , stringify ! (on_status_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_incoming_body_callback) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable) , "::" , stringify ! (on_incoming_body_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_retry_directive) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable) , "::" , stringify ! (get_retry_directive))) ; } # [repr (C)] # [derive (Copy , Clone)] pub struct aws_http_proxy_negotiator { pub ref_count : aws_ref_count , pub impl_ : * mut :: libc :: c_void , pub strategy_vtable : aws_http_proxy_negotiator__bindgen_ty_1 , } # [repr (C)] # [derive (Copy , Clone)] pub union aws_http_proxy_negotiator__bindgen_ty_1 { pub forwarding_vtable : * mut aws_http_proxy_negotiator_forwarding_vtable , pub tunnelling_vtable : * mut aws_http_proxy_negotiator_tunnelling_vtable , } # [test] fn bindgen_test_layout_aws_http_proxy_negotiator__bindgen_ty_1 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_negotiator__bindgen_ty_1 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_negotiator__bindgen_ty_1 > () , 8usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_negotiator__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_negotiator__bindgen_ty_1 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_negotiator__bindgen_ty_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . forwarding_vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator__bindgen_ty_1) , "::" , stringify ! (forwarding_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tunnelling_vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator__bindgen_ty_1) , "::" , stringify ! (tunnelling_vtable))) ; } impl Default for aws_http_proxy_negotiator__bindgen_ty_1 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [test] fn bindgen_test_layout_aws_http_proxy_negotiator () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_negotiator > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_negotiator > () , 40usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_negotiator))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_negotiator > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_negotiator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . strategy_vtable) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator) , "::" , stringify ! (strategy_vtable))) ; } impl Default for aws_http_proxy_negotiator { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_http_proxy_strategy_create_negotiator_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_strategy : * mut aws_http_proxy_strategy , allocator : * mut aws_allocator) -> * mut aws_http_proxy_negotiator > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http_proxy_strategy_vtable { pub create_negotiator : aws_http_proxy_strategy_create_negotiator_fn , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_vtable > () , 8usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . create_negotiator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_vtable) , "::" , stringify ! (create_negotiator))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy { pub ref_count : aws_ref_count , pub vtable : * mut aws_http_proxy_strategy_vtable , pub impl_ : * mut :: libc :: c_void , pub proxy_connection_type : aws_http_proxy_connection_type , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy > () , 48usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_connection_type) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy) , "::" , stringify ! (proxy_connection_type))) ; } impl Default for aws_http_proxy_strategy { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy_basic_auth_options { pub proxy_connection_type : aws_http_proxy_connection_type , pub user_name : aws_byte_cursor , pub password : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_basic_auth_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_basic_auth_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_basic_auth_options > () , 40usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_basic_auth_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_basic_auth_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_basic_auth_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_connection_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_basic_auth_options) , "::" , stringify ! (proxy_connection_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_name) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_basic_auth_options) , "::" , stringify ! (user_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . password) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_basic_auth_options) , "::" , stringify ! (password))) ; } impl Default for aws_http_proxy_strategy_basic_auth_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy_tunneling_kerberos_options { pub get_token : aws_http_proxy_negotiation_get_token_sync_fn , pub get_token_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_tunneling_kerberos_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_tunneling_kerberos_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_tunneling_kerberos_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_tunneling_kerberos_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_tunneling_kerberos_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_tunneling_kerberos_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_token) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_kerberos_options) , "::" , stringify ! (get_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_token_user_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_kerberos_options) , "::" , stringify ! (get_token_user_data))) ; } impl Default for aws_http_proxy_strategy_tunneling_kerberos_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy_tunneling_ntlm_options { pub get_token : aws_http_proxy_negotiation_get_token_sync_fn , pub get_challenge_token : aws_http_proxy_negotiation_get_challenge_token_sync_fn , pub get_challenge_token_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_tunneling_ntlm_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_tunneling_ntlm_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_tunneling_ntlm_options > () , 24usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_tunneling_ntlm_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_tunneling_ntlm_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_tunneling_ntlm_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_token) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_ntlm_options) , "::" , stringify ! (get_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_challenge_token) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_ntlm_options) , "::" , stringify ! (get_challenge_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_challenge_token_user_data) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_ntlm_options) , "::" , stringify ! (get_challenge_token_user_data))) ; } impl Default for aws_http_proxy_strategy_tunneling_ntlm_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy_tunneling_adaptive_options { pub kerberos_options : * mut aws_http_proxy_strategy_tunneling_kerberos_options , pub ntlm_options : * mut aws_http_proxy_strategy_tunneling_ntlm_options , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_tunneling_adaptive_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_tunneling_adaptive_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_tunneling_adaptive_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_tunneling_adaptive_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_tunneling_adaptive_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_tunneling_adaptive_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . kerberos_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_adaptive_options) , "::" , stringify ! (kerberos_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ntlm_options) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_adaptive_options) , "::" , stringify ! (ntlm_options))) ; } impl Default for aws_http_proxy_strategy_tunneling_adaptive_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy_tunneling_sequence_options { pub strategies : * mut * mut aws_http_proxy_strategy , pub strategy_count : u32 , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_tunneling_sequence_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_tunneling_sequence_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_tunneling_sequence_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_tunneling_sequence_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_tunneling_sequence_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_tunneling_sequence_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . strategies) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_sequence_options) , "::" , stringify ! (strategies))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . strategy_count) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_sequence_options) , "::" , stringify ! (strategy_count))) ; } impl Default for aws_http_proxy_strategy_tunneling_sequence_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Take a reference to an http proxy negotiator\n @param proxy_negotiator negotiator to take a reference to\n @return the strategy"] pub fn aws_http_proxy_negotiator_acquire (proxy_negotiator : * mut aws_http_proxy_negotiator) -> * mut aws_http_proxy_negotiator ; } extern "C" { # [doc = " Release a reference to an http proxy negotiator\n @param proxy_negotiator negotiator to release a reference to"] pub fn aws_http_proxy_negotiator_release (proxy_negotiator : * mut aws_http_proxy_negotiator) ; } extern "C" { # [doc = " Creates a new proxy negotiator from a proxy strategy\n @param allocator memory allocator to use\n @param strategy strategy to creation a new negotiator for\n @return a new proxy negotiator if successful, otherwise NULL"] pub fn aws_http_proxy_strategy_create_negotiator (strategy : * mut aws_http_proxy_strategy , allocator : * mut aws_allocator) -> * mut aws_http_proxy_negotiator ; } extern "C" { # [doc = " Take a reference to an http proxy strategy\n @param proxy_strategy strategy to take a reference to\n @return the strategy"] pub fn aws_http_proxy_strategy_acquire (proxy_strategy : * mut aws_http_proxy_strategy) -> * mut aws_http_proxy_strategy ; } extern "C" { # [doc = " Release a reference to an http proxy strategy\n @param proxy_strategy strategy to release a reference to"] pub fn aws_http_proxy_strategy_release (proxy_strategy : * mut aws_http_proxy_strategy) ; } extern "C" { # [doc = " A constructor for a proxy strategy that performs basic authentication by adding the appropriate\n header and header value to requests or CONNECT requests.\n\n @param allocator memory allocator to use\n @param config basic authentication configuration info\n @return a new proxy strategy if successfully constructed, otherwise NULL"] pub fn aws_http_proxy_strategy_new_basic_auth (allocator : * mut aws_allocator , config : * mut aws_http_proxy_strategy_basic_auth_options) -> * mut aws_http_proxy_strategy ; } extern "C" { # [doc = " Constructor for an adaptive tunneling proxy strategy. This strategy attempts a vanilla CONNECT and if that\n fails it may make followup CONNECT attempts using kerberos or ntlm tokens, based on configuration and proxy\n response properties.\n\n @param allocator memory allocator to use\n @param config configuration options for the strategy\n @return a new proxy strategy if successfully constructed, otherwise NULL"] pub fn aws_http_proxy_strategy_new_tunneling_adaptive (allocator : * mut aws_allocator , config : * mut aws_http_proxy_strategy_tunneling_adaptive_options) -> * mut aws_http_proxy_strategy ; } extern "C" { # [doc = " Create a persistent proxy configuration from http connection options\n @param allocator memory allocator to use\n @param options http connection options to source proxy configuration from\n @return"] pub fn aws_http_proxy_config_new_from_connection_options (allocator : * mut aws_allocator , options : * const aws_http_client_connection_options) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Create a persistent proxy configuration from http connection manager options\n @param allocator memory allocator to use\n @param options http connection manager options to source proxy configuration from\n @return"] pub fn aws_http_proxy_config_new_from_manager_options (allocator : * mut aws_allocator , options : * const aws_http_connection_manager_options) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Create a persistent proxy configuration from non-persistent proxy options. The resulting\n proxy configuration assumes a tunneling connection type.\n\n @param allocator memory allocator to use\n @param options http proxy options to source proxy configuration from\n @return"] pub fn aws_http_proxy_config_new_tunneling_from_proxy_options (allocator : * mut aws_allocator , options : * const aws_http_proxy_options) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Create a persistent proxy configuration from non-persistent proxy options.\n Legacy connection type of proxy options will be rejected.\n\n @param allocator memory allocator to use\n @param options http proxy options to source proxy configuration from\n @return"] pub fn aws_http_proxy_config_new_from_proxy_options (allocator : * mut aws_allocator , options : * const aws_http_proxy_options) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Create a persistent proxy configuration from non-persistent proxy options.\n\n @param allocator memory allocator to use\n @param options http proxy options to source proxy configuration from\n @param is_tls_connection tls connection info of the main connection to determine connection_type\n when the connection_type is legacy.\n @return"] pub fn aws_http_proxy_config_new_from_proxy_options_with_tls_info (allocator : * mut aws_allocator , proxy_options : * const aws_http_proxy_options , is_tls_connection : bool) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Clones an existing proxy configuration. A refactor could remove this (do a \"move\" between the old and new user\n data in the one spot it's used) but that should wait until we have better test cases for the logic where this\n gets invoked (ntlm/kerberos chains).\n\n @param allocator memory allocator to use\n @param proxy_config http proxy configuration to clone\n @return"] pub fn aws_http_proxy_config_new_clone (allocator : * mut aws_allocator , proxy_config : * const aws_http_proxy_config) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Destroys an http proxy configuration\n @param config http proxy configuration to destroy"] pub fn aws_http_proxy_config_destroy (config : * mut aws_http_proxy_config) ; } extern "C" { # [doc = " Initializes non-persistent http proxy options from a persistent http proxy configuration\n @param options http proxy options to initialize\n @param config the http proxy config to use as an initialization source"] pub fn aws_http_proxy_options_init_from_config (options : * mut aws_http_proxy_options , config : * const aws_http_proxy_config) ; } extern "C" { # [doc = " Establish an arbitrary protocol connection through an http proxy via tunneling CONNECT. Alpn is\n not required for this connection process to succeed, but we encourage its use if available.\n\n @param channel_options configuration options for the socket level connection\n @param proxy_options configuration options for the proxy connection\n\n @return AWS_OP_SUCCESS if the asynchronous channel kickoff succeeded, AWS_OP_ERR otherwise"] pub fn aws_http_proxy_new_socket_channel (channel_options : * mut aws_socket_channel_bootstrap_options , proxy_options : * const aws_http_proxy_options) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_connection_finish_code { AWS_S3_CONNECTION_FINISH_CODE_SUCCESS = 0 , AWS_S3_CONNECTION_FINISH_CODE_FAILED = 1 , AWS_S3_CONNECTION_FINISH_CODE_RETRY = 2 , } pub type aws_s3_endpoint_shutdown_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_endpoint_options { pub host_name : * mut aws_string , pub shutdown_callback : aws_s3_endpoint_shutdown_fn , pub client_bootstrap : * mut aws_client_bootstrap , pub tls_connection_options : * const aws_tls_connection_options , pub dns_host_address_ttl_seconds : usize , pub client : * mut aws_s3_client , pub max_connections : u32 , pub port : u16 , # [doc = " Optional.\n Proxy configuration for http connection."] pub proxy_config : * mut aws_http_proxy_config , # [doc = " Optional.\n Configuration for fetching proxy configuration from environment.\n By Default proxy_ev_settings.aws_http_proxy_env_var_type is set to AWS_HPEV_ENABLE which means read proxy\n configuration from environment.\n Only works when proxy_config is not set. If both are set, configuration from proxy_config is used."] pub proxy_ev_settings : * mut proxy_env_var_settings , # [doc = " Optional.\n If set to 0, default value is used."] pub connect_timeout_ms : u32 , # [doc = " Optional.\n Set keepalive to periodically transmit messages for detecting a disconnected peer."] pub tcp_keep_alive_options : * mut aws_s3_tcp_keep_alive_options , # [doc = " Optional.\n Configuration options for connection monitoring.\n If the transfer speed falls below the specified minimum_throughput_bytes_per_second, the operation is aborted."] pub monitoring_options : * mut aws_http_connection_monitoring_options , } # [test] fn bindgen_test_layout_aws_s3_endpoint_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_endpoint_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_endpoint_options > () , 96usize , concat ! ("Size of: " , stringify ! (aws_s3_endpoint_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_endpoint_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_endpoint_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client_bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (client_bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_connection_options) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (tls_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . dns_host_address_ttl_seconds) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (dns_host_address_ttl_seconds))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (client))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_connections) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (max_connections))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 52usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_config) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (proxy_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_settings) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (proxy_ev_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connect_timeout_ms) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (connect_timeout_ms))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tcp_keep_alive_options) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (tcp_keep_alive_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . monitoring_options) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (monitoring_options))) ; } impl Default for aws_s3_endpoint_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_s3_endpoint_system_vtable { pub acquire : :: std :: option :: Option < unsafe extern "C" fn (endpoint : * mut aws_s3_endpoint , already_holding_lock : bool) > , pub release : :: std :: option :: Option < unsafe extern "C" fn (endpoint : * mut aws_s3_endpoint) > , } # [test] fn bindgen_test_layout_aws_s3_endpoint_system_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_endpoint_system_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_endpoint_system_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_s3_endpoint_system_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_endpoint_system_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_endpoint_system_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . acquire) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_system_vtable) , "::" , stringify ! (acquire))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . release) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_system_vtable) , "::" , stringify ! (release))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_endpoint { pub client_synced_data : aws_s3_endpoint__bindgen_ty_1 , pub allocator : * mut aws_allocator , pub host_name : * mut aws_string , pub http_connection_manager : * mut aws_http_connection_manager , pub client : * mut aws_s3_client , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_s3_endpoint__bindgen_ty_1 { pub ref_count : usize , } # [test] fn bindgen_test_layout_aws_s3_endpoint__bindgen_ty_1 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_endpoint__bindgen_ty_1 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_endpoint__bindgen_ty_1 > () , 8usize , concat ! ("Size of: " , stringify ! (aws_s3_endpoint__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_endpoint__bindgen_ty_1 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_endpoint__bindgen_ty_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint__bindgen_ty_1) , "::" , stringify ! (ref_count))) ; } # [test] fn bindgen_test_layout_aws_s3_endpoint () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_endpoint > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_endpoint > () , 40usize , concat ! ("Size of: " , stringify ! (aws_s3_endpoint))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_endpoint > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_endpoint))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client_synced_data) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint) , "::" , stringify ! (client_synced_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http_connection_manager) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint) , "::" , stringify ! (http_connection_manager))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint) , "::" , stringify ! (client))) ; } impl Default for aws_s3_endpoint { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_connection { pub endpoint : * mut aws_s3_endpoint , pub http_connection : * mut aws_http_connection , pub request : * mut aws_s3_request , pub retry_token : * mut aws_retry_token , } # [test] fn bindgen_test_layout_aws_s3_connection () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_connection > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_connection > () , 32usize , concat ! ("Size of: " , stringify ! (aws_s3_connection))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_connection > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_connection))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoint) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_connection) , "::" , stringify ! (endpoint))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http_connection) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_connection) , "::" , stringify ! (http_connection))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . request) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_connection) , "::" , stringify ! (request))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . retry_token) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_connection) , "::" , stringify ! (retry_token))) ; } impl Default for aws_s3_connection { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_s3_client_vtable { pub meta_request_factory : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client , options : * const aws_s3_meta_request_options) -> * mut aws_s3_meta_request > , pub create_connection_for_request : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client , request : * mut aws_s3_request) > , pub acquire_http_connection : :: std :: option :: Option < unsafe extern "C" fn (conn_manager : * mut aws_http_connection_manager , on_connection_acquired_callback : aws_http_connection_manager_on_connection_setup_fn , user_data : * mut :: libc :: c_void) > , pub get_host_address_count : :: std :: option :: Option < unsafe extern "C" fn (host_resolver : * mut aws_host_resolver , host_name : * const aws_string , flags : u32) -> usize > , pub schedule_process_work_synced : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client) > , pub process_work : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client) > , pub endpoint_shutdown_callback : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client) > , pub finish_destroy : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client) > , } # [test] fn bindgen_test_layout_aws_s3_client_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client_vtable > () , 64usize , concat ! ("Size of: " , stringify ! (aws_s3_client_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . meta_request_factory) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (meta_request_factory))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . create_connection_for_request) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (create_connection_for_request))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . acquire_http_connection) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (acquire_http_connection))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_host_address_count) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (get_host_address_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . schedule_process_work_synced) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (schedule_process_work_synced))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_work) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (process_work))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoint_shutdown_callback) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (endpoint_shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . finish_destroy) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (finish_destroy))) ; } # [repr (C)] pub struct aws_s3_client { pub allocator : * mut aws_allocator , pub vtable : * mut aws_s3_client_vtable , pub ref_count : aws_ref_count , pub client_bootstrap : * mut aws_client_bootstrap , pub process_work_event_loop : * mut aws_event_loop , pub body_streaming_elg : * mut aws_event_loop_group , pub region : * mut aws_string , pub part_size : usize , pub max_part_size : u64 , pub multipart_upload_threshold : u64 , pub tls_connection_options : * mut aws_tls_connection_options , pub cached_signing_config : * mut aws_cached_signing_config_aws , pub throughput_target_gbps : f64 , pub ideal_vip_count : u32 , # [doc = " For multi-part upload, content-md5 will be calculated if the AWS_MR_CONTENT_MD5_ENABLED is specified\n or initial request has content-md5 header.\n For single-part upload, if the content-md5 header is specified, it will remain unchanged. If the header is not\n specified, and this is set to AWS_MR_CONTENT_MD5_ENABLED, it will be calculated."] pub compute_content_md5 : aws_s3_meta_request_compute_content_md5 , pub max_active_connections_override : u32 , pub max_allowed_connections : aws_atomic_var , pub retry_strategy : * mut aws_retry_strategy , # [doc = " Optional.\n Proxy configuration for http connection."] pub proxy_config : * mut aws_http_proxy_config , # [doc = " Optional.\n Configuration for fetching proxy configuration from environment.\n By Default proxy_ev_settings.aws_http_proxy_env_var_type is set to AWS_HPEV_ENABLE which means read proxy\n configuration from environment.\n Only works when proxy_config is not set. If both are set, configuration from proxy_config is used."] pub proxy_ev_settings : * mut proxy_env_var_settings , # [doc = " Optional.\n If set to 0, default value is used."] pub connect_timeout_ms : u32 , # [doc = " Optional.\n Set keepalive to periodically transmit messages for detecting a disconnected peer."] pub tcp_keep_alive_options : * mut aws_s3_tcp_keep_alive_options , # [doc = " Configuration options for connection monitoring.\n If the transfer speed falls below the specified minimum_throughput_bytes_per_second, the operation is aborted.\n If user passes in NULL, default values are used."] pub monitoring_options : aws_http_connection_monitoring_options , pub proxy_ev_tls_options : * mut aws_tls_connection_options , pub shutdown_callback : aws_s3_client_shutdown_complete_callback_fn , pub shutdown_callback_user_data : * mut :: libc :: c_void , pub enable_read_backpressure : bool , pub initial_read_window : usize , pub stats : aws_s3_client__bindgen_ty_1 , pub synced_data : aws_s3_client__bindgen_ty_2 , pub threaded_data : aws_s3_client__bindgen_ty_3 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_client__bindgen_ty_1 { pub num_requests_in_flight : aws_atomic_var , pub num_requests_network_io : [aws_atomic_var ; 4usize] , pub num_requests_stream_queued_waiting : aws_atomic_var , pub num_requests_streaming_response : aws_atomic_var , } # [test] fn bindgen_test_layout_aws_s3_client__bindgen_ty_1 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client__bindgen_ty_1 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client__bindgen_ty_1 > () , 56usize , concat ! ("Size of: " , stringify ! (aws_s3_client__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client__bindgen_ty_1 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client__bindgen_ty_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_requests_in_flight) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_1) , "::" , stringify ! (num_requests_in_flight))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_requests_network_io) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_1) , "::" , stringify ! (num_requests_network_io))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_requests_stream_queued_waiting) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_1) , "::" , stringify ! (num_requests_stream_queued_waiting))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_requests_streaming_response) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_1) , "::" , stringify ! (num_requests_streaming_response))) ; } impl Default for aws_s3_client__bindgen_ty_1 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] pub struct aws_s3_client__bindgen_ty_2 { pub lock : aws_mutex , pub endpoints : aws_hash_table , pub num_failed_prepare_requests : u32 , pub pending_meta_request_work : aws_linked_list , pub prepared_requests : aws_linked_list , pub process_work_task : aws_task , pub num_endpoints_allocated : u32 , pub _bitfield_align_1 : [u8 ; 0] , pub _bitfield_1 : __BindgenBitfieldUnit < [u8 ; 1usize] > , pub __bindgen_padding_0 : [u8 ; 3usize] , } # [test] fn bindgen_test_layout_aws_s3_client__bindgen_ty_2 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client__bindgen_ty_2 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client__bindgen_ty_2 > () , 200usize , concat ! ("Size of: " , stringify ! (aws_s3_client__bindgen_ty_2))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client__bindgen_ty_2 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client__bindgen_ty_2))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . lock) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (lock))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoints) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (endpoints))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_failed_prepare_requests) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (num_failed_prepare_requests))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . pending_meta_request_work) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (pending_meta_request_work))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . prepared_requests) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (prepared_requests))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_work_task) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (process_work_task))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_endpoints_allocated) as usize - ptr as usize } , 192usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (num_endpoints_allocated))) ; } impl Default for aws_s3_client__bindgen_ty_2 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } impl aws_s3_client__bindgen_ty_2 { # [inline] pub fn active (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (0usize , 1u8) as u32) } } # [inline] pub fn set_active (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (0usize , 1u8 , val as u64) } } # [inline] pub fn start_destroy_executing (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (1usize , 1u8) as u32) } } # [inline] pub fn set_start_destroy_executing (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (1usize , 1u8 , val as u64) } } # [inline] pub fn process_work_task_scheduled (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (2usize , 1u8) as u32) } } # [inline] pub fn set_process_work_task_scheduled (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (2usize , 1u8 , val as u64) } } # [inline] pub fn process_work_task_in_progress (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (3usize , 1u8) as u32) } } # [inline] pub fn set_process_work_task_in_progress (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (3usize , 1u8 , val as u64) } } # [inline] pub fn body_streaming_elg_allocated (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (4usize , 1u8) as u32) } } # [inline] pub fn set_body_streaming_elg_allocated (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (4usize , 1u8 , val as u64) } } # [inline] pub fn finish_destroy (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (5usize , 1u8) as u32) } } # [inline] pub fn set_finish_destroy (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (5usize , 1u8 , val as u64) } } # [inline] pub fn new_bitfield_1 (active : u32 , start_destroy_executing : u32 , process_work_task_scheduled : u32 , process_work_task_in_progress : u32 , body_streaming_elg_allocated : u32 , finish_destroy : u32) -> __BindgenBitfieldUnit < [u8 ; 1usize] > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [u8 ; 1usize] > = Default :: default () ; __bindgen_bitfield_unit . set (0usize , 1u8 , { let active : u32 = unsafe { :: std :: mem :: transmute (active) } ; active as u64 }) ; __bindgen_bitfield_unit . set (1usize , 1u8 , { let start_destroy_executing : u32 = unsafe { :: std :: mem :: transmute (start_destroy_executing) } ; start_destroy_executing as u64 }) ; __bindgen_bitfield_unit . set (2usize , 1u8 , { let process_work_task_scheduled : u32 = unsafe { :: std :: mem :: transmute (process_work_task_scheduled) } ; process_work_task_scheduled as u64 }) ; __bindgen_bitfield_unit . set (3usize , 1u8 , { let process_work_task_in_progress : u32 = unsafe { :: std :: mem :: transmute (process_work_task_in_progress) } ; process_work_task_in_progress as u64 }) ; __bindgen_bitfield_unit . set (4usize , 1u8 , { let body_streaming_elg_allocated : u32 = unsafe { :: std :: mem :: transmute (body_streaming_elg_allocated) } ; body_streaming_elg_allocated as u64 }) ; __bindgen_bitfield_unit . set (5usize , 1u8 , { let finish_destroy : u32 = unsafe { :: std :: mem :: transmute (finish_destroy) } ; finish_destroy as u64 }) ; __bindgen_bitfield_unit } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_client__bindgen_ty_3 { pub request_queue : aws_linked_list , pub meta_requests : aws_linked_list , pub request_queue_size : u32 , pub num_requests_being_prepared : u32 , } # [test] fn bindgen_test_layout_aws_s3_client__bindgen_ty_3 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client__bindgen_ty_3 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client__bindgen_ty_3 > () , 72usize , concat ! ("Size of: " , stringify ! (aws_s3_client__bindgen_ty_3))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client__bindgen_ty_3 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client__bindgen_ty_3))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . request_queue) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_3) , "::" , stringify ! (request_queue))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . meta_requests) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_3) , "::" , stringify ! (meta_requests))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . request_queue_size) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_3) , "::" , stringify ! (request_queue_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_requests_being_prepared) as usize - ptr as usize } , 68usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_3) , "::" , stringify ! (num_requests_being_prepared))) ; } impl Default for aws_s3_client__bindgen_ty_3 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [test] fn bindgen_test_layout_aws_s3_client () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client > () , 584usize , concat ! ("Size of: " , stringify ! (aws_s3_client))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client_bootstrap) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (client_bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_work_event_loop) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (process_work_event_loop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . body_streaming_elg) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (body_streaming_elg))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . region) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (region))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_size) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_part_size) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (max_part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . multipart_upload_threshold) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (multipart_upload_threshold))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_connection_options) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (tls_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cached_signing_config) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (cached_signing_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . throughput_target_gbps) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (throughput_target_gbps))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ideal_vip_count) as usize - ptr as usize } , 120usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (ideal_vip_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . compute_content_md5) as usize - ptr as usize } , 124usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (compute_content_md5))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_active_connections_override) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (max_active_connections_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_allowed_connections) as usize - ptr as usize } , 136usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (max_allowed_connections))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . retry_strategy) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (retry_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_config) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (proxy_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_settings) as usize - ptr as usize } , 160usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (proxy_ev_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connect_timeout_ms) as usize - ptr as usize } , 168usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (connect_timeout_ms))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tcp_keep_alive_options) as usize - ptr as usize } , 176usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (tcp_keep_alive_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . monitoring_options) as usize - ptr as usize } , 184usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (monitoring_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_tls_options) as usize - ptr as usize } , 216usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (proxy_ev_tls_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 224usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback_user_data) as usize - ptr as usize } , 232usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (shutdown_callback_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_backpressure) as usize - ptr as usize } , 240usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (enable_read_backpressure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_read_window) as usize - ptr as usize } , 248usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (initial_read_window))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . stats) as usize - ptr as usize } , 256usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (stats))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . synced_data) as usize - ptr as usize } , 312usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (synced_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . threaded_data) as usize - ptr as usize } , 512usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (threaded_data))) ; } impl Default for aws_s3_client { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_meta_request_resume_token { pub allocator : * mut aws_allocator , pub ref_count : aws_ref_count , pub type_ : aws_s3_meta_request_type , pub multipart_upload_id : * mut aws_string , pub part_size : usize , pub total_num_parts : usize , pub num_parts_completed : usize , } # [test] fn bindgen_test_layout_aws_s3_meta_request_resume_token () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_meta_request_resume_token > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_meta_request_resume_token > () , 72usize , concat ! ("Size of: " , stringify ! (aws_s3_meta_request_resume_token))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_meta_request_resume_token > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_meta_request_resume_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . type_) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (type_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . multipart_upload_id) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (multipart_upload_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_size) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . total_num_parts) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (total_num_parts))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_parts_completed) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (num_parts_completed))) ; } impl Default for aws_s3_meta_request_resume_token { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_s3_client_notify_connection_finished (client : * mut aws_s3_client , connection : * mut aws_s3_connection , error_code : :: libc :: c_int , finish_code : aws_s3_connection_finish_code) ; } extern "C" { pub fn aws_s3_meta_request_resume_token_new (allocator : * mut aws_allocator) -> * mut aws_s3_meta_request_resume_token ; } extern "C" { pub fn aws_s3_set_dns_ttl (ttl : usize) ; } extern "C" { pub fn aws_s3_client_get_max_requests_prepare (client : * mut aws_s3_client) -> u32 ; } extern "C" { pub fn aws_s3_client_get_max_active_connections (client : * mut aws_s3_client , meta_request : * mut aws_s3_meta_request) -> u32 ; } extern "C" { pub fn aws_s3_client_get_max_requests_in_flight (client : * mut aws_s3_client) -> u32 ; } extern "C" { pub fn aws_s3_client_queue_requests_threaded (client : * mut aws_s3_client , request_list : * mut aws_linked_list , queue_front : bool) -> u32 ; } extern "C" { pub fn aws_s3_client_dequeue_request_threaded (client : * mut aws_s3_client) -> * mut aws_s3_request ; } extern "C" { pub fn aws_s3_client_schedule_process_work (client : * mut aws_s3_client) ; } extern "C" { pub fn aws_s3_client_update_meta_requests_threaded (client : * mut aws_s3_client) ; } extern "C" { pub fn aws_s3_client_update_connections_threaded (client : * mut aws_s3_client) ; } extern "C" { pub fn aws_s3_endpoint_new (allocator : * mut aws_allocator , options : * const aws_s3_endpoint_options) -> * mut aws_s3_endpoint ; } extern "C" { pub fn aws_s3_client_lock_synced_data (client : * mut aws_s3_client) ; } extern "C" { pub fn aws_s3_client_unlock_synced_data (client : * mut aws_s3_client) ; } extern "C" { pub fn aws_s3_endpoint_set_system_vtable (vtable : * const aws_s3_endpoint_system_vtable) ; } extern "C" { pub fn aws_s3_endpoint_acquire (endpoint : * mut aws_s3_endpoint , already_holding_lock : bool) -> * mut aws_s3_endpoint ; } extern "C" { pub fn aws_s3_endpoint_release (endpoint : * mut aws_s3_endpoint) ; } extern "C" { pub static g_max_num_connections_per_vip : u32 ; } extern "C" { pub static g_num_conns_per_vip_meta_request_look_up : [u32 ; 0usize] ; } pub type __builtin_va_list = [__va_list_tag ; 1usize] ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct __va_list_tag { pub gp_offset : :: libc :: c_uint , pub fp_offset : :: libc :: c_uint , pub overflow_arg_area : * mut :: libc :: c_void , pub reg_save_area : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout___va_list_tag () { const UNINIT : :: std :: mem :: MaybeUninit < __va_list_tag > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < __va_list_tag > () , 24usize , concat ! ("Size of: " , stringify ! (__va_list_tag))) ; assert_eq ! (:: std :: mem :: align_of :: < __va_list_tag > () , 8usize , concat ! ("Alignment of " , stringify ! (__va_list_tag))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . gp_offset) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (__va_list_tag) , "::" , stringify ! (gp_offset))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . fp_offset) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (__va_list_tag) , "::" , stringify ! (fp_offset))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . overflow_arg_area) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (__va_list_tag) , "::" , stringify ! (overflow_arg_area))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . reg_save_area) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (__va_list_tag) , "::" , stringify ! (reg_save_area))) ; } impl Default for __va_list_tag { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " (Optional)\n Use a cached merged profile collection. A merge collection has both config file\n (~/.aws/config) and credentials file based profile collection (~/.aws/credentials) using\n `aws_profile_collection_new_from_merge`.\n If this option is provided, `config_file_name_override` and `credentials_file_name_override` will be ignored."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_profile_collection { pub _address : u8 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_tls_ctx { pub _address : u8 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_cached_signing_config_aws { pub _address : u8 , } [INFO] [stdout] | + + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: 2 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished dev [unoptimized + debuginfo] target(s) in 39.95s [INFO] running `Command { std: "docker" "inspect" "7b9bb256e3777efdfee0d1844f9b29631ae32c5c186b611d68b9872ffc4e8f53", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "7b9bb256e3777efdfee0d1844f9b29631ae32c5c186b611d68b9872ffc4e8f53", kill_on_drop: false }` [INFO] [stdout] 7b9bb256e3777efdfee0d1844f9b29631ae32c5c186b611d68b9872ffc4e8f53 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc1/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=warn" "-e" "RUSTDOCFLAGS=--cap-lints=warn" "-e" "RUSTC_BOOTSTRAP=1" "-e" "DOCS_RS=1" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:023092b8bfa974c7f3e45c5ce651cc8dd3afd5e76915d5995b8dacd3032bf956" "/opt/rustwide/cargo-home/bin/cargo" "+1.73.0" "rustdoc" "--lib" "-Zrustdoc-map" "-Z" "unstable-options" "--config" "build.rustdocflags=[\"-Z\", \"unstable-options\", \"--document-private-items\"]" "--frozen" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 053e2a17a5d0694629a4481c58c2cec92cb32142699f5b8bcd0a135731e5e27d [INFO] running `Command { std: "docker" "start" "-a" "053e2a17a5d0694629a4481c58c2cec92cb32142699f5b8bcd0a135731e5e27d", kill_on_drop: false }` [INFO] [stderr] Documenting mountpoint-s3-crt-sys v0.3.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unclosed HTML tag `void` [INFO] [stdout] --> /opt/rustwide/target/debug/build/mountpoint-s3-crt-sys-f5c1badc4e97417b/out/bindings.rs:5:353503 [INFO] [stdout] | [INFO] [stdout] 5 | ...s_future_void { _unused : [u8 ; 0] , } extern "C" { # [doc = " aws_future"] pub fn aws_future_void_new (alloc : * mut aws_alloca... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(rustdoc::invalid_html_tags)]` on by default [INFO] [stdout] help: try marking as source code [INFO] [stdout] | [INFO] [stdout] 5 | # [repr (C)] # [derive (Copy , Clone , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd)] pub struct __BindgenBitfieldUnit < Storage > { storage : Storage , } impl < Storage > __BindgenBitfieldUnit < Storage > { # [inline] pub const fn new (storage : Storage) -> Self { Self { storage } } } impl < Storage > __BindgenBitfieldUnit < Storage > where Storage : AsRef < [u8] > + AsMut < [u8] >, { # [inline] pub fn get_bit (& self , index : usize) -> bool { debug_assert ! (index / 8 < self . storage . as_ref () . len ()) ; let byte_index = index / 8 ; let byte = self . storage . as_ref () [byte_index] ; let bit_index = if cfg ! (target_endian = "big") { 7 - (index % 8) } else { index % 8 } ; let mask = 1 << bit_index ; byte & mask == mask } # [inline] pub fn set_bit (& mut self , index : usize , val : bool) { debug_assert ! (index / 8 < self . storage . as_ref () . len ()) ; let byte_index = index / 8 ; let byte = & mut self . storage . as_mut () [byte_index] ; let bit_index = if cfg ! (target_endian = "big") { 7 - (index % 8) } else { index % 8 } ; let mask = 1 << bit_index ; if val { * byte |= mask ; } else { * byte &= ! mask ; } } # [inline] pub fn get (& self , bit_offset : usize , bit_width : u8) -> u64 { debug_assert ! (bit_width <= 64) ; debug_assert ! (bit_offset / 8 < self . storage . as_ref () . len ()) ; debug_assert ! ((bit_offset + (bit_width as usize)) / 8 <= self . storage . as_ref () . len ()) ; let mut val = 0 ; for i in 0 .. (bit_width as usize) { if self . get_bit (i + bit_offset) { let index = if cfg ! (target_endian = "big") { bit_width as usize - 1 - i } else { i } ; val |= 1 << index ; } } val } # [inline] pub fn set (& mut self , bit_offset : usize , bit_width : u8 , val : u64) { debug_assert ! (bit_width <= 64) ; debug_assert ! (bit_offset / 8 < self . storage . as_ref () . len ()) ; debug_assert ! ((bit_offset + (bit_width as usize)) / 8 <= self . storage . as_ref () . len ()) ; for i in 0 .. (bit_width as usize) { let mask = 1 << i ; let val_bit_is_set = val & mask == mask ; let index = if cfg ! (target_endian = "big") { bit_width as usize - 1 - i } else { i } ; self . set_bit (index + bit_offset , val_bit_is_set) ; } } } pub const PRInSTR : & [u8 ; 5] = b"%.*s\0" ; pub const AWS_PACKAGE_SLOTS : i32 = 16 ; pub const AWS_C_COMMON_PACKAGE_ID : i32 = 0 ; pub const AWS_OP_SUCCESS : i32 = 0 ; pub const AWS_OP_ERR : i32 = - 1 ; pub const AWS_ERROR_ENUM_STRIDE_BITS : i32 = 10 ; pub const AWS_ERROR_ENUM_STRIDE : i32 = 1024 ; pub const SIZE_BITS : i32 = 64 ; pub const AWS_C_IO_PACKAGE_ID : i32 = 1 ; pub const AWS_THREAD_NAME_RECOMMENDED_STRLEN : i32 = 15 ; pub const AWS_THREAD_ONCE_STATIC_INIT : i32 = 0 ; pub const AWS_LOG_LEVEL_NONE : i32 = 0 ; pub const AWS_LOG_LEVEL_FATAL : i32 = 1 ; pub const AWS_LOG_LEVEL_ERROR : i32 = 2 ; pub const AWS_LOG_LEVEL_WARN : i32 = 3 ; pub const AWS_LOG_LEVEL_INFO : i32 = 4 ; pub const AWS_LOG_LEVEL_DEBUG : i32 = 5 ; pub const AWS_LOG_LEVEL_TRACE : i32 = 6 ; pub const AWS_C_SDKUTILS_PACKAGE_ID : i32 = 15 ; pub const AWS_C_AUTH_PACKAGE_ID : i32 = 6 ; pub const AWS_C_HTTP_PACKAGE_ID : i32 = 2 ; pub const AWS_HTTP2_DEFAULT_MAX_CLOSED_STREAMS : i32 = 32 ; pub const AWS_HTTP2_PING_DATA_SIZE : i32 = 8 ; pub const AWS_HTTP2_SETTINGS_COUNT : i32 = 6 ; pub const AWS_C_S3_PACKAGE_ID : i32 = 14 ; pub const AWS_S3_CLIENT_VERSION : & [u8 ; 6] = b"0.1.x\0" ; pub const AWS_CACHE_LINE : _bindgen_ty_18 = _bindgen_ty_18 :: AWS_CACHE_LINE ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_18 { AWS_CACHE_LINE = 64 , } pub type va_list = __builtin_va_list ; pub type __gnuc_va_list = __builtin_va_list ; extern "C" { pub fn aws_fatal_assert (cond_str : * const :: libc :: c_char , file : * const :: libc :: c_char , line : :: libc :: c_int) -> ! ; } pub type pthread_once_t = :: libc :: c_int ; # [doc = " @deprecated Use int64_t instead for offsets in public APIs."] pub type aws_off_t = i64 ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_allocator { pub mem_acquire : :: std :: option :: Option < unsafe extern "C" fn (allocator : * mut aws_allocator , size : usize) -> * mut :: libc :: c_void > , pub mem_release : :: std :: option :: Option < unsafe extern "C" fn (allocator : * mut aws_allocator , ptr : * mut :: libc :: c_void) > , pub mem_realloc : :: std :: option :: Option < unsafe extern "C" fn (allocator : * mut aws_allocator , oldptr : * mut :: libc :: c_void , oldsize : usize , newsize : usize) -> * mut :: libc :: c_void > , pub mem_calloc : :: std :: option :: Option < unsafe extern "C" fn (allocator : * mut aws_allocator , num : usize , size : usize) -> * mut :: libc :: c_void > , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_allocator () { const UNINIT : :: std :: mem :: MaybeUninit < aws_allocator > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_allocator > () , 40usize , concat ! ("Size of: " , stringify ! (aws_allocator))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_allocator > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . mem_acquire) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_allocator) , "::" , stringify ! (mem_acquire))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . mem_release) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_allocator) , "::" , stringify ! (mem_release))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . mem_realloc) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_allocator) , "::" , stringify ! (mem_realloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . mem_calloc) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_allocator) , "::" , stringify ! (mem_calloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_allocator) , "::" , stringify ! (impl_))) ; } impl Default for aws_allocator { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Inexpensive (constant time) check of data-structure invariants."] pub fn aws_allocator_is_valid (alloc : * const aws_allocator) -> bool ; } extern "C" { pub fn aws_default_allocator () -> * mut aws_allocator ; } extern "C" { # [doc = " Returns at least `size` of memory ready for usage. In versions v0.6.8 and prior, this function was allowed to return\n NULL. In later versions, if allocator->mem_acquire() returns NULL, this function will assert and exit. To handle\n conditions where OOM is not a fatal error, allocator->mem_acquire() is responsible for finding/reclaiming/running a\n GC etc...before returning."] pub fn aws_mem_acquire (allocator : * mut aws_allocator , size : usize) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Allocates a block of memory for an array of num elements, each of them size bytes long, and initializes all its bits\n to zero. In versions v0.6.8 and prior, this function was allowed to return NULL.\n In later versions, if allocator->mem_calloc() returns NULL, this function will assert and exit. To handle\n conditions where OOM is not a fatal error, allocator->mem_calloc() is responsible for finding/reclaiming/running a\n GC etc...before returning."] pub fn aws_mem_calloc (allocator : * mut aws_allocator , num : usize , size : usize) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Allocates many chunks of bytes into a single block. Expects to be called with alternating void ** (dest), size_t\n (size). The first void ** will be set to the root of the allocation. Alignment is assumed to be sizeof(intmax_t).\n\n This is useful for allocating structs using the pimpl pattern, as you may allocate the public object and impl object\n in the same contiguous block of memory.\n\n Returns a pointer to the allocation.\n\n In versions v0.6.8 and prior, this function was allowed to return\n NULL. In later versions, if allocator->mem_acquire() returns NULL, this function will assert and exit. To handle\n conditions where OOM is not a fatal error, allocator->mem_acquire() is responsible for finding/reclaiming/running a\n GC etc...before returning."] pub fn aws_mem_acquire_many (allocator : * mut aws_allocator , count : usize , ...) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Releases ptr back to whatever allocated it.\n Nothing happens if ptr is NULL."] pub fn aws_mem_release (allocator : * mut aws_allocator , ptr : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Attempts to adjust the size of the pointed-to memory buffer from oldsize to\n newsize. The pointer (*ptr) may be changed if the memory needs to be\n reallocated.\n\n In versions v0.6.8 and prior, this function was allowed to return\n NULL. In later versions, if allocator->mem_realloc() returns NULL, this function will assert and exit. To handle\n conditions where OOM is not a fatal error, allocator->mem_realloc() is responsible for finding/reclaiming/running a\n GC etc...before returning."] pub fn aws_mem_realloc (allocator : * mut aws_allocator , ptr : * mut * mut :: libc :: c_void , oldsize : usize , newsize : usize) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_mem_trace_level { AWS_MEMTRACE_NONE = 0 , AWS_MEMTRACE_BYTES = 1 , AWS_MEMTRACE_STACKS = 2 , } extern "C" { pub fn aws_mem_tracer_new (allocator : * mut aws_allocator , deprecated : * mut aws_allocator , level : aws_mem_trace_level , frames_per_stack : usize) -> * mut aws_allocator ; } extern "C" { pub fn aws_mem_tracer_destroy (trace_allocator : * mut aws_allocator) -> * mut aws_allocator ; } extern "C" { pub fn aws_mem_tracer_dump (trace_allocator : * mut aws_allocator) ; } extern "C" { pub fn aws_mem_tracer_bytes (trace_allocator : * mut aws_allocator) -> usize ; } extern "C" { pub fn aws_mem_tracer_count (trace_allocator : * mut aws_allocator) -> usize ; } extern "C" { pub fn aws_small_block_allocator_new (allocator : * mut aws_allocator , multi_threaded : bool) -> * mut aws_allocator ; } extern "C" { pub fn aws_small_block_allocator_destroy (sba_allocator : * mut aws_allocator) ; } extern "C" { pub fn aws_small_block_allocator_bytes_active (sba_allocator : * mut aws_allocator) -> usize ; } extern "C" { pub fn aws_small_block_allocator_bytes_reserved (sba_allocator : * mut aws_allocator) -> usize ; } extern "C" { pub fn aws_small_block_allocator_page_size (sba_allocator : * mut aws_allocator) -> usize ; } extern "C" { pub fn aws_small_block_allocator_page_size_available (sba_allocator : * mut aws_allocator) -> usize ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_error_info { pub error_code : :: libc :: c_int , pub literal_name : * const :: libc :: c_char , pub error_str : * const :: libc :: c_char , pub lib_name : * const :: libc :: c_char , pub formatted_name : * const :: libc :: c_char , } # [test] fn bindgen_test_layout_aws_error_info () { const UNINIT : :: std :: mem :: MaybeUninit < aws_error_info > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_error_info > () , 40usize , concat ! ("Size of: " , stringify ! (aws_error_info))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_error_info > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_error_info))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_code) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_error_info) , "::" , stringify ! (error_code))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . literal_name) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_error_info) , "::" , stringify ! (literal_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_str) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_error_info) , "::" , stringify ! (error_str))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . lib_name) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_error_info) , "::" , stringify ! (lib_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . formatted_name) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_error_info) , "::" , stringify ! (formatted_name))) ; } impl Default for aws_error_info { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_error_info_list { pub error_list : * const aws_error_info , pub count : u16 , } # [test] fn bindgen_test_layout_aws_error_info_list () { const UNINIT : :: std :: mem :: MaybeUninit < aws_error_info_list > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_error_info_list > () , 16usize , concat ! ("Size of: " , stringify ! (aws_error_info_list))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_error_info_list > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_error_info_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_list) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_error_info_list) , "::" , stringify ! (error_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . count) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_error_info_list) , "::" , stringify ! (count))) ; } impl Default for aws_error_info_list { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_error_handler_fn = :: std :: option :: Option < unsafe extern "C" fn (err : :: libc :: c_int , ctx : * mut :: libc :: c_void) > ; extern "C" { pub fn aws_last_error () -> :: libc :: c_int ; } extern "C" { pub fn aws_error_str (err : :: libc :: c_int) -> * const :: libc :: c_char ; } extern "C" { pub fn aws_error_name (err : :: libc :: c_int) -> * const :: libc :: c_char ; } extern "C" { pub fn aws_error_lib_name (err : :: libc :: c_int) -> * const :: libc :: c_char ; } extern "C" { pub fn aws_error_debug_str (err : :: libc :: c_int) -> * const :: libc :: c_char ; } extern "C" { pub fn aws_raise_error_private (err : :: libc :: c_int) ; } extern "C" { pub fn aws_raise_error (err : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { pub fn aws_reset_error () ; } extern "C" { pub fn aws_restore_error (err : :: libc :: c_int) ; } extern "C" { pub fn aws_set_global_error_handler_fn (handler : aws_error_handler_fn , ctx : * mut :: libc :: c_void) -> aws_error_handler_fn ; } extern "C" { pub fn aws_set_thread_local_error_handler_fn (handler : aws_error_handler_fn , ctx : * mut :: libc :: c_void) -> aws_error_handler_fn ; } extern "C" { # [doc = " TODO: this needs to be a private function (wait till we have the cmake story\n better before moving it though). It should be external for the purpose of\n other libs we own, but customers should not be able to hit it without going\n out of their way to do so."] pub fn aws_register_error_info (error_info : * const aws_error_info_list) ; } extern "C" { pub fn aws_unregister_error_info (error_info : * const aws_error_info_list) ; } extern "C" { # [doc = " Convert a c library io error into an aws error, and raise it.\n If no conversion is found, AWS_ERROR_SYS_CALL_FAILURE is raised.\n Always returns AWS_OP_ERR."] pub fn aws_translate_and_raise_io_error (error_no : :: libc :: c_int) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_common_error { AWS_ERROR_SUCCESS = 0 , AWS_ERROR_OOM = 1 , AWS_ERROR_NO_SPACE = 2 , AWS_ERROR_UNKNOWN = 3 , AWS_ERROR_SHORT_BUFFER = 4 , AWS_ERROR_OVERFLOW_DETECTED = 5 , AWS_ERROR_UNSUPPORTED_OPERATION = 6 , AWS_ERROR_INVALID_BUFFER_SIZE = 7 , AWS_ERROR_INVALID_HEX_STR = 8 , AWS_ERROR_INVALID_BASE64_STR = 9 , AWS_ERROR_INVALID_INDEX = 10 , AWS_ERROR_THREAD_INVALID_SETTINGS = 11 , AWS_ERROR_THREAD_INSUFFICIENT_RESOURCE = 12 , AWS_ERROR_THREAD_NO_PERMISSIONS = 13 , AWS_ERROR_THREAD_NOT_JOINABLE = 14 , AWS_ERROR_THREAD_NO_SUCH_THREAD_ID = 15 , AWS_ERROR_THREAD_DEADLOCK_DETECTED = 16 , AWS_ERROR_MUTEX_NOT_INIT = 17 , AWS_ERROR_MUTEX_TIMEOUT = 18 , AWS_ERROR_MUTEX_CALLER_NOT_OWNER = 19 , AWS_ERROR_MUTEX_FAILED = 20 , AWS_ERROR_COND_VARIABLE_INIT_FAILED = 21 , AWS_ERROR_COND_VARIABLE_TIMED_OUT = 22 , AWS_ERROR_COND_VARIABLE_ERROR_UNKNOWN = 23 , AWS_ERROR_CLOCK_FAILURE = 24 , AWS_ERROR_LIST_EMPTY = 25 , AWS_ERROR_DEST_COPY_TOO_SMALL = 26 , AWS_ERROR_LIST_EXCEEDS_MAX_SIZE = 27 , AWS_ERROR_LIST_STATIC_MODE_CANT_SHRINK = 28 , AWS_ERROR_PRIORITY_QUEUE_FULL = 29 , AWS_ERROR_PRIORITY_QUEUE_EMPTY = 30 , AWS_ERROR_PRIORITY_QUEUE_BAD_NODE = 31 , AWS_ERROR_HASHTBL_ITEM_NOT_FOUND = 32 , AWS_ERROR_INVALID_DATE_STR = 33 , AWS_ERROR_INVALID_ARGUMENT = 34 , AWS_ERROR_RANDOM_GEN_FAILED = 35 , AWS_ERROR_MALFORMED_INPUT_STRING = 36 , AWS_ERROR_UNIMPLEMENTED = 37 , AWS_ERROR_INVALID_STATE = 38 , AWS_ERROR_ENVIRONMENT_GET = 39 , AWS_ERROR_ENVIRONMENT_SET = 40 , AWS_ERROR_ENVIRONMENT_UNSET = 41 , AWS_ERROR_STREAM_UNSEEKABLE = 42 , AWS_ERROR_NO_PERMISSION = 43 , AWS_ERROR_FILE_INVALID_PATH = 44 , AWS_ERROR_MAX_FDS_EXCEEDED = 45 , AWS_ERROR_SYS_CALL_FAILURE = 46 , AWS_ERROR_C_STRING_BUFFER_NOT_NULL_TERMINATED = 47 , AWS_ERROR_STRING_MATCH_NOT_FOUND = 48 , AWS_ERROR_DIVIDE_BY_ZERO = 49 , AWS_ERROR_INVALID_FILE_HANDLE = 50 , AWS_ERROR_OPERATION_INTERUPTED = 51 , AWS_ERROR_DIRECTORY_NOT_EMPTY = 52 , AWS_ERROR_PLATFORM_NOT_SUPPORTED = 53 , AWS_ERROR_INVALID_UTF8 = 54 , AWS_ERROR_GET_HOME_DIRECTORY_FAILED = 55 , AWS_ERROR_INVALID_XML = 56 , AWS_ERROR_END_COMMON_RANGE = 1023 , } extern "C" { # [doc = " Returns whether each byte is zero."] pub fn aws_is_mem_zeroed (buf : * const :: libc :: c_void , bufsize : usize) -> bool ; } extern "C" { # [doc = " Securely zeroes a memory buffer. This function will attempt to ensure that\n the compiler will not optimize away this zeroing operation."] pub fn aws_secure_zero (pBuf : * mut :: libc :: c_void , bufsize : usize) ; } extern "C" { # [doc = " Initializes internal data structures used by aws-c-common.\n Must be called before using any functionality in aws-c-common."] pub fn aws_common_library_init (allocator : * mut aws_allocator) ; } extern "C" { # [doc = " Shuts down the internal data structures used by aws-c-common."] pub fn aws_common_library_clean_up () ; } extern "C" { pub fn aws_common_fatal_assert_library_initialized () ; } extern "C" { # [doc = " Multiplies a * b. If the result overflows, returns 2^64 - 1."] pub fn aws_mul_u64_saturating (a : u64 , b : u64) -> u64 ; } extern "C" { # [doc = " If a * b overflows, returns AWS_OP_ERR; otherwise multiplies\n a * b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_mul_u64_checked (a : u64 , b : u64 , r : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Multiplies a * b. If the result overflows, returns 2^32 - 1."] pub fn aws_mul_u32_saturating (a : u32 , b : u32) -> u32 ; } extern "C" { # [doc = " If a * b overflows, returns AWS_OP_ERR; otherwise multiplies\n a * b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_mul_u32_checked (a : u32 , b : u32 , r : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Adds a + b. If the result overflows returns 2^64 - 1."] pub fn aws_add_u64_saturating (a : u64 , b : u64) -> u64 ; } extern "C" { # [doc = " If a + b overflows, returns AWS_OP_ERR; otherwise adds\n a + b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_add_u64_checked (a : u64 , b : u64 , r : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Adds a + b. If the result overflows returns 2^32 - 1."] pub fn aws_add_u32_saturating (a : u32 , b : u32) -> u32 ; } extern "C" { # [doc = " If a + b overflows, returns AWS_OP_ERR; otherwise adds\n a + b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_add_u32_checked (a : u32 , b : u32 , r : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Subtracts a - b. If the result overflows returns 0."] pub fn aws_sub_u64_saturating (a : u64 , b : u64) -> u64 ; } extern "C" { # [doc = " If a - b overflows, returns AWS_OP_ERR; otherwise subtracts\n a - b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_sub_u64_checked (a : u64 , b : u64 , r : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Subtracts a - b. If the result overflows returns 0."] pub fn aws_sub_u32_saturating (a : u32 , b : u32) -> u32 ; } extern "C" { # [doc = " If a - b overflows, returns AWS_OP_ERR; otherwise subtracts\n a - b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_sub_u32_checked (a : u32 , b : u32 , r : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Multiplies a * b. If the result overflows, returns SIZE_MAX."] pub fn aws_mul_size_saturating (a : usize , b : usize) -> usize ; } extern "C" { # [doc = " Multiplies a * b and returns the result in *r. If the result\n overflows, returns AWS_OP_ERR; otherwise returns AWS_OP_SUCCESS."] pub fn aws_mul_size_checked (a : usize , b : usize , r : * mut usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Adds a + b. If the result overflows returns SIZE_MAX."] pub fn aws_add_size_saturating (a : usize , b : usize) -> usize ; } extern "C" { # [doc = " Adds a + b and returns the result in *r. If the result\n overflows, returns AWS_OP_ERR; otherwise returns AWS_OP_SUCCESS."] pub fn aws_add_size_checked (a : usize , b : usize , r : * mut usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Adds [num] arguments (expected to be of size_t), and returns the result in *r.\n If the result overflows, returns AWS_OP_ERR; otherwise returns AWS_OP_SUCCESS."] pub fn aws_add_size_checked_varargs (num : usize , r : * mut usize , ...) -> :: libc :: c_int ; } extern "C" { # [doc = " Subtracts a - b. If the result overflows returns 0."] pub fn aws_sub_size_saturating (a : usize , b : usize) -> usize ; } extern "C" { # [doc = " If a - b overflows, returns AWS_OP_ERR; otherwise subtracts\n a - b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_sub_size_checked (a : usize , b : usize , r : * mut usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Function to check if x is power of 2"] pub fn aws_is_power_of_two (x : usize) -> bool ; } extern "C" { # [doc = " Function to find the smallest result that is power of 2 >= n. Returns AWS_OP_ERR if this cannot\n be done without overflow"] pub fn aws_round_up_to_power_of_two (n : usize , result : * mut usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Counts the number of leading 0 bits in an integer. 0 will return the size of the integer in bits."] pub fn aws_clz_u32 (n : u32) -> usize ; } extern "C" { pub fn aws_clz_i32 (n : i32) -> usize ; } extern "C" { pub fn aws_clz_u64 (n : u64) -> usize ; } extern "C" { pub fn aws_clz_i64 (n : i64) -> usize ; } extern "C" { pub fn aws_clz_size (n : usize) -> usize ; } extern "C" { # [doc = " Counts the number of trailing 0 bits in an integer. 0 will return the size of the integer in bits."] pub fn aws_ctz_u32 (n : u32) -> usize ; } extern "C" { pub fn aws_ctz_i32 (n : i32) -> usize ; } extern "C" { pub fn aws_ctz_u64 (n : u64) -> usize ; } extern "C" { pub fn aws_ctz_i64 (n : i64) -> usize ; } extern "C" { pub fn aws_ctz_size (n : usize) -> usize ; } extern "C" { pub fn aws_min_u8 (a : u8 , b : u8) -> u8 ; } extern "C" { pub fn aws_max_u8 (a : u8 , b : u8) -> u8 ; } extern "C" { pub fn aws_min_i8 (a : i8 , b : i8) -> i8 ; } extern "C" { pub fn aws_max_i8 (a : i8 , b : i8) -> i8 ; } extern "C" { pub fn aws_min_u16 (a : u16 , b : u16) -> u16 ; } extern "C" { pub fn aws_max_u16 (a : u16 , b : u16) -> u16 ; } extern "C" { pub fn aws_min_i16 (a : i16 , b : i16) -> i16 ; } extern "C" { pub fn aws_max_i16 (a : i16 , b : i16) -> i16 ; } extern "C" { pub fn aws_min_u32 (a : u32 , b : u32) -> u32 ; } extern "C" { pub fn aws_max_u32 (a : u32 , b : u32) -> u32 ; } extern "C" { pub fn aws_min_i32 (a : i32 , b : i32) -> i32 ; } extern "C" { pub fn aws_max_i32 (a : i32 , b : i32) -> i32 ; } extern "C" { pub fn aws_min_u64 (a : u64 , b : u64) -> u64 ; } extern "C" { pub fn aws_max_u64 (a : u64 , b : u64) -> u64 ; } extern "C" { pub fn aws_min_i64 (a : i64 , b : i64) -> i64 ; } extern "C" { pub fn aws_max_i64 (a : i64 , b : i64) -> i64 ; } extern "C" { pub fn aws_min_size (a : usize , b : usize) -> usize ; } extern "C" { pub fn aws_max_size (a : usize , b : usize) -> usize ; } extern "C" { pub fn aws_min_int (a : :: libc :: c_int , b : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { pub fn aws_max_int (a : :: libc :: c_int , b : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { pub fn aws_min_float (a : f32 , b : f32) -> f32 ; } extern "C" { pub fn aws_max_float (a : f32 , b : f32) -> f32 ; } extern "C" { pub fn aws_min_double (a : f64 , b : f64) -> f64 ; } extern "C" { pub fn aws_max_double (a : f64 , b : f64) -> f64 ; } pub const AWS_ARRAY_LIST_DEBUG_FILL : _bindgen_ty_19 = _bindgen_ty_19 :: AWS_ARRAY_LIST_DEBUG_FILL ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_19 { AWS_ARRAY_LIST_DEBUG_FILL = 221 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_array_list { pub alloc : * mut aws_allocator , pub current_size : usize , pub length : usize , pub item_size : usize , pub data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_array_list () { const UNINIT : :: std :: mem :: MaybeUninit < aws_array_list > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_array_list > () , 40usize , concat ! ("Size of: " , stringify ! (aws_array_list))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_array_list > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_array_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_array_list) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . current_size) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_array_list) , "::" , stringify ! (current_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . length) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_array_list) , "::" , stringify ! (length))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . item_size) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_array_list) , "::" , stringify ! (item_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . data) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_array_list) , "::" , stringify ! (data))) ; } impl Default for aws_array_list { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Prototype for a comparator function for sorting elements.\n\n a and b should be cast to pointers to the element type held in the list\n before being dereferenced. The function should compare the elements and\n return a positive number if a > b, zero if a = b, and a negative number\n if a < b."] pub type aws_array_list_comparator_fn = :: std :: option :: Option < unsafe extern "C" fn (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> :: libc :: c_int > ; extern "C" { # [doc = " Initializes an array list with an array of size initial_item_allocation * item_size. In this mode, the array size\n will grow by a factor of 2 upon insertion if space is not available. initial_item_allocation is the number of\n elements you want space allocated for. item_size is the size of each element in bytes. Mixing items types is not\n supported by this API."] pub fn aws_array_list_init_dynamic (list : * mut aws_array_list , alloc : * mut aws_allocator , initial_item_allocation : usize , item_size : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Initializes an array list with a preallocated array of void *. item_count is the number of elements in the array,\n and item_size is the size in bytes of each element. Mixing items types is not supported\n by this API. Once this list is full, new items will be rejected."] pub fn aws_array_list_init_static (list : * mut aws_array_list , raw_array : * mut :: libc :: c_void , item_count : usize , item_size : usize) ; } extern "C" { # [doc = " Initializes an array list with a preallocated array of *already-initialized* elements. item_count is the number of\n elements in the array, and item_size is the size in bytes of each element.\n\n Once initialized, nothing further can be added to the list, since it will be full and cannot resize.\n\n Primary use case is to treat an already-initialized C array as an array list."] pub fn aws_array_list_init_static_from_initialized (list : * mut aws_array_list , raw_array : * mut :: libc :: c_void , item_count : usize , item_size : usize) ; } extern "C" { # [doc = " Set of properties of a valid aws_array_list."] pub fn aws_array_list_is_valid (list : * const aws_array_list) -> bool ; } extern "C" { # [doc = " Deallocates any memory that was allocated for this list, and resets list for reuse or deletion."] pub fn aws_array_list_clean_up (list : * mut aws_array_list) ; } extern "C" { # [doc = " Erases and then deallocates any memory that was allocated for this list, and resets list for reuse or deletion."] pub fn aws_array_list_clean_up_secure (list : * mut aws_array_list) ; } extern "C" { # [doc = " Pushes the memory pointed to by val onto the end of internal list"] pub fn aws_array_list_push_back (list : * mut aws_array_list , val : * const :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the element at the front of the list if it exists. If list is empty, AWS_ERROR_LIST_EMPTY will be raised"] pub fn aws_array_list_front (list : * const aws_array_list , val : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Pushes the memory pointed to by val onto the front of internal list.\n This call results in shifting all of the elements in the list. Avoid this call unless that\n is intended behavior."] pub fn aws_array_list_push_front (list : * mut aws_array_list , val : * const :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Deletes the element at the front of the list if it exists. If list is empty, AWS_ERROR_LIST_EMPTY will be raised.\n This call results in shifting all of the elements at the end of the array to the front. Avoid this call unless that\n is intended behavior."] pub fn aws_array_list_pop_front (list : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Delete N elements from the front of the list.\n Remaining elements are shifted to the front of the list.\n If the list has less than N elements, the list is cleared.\n This call is more efficient than calling aws_array_list_pop_front() N times."] pub fn aws_array_list_pop_front_n (list : * mut aws_array_list , n : usize) ; } extern "C" { # [doc = " Deletes the element this index in the list if it exists.\n If element does not exist, AWS_ERROR_INVALID_INDEX will be raised.\n This call results in shifting all remaining elements towards the front.\n Avoid this call unless that is intended behavior."] pub fn aws_array_list_erase (list : * mut aws_array_list , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the element at the end of the list if it exists. If list is empty, AWS_ERROR_LIST_EMPTY will be raised."] pub fn aws_array_list_back (list : * const aws_array_list , val : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Deletes the element at the end of the list if it exists. If list is empty, AWS_ERROR_LIST_EMPTY will be raised."] pub fn aws_array_list_pop_back (list : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Clears all elements in the array and resets length to zero. Size does not change in this operation."] pub fn aws_array_list_clear (list : * mut aws_array_list) ; } extern "C" { # [doc = " If in dynamic mode, shrinks the allocated array size to the minimum amount necessary to store its elements."] pub fn aws_array_list_shrink_to_fit (list : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the elements from from to to. If to is in static mode, it must at least be the same length as from. Any data\n in to will be overwritten in this copy."] pub fn aws_array_list_copy (from : * const aws_array_list , to : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Swap contents between two dynamic lists. Both lists must use the same allocator."] pub fn aws_array_list_swap_contents (list_a : * mut aws_array_list , list_b : * mut aws_array_list) ; } extern "C" { # [doc = " Returns the number of elements that can fit in the internal array. If list is initialized in dynamic mode,\n the capacity changes over time."] pub fn aws_array_list_capacity (list : * const aws_array_list) -> usize ; } extern "C" { # [doc = " Returns the number of elements in the internal array."] pub fn aws_array_list_length (list : * const aws_array_list) -> usize ; } extern "C" { # [doc = " Copies the memory at index to val. If element does not exist, AWS_ERROR_INVALID_INDEX will be raised."] pub fn aws_array_list_get_at (list : * const aws_array_list , val : * mut :: libc :: c_void , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the memory address of the element at index to *val. If element does not exist, AWS_ERROR_INVALID_INDEX will be\n raised."] pub fn aws_array_list_get_at_ptr (list : * const aws_array_list , val : * mut * mut :: libc :: c_void , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Ensures that the array list has enough capacity to store a value at the specified index. If there is not already\n enough capacity, and the list is in dynamic mode, this function will attempt to allocate more memory, expanding the\n list. In static mode, if 'index' is beyond the maximum index, AWS_ERROR_INVALID_INDEX will be raised."] pub fn aws_array_list_ensure_capacity (list : * mut aws_array_list , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the the memory pointed to by val into the array at index. If in dynamic mode, the size will grow by a factor\n of two when the array is full. In static mode, AWS_ERROR_INVALID_INDEX will be raised if the index is past the bounds\n of the array."] pub fn aws_array_list_set_at (list : * mut aws_array_list , val : * const :: libc :: c_void , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Swap elements at the specified indices, which must be within the bounds of the array."] pub fn aws_array_list_swap (list : * mut aws_array_list , a : usize , b : usize) ; } extern "C" { # [doc = " Sort elements in the list in-place according to the comparator function."] pub fn aws_array_list_sort (list : * mut aws_array_list , compare_fn : aws_array_list_comparator_fn) ; } extern "C" { # [doc = " Returns 1 if machine is big endian, 0 if little endian.\n If you compile with even -O1 optimization, this check is completely optimized\n out at compile time and code which calls \"if (aws_is_big_endian())\" will do\n the right thing without branching."] pub fn aws_is_big_endian () -> :: libc :: c_int ; } extern "C" { # [doc = " Convert 64 bit integer from host to network byte order."] pub fn aws_hton64 (x : u64) -> u64 ; } extern "C" { # [doc = " Convert 64 bit integer from network to host byte order."] pub fn aws_ntoh64 (x : u64) -> u64 ; } extern "C" { # [doc = " Convert 32 bit integer from host to network byte order."] pub fn aws_hton32 (x : u32) -> u32 ; } extern "C" { # [doc = " Convert 32 bit float from host to network byte order."] pub fn aws_htonf32 (x : f32) -> f32 ; } extern "C" { # [doc = " Convert 64 bit double from host to network byte order."] pub fn aws_htonf64 (x : f64) -> f64 ; } extern "C" { # [doc = " Convert 32 bit integer from network to host byte order."] pub fn aws_ntoh32 (x : u32) -> u32 ; } extern "C" { # [doc = " Convert 32 bit float from network to host byte order."] pub fn aws_ntohf32 (x : f32) -> f32 ; } extern "C" { # [doc = " Convert 32 bit float from network to host byte order."] pub fn aws_ntohf64 (x : f64) -> f64 ; } extern "C" { # [doc = " Convert 16 bit integer from host to network byte order."] pub fn aws_hton16 (x : u16) -> u16 ; } extern "C" { # [doc = " Convert 16 bit integer from network to host byte order."] pub fn aws_ntoh16 (x : u16) -> u16 ; } # [doc = " Represents a length-delimited binary string or buffer. If byte buffer points\n to constant memory or memory that should otherwise not be freed by this\n struct, set allocator to NULL and free function will be a no-op.\n\n This structure used to define the output for all functions that write to a buffer.\n\n Note that this structure allocates memory at the buffer pointer only. The\n struct itself does not get dynamically allocated and must be either\n maintained or copied to avoid losing access to the memory."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_byte_buf { pub len : usize , pub buffer : * mut u8 , pub capacity : usize , pub allocator : * mut aws_allocator , } # [test] fn bindgen_test_layout_aws_byte_buf () { const UNINIT : :: std :: mem :: MaybeUninit < aws_byte_buf > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_byte_buf > () , 32usize , concat ! ("Size of: " , stringify ! (aws_byte_buf))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_byte_buf > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_byte_buf))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . len) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_byte_buf) , "::" , stringify ! (len))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . buffer) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_byte_buf) , "::" , stringify ! (buffer))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . capacity) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_byte_buf) , "::" , stringify ! (capacity))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_byte_buf) , "::" , stringify ! (allocator))) ; } impl Default for aws_byte_buf { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Represents a movable pointer within a larger binary string or buffer.\n\n This structure is used to define buffers for reading."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_byte_cursor { pub len : usize , pub ptr : * mut u8 , } # [test] fn bindgen_test_layout_aws_byte_cursor () { const UNINIT : :: std :: mem :: MaybeUninit < aws_byte_cursor > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_byte_cursor > () , 16usize , concat ! ("Size of: " , stringify ! (aws_byte_cursor))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_byte_cursor > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_byte_cursor))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . len) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_byte_cursor) , "::" , stringify ! (len))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ptr) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_byte_cursor) , "::" , stringify ! (ptr))) ; } impl Default for aws_byte_cursor { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Signature for function argument to trim APIs"] pub type aws_byte_predicate_fn = :: std :: option :: Option < unsafe extern "C" fn (value : u8) -> bool > ; extern "C" { # [doc = " Compare two arrays.\n Return whether their contents are equivalent.\n NULL may be passed as the array pointer if its length is declared to be 0."] pub fn aws_array_eq (array_a : * const :: libc :: c_void , len_a : usize , array_b : * const :: libc :: c_void , len_b : usize) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of two arrays.\n Return whether their contents are equivalent.\n NULL may be passed as the array pointer if its length is declared to be 0.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_array_eq_ignore_case (array_a : * const :: libc :: c_void , len_a : usize , array_b : * const :: libc :: c_void , len_b : usize) -> bool ; } extern "C" { # [doc = " Compare an array and a null-terminated string.\n Returns true if their contents are equivalent.\n The array should NOT contain a null-terminator, or the comparison will always return false.\n NULL may be passed as the array pointer if its length is declared to be 0."] pub fn aws_array_eq_c_str (array : * const :: libc :: c_void , array_len : usize , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of an array and a null-terminated string.\n Return whether their contents are equivalent.\n The array should NOT contain a null-terminator, or the comparison will always return false.\n NULL may be passed as the array pointer if its length is declared to be 0.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_array_eq_c_str_ignore_case (array : * const :: libc :: c_void , array_len : usize , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { pub fn aws_byte_buf_init (buf : * mut aws_byte_buf , allocator : * mut aws_allocator , capacity : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Initializes an aws_byte_buf structure base on another valid one.\n Requires: *src and *allocator are valid objects.\n Ensures: *dest is a valid aws_byte_buf with a new backing array dest->buffer\n which is a copy of the elements from src->buffer."] pub fn aws_byte_buf_init_copy (dest : * mut aws_byte_buf , allocator : * mut aws_allocator , src : * const aws_byte_buf) -> :: libc :: c_int ; } extern "C" { # [doc = " Reads 'filename' into 'out_buf'. If successful, 'out_buf' is allocated and filled with the data;\n It is your responsibility to call 'aws_byte_buf_clean_up()' on it. Otherwise, 'out_buf' remains\n unused. In the very unfortunate case where some API needs to treat out_buf as a c_string, a null terminator\n is appended, but is not included as part of the length field."] pub fn aws_byte_buf_init_from_file (out_buf : * mut aws_byte_buf , alloc : * mut aws_allocator , filename : * const :: libc :: c_char) -> :: libc :: c_int ; } extern "C" { # [doc = " Evaluates the set of properties that define the shape of all valid aws_byte_buf structures.\n It is also a cheap check, in the sense it run in constant time (i.e., no loops or recursion)."] pub fn aws_byte_buf_is_valid (buf : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Evaluates the set of properties that define the shape of all valid aws_byte_cursor structures.\n It is also a cheap check, in the sense it runs in constant time (i.e., no loops or recursion)."] pub fn aws_byte_cursor_is_valid (cursor : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Copies src buffer into dest and sets the correct len and capacity.\n A new memory zone is allocated for dest->buffer. When dest is no longer needed it will have to be cleaned-up using\n aws_byte_buf_clean_up(dest).\n Dest capacity and len will be equal to the src len. Allocator of the dest will be identical with parameter allocator.\n If src buffer is null the dest will have a null buffer with a len and a capacity of 0\n Returns AWS_OP_SUCCESS in case of success or AWS_OP_ERR when memory can't be allocated."] pub fn aws_byte_buf_init_copy_from_cursor (dest : * mut aws_byte_buf , allocator : * mut aws_allocator , src : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Init buffer with contents of multiple cursors, and update cursors to reference the memory stored in the buffer.\n Each cursor arg must be an `struct aws_byte_cursor *`. NULL must be passed as the final arg.\n NOTE: Do not append/grow/resize buffers initialized this way, or the cursors will end up referencing invalid memory.\n Returns AWS_OP_SUCCESS in case of success.\n AWS_OP_ERR is returned if memory can't be allocated or the total cursor length exceeds SIZE_MAX."] pub fn aws_byte_buf_init_cache_and_update_cursors (dest : * mut aws_byte_buf , allocator : * mut aws_allocator , ...) -> :: libc :: c_int ; } extern "C" { pub fn aws_byte_buf_clean_up (buf : * mut aws_byte_buf) ; } extern "C" { # [doc = " Equivalent to calling aws_byte_buf_secure_zero and then aws_byte_buf_clean_up\n on the buffer."] pub fn aws_byte_buf_clean_up_secure (buf : * mut aws_byte_buf) ; } extern "C" { # [doc = " Resets the len of the buffer to 0, but does not free the memory. The buffer can then be reused.\n Optionally zeroes the contents, if the \"zero_contents\" flag is true."] pub fn aws_byte_buf_reset (buf : * mut aws_byte_buf , zero_contents : bool) ; } extern "C" { # [doc = " Sets all bytes of buffer to zero and resets len to zero."] pub fn aws_byte_buf_secure_zero (buf : * mut aws_byte_buf) ; } extern "C" { # [doc = " Compare two aws_byte_buf structures.\n Return whether their contents are equivalent."] pub fn aws_byte_buf_eq (a : * const aws_byte_buf , b : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of two aws_byte_buf structures.\n Return whether their contents are equivalent.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_buf_eq_ignore_case (a : * const aws_byte_buf , b : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Compare an aws_byte_buf and a null-terminated string.\n Returns true if their contents are equivalent.\n The buffer should NOT contain a null-terminator, or the comparison will always return false."] pub fn aws_byte_buf_eq_c_str (buf : * const aws_byte_buf , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of an aws_byte_buf and a null-terminated string.\n Return whether their contents are equivalent.\n The buffer should NOT contain a null-terminator, or the comparison will always return false.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_buf_eq_c_str_ignore_case (buf : * const aws_byte_buf , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " No copies, no buffer allocations. Iterates over input_str, and returns the\n next substring between split_on instances relative to previous substr.\n Behaves similar to strtok with substr being used as state for next split.\n\n Returns true each time substr is set and false when there is no more splits\n (substr is set to empty in that case).\n\n Example usage.\n struct aws_byte_cursor substr = {0};\n while (aws_byte_cursor_next_split(&input_str, ';', &substr)) {\n // ...use substr...\n }\n\n Note: It is the user's responsibility zero-initialize substr before the first call.\n\n Edge case rules are as follows:\n empty input will have single empty split. ex. \"\" splits into \"\"\n if input starts with split_on then first split is empty. ex \";A\" splits into \"\", \"A\"\n adjacent split tokens result in empty split. ex \"A;;B\" splits into \"A\", \"\", \"B\"\n If the input ends with split_on, last split is empty. ex. \"A;\" splits into \"A\", \"\"\n\n It is the user's responsibility to make sure the input buffer stays in memory\n long enough to use the results."] pub fn aws_byte_cursor_next_split (input_str : * const aws_byte_cursor , split_on : :: libc :: c_char , substr : * mut aws_byte_cursor) -> bool ; } extern "C" { # [doc = " No copies, no buffer allocations. Fills in output with a list of\n aws_byte_cursor instances where buffer is an offset into the input_str and\n len is the length of that string in the original buffer.\n\n Edge case rules are as follows:\n if the input begins with split_on, an empty cursor will be the first entry in\n output. if the input has two adjacent split_on tokens, an empty cursor will\n be inserted into the output. if the input ends with split_on, an empty cursor\n will be appended to the output.\n\n It is the user's responsibility to properly initialize output. Recommended number of preallocated elements from\n output is your most likely guess for the upper bound of the number of elements resulting from the split.\n\n The type that will be stored in output is struct aws_byte_cursor (you'll need\n this for the item size param).\n\n It is the user's responsibility to make sure the input buffer stays in memory\n long enough to use the results."] pub fn aws_byte_cursor_split_on_char (input_str : * const aws_byte_cursor , split_on : :: libc :: c_char , output : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " No copies, no buffer allocations. Fills in output with a list of aws_byte_cursor instances where buffer is\n an offset into the input_str and len is the length of that string in the original buffer. N is the max number of\n splits, if this value is zero, it will add all splits to the output.\n\n Edge case rules are as follows:\n if the input begins with split_on, an empty cursor will be the first entry in output\n if the input has two adjacent split_on tokens, an empty cursor will be inserted into the output.\n if the input ends with split_on, an empty cursor will be appended to the output.\n\n It is the user's responsibility to properly initialize output. Recommended number of preallocated elements from\n output is your most likely guess for the upper bound of the number of elements resulting from the split.\n\n If the output array is not large enough, input_str will be updated to point to the first character after the last\n processed split_on instance.\n\n The type that will be stored in output is struct aws_byte_cursor (you'll need this for the item size param).\n\n It is the user's responsibility to make sure the input buffer stays in memory long enough to use the results."] pub fn aws_byte_cursor_split_on_char_n (input_str : * const aws_byte_cursor , split_on : :: libc :: c_char , n : usize , output : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Search for an exact byte match inside a cursor. The first match will be returned. Returns AWS_OP_SUCCESS\n on successful match and first_find will be set to the offset in input_str, and length will be the remaining length\n from input_str past the returned offset. If the match was not found, AWS_OP_ERR will be returned and\n AWS_ERROR_STRING_MATCH_NOT_FOUND will be raised."] pub fn aws_byte_cursor_find_exact (input_str : * const aws_byte_cursor , to_find : * const aws_byte_cursor , first_find : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Shrinks a byte cursor from the right for as long as the supplied predicate is true"] pub fn aws_byte_cursor_right_trim_pred (source : * const aws_byte_cursor , predicate : aws_byte_predicate_fn) -> aws_byte_cursor ; } extern "C" { # [doc = " Shrinks a byte cursor from the left for as long as the supplied predicate is true"] pub fn aws_byte_cursor_left_trim_pred (source : * const aws_byte_cursor , predicate : aws_byte_predicate_fn) -> aws_byte_cursor ; } extern "C" { # [doc = " Shrinks a byte cursor from both sides for as long as the supplied predicate is true"] pub fn aws_byte_cursor_trim_pred (source : * const aws_byte_cursor , predicate : aws_byte_predicate_fn) -> aws_byte_cursor ; } extern "C" { # [doc = " Returns true if the byte cursor's range of bytes all satisfy the predicate"] pub fn aws_byte_cursor_satisfies_pred (source : * const aws_byte_cursor , predicate : aws_byte_predicate_fn) -> bool ; } extern "C" { # [doc = " Copies from to to. If to is too small, AWS_ERROR_DEST_COPY_TOO_SMALL will be\n returned. dest->len will contain the amount of data actually copied to dest.\n\n from and to may be the same buffer, permitting copying a buffer into itself."] pub fn aws_byte_buf_append (to : * mut aws_byte_buf , from : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies from to to while converting bytes via the passed in lookup table.\n If to is too small, AWS_ERROR_DEST_COPY_TOO_SMALL will be\n returned. to->len will contain its original size plus the amount of data actually copied to to.\n\n from and to should not be the same buffer (overlap is not handled)\n lookup_table must be at least 256 bytes"] pub fn aws_byte_buf_append_with_lookup (to : * mut aws_byte_buf , from : * const aws_byte_cursor , lookup_table : * const u8) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies from to to. If to is too small, the buffer will be grown appropriately and\n the old contents copied to, before the new contents are appended.\n\n If the grow fails (overflow or OOM), then an error will be returned.\n\n from and to may be the same buffer, permitting copying a buffer into itself."] pub fn aws_byte_buf_append_dynamic (to : * mut aws_byte_buf , from : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies `from` to `to`. If `to` is too small, the buffer will be grown appropriately and\n the old contents copied over, before the new contents are appended.\n\n If the grow fails (overflow or OOM), then an error will be returned.\n\n If the buffer is grown, the old buffer will be securely cleared before getting freed.\n\n `from` and `to` may be the same buffer, permitting copying a buffer into itself."] pub fn aws_byte_buf_append_dynamic_secure (to : * mut aws_byte_buf , from : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies a single byte into `to`. If `to` is too small, the buffer will be grown appropriately and\n the old contents copied over, before the byte is appended.\n\n If the grow fails (overflow or OOM), then an error will be returned."] pub fn aws_byte_buf_append_byte_dynamic (buffer : * mut aws_byte_buf , value : u8) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies a single byte into `to`. If `to` is too small, the buffer will be grown appropriately and\n the old contents copied over, before the byte is appended.\n\n If the grow fails (overflow or OOM), then an error will be returned.\n\n If the buffer is grown, the old buffer will be securely cleared before getting freed."] pub fn aws_byte_buf_append_byte_dynamic_secure (buffer : * mut aws_byte_buf , value : u8) -> :: libc :: c_int ; } extern "C" { # [doc = " Copy contents of cursor to buffer, then update cursor to reference the memory stored in the buffer.\n If buffer is too small, AWS_ERROR_DEST_COPY_TOO_SMALL will be returned.\n\n The cursor is permitted to reference memory from earlier in the buffer."] pub fn aws_byte_buf_append_and_update (to : * mut aws_byte_buf , from_and_update : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Appends '\\0' at the end of the buffer."] pub fn aws_byte_buf_append_null_terminator (buf : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { # [doc = " Attempts to increase the capacity of a buffer to the requested capacity\n\n If the the buffer's capacity is currently larger than the request capacity, the\n function does nothing (no shrink is performed)."] pub fn aws_byte_buf_reserve (buffer : * mut aws_byte_buf , requested_capacity : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Convenience function that attempts to increase the capacity of a buffer relative to the current\n length.\n\n aws_byte_buf_reserve_relative(buf, x) ~~ aws_byte_buf_reserve(buf, buf->len + x)\n"] pub fn aws_byte_buf_reserve_relative (buffer : * mut aws_byte_buf , additional_length : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Concatenates a variable number of struct aws_byte_buf * into destination.\n Number of args must be greater than 1. If dest is too small,\n AWS_ERROR_DEST_COPY_TOO_SMALL will be returned. dest->len will contain the\n amount of data actually copied to dest."] pub fn aws_byte_buf_cat (dest : * mut aws_byte_buf , number_of_args : usize , ...) -> :: libc :: c_int ; } extern "C" { # [doc = " Compare two aws_byte_cursor structures.\n Return whether their contents are equivalent."] pub fn aws_byte_cursor_eq (a : * const aws_byte_cursor , b : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of two aws_byte_cursor structures.\n Return whether their contents are equivalent.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_cursor_eq_ignore_case (a : * const aws_byte_cursor , b : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Compare an aws_byte_cursor and an aws_byte_buf.\n Return whether their contents are equivalent."] pub fn aws_byte_cursor_eq_byte_buf (a : * const aws_byte_cursor , b : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of an aws_byte_cursor and an aws_byte_buf.\n Return whether their contents are equivalent.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_cursor_eq_byte_buf_ignore_case (a : * const aws_byte_cursor , b : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Compare an aws_byte_cursor and a null-terminated string.\n Returns true if their contents are equivalent.\n The cursor should NOT contain a null-terminator, or the comparison will always return false."] pub fn aws_byte_cursor_eq_c_str (cursor : * const aws_byte_cursor , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of an aws_byte_cursor and a null-terminated string.\n Return whether their contents are equivalent.\n The cursor should NOT contain a null-terminator, or the comparison will always return false.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_cursor_eq_c_str_ignore_case (cursor : * const aws_byte_cursor , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Return true if the input starts with the prefix (exact byte comparison)."] pub fn aws_byte_cursor_starts_with (input : * const aws_byte_cursor , prefix : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Return true if the input starts with the prefix (case-insensitive).\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_cursor_starts_with_ignore_case (input : * const aws_byte_cursor , prefix : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Case-insensitive hash function for array containing ASCII or UTF-8 text."] pub fn aws_hash_array_ignore_case (array : * const :: libc :: c_void , len : usize) -> u64 ; } extern "C" { # [doc = " Case-insensitive hash function for aws_byte_cursors stored in an aws_hash_table.\n For case-sensitive hashing, use aws_hash_byte_cursor_ptr()."] pub fn aws_hash_byte_cursor_ptr_ignore_case (item : * const :: libc :: c_void) -> u64 ; } extern "C" { # [doc = " Returns a lookup table for bytes that is the identity transformation with the exception\n of uppercase ascii characters getting replaced with lowercase characters. Used in\n caseless comparisons."] pub fn aws_lookup_table_to_lower_get () -> * const u8 ; } extern "C" { # [doc = " Returns lookup table to go from ASCII/UTF-8 hex character to a number (0-15).\n Non-hex characters map to 255.\n Valid examples:\n '0' -> 0\n 'F' -> 15\n 'f' -> 15\n Invalid examples:\n ' ' -> 255\n 'Z' -> 255\n '\\0' -> 255"] pub fn aws_lookup_table_hex_to_num_get () -> * const u8 ; } extern "C" { # [doc = " Lexical (byte value) comparison of two byte cursors"] pub fn aws_byte_cursor_compare_lexical (lhs : * const aws_byte_cursor , rhs : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Lexical (byte value) comparison of two byte cursors where the raw values are sent through a lookup table first"] pub fn aws_byte_cursor_compare_lookup (lhs : * const aws_byte_cursor , rhs : * const aws_byte_cursor , lookup_table : * const u8) -> :: libc :: c_int ; } extern "C" { # [doc = " For creating a byte buffer from a null-terminated string literal."] pub fn aws_byte_buf_from_c_str (c_str : * const :: libc :: c_char) -> aws_byte_buf ; } extern "C" { pub fn aws_byte_buf_from_array (bytes : * const :: libc :: c_void , len : usize) -> aws_byte_buf ; } extern "C" { pub fn aws_byte_buf_from_empty_array (bytes : * const :: libc :: c_void , capacity : usize) -> aws_byte_buf ; } extern "C" { pub fn aws_byte_cursor_from_buf (buf : * const aws_byte_buf) -> aws_byte_cursor ; } extern "C" { pub fn aws_byte_cursor_from_c_str (c_str : * const :: libc :: c_char) -> aws_byte_cursor ; } extern "C" { pub fn aws_byte_cursor_from_array (bytes : * const :: libc :: c_void , len : usize) -> aws_byte_cursor ; } extern "C" { # [doc = " Tests if the given aws_byte_cursor has at least len bytes remaining. If so,\n *buf is advanced by len bytes (incrementing ->ptr and decrementing ->len),\n and an aws_byte_cursor referring to the first len bytes of the original *buf\n is returned. Otherwise, an aws_byte_cursor with ->ptr = NULL, ->len = 0 is\n returned.\n\n Note that if len is above (SIZE_MAX / 2), this function will also treat it as\n a buffer overflow, and return NULL without changing *buf."] pub fn aws_byte_cursor_advance (cursor : * mut aws_byte_cursor , len : usize) -> aws_byte_cursor ; } extern "C" { # [doc = " Behaves identically to aws_byte_cursor_advance, but avoids speculative\n execution potentially reading out-of-bounds pointers (by returning an\n empty ptr in such speculated paths).\n\n This should generally be done when using an untrusted or\n data-dependent value for 'len', to avoid speculating into a path where\n cursor->ptr points outside the true ptr length."] pub fn aws_byte_cursor_advance_nospec (cursor : * mut aws_byte_cursor , len : usize) -> aws_byte_cursor ; } extern "C" { # [doc = " Reads specified length of data from byte cursor and copies it to the\n destination array.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read (cur : * mut aws_byte_cursor , dest : * mut :: libc :: c_void , len : usize) -> bool ; } extern "C" { # [doc = " Reads as many bytes from cursor as size of buffer, and copies them to buffer.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_and_fill_buffer (cur : * mut aws_byte_cursor , dest : * mut aws_byte_buf) -> bool ; } extern "C" { # [doc = " Reads a single byte from cursor, placing it in *var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_u8 (cur : * mut aws_byte_cursor , var : * mut u8) -> bool ; } extern "C" { # [doc = " Reads a 16-bit value in network byte order from cur, and places it in host\n byte order into var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_be16 (cur : * mut aws_byte_cursor , var : * mut u16) -> bool ; } extern "C" { # [doc = " Reads an unsigned 24-bit value (3 bytes) in network byte order from cur,\n and places it in host byte order into 32-bit var.\n Ex: if cur's next 3 bytes are {0xAA, 0xBB, 0xCC}, then var becomes 0x00AABBCC.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_be24 (cur : * mut aws_byte_cursor , var : * mut u32) -> bool ; } extern "C" { # [doc = " Reads a 32-bit value in network byte order from cur, and places it in host\n byte order into var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_be32 (cur : * mut aws_byte_cursor , var : * mut u32) -> bool ; } extern "C" { # [doc = " Reads a 64-bit value in network byte order from cur, and places it in host\n byte order into var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_be64 (cur : * mut aws_byte_cursor , var : * mut u64) -> bool ; } extern "C" { # [doc = " Reads a 32-bit value in network byte order from cur, and places it in host\n byte order into var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_float_be32 (cur : * mut aws_byte_cursor , var : * mut f32) -> bool ; } extern "C" { # [doc = " Reads a 64-bit value in network byte order from cur, and places it in host\n byte order into var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_float_be64 (cur : * mut aws_byte_cursor , var : * mut f64) -> bool ; } extern "C" { # [doc = " Reads 2 hex characters from ASCII/UTF-8 text to produce an 8-bit number.\n Accepts both lowercase 'a'-'f' and uppercase 'A'-'F'.\n For example: \"0F\" produces 15.\n\n On success, returns true and advances the cursor by 2.\n If there is insufficient space in the cursor or an invalid character\n is encountered, returns false, leaving the cursor unchanged."] pub fn aws_byte_cursor_read_hex_u8 (cur : * mut aws_byte_cursor , var : * mut u8) -> bool ; } extern "C" { # [doc = " Appends a sub-buffer to the specified buffer.\n\n If the buffer has at least `len' bytes remaining (buffer->capacity - buffer->len >= len),\n then buffer->len is incremented by len, and an aws_byte_buf is assigned to *output corresponding\n to the last len bytes of the input buffer. The aws_byte_buf at *output will have a null\n allocator, a zero initial length, and a capacity of 'len'. The function then returns true.\n\n If there is insufficient space, then this function nulls all fields in *output and returns\n false."] pub fn aws_byte_buf_advance (buffer : * mut aws_byte_buf , output : * mut aws_byte_buf , len : usize) -> bool ; } extern "C" { # [doc = " Write specified number of bytes from array to byte buffer.\n\n On success, returns true and updates the buffer length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write (buf : * mut aws_byte_buf , src : * const u8 , len : usize) -> bool ; } extern "C" { # [doc = " Copies all bytes from buffer to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_from_whole_buffer (buf : * mut aws_byte_buf , src : aws_byte_buf) -> bool ; } extern "C" { # [doc = " Copies all bytes from buffer to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_from_whole_cursor (buf : * mut aws_byte_buf , src : aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Without increasing buf's capacity, write as much as possible from advancing_cursor into buf.\n\n buf's len is updated accordingly.\n advancing_cursor is advanced so it contains the remaining unwritten parts.\n Returns the section of advancing_cursor which was written.\n\n This function cannot fail. If buf is full (len == capacity) or advancing_len has 0 length,\n then buf and advancing_cursor are not altered and a cursor with 0 length is returned.\n\n Example: Given a buf with 2 bytes of space available and advancing_cursor with contents \"abc\".\n \"ab\" will be written to buf and buf->len will increase 2 and become equal to buf->capacity.\n advancing_cursor will advance so its contents become the unwritten \"c\".\n The returned cursor's contents will be the \"ab\" from the original advancing_cursor."] pub fn aws_byte_buf_write_to_capacity (buf : * mut aws_byte_buf , advancing_cursor : * mut aws_byte_cursor) -> aws_byte_cursor ; } extern "C" { # [doc = " Copies one byte to buffer.\n\n On success, returns true and updates the cursor /length\naccordingly.\n\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_u8 (buf : * mut aws_byte_buf , c : u8) -> bool ; } extern "C" { # [doc = " Writes one byte repeatedly to buffer (like memset)\n\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_u8_n (buf : * mut aws_byte_buf , c : u8 , count : usize) -> bool ; } extern "C" { # [doc = " Writes a 16-bit integer in network byte order (big endian) to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_be16 (buf : * mut aws_byte_buf , x : u16) -> bool ; } extern "C" { # [doc = " Writes low 24-bits (3 bytes) of an unsigned integer in network byte order (big endian) to buffer.\n Ex: If x is 0x00AABBCC then {0xAA, 0xBB, 0xCC} is written to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, or x's value cannot fit in 3 bytes,\n returns false, leaving the buffer unchanged."] pub fn aws_byte_buf_write_be24 (buf : * mut aws_byte_buf , x : u32) -> bool ; } extern "C" { # [doc = " Writes a 32-bit integer in network byte order (big endian) to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_be32 (buf : * mut aws_byte_buf , x : u32) -> bool ; } extern "C" { # [doc = " Writes a 32-bit float in network byte order (big endian) to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_float_be32 (buf : * mut aws_byte_buf , x : f32) -> bool ; } extern "C" { # [doc = " Writes a 64-bit integer in network byte order (big endian) to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_be64 (buf : * mut aws_byte_buf , x : u64) -> bool ; } extern "C" { # [doc = " Writes a 64-bit float in network byte order (big endian) to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_float_be64 (buf : * mut aws_byte_buf , x : f64) -> bool ; } extern "C" { # [doc = " Like isalnum(), but ignores C locale.\n Returns true if ch has the value of ASCII/UTF-8: 'a'-'z', 'A'-'Z', or '0'-'9'."] pub fn aws_isalnum (ch : u8) -> bool ; } extern "C" { # [doc = " Like isalpha(), but ignores C locale.\n Returns true if ch has the value of ASCII/UTF-8: 'a'-'z' or 'A'-'Z'."] pub fn aws_isalpha (ch : u8) -> bool ; } extern "C" { # [doc = " Like isdigit().\n Returns true if ch has the value of ASCII/UTF-8: '0'-'9'.\n\n Note: C's built-in isdigit() is also supposed to ignore the C locale,\n but cppreference.com claims \"some implementations (e.g. Microsoft in 1252 codepage)\n may classify additional single-byte characters as digits\""] pub fn aws_isdigit (ch : u8) -> bool ; } extern "C" { # [doc = " Like isxdigit().\n Returns true if ch has the value of ASCII/UTF-8: '0'-'9', 'a'-'f', or 'A'-'F'.\n\n Note: C's built-in isxdigit() is also supposed to ignore the C locale,\n but cppreference.com claims \"some implementations (e.g. Microsoft in 1252 codepage)\n may classify additional single-byte characters as digits\""] pub fn aws_isxdigit (ch : u8) -> bool ; } extern "C" { # [doc = " Like isspace(), but ignores C locale.\n Return true if ch has the value of ASCII/UTF-8: space (0x20), form feed (0x0C),\n line feed (0x0A), carriage return (0x0D), horizontal tab (0x09), or vertical tab (0x0B)."] pub fn aws_isspace (ch : u8) -> bool ; } extern "C" { # [doc = " Read entire cursor as ASCII/UTF-8 unsigned base-10 number.\n Stricter than strtoull(), which allows whitespace and inputs that start with \"0x\"\n\n Examples:\n \"0\" -> 0\n \"123\" -> 123\n \"00004\" -> 4 // leading zeros ok\n\n Rejects things like:\n \"-1\" // negative numbers not allowed\n \"1,000\" // only characters 0-9 allowed\n \"\" // blank string not allowed\n \" 0 \" // whitespace not allowed\n \"0x0\" // hex not allowed\n \"FF\" // hex not allowed\n \"999999999999999999999999999999999999999999\" // larger than max u64"] pub fn aws_byte_cursor_utf8_parse_u64 (cursor : aws_byte_cursor , dst : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Read entire cursor as ASCII/UTF-8 unsigned base-16 number with NO \"0x\" prefix.\n\n Examples:\n \"F\" -> 15\n \"000000ff\" -> 255 // leading zeros ok\n \"Ff\" -> 255 // mixed case ok\n \"123\" -> 291\n \"FFFFFFFFFFFFFFFF\" -> 18446744073709551616 // max u64\n\n Rejects things like:\n \"0x0\" // 0x prefix not allowed\n \"\" // blank string not allowed\n \" F \" // whitespace not allowed\n \"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\" // larger than max u64"] pub fn aws_byte_cursor_utf8_parse_u64_hex (cursor : aws_byte_cursor , dst : * mut u64) -> :: libc :: c_int ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_linked_list_node { pub next : * mut aws_linked_list_node , pub prev : * mut aws_linked_list_node , } # [test] fn bindgen_test_layout_aws_linked_list_node () { const UNINIT : :: std :: mem :: MaybeUninit < aws_linked_list_node > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_linked_list_node > () , 16usize , concat ! ("Size of: " , stringify ! (aws_linked_list_node))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_linked_list_node > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_linked_list_node))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . next) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_linked_list_node) , "::" , stringify ! (next))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . prev) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_linked_list_node) , "::" , stringify ! (prev))) ; } impl Default for aws_linked_list_node { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_linked_list { pub head : aws_linked_list_node , pub tail : aws_linked_list_node , } # [test] fn bindgen_test_layout_aws_linked_list () { const UNINIT : :: std :: mem :: MaybeUninit < aws_linked_list > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_linked_list > () , 32usize , concat ! ("Size of: " , stringify ! (aws_linked_list))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_linked_list > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_linked_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . head) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_linked_list) , "::" , stringify ! (head))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tail) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_linked_list) , "::" , stringify ! (tail))) ; } impl Default for aws_linked_list { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Set node's next and prev pointers to NULL."] pub fn aws_linked_list_node_reset (node : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Tests if the list is empty."] pub fn aws_linked_list_empty (list : * const aws_linked_list) -> bool ; } extern "C" { # [doc = " Checks that a linked list is valid."] pub fn aws_linked_list_is_valid (list : * const aws_linked_list) -> bool ; } extern "C" { # [doc = " Checks that the prev of the next pointer of a node points to the\n node. As this checks whether the [next] connection of a node is\n bidirectional, it returns false if used for the list tail."] pub fn aws_linked_list_node_next_is_valid (node : * const aws_linked_list_node) -> bool ; } extern "C" { # [doc = " Checks that the next of the prev pointer of a node points to the\n node. Similarly to the above, this returns false if used for the\n head of a list."] pub fn aws_linked_list_node_prev_is_valid (node : * const aws_linked_list_node) -> bool ; } extern "C" { # [doc = " Checks that a linked list satisfies double linked list connectivity\n constraints. This check is O(n) as it traverses the whole linked\n list to ensure that tail is reachable from head (and vice versa)\n and that every connection is bidirectional.\n\n Note: This check *cannot* go into an infinite loop, because we\n ensure that the connection to the next node is\n bidirectional. Therefore, if a node's [a] a.next is a previous node\n [b] in the list, b.prev != &a and so this check would fail, thus\n terminating the loop."] pub fn aws_linked_list_is_valid_deep (list : * const aws_linked_list) -> bool ; } extern "C" { # [doc = " Initializes the list. List will be empty after this call."] pub fn aws_linked_list_init (list : * mut aws_linked_list) ; } extern "C" { # [doc = " Returns an iteration pointer for the first element in the list."] pub fn aws_linked_list_begin (list : * const aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Returns an iteration pointer for one past the last element in the list."] pub fn aws_linked_list_end (list : * const aws_linked_list) -> * const aws_linked_list_node ; } extern "C" { # [doc = " Returns a pointer for the last element in the list.\n Used to begin iterating the list in reverse. Ex:\n for (i = aws_linked_list_rbegin(list); i != aws_linked_list_rend(list); i = aws_linked_list_prev(i)) {...}"] pub fn aws_linked_list_rbegin (list : * const aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Returns the pointer to one before the first element in the list.\n Used to end iterating the list in reverse."] pub fn aws_linked_list_rend (list : * const aws_linked_list) -> * const aws_linked_list_node ; } extern "C" { # [doc = " Returns the next element in the list."] pub fn aws_linked_list_next (node : * const aws_linked_list_node) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Returns the previous element in the list."] pub fn aws_linked_list_prev (node : * const aws_linked_list_node) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Inserts to_add immediately after after."] pub fn aws_linked_list_insert_after (after : * mut aws_linked_list_node , to_add : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Swaps the order two nodes in the linked list."] pub fn aws_linked_list_swap_nodes (a : * mut aws_linked_list_node , b : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Inserts to_add immediately before before."] pub fn aws_linked_list_insert_before (before : * mut aws_linked_list_node , to_add : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Removes the specified node from the list (prev/next point to each other) and\n returns the next node in the list."] pub fn aws_linked_list_remove (node : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Append new_node."] pub fn aws_linked_list_push_back (list : * mut aws_linked_list , node : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Returns the element in the back of the list."] pub fn aws_linked_list_back (list : * const aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Returns the element in the back of the list and removes it"] pub fn aws_linked_list_pop_back (list : * mut aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Prepend new_node."] pub fn aws_linked_list_push_front (list : * mut aws_linked_list , node : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Returns the element in the front of the list."] pub fn aws_linked_list_front (list : * const aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Returns the element in the front of the list and removes it"] pub fn aws_linked_list_pop_front (list : * mut aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { pub fn aws_linked_list_swap_contents (a : * mut aws_linked_list , b : * mut aws_linked_list) ; } extern "C" { # [doc = " Remove all nodes from one list, and add them to the back of another.\n\n Example: if dst={1,2} and src={3,4}, they become dst={1,2,3,4} and src={}"] pub fn aws_linked_list_move_all_back (dst : * mut aws_linked_list , src : * mut aws_linked_list) ; } extern "C" { # [doc = " Remove all nodes from one list, and add them to the front of another.\n\n Example: if dst={2,1} and src={4,3}, they become dst={4,3,2,1} and src={}"] pub fn aws_linked_list_move_all_front (dst : * mut aws_linked_list , src : * mut aws_linked_list) ; } # [repr (C)] # [derive (Copy , Clone)] pub struct aws_io_handle { pub data : aws_io_handle__bindgen_ty_1 , pub additional_data : * mut :: libc :: c_void , } # [repr (C)] # [derive (Copy , Clone)] pub union aws_io_handle__bindgen_ty_1 { pub fd : :: libc :: c_int , pub handle : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_io_handle__bindgen_ty_1 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_io_handle__bindgen_ty_1 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_io_handle__bindgen_ty_1 > () , 8usize , concat ! ("Size of: " , stringify ! (aws_io_handle__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_io_handle__bindgen_ty_1 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_io_handle__bindgen_ty_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . fd) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_io_handle__bindgen_ty_1) , "::" , stringify ! (fd))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . handle) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_io_handle__bindgen_ty_1) , "::" , stringify ! (handle))) ; } impl Default for aws_io_handle__bindgen_ty_1 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [test] fn bindgen_test_layout_aws_io_handle () { const UNINIT : :: std :: mem :: MaybeUninit < aws_io_handle > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_io_handle > () , 16usize , concat ! ("Size of: " , stringify ! (aws_io_handle))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_io_handle > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_io_handle))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . data) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_io_handle) , "::" , stringify ! (data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . additional_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_io_handle) , "::" , stringify ! (additional_data))) ; } impl Default for aws_io_handle { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_io_message_type { AWS_IO_MESSAGE_APPLICATION_DATA = 0 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_channel { _unused : [u8 ; 0] , } pub type aws_channel_on_message_write_completed_fn = :: std :: option :: Option < unsafe extern "C" fn (channel : * mut aws_channel , message : * mut aws_io_message , err_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_io_message { # [doc = " Allocator used for the message and message data. If this is null, the message belongs to a pool or some other\n message manager."] pub allocator : * mut aws_allocator , # [doc = " Buffer containing the data for message"] pub message_data : aws_byte_buf , # [doc = " type of the message. This is used for framework control messages. Currently the only type is\n AWS_IO_MESSAGE_APPLICATION_DATA"] pub message_type : aws_io_message_type , # [doc = " Conveys information about the contents of message_data (e.g. cast the ptr to some type). If 0, it's just opaque\n data."] pub message_tag : :: libc :: c_int , # [doc = " In order to avoid excess allocations/copies, on a partial read or write, the copy mark is set to indicate how\n much of this message has already been processed or copied."] pub copy_mark : usize , # [doc = " The channel that the message is bound to."] pub owning_channel : * mut aws_channel , # [doc = " Invoked by the channel once the entire message has been written to the data sink."] pub on_completion : aws_channel_on_message_write_completed_fn , # [doc = " arbitrary user data for the on_completion callback"] pub user_data : * mut :: libc :: c_void , # [doc = " it's incredibly likely something is going to need to queue this,\n go ahead and make sure the list info is part of the original allocation."] pub queueing_handle : aws_linked_list_node , } # [test] fn bindgen_test_layout_aws_io_message () { const UNINIT : :: std :: mem :: MaybeUninit < aws_io_message > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_io_message > () , 96usize , concat ! ("Size of: " , stringify ! (aws_io_message))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_io_message > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_io_message))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . message_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (message_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . message_type) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (message_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . message_tag) as usize - ptr as usize } , 44usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (message_tag))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . copy_mark) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (copy_mark))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . owning_channel) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (owning_channel))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_completion) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (on_completion))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . queueing_handle) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (queueing_handle))) ; } impl Default for aws_io_message { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_io_clock_fn = :: std :: option :: Option < unsafe extern "C" fn (timestamp : * mut u64) -> :: libc :: c_int > ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_io_errors { AWS_IO_CHANNEL_ERROR_ERROR_CANT_ACCEPT_INPUT = 1024 , AWS_IO_CHANNEL_UNKNOWN_MESSAGE_TYPE = 1025 , AWS_IO_CHANNEL_READ_WOULD_EXCEED_WINDOW = 1026 , AWS_IO_EVENT_LOOP_ALREADY_ASSIGNED = 1027 , AWS_IO_EVENT_LOOP_SHUTDOWN = 1028 , AWS_IO_TLS_ERROR_NEGOTIATION_FAILURE = 1029 , AWS_IO_TLS_ERROR_NOT_NEGOTIATED = 1030 , AWS_IO_TLS_ERROR_WRITE_FAILURE = 1031 , AWS_IO_TLS_ERROR_ALERT_RECEIVED = 1032 , AWS_IO_TLS_CTX_ERROR = 1033 , AWS_IO_TLS_VERSION_UNSUPPORTED = 1034 , AWS_IO_TLS_CIPHER_PREF_UNSUPPORTED = 1035 , AWS_IO_MISSING_ALPN_MESSAGE = 1036 , AWS_IO_UNHANDLED_ALPN_PROTOCOL_MESSAGE = 1037 , AWS_IO_FILE_VALIDATION_FAILURE = 1038 , AWS_ERROR_IO_EVENT_LOOP_THREAD_ONLY = 1039 , AWS_ERROR_IO_ALREADY_SUBSCRIBED = 1040 , AWS_ERROR_IO_NOT_SUBSCRIBED = 1041 , AWS_ERROR_IO_OPERATION_CANCELLED = 1042 , AWS_IO_READ_WOULD_BLOCK = 1043 , AWS_IO_BROKEN_PIPE = 1044 , AWS_IO_SOCKET_UNSUPPORTED_ADDRESS_FAMILY = 1045 , AWS_IO_SOCKET_INVALID_OPERATION_FOR_TYPE = 1046 , AWS_IO_SOCKET_CONNECTION_REFUSED = 1047 , AWS_IO_SOCKET_TIMEOUT = 1048 , AWS_IO_SOCKET_NO_ROUTE_TO_HOST = 1049 , AWS_IO_SOCKET_NETWORK_DOWN = 1050 , AWS_IO_SOCKET_CLOSED = 1051 , AWS_IO_SOCKET_NOT_CONNECTED = 1052 , AWS_IO_SOCKET_INVALID_OPTIONS = 1053 , AWS_IO_SOCKET_ADDRESS_IN_USE = 1054 , AWS_IO_SOCKET_INVALID_ADDRESS = 1055 , AWS_IO_SOCKET_ILLEGAL_OPERATION_FOR_STATE = 1056 , AWS_IO_SOCKET_CONNECT_ABORTED = 1057 , AWS_IO_DNS_QUERY_FAILED = 1058 , AWS_IO_DNS_INVALID_NAME = 1059 , AWS_IO_DNS_NO_ADDRESS_FOR_HOST = 1060 , AWS_IO_DNS_HOST_REMOVED_FROM_CACHE = 1061 , AWS_IO_STREAM_INVALID_SEEK_POSITION = 1062 , AWS_IO_STREAM_READ_FAILED = 1063 , DEPRECATED_AWS_IO_INVALID_FILE_HANDLE = 1064 , AWS_IO_SHARED_LIBRARY_LOAD_FAILURE = 1065 , AWS_IO_SHARED_LIBRARY_FIND_SYMBOL_FAILURE = 1066 , AWS_IO_TLS_NEGOTIATION_TIMEOUT = 1067 , AWS_IO_TLS_ALERT_NOT_GRACEFUL = 1068 , AWS_IO_MAX_RETRIES_EXCEEDED = 1069 , AWS_IO_RETRY_PERMISSION_DENIED = 1070 , AWS_IO_TLS_DIGEST_ALGORITHM_UNSUPPORTED = 1071 , AWS_IO_TLS_SIGNATURE_ALGORITHM_UNSUPPORTED = 1072 , AWS_ERROR_PKCS11_VERSION_UNSUPPORTED = 1073 , AWS_ERROR_PKCS11_TOKEN_NOT_FOUND = 1074 , AWS_ERROR_PKCS11_KEY_NOT_FOUND = 1075 , AWS_ERROR_PKCS11_KEY_TYPE_UNSUPPORTED = 1076 , AWS_ERROR_PKCS11_UNKNOWN_CRYPTOKI_RETURN_VALUE = 1077 , AWS_ERROR_PKCS11_CKR_CANCEL = 1078 , AWS_ERROR_PKCS11_CKR_HOST_MEMORY = 1079 , AWS_ERROR_PKCS11_CKR_SLOT_ID_INVALID = 1080 , AWS_ERROR_PKCS11_CKR_GENERAL_ERROR = 1081 , AWS_ERROR_PKCS11_CKR_FUNCTION_FAILED = 1082 , AWS_ERROR_PKCS11_CKR_ARGUMENTS_BAD = 1083 , AWS_ERROR_PKCS11_CKR_NO_EVENT = 1084 , AWS_ERROR_PKCS11_CKR_NEED_TO_CREATE_THREADS = 1085 , AWS_ERROR_PKCS11_CKR_CANT_LOCK = 1086 , AWS_ERROR_PKCS11_CKR_ATTRIBUTE_READ_ONLY = 1087 , AWS_ERROR_PKCS11_CKR_ATTRIBUTE_SENSITIVE = 1088 , AWS_ERROR_PKCS11_CKR_ATTRIBUTE_TYPE_INVALID = 1089 , AWS_ERROR_PKCS11_CKR_ATTRIBUTE_VALUE_INVALID = 1090 , AWS_ERROR_PKCS11_CKR_ACTION_PROHIBITED = 1091 , AWS_ERROR_PKCS11_CKR_DATA_INVALID = 1092 , AWS_ERROR_PKCS11_CKR_DATA_LEN_RANGE = 1093 , AWS_ERROR_PKCS11_CKR_DEVICE_ERROR = 1094 , AWS_ERROR_PKCS11_CKR_DEVICE_MEMORY = 1095 , AWS_ERROR_PKCS11_CKR_DEVICE_REMOVED = 1096 , AWS_ERROR_PKCS11_CKR_ENCRYPTED_DATA_INVALID = 1097 , AWS_ERROR_PKCS11_CKR_ENCRYPTED_DATA_LEN_RANGE = 1098 , AWS_ERROR_PKCS11_CKR_FUNCTION_CANCELED = 1099 , AWS_ERROR_PKCS11_CKR_FUNCTION_NOT_PARALLEL = 1100 , AWS_ERROR_PKCS11_CKR_FUNCTION_NOT_SUPPORTED = 1101 , AWS_ERROR_PKCS11_CKR_KEY_HANDLE_INVALID = 1102 , AWS_ERROR_PKCS11_CKR_KEY_SIZE_RANGE = 1103 , AWS_ERROR_PKCS11_CKR_KEY_TYPE_INCONSISTENT = 1104 , AWS_ERROR_PKCS11_CKR_KEY_NOT_NEEDED = 1105 , AWS_ERROR_PKCS11_CKR_KEY_CHANGED = 1106 , AWS_ERROR_PKCS11_CKR_KEY_NEEDED = 1107 , AWS_ERROR_PKCS11_CKR_KEY_INDIGESTIBLE = 1108 , AWS_ERROR_PKCS11_CKR_KEY_FUNCTION_NOT_PERMITTED = 1109 , AWS_ERROR_PKCS11_CKR_KEY_NOT_WRAPPABLE = 1110 , AWS_ERROR_PKCS11_CKR_KEY_UNEXTRACTABLE = 1111 , AWS_ERROR_PKCS11_CKR_MECHANISM_INVALID = 1112 , AWS_ERROR_PKCS11_CKR_MECHANISM_PARAM_INVALID = 1113 , AWS_ERROR_PKCS11_CKR_OBJECT_HANDLE_INVALID = 1114 , AWS_ERROR_PKCS11_CKR_OPERATION_ACTIVE = 1115 , AWS_ERROR_PKCS11_CKR_OPERATION_NOT_INITIALIZED = 1116 , AWS_ERROR_PKCS11_CKR_PIN_INCORRECT = 1117 , AWS_ERROR_PKCS11_CKR_PIN_INVALID = 1118 , AWS_ERROR_PKCS11_CKR_PIN_LEN_RANGE = 1119 , AWS_ERROR_PKCS11_CKR_PIN_EXPIRED = 1120 , AWS_ERROR_PKCS11_CKR_PIN_LOCKED = 1121 , AWS_ERROR_PKCS11_CKR_SESSION_CLOSED = 1122 , AWS_ERROR_PKCS11_CKR_SESSION_COUNT = 1123 , AWS_ERROR_PKCS11_CKR_SESSION_HANDLE_INVALID = 1124 , AWS_ERROR_PKCS11_CKR_SESSION_PARALLEL_NOT_SUPPORTED = 1125 , AWS_ERROR_PKCS11_CKR_SESSION_READ_ONLY = 1126 , AWS_ERROR_PKCS11_CKR_SESSION_EXISTS = 1127 , AWS_ERROR_PKCS11_CKR_SESSION_READ_ONLY_EXISTS = 1128 , AWS_ERROR_PKCS11_CKR_SESSION_READ_WRITE_SO_EXISTS = 1129 , AWS_ERROR_PKCS11_CKR_SIGNATURE_INVALID = 1130 , AWS_ERROR_PKCS11_CKR_SIGNATURE_LEN_RANGE = 1131 , AWS_ERROR_PKCS11_CKR_TEMPLATE_INCOMPLETE = 1132 , AWS_ERROR_PKCS11_CKR_TEMPLATE_INCONSISTENT = 1133 , AWS_ERROR_PKCS11_CKR_TOKEN_NOT_PRESENT = 1134 , AWS_ERROR_PKCS11_CKR_TOKEN_NOT_RECOGNIZED = 1135 , AWS_ERROR_PKCS11_CKR_TOKEN_WRITE_PROTECTED = 1136 , AWS_ERROR_PKCS11_CKR_UNWRAPPING_KEY_HANDLE_INVALID = 1137 , AWS_ERROR_PKCS11_CKR_UNWRAPPING_KEY_SIZE_RANGE = 1138 , AWS_ERROR_PKCS11_CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT = 1139 , AWS_ERROR_PKCS11_CKR_USER_ALREADY_LOGGED_IN = 1140 , AWS_ERROR_PKCS11_CKR_USER_NOT_LOGGED_IN = 1141 , AWS_ERROR_PKCS11_CKR_USER_PIN_NOT_INITIALIZED = 1142 , AWS_ERROR_PKCS11_CKR_USER_TYPE_INVALID = 1143 , AWS_ERROR_PKCS11_CKR_USER_ANOTHER_ALREADY_LOGGED_IN = 1144 , AWS_ERROR_PKCS11_CKR_USER_TOO_MANY_TYPES = 1145 , AWS_ERROR_PKCS11_CKR_WRAPPED_KEY_INVALID = 1146 , AWS_ERROR_PKCS11_CKR_WRAPPED_KEY_LEN_RANGE = 1147 , AWS_ERROR_PKCS11_CKR_WRAPPING_KEY_HANDLE_INVALID = 1148 , AWS_ERROR_PKCS11_CKR_WRAPPING_KEY_SIZE_RANGE = 1149 , AWS_ERROR_PKCS11_CKR_WRAPPING_KEY_TYPE_INCONSISTENT = 1150 , AWS_ERROR_PKCS11_CKR_RANDOM_SEED_NOT_SUPPORTED = 1151 , AWS_ERROR_PKCS11_CKR_RANDOM_NO_RNG = 1152 , AWS_ERROR_PKCS11_CKR_DOMAIN_PARAMS_INVALID = 1153 , AWS_ERROR_PKCS11_CKR_CURVE_NOT_SUPPORTED = 1154 , AWS_ERROR_PKCS11_CKR_BUFFER_TOO_SMALL = 1155 , AWS_ERROR_PKCS11_CKR_SAVED_STATE_INVALID = 1156 , AWS_ERROR_PKCS11_CKR_INFORMATION_SENSITIVE = 1157 , AWS_ERROR_PKCS11_CKR_STATE_UNSAVEABLE = 1158 , AWS_ERROR_PKCS11_CKR_CRYPTOKI_NOT_INITIALIZED = 1159 , AWS_ERROR_PKCS11_CKR_CRYPTOKI_ALREADY_INITIALIZED = 1160 , AWS_ERROR_PKCS11_CKR_MUTEX_BAD = 1161 , AWS_ERROR_PKCS11_CKR_MUTEX_NOT_LOCKED = 1162 , AWS_ERROR_PKCS11_CKR_NEW_PIN_MODE = 1163 , AWS_ERROR_PKCS11_CKR_NEXT_OTP = 1164 , AWS_ERROR_PKCS11_CKR_EXCEEDED_MAX_ITERATIONS = 1165 , AWS_ERROR_PKCS11_CKR_FIPS_SELF_TEST_FAILED = 1166 , AWS_ERROR_PKCS11_CKR_LIBRARY_LOAD_FAILED = 1167 , AWS_ERROR_PKCS11_CKR_PIN_TOO_WEAK = 1168 , AWS_ERROR_PKCS11_CKR_PUBLIC_KEY_INVALID = 1169 , AWS_ERROR_PKCS11_CKR_FUNCTION_REJECTED = 1170 , AWS_ERROR_IO_PINNED_EVENT_LOOP_MISMATCH = 1171 , AWS_ERROR_PKCS11_ENCODING_ERROR = 1172 , AWS_IO_TLS_ERROR_DEFAULT_TRUST_STORE_NOT_FOUND = 1173 , AWS_IO_STREAM_SEEK_FAILED = 1174 , AWS_IO_STREAM_GET_LENGTH_FAILED = 1175 , AWS_IO_STREAM_SEEK_UNSUPPORTED = 1176 , AWS_IO_STREAM_GET_LENGTH_UNSUPPORTED = 1177 , AWS_IO_TLS_ERROR_READ_FAILURE = 1178 , AWS_IO_ERROR_END_RANGE = 2047 , AWS_IO_INVALID_FILE_HANDLE = 50 , } extern "C" { # [doc = " Initializes internal datastructures used by aws-c-io.\n Must be called before using any functionality in aws-c-io."] pub fn aws_io_library_init (allocator : * mut aws_allocator) ; } extern "C" { # [doc = " Shuts down the internal datastructures used by aws-c-io."] pub fn aws_io_library_clean_up () ; } extern "C" { pub fn aws_io_fatal_assert_library_initialized () ; } # [doc = " struct aws_atomic_var represents an atomic variable - a value which can hold an integer or pointer\n that can be manipulated atomically. struct aws_atomic_vars should normally only be manipulated\n with atomics methods defined in this header."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_atomic_var { pub value : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_atomic_var () { const UNINIT : :: std :: mem :: MaybeUninit < aws_atomic_var > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_atomic_var > () , 8usize , concat ! ("Size of: " , stringify ! (aws_atomic_var))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_atomic_var > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_atomic_var))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_atomic_var) , "::" , stringify ! (value))) ; } impl Default for aws_atomic_var { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_memory_order { # [doc = " No particular ordering constraints are guaranteed relative to other\n operations at all; we merely ensure that the operation itself is atomic."] aws_memory_order_relaxed = 0 , # [doc = " Specifies acquire ordering. No reads or writes on the current thread can be\n reordered to happen before this operation. This is typically paired with a release\n ordering; any writes that happened on the releasing operation will be visible\n after the paired acquire operation.\n\n Acquire ordering is only meaningful on load or load-store operations."] aws_memory_order_acquire = 2 , # [doc = " Specifies release order. No reads or writes can be reordered to come after this\n operation. Typically paired with an acquire operation.\n\n Release ordering is only meaningful on store or load-store operations."] aws_memory_order_release = 3 , # [doc = " Specifies acquire-release order; if this operation acts as a load, it acts as an\n acquire operation; if it acts as a store, it acts as a release operation; if it's\n a load-store, it does both."] aws_memory_order_acq_rel = 4 , # [doc = " Specifies acquire-release order; if this operation acts as a load, it acts as an\n acquire operation; if it acts as a store, it acts as a release operation; if it's\n a load-store, it does both."] aws_memory_order_seq_cst = 5 , } extern "C" { # [doc = " Initializes an atomic variable with an integer value. This operation should be done before any\n other operations on this atomic variable, and must be done before attempting any parallel operations.\n\n This operation does not imply a barrier. Ensure that you use an acquire-release barrier (or stronger)\n when communicating the fact that initialization is complete to the other thread. Launching the thread\n implies a sufficiently strong barrier."] pub fn aws_atomic_init_int (var : * mut aws_atomic_var , n : usize) ; } extern "C" { # [doc = " Initializes an atomic variable with a pointer value. This operation should be done before any\n other operations on this atomic variable, and must be done before attempting any parallel operations.\n\n This operation does not imply a barrier. Ensure that you use an acquire-release barrier (or stronger)\n when communicating the fact that initialization is complete to the other thread. Launching the thread\n implies a sufficiently strong barrier."] pub fn aws_atomic_init_ptr (var : * mut aws_atomic_var , p : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Reads an atomic var as an integer, using the specified ordering, and returns the result."] pub fn aws_atomic_load_int_explicit (var : * const aws_atomic_var , memory_order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Reads an atomic var as an integer, using sequentially consistent ordering, and returns the result."] pub fn aws_atomic_load_int (var : * const aws_atomic_var) -> usize ; } extern "C" { # [doc = " Reads an atomic var as a pointer, using the specified ordering, and returns the result."] pub fn aws_atomic_load_ptr_explicit (var : * const aws_atomic_var , memory_order : aws_memory_order) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Reads an atomic var as a pointer, using sequentially consistent ordering, and returns the result."] pub fn aws_atomic_load_ptr (var : * const aws_atomic_var) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Stores an integer into an atomic var, using the specified ordering."] pub fn aws_atomic_store_int_explicit (var : * mut aws_atomic_var , n : usize , memory_order : aws_memory_order) ; } extern "C" { # [doc = " Stores an integer into an atomic var, using sequentially consistent ordering."] pub fn aws_atomic_store_int (var : * mut aws_atomic_var , n : usize) ; } extern "C" { # [doc = " Stores a pointer into an atomic var, using the specified ordering."] pub fn aws_atomic_store_ptr_explicit (var : * mut aws_atomic_var , p : * mut :: libc :: c_void , memory_order : aws_memory_order) ; } extern "C" { # [doc = " Stores a pointer into an atomic var, using sequentially consistent ordering."] pub fn aws_atomic_store_ptr (var : * mut aws_atomic_var , p : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Exchanges an integer with the value in an atomic_var, using the specified ordering.\n Returns the value that was previously in the atomic_var."] pub fn aws_atomic_exchange_int_explicit (var : * mut aws_atomic_var , n : usize , memory_order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Exchanges an integer with the value in an atomic_var, using sequentially consistent ordering.\n Returns the value that was previously in the atomic_var."] pub fn aws_atomic_exchange_int (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Exchanges a pointer with the value in an atomic_var, using the specified ordering.\n Returns the value that was previously in the atomic_var."] pub fn aws_atomic_exchange_ptr_explicit (var : * mut aws_atomic_var , p : * mut :: libc :: c_void , memory_order : aws_memory_order) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Exchanges an integer with the value in an atomic_var, using sequentially consistent ordering.\n Returns the value that was previously in the atomic_var."] pub fn aws_atomic_exchange_ptr (var : * mut aws_atomic_var , p : * mut :: libc :: c_void) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Atomically compares *var to *expected; if they are equal, atomically sets *var = desired. Otherwise, *expected is set\n to the value in *var. On success, the memory ordering used was order_success; otherwise, it was order_failure.\n order_failure must be no stronger than order_success, and must not be release or acq_rel.\n Returns true if the compare was successful and the variable updated to desired."] pub fn aws_atomic_compare_exchange_int_explicit (var : * mut aws_atomic_var , expected : * mut usize , desired : usize , order_success : aws_memory_order , order_failure : aws_memory_order) -> bool ; } extern "C" { # [doc = " Atomically compares *var to *expected; if they are equal, atomically sets *var = desired. Otherwise, *expected is set\n to the value in *var. Uses sequentially consistent memory ordering, regardless of success or failure.\n Returns true if the compare was successful and the variable updated to desired."] pub fn aws_atomic_compare_exchange_int (var : * mut aws_atomic_var , expected : * mut usize , desired : usize) -> bool ; } extern "C" { # [doc = " Atomically compares *var to *expected; if they are equal, atomically sets *var = desired. Otherwise, *expected is set\n to the value in *var. On success, the memory ordering used was order_success; otherwise, it was order_failure.\n order_failure must be no stronger than order_success, and must not be release or acq_rel.\n Returns true if the compare was successful and the variable updated to desired."] pub fn aws_atomic_compare_exchange_ptr_explicit (var : * mut aws_atomic_var , expected : * mut * mut :: libc :: c_void , desired : * mut :: libc :: c_void , order_success : aws_memory_order , order_failure : aws_memory_order) -> bool ; } extern "C" { # [doc = " Atomically compares *var to *expected; if they are equal, atomically sets *var = desired. Otherwise, *expected is set\n to the value in *var. Uses sequentially consistent memory ordering, regardless of success or failure.\n Returns true if the compare was successful and the variable updated to desired."] pub fn aws_atomic_compare_exchange_ptr (var : * mut aws_atomic_var , expected : * mut * mut :: libc :: c_void , desired : * mut :: libc :: c_void) -> bool ; } extern "C" { # [doc = " Atomically adds n to *var, and returns the previous value of *var."] pub fn aws_atomic_fetch_add_explicit (var : * mut aws_atomic_var , n : usize , order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Atomically subtracts n from *var, and returns the previous value of *var."] pub fn aws_atomic_fetch_sub_explicit (var : * mut aws_atomic_var , n : usize , order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Atomically ORs n with *var, and returns the previous value of *var."] pub fn aws_atomic_fetch_or_explicit (var : * mut aws_atomic_var , n : usize , order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Atomically ANDs n with *var, and returns the previous value of *var."] pub fn aws_atomic_fetch_and_explicit (var : * mut aws_atomic_var , n : usize , order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Atomically XORs n with *var, and returns the previous value of *var."] pub fn aws_atomic_fetch_xor_explicit (var : * mut aws_atomic_var , n : usize , order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Atomically adds n to *var, and returns the previous value of *var.\n Uses sequentially consistent ordering."] pub fn aws_atomic_fetch_add (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Atomically subtracts n from *var, and returns the previous value of *var.\n Uses sequentially consistent ordering."] pub fn aws_atomic_fetch_sub (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Atomically ands n into *var, and returns the previous value of *var.\n Uses sequentially consistent ordering."] pub fn aws_atomic_fetch_and (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Atomically ors n into *var, and returns the previous value of *var.\n Uses sequentially consistent ordering."] pub fn aws_atomic_fetch_or (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Atomically xors n into *var, and returns the previous value of *var.\n Uses sequentially consistent ordering."] pub fn aws_atomic_fetch_xor (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Provides the same reordering guarantees as an atomic operation with the specified memory order, without\n needing to actually perform an atomic operation."] pub fn aws_atomic_thread_fence (order : aws_memory_order) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_string { pub allocator : * mut aws_allocator , pub len : usize , pub bytes : [u8 ; 1usize] , } # [test] fn bindgen_test_layout_aws_string () { const UNINIT : :: std :: mem :: MaybeUninit < aws_string > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_string > () , 24usize , concat ! ("Size of: " , stringify ! (aws_string))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_string > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_string))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_string) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . len) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_string) , "::" , stringify ! (len))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bytes) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_string) , "::" , stringify ! (bytes))) ; } impl Default for aws_string { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Returns true if bytes of string are the same, false otherwise."] pub fn aws_string_eq (a : * const aws_string , b : * const aws_string) -> bool ; } extern "C" { # [doc = " Returns true if bytes of string are equivalent, using a case-insensitive comparison."] pub fn aws_string_eq_ignore_case (a : * const aws_string , b : * const aws_string) -> bool ; } extern "C" { # [doc = " Returns true if bytes of string and cursor are the same, false otherwise."] pub fn aws_string_eq_byte_cursor (str_ : * const aws_string , cur : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Returns true if bytes of string and cursor are equivalent, using a case-insensitive comparison."] pub fn aws_string_eq_byte_cursor_ignore_case (str_ : * const aws_string , cur : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Returns true if bytes of string and buffer are the same, false otherwise."] pub fn aws_string_eq_byte_buf (str_ : * const aws_string , buf : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Returns true if bytes of string and buffer are equivalent, using a case-insensitive comparison."] pub fn aws_string_eq_byte_buf_ignore_case (str_ : * const aws_string , buf : * const aws_byte_buf) -> bool ; } extern "C" { pub fn aws_string_eq_c_str (str_ : * const aws_string , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Returns true if bytes of strings are equivalent, using a case-insensitive comparison."] pub fn aws_string_eq_c_str_ignore_case (str_ : * const aws_string , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Constructor functions which copy data from null-terminated C-string or array of bytes."] pub fn aws_string_new_from_c_str (allocator : * mut aws_allocator , c_str : * const :: libc :: c_char) -> * mut aws_string ; } extern "C" { # [doc = " Allocate a new string with the same contents as array."] pub fn aws_string_new_from_array (allocator : * mut aws_allocator , bytes : * const u8 , len : usize) -> * mut aws_string ; } extern "C" { # [doc = " Allocate a new string with the same contents as another string."] pub fn aws_string_new_from_string (allocator : * mut aws_allocator , str_ : * const aws_string) -> * mut aws_string ; } extern "C" { # [doc = " Allocate a new string with the same contents as cursor."] pub fn aws_string_new_from_cursor (allocator : * mut aws_allocator , cursor : * const aws_byte_cursor) -> * mut aws_string ; } extern "C" { # [doc = " Allocate a new string with the same contents as buf."] pub fn aws_string_new_from_buf (allocator : * mut aws_allocator , buf : * const aws_byte_buf) -> * mut aws_string ; } extern "C" { # [doc = " Deallocate string."] pub fn aws_string_destroy (str_ : * mut aws_string) ; } extern "C" { # [doc = " Zeroes out the data bytes of string and then deallocates the memory.\n Not safe to run on a string created with AWS_STATIC_STRING_FROM_LITERAL."] pub fn aws_string_destroy_secure (str_ : * mut aws_string) ; } extern "C" { # [doc = " Compares lexicographical ordering of two strings. This is a binary\n byte-by-byte comparison, treating bytes as unsigned integers. It is suitable\n for either textual or binary data and is unaware of unicode or any other byte\n encoding. If both strings are identical in the bytes of the shorter string,\n then the longer string is lexicographically after the shorter.\n\n Returns a positive number if string a > string b. (i.e., string a is\n lexicographically after string b.) Returns zero if string a = string b.\n Returns negative number if string a < string b."] pub fn aws_string_compare (a : * const aws_string , b : * const aws_string) -> :: libc :: c_int ; } extern "C" { # [doc = " A convenience function for sorting lists of (const struct aws_string *) elements. This can be used as a\n comparator for aws_array_list_sort. It is just a simple wrapper around aws_string_compare."] pub fn aws_array_list_comparator_string (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies all bytes from string to buf.\n\n On success, returns true and updates the buf pointer/length\n accordingly. If there is insufficient space in the buf, returns\n false, leaving the buf unchanged."] pub fn aws_byte_buf_write_from_whole_string (buf : * mut aws_byte_buf , src : * const aws_string) -> bool ; } extern "C" { # [doc = " Creates an aws_byte_cursor from an existing string."] pub fn aws_byte_cursor_from_string (src : * const aws_string) -> aws_byte_cursor ; } extern "C" { # [doc = " If the string was dynamically allocated, clones it. If the string was statically allocated (i.e. has no allocator),\n returns the original string."] pub fn aws_string_clone_or_reuse (allocator : * mut aws_allocator , str_ : * const aws_string) -> * mut aws_string ; } extern "C" { # [doc = " Computes the length of a c string in bytes assuming the character set is either ASCII or UTF-8. If no NULL character\n is found within max_read_len of str, AWS_ERROR_C_STRING_BUFFER_NOT_NULL_TERMINATED is raised. Otherwise, str_len\n will contain the string length minus the NULL character, and AWS_OP_SUCCESS will be returned."] pub fn aws_secure_strlen (str_ : * const :: libc :: c_char , max_read_len : usize , str_len : * mut usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Equivalent to str->bytes."] pub fn aws_string_bytes (str_ : * const aws_string) -> * const u8 ; } extern "C" { # [doc = " Equivalent to `(const char *)str->bytes`."] pub fn aws_string_c_str (str_ : * const aws_string) -> * const :: libc :: c_char ; } extern "C" { # [doc = " Evaluates the set of properties that define the shape of all valid aws_string structures.\n It is also a cheap check, in the sense it run in constant time (i.e., no loops or recursion)."] pub fn aws_string_is_valid (str_ : * const aws_string) -> bool ; } extern "C" { # [doc = " Best-effort checks aws_string invariants, when the str->len is unknown"] pub fn aws_c_string_is_valid (str_ : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Evaluates if a char is a white character."] pub fn aws_char_is_space (c : u8) -> bool ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_thread_detach_state { AWS_THREAD_NOT_CREATED = 1 , AWS_THREAD_JOINABLE = 2 , AWS_THREAD_JOIN_COMPLETED = 3 , AWS_THREAD_MANAGED = 4 , } # [repr (u32)] # [non_exhaustive] # [doc = " Specifies the join strategy used on an aws_thread, which in turn controls whether or not a thread participates\n in the managed thread system. The managed thread system provides logic to guarantee a join on all participating\n threads at the cost of laziness (the user cannot control when joins happen).\n\n Manual - thread does not participate in the managed thread system; any joins must be done by the user. This\n is the default. The user must call aws_thread_clean_up(), but only after any desired join operation has completed.\n Not doing so will cause the windows handle to leak.\n\n Managed - the managed thread system will automatically perform a join some time after the thread's run function\n has completed. It is an error to call aws_thread_join on a thread configured with the managed join strategy. The\n managed thread system will call aws_thread_clean_up() on the thread after the background join has completed.\n\n Additionally, an API exists, aws_thread_join_all_managed(), which blocks and returns when all outstanding threads\n with the managed strategy have fully joined. This API is useful for tests (rather than waiting for many individual\n signals) and program shutdown or DLL unload. This API is automatically invoked by the common library clean up\n function. If the common library clean up is called from a managed thread, this will cause deadlock.\n\n Lazy thread joining is done only when threads finish their run function or when the user calls\n aws_thread_join_all_managed(). This means it may be a long time between thread function completion and the join\n being applied, but the queue of unjoined threads is always one or fewer so there is no critical resource\n backlog.\n\n Currently, only event loop group async cleanup and host resolver threads participate in the managed thread system.\n Additionally, event loop threads will increment and decrement the pending join count (they are manually joined\n internally) in order to have an accurate view of internal thread usage and also to prevent failure to release\n an event loop group fully from allowing aws_thread_join_all_managed() from running to completion when its\n intent is such that it should block instead."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_thread_join_strategy { AWS_TJS_MANUAL = 0 , AWS_TJS_MANAGED = 1 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_thread_options { pub stack_size : usize , pub cpu_id : i32 , pub join_strategy : aws_thread_join_strategy , # [doc = " Thread name, for debugging purpose.\n The length should not exceed AWS_THREAD_NAME_RECOMMENDED_STRLEN(15)\n if you want it to display properly on all platforms."] pub name : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_thread_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_thread_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_thread_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_thread_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_thread_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_thread_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . stack_size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_thread_options) , "::" , stringify ! (stack_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cpu_id) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_thread_options) , "::" , stringify ! (cpu_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . join_strategy) as usize - ptr as usize } , 12usize , concat ! ("Offset of field: " , stringify ! (aws_thread_options) , "::" , stringify ! (join_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . name) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_thread_options) , "::" , stringify ! (name))) ; } impl Default for aws_thread_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_thread_once = pthread_once_t ; pub type aws_thread_id_t = pthread_t ; # [repr (C)] pub struct aws_thread { pub allocator : * mut aws_allocator , pub detach_state : aws_thread_detach_state , pub thread_id : aws_thread_id_t , } # [test] fn bindgen_test_layout_aws_thread () { const UNINIT : :: std :: mem :: MaybeUninit < aws_thread > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_thread > () , 24usize , concat ! ("Size of: " , stringify ! (aws_thread))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_thread > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_thread))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_thread) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . detach_state) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_thread) , "::" , stringify ! (detach_state))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . thread_id) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_thread) , "::" , stringify ! (thread_id))) ; } impl Default for aws_thread { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Returns an instance of system default thread options."] pub fn aws_default_thread_options () -> * const aws_thread_options ; } extern "C" { pub fn aws_thread_call_once (flag : * mut aws_thread_once , call_once : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: libc :: c_void) > , user_data : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Initializes a new platform specific thread object struct (not the os-level\n thread itself)."] pub fn aws_thread_init (thread : * mut aws_thread , allocator : * mut aws_allocator) -> :: libc :: c_int ; } extern "C" { # [doc = " Creates an OS level thread and associates it with func. context will be passed to func when it is executed.\n options will be applied to the thread if they are applicable for the platform.\n\n After launch, you may join on the thread. A successfully launched thread must have clean_up called on it in order\n to avoid a handle leak. If you do not join before calling clean_up, the thread will become detached.\n\n Managed threads must not have join or clean_up called on them by external code."] pub fn aws_thread_launch (thread : * mut aws_thread , func : :: std :: option :: Option < unsafe extern "C" fn (arg : * mut :: libc :: c_void) > , arg : * mut :: libc :: c_void , options : * const aws_thread_options) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the id of thread"] pub fn aws_thread_get_id (thread : * mut aws_thread) -> aws_thread_id_t ; } extern "C" { # [doc = " Gets the detach state of the thread. For example, is it safe to call join on\n this thread? Has it been detached()?"] pub fn aws_thread_get_detach_state (thread : * mut aws_thread) -> aws_thread_detach_state ; } extern "C" { # [doc = " Joins the calling thread to a thread instance. Returns when thread is\n finished. Calling this from the associated OS thread will cause a deadlock."] pub fn aws_thread_join (thread : * mut aws_thread) -> :: libc :: c_int ; } extern "C" { # [doc = " Blocking call that waits for all managed threads to complete their join call. This can only be called\n from the main thread or a non-managed thread.\n\n This gets called automatically from library cleanup.\n\n By default the wait is unbounded, but that default can be overridden via aws_thread_set_managed_join_timeout_ns()"] pub fn aws_thread_join_all_managed () -> :: libc :: c_int ; } extern "C" { # [doc = " Overrides how long, in nanoseconds, that aws_thread_join_all_managed will wait for threads to complete.\n A value of zero will result in an unbounded wait."] pub fn aws_thread_set_managed_join_timeout_ns (timeout_in_ns : u64) ; } extern "C" { # [doc = " Cleans up the thread handle. Don't call this on a managed thread. If you wish to join the thread, you must join\n before calling this function."] pub fn aws_thread_clean_up (thread : * mut aws_thread) ; } extern "C" { # [doc = " Returns the thread id of the calling thread."] pub fn aws_thread_current_thread_id () -> aws_thread_id_t ; } extern "C" { # [doc = " Compare thread ids."] pub fn aws_thread_thread_id_equal (t1 : aws_thread_id_t , t2 : aws_thread_id_t) -> bool ; } extern "C" { # [doc = " Sleeps the current thread by nanos."] pub fn aws_thread_current_sleep (nanos : u64) ; } pub type aws_thread_atexit_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; extern "C" { # [doc = " Adds a callback to the chain to be called when the current thread joins.\n Callbacks are called from the current thread, in the reverse order they\n were added, after the thread function returns.\n If not called from within an aws_thread, has no effect."] pub fn aws_thread_current_at_exit (callback : aws_thread_atexit_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Increments the count of unjoined threads in the managed thread system. Used by managed threads and\n event loop threads. Additional usage requires the user to join corresponding threads themselves and\n correctly increment/decrement even in the face of launch/join errors.\n\n aws_thread_join_all_managed() will not return until this count has gone to zero."] pub fn aws_thread_increment_unjoined_count () ; } extern "C" { # [doc = " Decrements the count of unjoined threads in the managed thread system. Used by managed threads and\n event loop threads. Additional usage requires the user to join corresponding threads themselves and\n correctly increment/decrement even in the face of launch/join errors.\n\n aws_thread_join_all_managed() will not return until this count has gone to zero."] pub fn aws_thread_decrement_unjoined_count () ; } extern "C" { # [doc = " Gets name of the current thread.\n Caller is responsible for destroying returned string.\n If thread does not have a name, AWS_OP_SUCCESS is returned and out_name is\n set to NULL.\n If underlying OS call fails, AWS_ERROR_SYS_CALL_FAILURE will be raised\n If OS does not support getting thread name, AWS_ERROR_PLATFORM_NOT_SUPPORTED\n will be raised"] pub fn aws_thread_current_name (allocator : * mut aws_allocator , out_name : * mut * mut aws_string) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets name of the thread.\n Caller is responsible for destroying returned string.\n If thread does not have a name, AWS_OP_SUCCESS is returned and out_name is\n set to NULL.\n If underlying OS call fails, AWS_ERROR_SYS_CALL_FAILURE will be raised\n If OS does not support getting thread name, AWS_ERROR_PLATFORM_NOT_SUPPORTED\n will be raised"] pub fn aws_thread_name (allocator : * mut aws_allocator , thread_id : aws_thread_id_t , out_name : * mut * mut aws_string) -> :: libc :: c_int ; } pub mod aws_log_level { # [doc = " Controls what log calls pass through the logger and what log calls get filtered out.\n If a log level has a value of X, then all log calls using a level <= X will appear, while\n those using a value > X will not occur.\n\n You can filter both dynamically (by setting the log level on the logger object) or statically\n (by defining AWS_STATIC_LOG_LEVEL to be an appropriate integer module-wide). Statically filtered\n log calls will be completely compiled out but require a rebuild if you want to get more detail\n about what's happening."] pub type Type = :: libc :: c_uint ; pub const AWS_LL_NONE : Type = 0 ; pub const AWS_LL_FATAL : Type = 1 ; pub const AWS_LL_ERROR : Type = 2 ; pub const AWS_LL_WARN : Type = 3 ; pub const AWS_LL_INFO : Type = 4 ; pub const AWS_LL_DEBUG : Type = 5 ; pub const AWS_LL_TRACE : Type = 6 ; pub const AWS_LL_COUNT : Type = 7 ; } # [doc = " Log subject is a way of designating the topic of logging.\n\n The general idea is to support a finer-grained approach to log level control. The primary use case\n is for situations that require more detailed logging within a specific domain, where enabling that detail\n globally leads to an untenable flood of information.\n\n For example, enable TRACE logging for tls-related log statements (handshake binary payloads), but\n only WARN logging everywhere else (because http payloads would blow up the log files).\n\n Log subject is an enum similar to aws error: each library has its own value-space and someone is\n responsible for registering the value <-> string connections."] pub type aws_log_subject_t = u32 ; pub const AWS_LOG_SUBJECT_STRIDE_BITS : _bindgen_ty_20 = _bindgen_ty_20 :: AWS_LOG_SUBJECT_STRIDE_BITS ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_20 { AWS_LOG_SUBJECT_STRIDE_BITS = 10 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_subject_info { pub subject_id : aws_log_subject_t , pub subject_name : * const :: libc :: c_char , pub subject_description : * const :: libc :: c_char , } # [test] fn bindgen_test_layout_aws_log_subject_info () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_subject_info > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_subject_info > () , 24usize , concat ! ("Size of: " , stringify ! (aws_log_subject_info))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_subject_info > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_subject_info))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subject_id) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_subject_info) , "::" , stringify ! (subject_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subject_name) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_subject_info) , "::" , stringify ! (subject_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subject_description) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_log_subject_info) , "::" , stringify ! (subject_description))) ; } impl Default for aws_log_subject_info { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_subject_info_list { pub subject_list : * mut aws_log_subject_info , pub count : usize , } # [test] fn bindgen_test_layout_aws_log_subject_info_list () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_subject_info_list > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_subject_info_list > () , 16usize , concat ! ("Size of: " , stringify ! (aws_log_subject_info_list))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_subject_info_list > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_subject_info_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subject_list) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_subject_info_list) , "::" , stringify ! (subject_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . count) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_subject_info_list) , "::" , stringify ! (count))) ; } impl Default for aws_log_subject_info_list { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_common_log_subject { AWS_LS_COMMON_GENERAL = 0 , AWS_LS_COMMON_TASK_SCHEDULER = 1 , AWS_LS_COMMON_THREAD = 2 , AWS_LS_COMMON_MEMTRACE = 3 , AWS_LS_COMMON_XML_PARSER = 4 , AWS_LS_COMMON_IO = 5 , AWS_LS_COMMON_BUS = 6 , AWS_LS_COMMON_TEST = 7 , AWS_LS_COMMON_JSON_PARSER = 8 , AWS_LS_COMMON_LAST = 1023 , } # [doc = " We separate the log level function from the log call itself so that we can do the filter check in the macros (see\n below)\n\n By doing so, we make it so that the variadic format arguments are not even evaluated if the filter check does not\n succeed."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_logger_vtable { pub log : :: std :: option :: Option < unsafe extern "C" fn (logger : * mut aws_logger , log_level : aws_log_level :: Type , subject : aws_log_subject_t , format : * const :: libc :: c_char , ...) -> :: libc :: c_int > , pub get_log_level : :: std :: option :: Option < unsafe extern "C" fn (logger : * mut aws_logger , subject : aws_log_subject_t) -> aws_log_level :: Type > , pub clean_up : :: std :: option :: Option < unsafe extern "C" fn (logger : * mut aws_logger) > , pub set_log_level : :: std :: option :: Option < unsafe extern "C" fn (logger : * mut aws_logger , arg1 : aws_log_level :: Type) -> :: libc :: c_int > , } # [test] fn bindgen_test_layout_aws_logger_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_logger_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_logger_vtable > () , 32usize , concat ! ("Size of: " , stringify ! (aws_logger_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_logger_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_logger_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . log) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_logger_vtable) , "::" , stringify ! (log))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_log_level) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_logger_vtable) , "::" , stringify ! (get_log_level))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clean_up) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_logger_vtable) , "::" , stringify ! (clean_up))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . set_log_level) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_logger_vtable) , "::" , stringify ! (set_log_level))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_logger { pub vtable : * mut aws_logger_vtable , pub allocator : * mut aws_allocator , pub p_impl : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_logger () { const UNINIT : :: std :: mem :: MaybeUninit < aws_logger > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_logger > () , 24usize , concat ! ("Size of: " , stringify ! (aws_logger))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_logger > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_logger))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_logger) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_logger) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . p_impl) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_logger) , "::" , stringify ! (p_impl))) ; } impl Default for aws_logger { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_logger_pipeline { pub formatter : * mut aws_log_formatter , pub channel : * mut aws_log_channel , pub writer : * mut aws_log_writer , pub allocator : * mut aws_allocator , pub level : aws_atomic_var , } # [test] fn bindgen_test_layout_aws_logger_pipeline () { const UNINIT : :: std :: mem :: MaybeUninit < aws_logger_pipeline > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_logger_pipeline > () , 40usize , concat ! ("Size of: " , stringify ! (aws_logger_pipeline))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_logger_pipeline > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_logger_pipeline))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . formatter) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_logger_pipeline) , "::" , stringify ! (formatter))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . channel) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_logger_pipeline) , "::" , stringify ! (channel))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . writer) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_logger_pipeline) , "::" , stringify ! (writer))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_logger_pipeline) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . level) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_logger_pipeline) , "::" , stringify ! (level))) ; } impl Default for aws_logger_pipeline { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Options for aws_logger_init_standard().\n Set `filename` to open a file for logging and close it when the logger cleans up.\n Set `file` to use a file that is already open, such as `stderr` or `stdout`."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_logger_standard_options { pub level : aws_log_level :: Type , pub filename : * const :: libc :: c_char , pub file : * mut FILE , } # [test] fn bindgen_test_layout_aws_logger_standard_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_logger_standard_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_logger_standard_options > () , 24usize , concat ! ("Size of: " , stringify ! (aws_logger_standard_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_logger_standard_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_logger_standard_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . level) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_logger_standard_options) , "::" , stringify ! (level))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . filename) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_logger_standard_options) , "::" , stringify ! (filename))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . file) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_logger_standard_options) , "::" , stringify ! (file))) ; } impl Default for aws_logger_standard_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Sets the aws logger used globally across the process. Not thread-safe. Must only be called once."] pub fn aws_logger_set (logger : * mut aws_logger) ; } extern "C" { # [doc = " Gets the aws logger used globally across the process."] pub fn aws_logger_get () -> * mut aws_logger ; } extern "C" { # [doc = " Gets the aws logger used globally across the process if the logging level is at least the inputted level.\n\n @param subject log subject to perform the level check versus, not currently used\n @param level logging level to check against in order to return the logger\n @return the current logger if the current logging level is at or more detailed then the supplied logging level"] pub fn aws_logger_get_conditional (subject : aws_log_subject_t , level : aws_log_level :: Type) -> * mut aws_logger ; } extern "C" { # [doc = " Cleans up all resources used by the logger; simply invokes the clean_up v-function"] pub fn aws_logger_clean_up (logger : * mut aws_logger) ; } extern "C" { # [doc = " Sets the current logging level for the logger. Loggers are not require to support this.\n @param logger logger to set the log level for\n @param level new log level for the logger\n @return AWS_OP_SUCCESS if the level was successfully set, AWS_OP_ERR otherwise"] pub fn aws_logger_set_log_level (logger : * mut aws_logger , level : aws_log_level :: Type) -> :: libc :: c_int ; } extern "C" { # [doc = " Converts a log level to a c-string constant. Intended primarily to support building log lines that\n include the level in them, i.e.\n\n [ERROR] 10:34:54.642 01-31-19 - Json parse error...."] pub fn aws_log_level_to_string (log_level : aws_log_level :: Type , level_string : * mut * const :: libc :: c_char) -> :: libc :: c_int ; } extern "C" { # [doc = " Converts a c-string constant to a log level value. Uses case-insensitive comparison\n and simply iterates all possibilities until a match or nothing remains. If no match\n is found, AWS_OP_ERR is returned."] pub fn aws_string_to_log_level (level_string : * const :: libc :: c_char , log_level : * mut aws_log_level :: Type) -> :: libc :: c_int ; } extern "C" { # [doc = " Converts an aws_thread_id_t to a c-string. For portability, aws_thread_id_t\n must not be printed directly. Intended primarily to support building log\n lines that include the thread id in them. The parameter `buffer` must\n point-to a char buffer of length `bufsz == AWS_THREAD_ID_T_REPR_BUFSZ`. The\n thread id representation is returned in `buffer`."] pub fn aws_thread_id_t_to_string (thread_id : aws_thread_id_t , buffer : * mut :: libc :: c_char , bufsz : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Get subject name from log subject."] pub fn aws_log_subject_name (subject : aws_log_subject_t) -> * const :: libc :: c_char ; } extern "C" { # [doc = " Connects log subject strings with log subject integer values"] pub fn aws_register_log_subject_info_list (log_subject_list : * mut aws_log_subject_info_list) ; } extern "C" { # [doc = " Disconnects log subject strings with log subject integer values"] pub fn aws_unregister_log_subject_info_list (log_subject_list : * mut aws_log_subject_info_list) ; } extern "C" { pub fn aws_logger_init_standard (logger : * mut aws_logger , allocator : * mut aws_allocator , options : * mut aws_logger_standard_options) -> :: libc :: c_int ; } extern "C" { pub fn aws_logger_init_from_external (logger : * mut aws_logger , allocator : * mut aws_allocator , formatter : * mut aws_log_formatter , channel : * mut aws_log_channel , writer : * mut aws_log_writer , level : aws_log_level :: Type) -> :: libc :: c_int ; } extern "C" { pub static mut g_pipeline_logger_owned_vtable : aws_logger_vtable ; } extern "C" { pub fn aws_logger_init_noalloc (logger : * mut aws_logger , allocator : * mut aws_allocator , options : * mut aws_logger_standard_options) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_io_log_subject { AWS_LS_IO_GENERAL = 1024 , AWS_LS_IO_EVENT_LOOP = 1025 , AWS_LS_IO_SOCKET = 1026 , AWS_LS_IO_SOCKET_HANDLER = 1027 , AWS_LS_IO_TLS = 1028 , AWS_LS_IO_ALPN = 1029 , AWS_LS_IO_DNS = 1030 , AWS_LS_IO_PKI = 1031 , AWS_LS_IO_CHANNEL = 1032 , AWS_LS_IO_CHANNEL_BOOTSTRAP = 1033 , AWS_LS_IO_FILE_UTILS = 1034 , AWS_LS_IO_SHARED_LIBRARY = 1035 , AWS_LS_IO_EXPONENTIAL_BACKOFF_RETRY_STRATEGY = 1036 , AWS_LS_IO_STANDARD_RETRY_STRATEGY = 1037 , AWS_LS_IO_PKCS11 = 1038 , AWS_IO_LS_LAST = 2047 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_sdkutils_errors { AWS_ERROR_SDKUTILS_GENERAL = 15360 , AWS_ERROR_SDKUTILS_PARSE_FATAL = 15361 , AWS_ERROR_SDKUTILS_PARSE_RECOVERABLE = 15362 , AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_RULESET = 15363 , AWS_ERROR_SDKUTILS_ENDPOINTS_PARSE_FAILED = 15364 , AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_INIT_FAILED = 15365 , AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_FAILED = 15366 , AWS_ERROR_SDKUTILS_ENDPOINTS_EMPTY_RULESET = 15367 , AWS_ERROR_SDKUTILS_ENDPOINTS_RULESET_EXHAUSTED = 15368 , AWS_ERROR_SDKUTILS_PARTITIONS_UNSUPPORTED = 15369 , AWS_ERROR_SDKUTILS_PARTITIONS_PARSE_FAILED = 15370 , AWS_ERROR_SDKUTILS_END_RANGE = 16383 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_sdkutils_log_subject { AWS_LS_SDKUTILS_GENERAL = 15360 , AWS_LS_SDKUTILS_PROFILE = 15361 , AWS_LS_SDKUTILS_ENDPOINTS_PARSING = 15362 , AWS_LS_SDKUTILS_ENDPOINTS_RESOLVE = 15363 , AWS_LS_SDKUTILS_ENDPOINTS_GENERAL = 15364 , AWS_LS_SDKUTILS_PARTITIONS_PARSING = 15365 , AWS_LS_SDKUTILS_LAST = 16383 , } extern "C" { pub fn aws_sdkutils_library_init (allocator : * mut aws_allocator) ; } extern "C" { pub fn aws_sdkutils_library_clean_up () ; } # [repr (u32)] # [non_exhaustive] # [doc = " Auth-specific error codes"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_auth_errors { AWS_AUTH_PROFILE_PARSE_RECOVERABLE_ERROR = 15362 , AWS_AUTH_PROFILE_PARSE_FATAL_ERROR = 15361 , AWS_AUTH_SIGNING_UNSUPPORTED_ALGORITHM = 6144 , AWS_AUTH_SIGNING_MISMATCHED_CONFIGURATION = 6145 , AWS_AUTH_SIGNING_NO_CREDENTIALS = 6146 , AWS_AUTH_SIGNING_ILLEGAL_REQUEST_QUERY_PARAM = 6147 , AWS_AUTH_SIGNING_ILLEGAL_REQUEST_HEADER = 6148 , AWS_AUTH_SIGNING_INVALID_CONFIGURATION = 6149 , AWS_AUTH_CREDENTIALS_PROVIDER_INVALID_ENVIRONMENT = 6150 , AWS_AUTH_CREDENTIALS_PROVIDER_INVALID_DELEGATE = 6151 , AWS_AUTH_CREDENTIALS_PROVIDER_PROFILE_SOURCE_FAILURE = 6152 , AWS_AUTH_CREDENTIALS_PROVIDER_IMDS_SOURCE_FAILURE = 6153 , AWS_AUTH_CREDENTIALS_PROVIDER_STS_SOURCE_FAILURE = 6154 , AWS_AUTH_CREDENTIALS_PROVIDER_HTTP_STATUS_FAILURE = 6155 , AWS_AUTH_PROVIDER_PARSER_UNEXPECTED_RESPONSE = 6156 , AWS_AUTH_CREDENTIALS_PROVIDER_ECS_SOURCE_FAILURE = 6157 , AWS_AUTH_CREDENTIALS_PROVIDER_X509_SOURCE_FAILURE = 6158 , AWS_AUTH_CREDENTIALS_PROVIDER_PROCESS_SOURCE_FAILURE = 6159 , AWS_AUTH_CREDENTIALS_PROVIDER_STS_WEB_IDENTITY_SOURCE_FAILURE = 6160 , AWS_AUTH_SIGNING_UNSUPPORTED_SIGNATURE_TYPE = 6161 , AWS_AUTH_SIGNING_MISSING_PREVIOUS_SIGNATURE = 6162 , AWS_AUTH_SIGNING_INVALID_CREDENTIALS = 6163 , AWS_AUTH_CANONICAL_REQUEST_MISMATCH = 6164 , AWS_AUTH_SIGV4A_SIGNATURE_VALIDATION_FAILURE = 6165 , AWS_AUTH_CREDENTIALS_PROVIDER_COGNITO_SOURCE_FAILURE = 6166 , AWS_AUTH_CREDENTIALS_PROVIDER_DELEGATE_FAILURE = 6167 , AWS_AUTH_SSO_TOKEN_PROVIDER_SOURCE_FAILURE = 6168 , AWS_AUTH_SSO_TOKEN_INVALID = 6169 , AWS_AUTH_SSO_TOKEN_EXPIRED = 6170 , AWS_AUTH_CREDENTIALS_PROVIDER_SSO_SOURCE_FAILURE = 6171 , AWS_AUTH_ERROR_END_RANGE = 7167 , } # [repr (u32)] # [non_exhaustive] # [doc = " Auth-specific logging subjects"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_auth_log_subject { AWS_LS_AUTH_GENERAL = 6144 , AWS_LS_AUTH_PROFILE = 6145 , AWS_LS_AUTH_CREDENTIALS_PROVIDER = 6146 , AWS_LS_AUTH_SIGNING = 6147 , AWS_LS_IMDS_CLIENT = 6148 , AWS_LS_AUTH_LAST = 7167 , } extern "C" { # [doc = " Initializes internal datastructures used by aws-c-auth.\n Must be called before using any functionality in aws-c-auth.\n\n @param allocator memory allocator to use for any module-level memory allocation"] pub fn aws_auth_library_init (allocator : * mut aws_allocator) ; } extern "C" { # [doc = " Clean up internal datastructures used by aws-c-auth.\n Must not be called until application is done using functionality in aws-c-auth."] pub fn aws_auth_library_clean_up () ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_auth_http_system_vtable { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_ecc_key_pair { _unused : [u8 ; 0] , } extern "C" { pub static aws_sts_assume_role_default_duration_secs : u16 ; } pub type aws_on_get_credentials_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (credentials : * mut aws_credentials , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_credentials_provider_get_credentials_fn = :: std :: option :: Option < unsafe extern "C" fn (provider : * mut aws_credentials_provider , callback : aws_on_get_credentials_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; pub type aws_credentials_provider_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (provider : * mut aws_credentials_provider) > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_credentials_provider_vtable { pub get_credentials : aws_credentials_provider_get_credentials_fn , pub destroy : aws_credentials_provider_destroy_fn , } # [test] fn bindgen_test_layout_aws_credentials_provider_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_credentials) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_vtable) , "::" , stringify ! (get_credentials))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_vtable) , "::" , stringify ! (destroy))) ; } pub type aws_credentials_provider_shutdown_completed_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_shutdown_options { pub shutdown_callback : aws_credentials_provider_shutdown_completed_fn , pub shutdown_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_credentials_provider_shutdown_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_shutdown_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_shutdown_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_shutdown_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_shutdown_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_shutdown_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_user_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_shutdown_options) , "::" , stringify ! (shutdown_user_data))) ; } impl Default for aws_credentials_provider_shutdown_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " A baseclass for credentials providers. A credentials provider is an object that has an asynchronous\n query function for retrieving AWS credentials.\n\n Ref-counted. Thread-safe."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider { pub vtable : * mut aws_credentials_provider_vtable , pub allocator : * mut aws_allocator , pub shutdown_options : aws_credentials_provider_shutdown_options , pub impl_ : * mut :: libc :: c_void , pub ref_count : aws_atomic_var , } # [test] fn bindgen_test_layout_aws_credentials_provider () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider > () , 48usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider) , "::" , stringify ! (ref_count))) ; } impl Default for aws_credentials_provider { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for a provider that returns a fixed set of credentials"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_static_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub access_key_id : aws_byte_cursor , pub secret_access_key : aws_byte_cursor , pub session_token : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_credentials_provider_static_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_static_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_static_options > () , 64usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_static_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_static_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_static_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_static_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . access_key_id) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_static_options) , "::" , stringify ! (access_key_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . secret_access_key) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_static_options) , "::" , stringify ! (secret_access_key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . session_token) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_static_options) , "::" , stringify ! (session_token))) ; } impl Default for aws_credentials_provider_static_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for a provider that returns credentials based on environment variable values"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_environment_options { pub shutdown_options : aws_credentials_provider_shutdown_options , } # [test] fn bindgen_test_layout_aws_credentials_provider_environment_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_environment_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_environment_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_environment_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_environment_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_environment_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_environment_options) , "::" , stringify ! (shutdown_options))) ; } impl Default for aws_credentials_provider_environment_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for a provider that sources credentials from the aws config and credentials files\n (by default ~/.aws/config and ~/.aws/credentials)"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_profile_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub profile_name_override : aws_byte_cursor , pub config_file_name_override : aws_byte_cursor , pub credentials_file_name_override : aws_byte_cursor , # [doc = " (Optional)\n Use a cached merged profile collection. A merge collection has both config file\n (~/.aws/config) and credentials file based profile collection (~/.aws/credentials) using\n `aws_profile_collection_new_from_merge`.\n If this option is provided, `config_file_name_override` and `credentials_file_name_override` will be ignored."] pub profile_collection_cached : * mut aws_profile_collection , pub bootstrap : * mut aws_client_bootstrap , pub tls_ctx : * mut aws_tls_ctx , pub function_table : * mut aws_auth_http_system_vtable , } # [test] fn bindgen_test_layout_aws_credentials_provider_profile_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_profile_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_profile_options > () , 96usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_profile_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_profile_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_profile_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_name_override) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (profile_name_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_file_name_override) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (config_file_name_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . credentials_file_name_override) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (credentials_file_name_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_collection_cached) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (profile_collection_cached))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (function_table))) ; } impl Default for aws_credentials_provider_profile_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for a provider that functions as a caching decorator. Credentials sourced through this\n provider will be cached within it until their expiration time. When the cached credentials expire, new\n credentials will be fetched when next queried."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_cached_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub source : * mut aws_credentials_provider , pub refresh_time_in_milliseconds : u64 , pub high_res_clock_fn : aws_io_clock_fn , pub system_clock_fn : aws_io_clock_fn , } # [test] fn bindgen_test_layout_aws_credentials_provider_cached_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_cached_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_cached_options > () , 48usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_cached_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_cached_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_cached_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cached_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . source) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cached_options) , "::" , stringify ! (source))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . refresh_time_in_milliseconds) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cached_options) , "::" , stringify ! (refresh_time_in_milliseconds))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . high_res_clock_fn) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cached_options) , "::" , stringify ! (high_res_clock_fn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . system_clock_fn) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cached_options) , "::" , stringify ! (system_clock_fn))) ; } impl Default for aws_credentials_provider_cached_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for a provider that queries, in order, a list of providers. This provider uses the\n first set of credentials successfully queried. Providers are queried one at a time; a provider is not queried\n until the preceding provider has failed to source credentials."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_chain_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub providers : * mut * mut aws_credentials_provider , pub provider_count : usize , } # [test] fn bindgen_test_layout_aws_credentials_provider_chain_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_chain_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_chain_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_chain_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_chain_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_chain_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . providers) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_options) , "::" , stringify ! (providers))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . provider_count) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_options) , "::" , stringify ! (provider_count))) ; } impl Default for aws_credentials_provider_chain_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_imds_protocol_version { # [doc = " Defaults to IMDS_PROTOCOL_V2. It can be set to either one and IMDS Client\n will figure out (by looking at response code) which protocol an instance\n is using. But a more clear setting will reduce unnecessary network request."] IMDS_PROTOCOL_V2 = 0 , # [doc = " Defaults to IMDS_PROTOCOL_V2. It can be set to either one and IMDS Client\n will figure out (by looking at response code) which protocol an instance\n is using. But a more clear setting will reduce unnecessary network request."] IMDS_PROTOCOL_V1 = 1 , } # [doc = " Configuration options for the provider that sources credentials from ec2 instance metadata"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_imds_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , pub imds_version : aws_imds_protocol_version , pub function_table : * mut aws_auth_http_system_vtable , } # [test] fn bindgen_test_layout_aws_credentials_provider_imds_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_imds_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_imds_options > () , 40usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_imds_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_imds_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_imds_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_imds_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_imds_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . imds_version) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_imds_options) , "::" , stringify ! (imds_version))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_imds_options) , "::" , stringify ! (function_table))) ; } impl Default for aws_credentials_provider_imds_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_ecs_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , pub host : aws_byte_cursor , pub path_and_query : aws_byte_cursor , pub auth_token : aws_byte_cursor , pub tls_ctx : * mut aws_tls_ctx , pub function_table : * mut aws_auth_http_system_vtable , pub port : u16 , } # [test] fn bindgen_test_layout_aws_credentials_provider_ecs_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_ecs_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_ecs_options > () , 96usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_ecs_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_ecs_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_ecs_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . path_and_query) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (path_and_query))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . auth_token) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (auth_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (function_table))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (port))) ; } impl Default for aws_credentials_provider_ecs_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for the X509 credentials provider\n\n The x509 credentials provider sources temporary credentials from AWS IoT Core using TLS mutual authentication.\n See details: https://docs.aws.amazon.com/iot/latest/developerguide/authorizing-direct-aws.html\n An end to end demo with detailed steps can be found here:\n https://aws.amazon.com/blogs/security/how-to-eliminate-the-need-for-hardcoded-aws-credentials-in-devices-by-using-the-aws-iot-credentials-provider/"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_x509_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , pub tls_connection_options : * const aws_tls_connection_options , pub thing_name : aws_byte_cursor , pub role_alias : aws_byte_cursor , # [doc = " Per-account X509 credentials sourcing endpoint."] pub endpoint : aws_byte_cursor , # [doc = " (Optional) Http proxy configuration for the http request that fetches credentials"] pub proxy_options : * const aws_http_proxy_options , pub function_table : * mut aws_auth_http_system_vtable , } # [test] fn bindgen_test_layout_aws_credentials_provider_x509_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_x509_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_x509_options > () , 96usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_x509_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_x509_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_x509_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_connection_options) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (tls_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . thing_name) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (thing_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . role_alias) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (role_alias))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoint) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (endpoint))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_options) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (function_table))) ; } impl Default for aws_credentials_provider_x509_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for the STS web identity provider\n\n Sts with web identity credentials provider sources a set of temporary security credentials for users who have been\n authenticated in a mobile or web application with a web identity provider.\n Example providers include Amazon Cognito, Login with Amazon, Facebook, Google, or any OpenID Connect-compatible\n identity provider like Elastic Kubernetes Service\n https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html\n The required parameters used in the request (region, roleArn, sessionName, tokenFilePath) are automatically resolved\n by SDK from envrionment variables or config file.\n---------------------------------------------------------------------------------\n| Parameter | Environment Variable Name | Config File Property Name |\n----------------------------------------------------------------------------------\n| region | AWS_DEFAULT_REGION | region |\n| role_arn | AWS_ROLE_ARN | role_arn |\n| role_session_name | AWS_ROLE_SESSION_NAME | role_session_name |\n| token_file_path | AWS_WEB_IDENTITY_TOKEN_FILE | web_identity_token_file |\n|--------------------------------------------------------------------------------|"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_sts_web_identity_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , # [doc = " (Optional)\n Use a cached config profile collection. You can also pass a merged collection."] pub config_profile_collection_cached : * mut aws_profile_collection , pub tls_ctx : * mut aws_tls_ctx , pub function_table : * mut aws_auth_http_system_vtable , pub profile_name_override : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_credentials_provider_sts_web_identity_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_sts_web_identity_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_sts_web_identity_options > () , 64usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_sts_web_identity_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_sts_web_identity_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_sts_web_identity_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_profile_collection_cached) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (config_profile_collection_cached))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (function_table))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_name_override) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (profile_name_override))) ; } impl Default for aws_credentials_provider_sts_web_identity_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_sso_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub profile_name_override : aws_byte_cursor , pub config_file_name_override : aws_byte_cursor , # [doc = " (Optional)\n Use a cached config profile collection. You can also pass a merged collection.\n config_file_name_override will be ignored if this option is provided."] pub config_file_cached : * mut aws_profile_collection , pub bootstrap : * mut aws_client_bootstrap , pub tls_ctx : * mut aws_tls_ctx , pub function_table : * mut aws_auth_http_system_vtable , pub system_clock_fn : aws_io_clock_fn , } # [test] fn bindgen_test_layout_aws_credentials_provider_sso_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_sso_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_sso_options > () , 88usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_sso_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_sso_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_sso_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_name_override) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (profile_name_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_file_name_override) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (config_file_name_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_file_cached) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (config_file_cached))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (function_table))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . system_clock_fn) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (system_clock_fn))) ; } impl Default for aws_credentials_provider_sso_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for the STS credentials provider"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_sts_options { pub bootstrap : * mut aws_client_bootstrap , pub tls_ctx : * mut aws_tls_ctx , pub creds_provider : * mut aws_credentials_provider , pub role_arn : aws_byte_cursor , pub session_name : aws_byte_cursor , pub duration_seconds : u16 , # [doc = " (Optional) Http proxy configuration for the AssumeRole http request that fetches credentials"] pub http_proxy_options : * const aws_http_proxy_options , pub shutdown_options : aws_credentials_provider_shutdown_options , pub function_table : * mut aws_auth_http_system_vtable , pub system_clock_fn : aws_io_clock_fn , } # [test] fn bindgen_test_layout_aws_credentials_provider_sts_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_sts_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_sts_options > () , 104usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_sts_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_sts_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_sts_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . creds_provider) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (creds_provider))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . role_arn) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (role_arn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . session_name) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (session_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . duration_seconds) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (duration_seconds))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http_proxy_options) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (http_proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (function_table))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . system_clock_fn) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (system_clock_fn))) ; } impl Default for aws_credentials_provider_sts_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for the process credentials provider\n\n The process credentials provider sources credentials from running a command or process.\n The command to run is sourced from a profile in the AWS config file, using the standard\n profile selection rules. The profile key the command is read from is \"credential_process.\"\n E.g.:\n [default]\n credential_process=/opt/amazon/bin/my-credential-fetcher --argsA=abc\n On successfully running the command, the output should be a json data with the following\n format:\n {\n\"Version\": 1,\n\"AccessKeyId\": \"accesskey\",\n\"SecretAccessKey\": \"secretAccessKey\"\n\"SessionToken\": \"....\",\n\"Expiration\": \"2019-05-29T00:21:43Z\"\n}\n Version here identifies the command output format version."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_process_options { pub shutdown_options : aws_credentials_provider_shutdown_options , # [doc = " In which profile name to look for credential_process,\n if not provided, we will try environment variable: AWS_PROFILE."] pub profile_to_use : aws_byte_cursor , # [doc = " (Optional)\n Use a cached config profile collection. You can also pass a merged collection."] pub config_profile_collection_cached : * mut aws_profile_collection , } # [test] fn bindgen_test_layout_aws_credentials_provider_process_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_process_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_process_options > () , 40usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_process_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_process_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_process_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_process_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_to_use) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_process_options) , "::" , stringify ! (profile_to_use))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_profile_collection_cached) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_process_options) , "::" , stringify ! (config_profile_collection_cached))) ; } impl Default for aws_credentials_provider_process_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for the default credentials provider chain."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_chain_default_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , pub tls_ctx : * mut aws_tls_ctx , # [doc = " (Optional)\n Use a cached merged profile collection. A merge collection has both config file\n (~/.aws/config) and credentials file based profile collection (~/.aws/credentials) using\n `aws_profile_collection_new_from_merge`.\n If this option is provided, `config_file_name_override` and `credentials_file_name_override` will be ignored."] pub profile_collection_cached : * mut aws_profile_collection , pub profile_name_override : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_credentials_provider_chain_default_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_chain_default_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_chain_default_options > () , 56usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_chain_default_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_chain_default_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_chain_default_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_default_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_default_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_default_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_collection_cached) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_default_options) , "::" , stringify ! (profile_collection_cached))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_name_override) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_default_options) , "::" , stringify ! (profile_name_override))) ; } impl Default for aws_credentials_provider_chain_default_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_credentials_provider_delegate_get_credentials_fn = :: std :: option :: Option < unsafe extern "C" fn (delegate_user_data : * mut :: libc :: c_void , callback : aws_on_get_credentials_callback_fn , callback_user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Configuration options for the delegate credentials provider."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_delegate_options { pub shutdown_options : aws_credentials_provider_shutdown_options , # [doc = " Delegated get_credentials() callback."] pub get_credentials : aws_credentials_provider_delegate_get_credentials_fn , # [doc = " User data for delegated callbacks."] pub delegate_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_credentials_provider_delegate_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_delegate_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_delegate_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_delegate_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_delegate_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_delegate_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_delegate_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_credentials) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_delegate_options) , "::" , stringify ! (get_credentials))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . delegate_user_data) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_delegate_options) , "::" , stringify ! (delegate_user_data))) ; } impl Default for aws_credentials_provider_delegate_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " A (string) pair defining an identity provider and a valid login token sourced from it."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_cognito_identity_provider_token_pair { # [doc = " Name of an identity provider"] pub identity_provider_name : aws_byte_cursor , # [doc = " Valid login token source from the identity provider"] pub identity_provider_token : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_cognito_identity_provider_token_pair () { const UNINIT : :: std :: mem :: MaybeUninit < aws_cognito_identity_provider_token_pair > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_cognito_identity_provider_token_pair > () , 32usize , concat ! ("Size of: " , stringify ! (aws_cognito_identity_provider_token_pair))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_cognito_identity_provider_token_pair > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_cognito_identity_provider_token_pair))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . identity_provider_name) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_cognito_identity_provider_token_pair) , "::" , stringify ! (identity_provider_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . identity_provider_token) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_cognito_identity_provider_token_pair) , "::" , stringify ! (identity_provider_token))) ; } impl Default for aws_cognito_identity_provider_token_pair { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options needed to create a Cognito-based Credentials Provider"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_cognito_options { pub shutdown_options : aws_credentials_provider_shutdown_options , # [doc = " Cognito service regional endpoint to source credentials from."] pub endpoint : aws_byte_cursor , # [doc = " Cognito identity to fetch credentials relative to."] pub identity : aws_byte_cursor , # [doc = " Optional set of identity provider token pairs to allow for authenticated identity access."] pub logins : * mut aws_cognito_identity_provider_token_pair , pub login_count : usize , # [doc = " Optional ARN of the role to be assumed when multiple roles were received in the token from the identity provider."] pub custom_role_arn : * mut aws_byte_cursor , pub bootstrap : * mut aws_client_bootstrap , pub tls_ctx : * mut aws_tls_ctx , # [doc = " (Optional) Http proxy configuration for the http request that fetches credentials"] pub http_proxy_options : * const aws_http_proxy_options , pub function_table : * mut aws_auth_http_system_vtable , } # [test] fn bindgen_test_layout_aws_credentials_provider_cognito_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_cognito_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_cognito_options > () , 104usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_cognito_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_cognito_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_cognito_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoint) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (endpoint))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . identity) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (identity))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . logins) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (logins))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . login_count) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (login_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . custom_role_arn) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (custom_role_arn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http_proxy_options) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (http_proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (function_table))) ; } impl Default for aws_credentials_provider_cognito_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Creates a new set of aws credentials\n\n @param allocator memory allocator to use\n @param access_key_id_cursor value for the aws access key id field\n @param secret_access_key_cursor value for the secret access key field\n @param session_token_cursor (optional) security token associated with the credentials\n @param expiration_timepoint_seconds timepoint, in seconds since epoch, that the credentials will no longer\n be valid past. For credentials that do not expire, use UINT64_MAX\n\n @return a valid credentials object, or NULL"] pub fn aws_credentials_new (allocator : * mut aws_allocator , access_key_id_cursor : aws_byte_cursor , secret_access_key_cursor : aws_byte_cursor , session_token_cursor : aws_byte_cursor , expiration_timepoint_seconds : u64) -> * mut aws_credentials ; } extern "C" { # [doc = " Creates a new set of aws anonymous credentials.\n Use Anonymous credentials, when you want to skip the signing process.\n\n @param allocator memory allocator to use\n\n @return a valid credentials object, or NULL"] pub fn aws_credentials_new_anonymous (allocator : * mut aws_allocator) -> * mut aws_credentials ; } extern "C" { # [doc = " Creates a new set of AWS credentials\n\n @param allocator memory allocator to use\n @param access_key_id value for the aws access key id field\n @param secret_access_key value for the secret access key field\n @param session_token (optional) security token associated with the credentials\n @param expiration_timepoint_seconds timepoint, in seconds since epoch, that the credentials will no longer\n be valid past. For credentials that do not expire, use UINT64_MAX\n\n @return a valid credentials object, or NULL"] pub fn aws_credentials_new_from_string (allocator : * mut aws_allocator , access_key_id : * const aws_string , secret_access_key : * const aws_string , session_token : * const aws_string , expiration_timepoint_seconds : u64) -> * mut aws_credentials ; } extern "C" { # [doc = " Creates a set of AWS credentials that includes an ECC key pair. These credentials do not have a value for\n the secret access key; the ecc key takes over that field's role in sigv4a signing.\n\n @param allocator memory allocator to use for all memory allocation\n @param access_key_id access key id for the credential set\n @param ecc_key ecc key to use during signing when using these credentials\n @param session_token (optional) session token associated with the credentials\n @param expiration_timepoint_in_seconds (optional) if session-based, time at which these credentials expire\n @return a new pair of AWS credentials, or NULL"] pub fn aws_credentials_new_ecc (allocator : * mut aws_allocator , access_key_id : aws_byte_cursor , ecc_key : * mut aws_ecc_key_pair , session_token : aws_byte_cursor , expiration_timepoint_in_seconds : u64) -> * mut aws_credentials ; } extern "C" { pub fn aws_credentials_new_ecc_from_aws_credentials (allocator : * mut aws_allocator , credentials : * const aws_credentials) -> * mut aws_credentials ; } extern "C" { # [doc = " Add a reference to some credentials\n\n @param credentials credentials to increment the ref count on"] pub fn aws_credentials_acquire (credentials : * const aws_credentials) ; } extern "C" { # [doc = " Remove a reference to some credentials\n\n @param credentials credentials to decrement the ref count on"] pub fn aws_credentials_release (credentials : * const aws_credentials) ; } extern "C" { # [doc = " Get the AWS access key id from a set of credentials\n\n @param credentials credentials to get the access key id from\n @return a byte cursor to the access key id"] pub fn aws_credentials_get_access_key_id (credentials : * const aws_credentials) -> aws_byte_cursor ; } extern "C" { # [doc = " Get the AWS secret access key from a set of credentials\n\n @param credentials credentials to get the secret access key from\n @return a byte cursor to the secret access key"] pub fn aws_credentials_get_secret_access_key (credentials : * const aws_credentials) -> aws_byte_cursor ; } extern "C" { # [doc = " Get the AWS session token from a set of credentials\n\n @param credentials credentials to get the session token from\n @return a byte cursor to the session token or an empty byte cursor if there is no session token"] pub fn aws_credentials_get_session_token (credentials : * const aws_credentials) -> aws_byte_cursor ; } extern "C" { # [doc = " Get the expiration timepoint (in seconds since epoch) associated with a set of credentials\n\n @param credentials credentials to get the expiration timepoint for\n @return the time, in seconds since epoch, the credentials will expire; UINT64_MAX for credentials\n without a specific expiration time"] pub fn aws_credentials_get_expiration_timepoint_seconds (credentials : * const aws_credentials) -> u64 ; } extern "C" { # [doc = " Get the elliptic curve key associated with this set of credentials\n @param credentials credentials to get the the elliptic curve key for\n @return the elliptic curve key associated with the credentials, or NULL if no key is associated with\n these credentials"] pub fn aws_credentials_get_ecc_key_pair (credentials : * const aws_credentials) -> * mut aws_ecc_key_pair ; } extern "C" { # [doc = " If credentials are anonymous, then the signing process is skipped.\n\n @param credentials credentials to check\n\n @return true if the credentials are anonymous; false otherwise."] pub fn aws_credentials_is_anonymous (credentials : * const aws_credentials) -> bool ; } extern "C" { # [doc = " Derives an ecc key pair (based on the nist P256 curve) from the access key id and secret access key components\n of a set of AWS credentials using an internal key derivation specification. Used to perform sigv4a signing in\n the hybrid mode based on AWS credentials.\n\n @param allocator memory allocator to use for all memory allocation\n @param credentials AWS credentials to derive the ECC key from using the AWS sigv4a key deriviation specification\n @return a new ecc key pair or NULL on failure"] pub fn aws_ecc_key_pair_new_ecdsa_p256_key_from_aws_credentials (allocator : * mut aws_allocator , credentials : * const aws_credentials) -> * mut aws_ecc_key_pair ; } extern "C" { # [doc = " Release a reference to a credentials provider\n\n @param provider provider to decrement the ref count on"] pub fn aws_credentials_provider_release (provider : * mut aws_credentials_provider) -> * mut aws_credentials_provider ; } extern "C" { pub fn aws_credentials_provider_acquire (provider : * mut aws_credentials_provider) -> * mut aws_credentials_provider ; } extern "C" { pub fn aws_credentials_provider_get_credentials (provider : * mut aws_credentials_provider , callback : aws_on_get_credentials_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Creates a simple provider that just returns a fixed set of credentials\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_static (allocator : * mut aws_allocator , options : * const aws_credentials_provider_static_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a simple anonymous credentials provider\n\n @param allocator memory allocator to use for all memory allocation\n @param shutdown_options an optional shutdown callback that gets\n invoked when the resources used by the provider are no longer in use.\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_anonymous (allocator : * mut aws_allocator , shutdown_options : * const aws_credentials_provider_shutdown_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that returns credentials sourced from the environment variables:\n\n AWS_ACCESS_KEY_ID\n AWS_SECRET_ACCESS_KEY\n AWS_SESSION_TOKEN\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_environment (allocator : * mut aws_allocator , options : * const aws_credentials_provider_environment_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that functions as a caching decorating of another provider.\n\n For example, the default chain is implemented as:\n\n CachedProvider -> ProviderChain(EnvironmentProvider -> ProfileProvider -> ECS/EC2IMD etc...)\n\n A reference is taken on the target provider\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_cached (allocator : * mut aws_allocator , options : * const aws_credentials_provider_cached_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from key-value profiles loaded from the aws credentials\n file (\"~/.aws/credentials\" by default) and the aws config file (\"~/.aws/config\" by\n default)\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_profile (allocator : * mut aws_allocator , options : * const aws_credentials_provider_profile_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that assumes an IAM role via. STS AssumeRole() API. This provider will fetch new credentials\n upon each call to aws_credentials_provider_get_credentials().\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_sts (allocator : * mut aws_allocator , options : * const aws_credentials_provider_sts_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from an ordered sequence of providers, with the overall result\n being from the first provider to return a valid set of credentials\n\n References are taken on all supplied providers\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_chain (allocator : * mut aws_allocator , options : * const aws_credentials_provider_chain_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from the ec2 instance metadata service\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_imds (allocator : * mut aws_allocator , options : * const aws_credentials_provider_imds_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from the ecs role credentials service\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_ecs (allocator : * mut aws_allocator , options : * const aws_credentials_provider_ecs_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from IoT Core\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_x509 (allocator : * mut aws_allocator , options : * const aws_credentials_provider_x509_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from STS using AssumeRoleWithWebIdentity\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_sts_web_identity (allocator : * mut aws_allocator , options : * const aws_credentials_provider_sts_web_identity_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from SSO using a SSOToken.\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_sso (allocator : * mut aws_allocator , options : * const aws_credentials_provider_sso_options) -> * mut aws_credentials_provider ; } extern "C" { pub fn aws_credentials_provider_new_process (allocator : * mut aws_allocator , options : * const aws_credentials_provider_process_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Create a credentials provider depends on provided vtable to fetch the credentials.\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_delegate (allocator : * mut aws_allocator , options : * const aws_credentials_provider_delegate_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from the Cognito-Identity service via an\n invocation of the GetCredentialsForIdentity API call.\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_cognito (allocator : * mut aws_allocator , options : * const aws_credentials_provider_cognito_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a cognito-based provider that has a caching layer wrapped around it\n\n @param allocator memory allocator to use for all memory allocation\n @param options cognito-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_cognito_caching (allocator : * mut aws_allocator , options : * const aws_credentials_provider_cognito_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates the default provider chain used by most AWS SDKs.\n\n Generally:\n\n (1) Environment\n (2) Profile\n (3) STS web identity\n (4) (conditional, off by default) ECS\n (5) (conditional, on by default) EC2 Instance Metadata\n\n Support for environmental control of the default provider chain is not yet\n implemented.\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_chain_default (allocator : * mut aws_allocator , options : * const aws_credentials_provider_chain_default_options) -> * mut aws_credentials_provider ; } extern "C" { pub static mut g_aws_credentials_provider_http_function_table : * const aws_auth_http_system_vtable ; } pub const AWS_DATE_TIME_STR_MAX_LEN : _bindgen_ty_21 = _bindgen_ty_21 :: AWS_DATE_TIME_STR_MAX_LEN ; pub const AWS_DATE_TIME_STR_MAX_BASIC_LEN : _bindgen_ty_21 = _bindgen_ty_21 :: AWS_DATE_TIME_STR_MAX_BASIC_LEN ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_21 { AWS_DATE_TIME_STR_MAX_LEN = 100 , AWS_DATE_TIME_STR_MAX_BASIC_LEN = 20 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_date_format { AWS_DATE_FORMAT_RFC822 = 0 , AWS_DATE_FORMAT_ISO_8601 = 1 , AWS_DATE_FORMAT_ISO_8601_BASIC = 2 , AWS_DATE_FORMAT_AUTO_DETECT = 3 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_date_month { AWS_DATE_MONTH_JANUARY = 0 , AWS_DATE_MONTH_FEBRUARY = 1 , AWS_DATE_MONTH_MARCH = 2 , AWS_DATE_MONTH_APRIL = 3 , AWS_DATE_MONTH_MAY = 4 , AWS_DATE_MONTH_JUNE = 5 , AWS_DATE_MONTH_JULY = 6 , AWS_DATE_MONTH_AUGUST = 7 , AWS_DATE_MONTH_SEPTEMBER = 8 , AWS_DATE_MONTH_OCTOBER = 9 , AWS_DATE_MONTH_NOVEMBER = 10 , AWS_DATE_MONTH_DECEMBER = 11 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_date_day_of_week { AWS_DATE_DAY_OF_WEEK_SUNDAY = 0 , AWS_DATE_DAY_OF_WEEK_MONDAY = 1 , AWS_DATE_DAY_OF_WEEK_TUESDAY = 2 , AWS_DATE_DAY_OF_WEEK_WEDNESDAY = 3 , AWS_DATE_DAY_OF_WEEK_THURSDAY = 4 , AWS_DATE_DAY_OF_WEEK_FRIDAY = 5 , AWS_DATE_DAY_OF_WEEK_SATURDAY = 6 , } # [repr (C)] pub struct aws_date_time { pub timestamp : time_t , pub milliseconds : u16 , pub tz : [:: libc :: c_char ; 6usize] , pub gmt_time : tm , pub local_time : tm , pub utc_assumed : bool , } # [test] fn bindgen_test_layout_aws_date_time () { const UNINIT : :: std :: mem :: MaybeUninit < aws_date_time > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_date_time > () , 136usize , concat ! ("Size of: " , stringify ! (aws_date_time))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_date_time > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_date_time))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . timestamp) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (timestamp))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . milliseconds) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (milliseconds))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tz) as usize - ptr as usize } , 10usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (tz))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . gmt_time) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (gmt_time))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . local_time) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (local_time))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . utc_assumed) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (utc_assumed))) ; } impl Default for aws_date_time { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Initializes dt to be the current system time."] pub fn aws_date_time_init_now (dt : * mut aws_date_time) ; } extern "C" { # [doc = " Initializes dt to be the time represented in milliseconds since unix epoch."] pub fn aws_date_time_init_epoch_millis (dt : * mut aws_date_time , ms_since_epoch : u64) ; } extern "C" { # [doc = " Initializes dt to be the time represented in seconds.millis since unix epoch."] pub fn aws_date_time_init_epoch_secs (dt : * mut aws_date_time , sec_ms : f64) ; } extern "C" { # [doc = " Initializes dt to be the time represented by date_str in format 'fmt'. Returns AWS_OP_SUCCESS if the\n string was successfully parsed, returns AWS_OP_ERR if parsing failed.\n\n Notes for AWS_DATE_FORMAT_RFC822:\n If no time zone information is provided, it is assumed to be local time (please don't do this).\n\n If the time zone is something other than something indicating Universal Time (e.g. Z, UT, UTC, or GMT) or an offset\n from UTC (e.g. +0100, -0700), parsing will fail.\n\n Really, it's just better if you always use Universal Time."] pub fn aws_date_time_init_from_str (dt : * mut aws_date_time , date_str : * const aws_byte_buf , fmt : aws_date_format) -> :: libc :: c_int ; } extern "C" { # [doc = " aws_date_time_init variant that takes a byte_cursor rather than a byte_buf"] pub fn aws_date_time_init_from_str_cursor (dt : * mut aws_date_time , date_str_cursor : * const aws_byte_cursor , fmt : aws_date_format) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the current time as a formatted date string in local time into output_buf. If buffer is too small, it will\n return AWS_OP_ERR. A good size suggestion is AWS_DATE_TIME_STR_MAX_LEN bytes. AWS_DATE_FORMAT_AUTO_DETECT is not\n allowed."] pub fn aws_date_time_to_local_time_str (dt : * const aws_date_time , fmt : aws_date_format , output_buf : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the current time as a formatted date string in utc time into output_buf. If buffer is too small, it will\n return AWS_OP_ERR. A good size suggestion is AWS_DATE_TIME_STR_MAX_LEN bytes. AWS_DATE_FORMAT_AUTO_DETECT is not\n allowed."] pub fn aws_date_time_to_utc_time_str (dt : * const aws_date_time , fmt : aws_date_format , output_buf : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the current time as a formatted short date string in local time into output_buf. If buffer is too small, it\n will return AWS_OP_ERR. A good size suggestion is AWS_DATE_TIME_STR_MAX_LEN bytes. AWS_DATE_FORMAT_AUTO_DETECT is not\n allowed."] pub fn aws_date_time_to_local_time_short_str (dt : * const aws_date_time , fmt : aws_date_format , output_buf : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the current time as a formatted short date string in utc time into output_buf. If buffer is too small, it will\n return AWS_OP_ERR. A good size suggestion is AWS_DATE_TIME_STR_MAX_LEN bytes. AWS_DATE_FORMAT_AUTO_DETECT is not\n allowed."] pub fn aws_date_time_to_utc_time_short_str (dt : * const aws_date_time , fmt : aws_date_format , output_buf : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { pub fn aws_date_time_as_epoch_secs (dt : * const aws_date_time) -> f64 ; } extern "C" { pub fn aws_date_time_as_nanos (dt : * const aws_date_time) -> u64 ; } extern "C" { pub fn aws_date_time_as_millis (dt : * const aws_date_time) -> u64 ; } extern "C" { pub fn aws_date_time_year (dt : * const aws_date_time , local_time : bool) -> u16 ; } extern "C" { pub fn aws_date_time_month (dt : * const aws_date_time , local_time : bool) -> aws_date_month ; } extern "C" { pub fn aws_date_time_month_day (dt : * const aws_date_time , local_time : bool) -> u8 ; } extern "C" { pub fn aws_date_time_day_of_week (dt : * const aws_date_time , local_time : bool) -> aws_date_day_of_week ; } extern "C" { pub fn aws_date_time_hour (dt : * const aws_date_time , local_time : bool) -> u8 ; } extern "C" { pub fn aws_date_time_minute (dt : * const aws_date_time , local_time : bool) -> u8 ; } extern "C" { pub fn aws_date_time_second (dt : * const aws_date_time , local_time : bool) -> u8 ; } extern "C" { pub fn aws_date_time_dst (dt : * const aws_date_time , local_time : bool) -> bool ; } extern "C" { # [doc = " returns the difference of a and b (a - b) in seconds."] pub fn aws_date_time_diff (a : * const aws_date_time , b : * const aws_date_time) -> time_t ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_errors { AWS_ERROR_HTTP_UNKNOWN = 2048 , AWS_ERROR_HTTP_HEADER_NOT_FOUND = 2049 , AWS_ERROR_HTTP_INVALID_HEADER_FIELD = 2050 , AWS_ERROR_HTTP_INVALID_HEADER_NAME = 2051 , AWS_ERROR_HTTP_INVALID_HEADER_VALUE = 2052 , AWS_ERROR_HTTP_INVALID_METHOD = 2053 , AWS_ERROR_HTTP_INVALID_PATH = 2054 , AWS_ERROR_HTTP_INVALID_STATUS_CODE = 2055 , AWS_ERROR_HTTP_MISSING_BODY_STREAM = 2056 , AWS_ERROR_HTTP_INVALID_BODY_STREAM = 2057 , AWS_ERROR_HTTP_CONNECTION_CLOSED = 2058 , AWS_ERROR_HTTP_SWITCHED_PROTOCOLS = 2059 , AWS_ERROR_HTTP_UNSUPPORTED_PROTOCOL = 2060 , AWS_ERROR_HTTP_REACTION_REQUIRED = 2061 , AWS_ERROR_HTTP_DATA_NOT_AVAILABLE = 2062 , AWS_ERROR_HTTP_OUTGOING_STREAM_LENGTH_INCORRECT = 2063 , AWS_ERROR_HTTP_CALLBACK_FAILURE = 2064 , AWS_ERROR_HTTP_WEBSOCKET_UPGRADE_FAILURE = 2065 , AWS_ERROR_HTTP_WEBSOCKET_CLOSE_FRAME_SENT = 2066 , AWS_ERROR_HTTP_WEBSOCKET_IS_MIDCHANNEL_HANDLER = 2067 , AWS_ERROR_HTTP_CONNECTION_MANAGER_INVALID_STATE_FOR_ACQUIRE = 2068 , AWS_ERROR_HTTP_CONNECTION_MANAGER_VENDED_CONNECTION_UNDERFLOW = 2069 , AWS_ERROR_HTTP_SERVER_CLOSED = 2070 , AWS_ERROR_HTTP_PROXY_CONNECT_FAILED = 2071 , AWS_ERROR_HTTP_CONNECTION_MANAGER_SHUTTING_DOWN = 2072 , AWS_ERROR_HTTP_CHANNEL_THROUGHPUT_FAILURE = 2073 , AWS_ERROR_HTTP_PROTOCOL_ERROR = 2074 , AWS_ERROR_HTTP_STREAM_IDS_EXHAUSTED = 2075 , AWS_ERROR_HTTP_GOAWAY_RECEIVED = 2076 , AWS_ERROR_HTTP_RST_STREAM_RECEIVED = 2077 , AWS_ERROR_HTTP_RST_STREAM_SENT = 2078 , AWS_ERROR_HTTP_STREAM_NOT_ACTIVATED = 2079 , AWS_ERROR_HTTP_STREAM_HAS_COMPLETED = 2080 , AWS_ERROR_HTTP_PROXY_STRATEGY_NTLM_CHALLENGE_TOKEN_MISSING = 2081 , AWS_ERROR_HTTP_PROXY_STRATEGY_TOKEN_RETRIEVAL_FAILURE = 2082 , AWS_ERROR_HTTP_PROXY_CONNECT_FAILED_RETRYABLE = 2083 , AWS_ERROR_HTTP_PROTOCOL_SWITCH_FAILURE = 2084 , AWS_ERROR_HTTP_MAX_CONCURRENT_STREAMS_EXCEEDED = 2085 , AWS_ERROR_HTTP_STREAM_MANAGER_SHUTTING_DOWN = 2086 , AWS_ERROR_HTTP_STREAM_MANAGER_CONNECTION_ACQUIRE_FAILURE = 2087 , AWS_ERROR_HTTP_STREAM_MANAGER_UNEXPECTED_HTTP_VERSION = 2088 , AWS_ERROR_HTTP_WEBSOCKET_PROTOCOL_ERROR = 2089 , AWS_ERROR_HTTP_MANUAL_WRITE_NOT_ENABLED = 2090 , AWS_ERROR_HTTP_MANUAL_WRITE_HAS_COMPLETED = 2091 , AWS_ERROR_HTTP_END_RANGE = 3071 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http2_error_code { AWS_HTTP2_ERR_NO_ERROR = 0 , AWS_HTTP2_ERR_PROTOCOL_ERROR = 1 , AWS_HTTP2_ERR_INTERNAL_ERROR = 2 , AWS_HTTP2_ERR_FLOW_CONTROL_ERROR = 3 , AWS_HTTP2_ERR_SETTINGS_TIMEOUT = 4 , AWS_HTTP2_ERR_STREAM_CLOSED = 5 , AWS_HTTP2_ERR_FRAME_SIZE_ERROR = 6 , AWS_HTTP2_ERR_REFUSED_STREAM = 7 , AWS_HTTP2_ERR_CANCEL = 8 , AWS_HTTP2_ERR_COMPRESSION_ERROR = 9 , AWS_HTTP2_ERR_CONNECT_ERROR = 10 , AWS_HTTP2_ERR_ENHANCE_YOUR_CALM = 11 , AWS_HTTP2_ERR_INADEQUATE_SECURITY = 12 , AWS_HTTP2_ERR_HTTP_1_1_REQUIRED = 13 , AWS_HTTP2_ERR_COUNT = 14 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_log_subject { AWS_LS_HTTP_GENERAL = 2048 , AWS_LS_HTTP_CONNECTION = 2049 , AWS_LS_HTTP_ENCODER = 2050 , AWS_LS_HTTP_DECODER = 2051 , AWS_LS_HTTP_SERVER = 2052 , AWS_LS_HTTP_STREAM = 2053 , AWS_LS_HTTP_CONNECTION_MANAGER = 2054 , AWS_LS_HTTP_STREAM_MANAGER = 2055 , AWS_LS_HTTP_WEBSOCKET = 2056 , AWS_LS_HTTP_WEBSOCKET_SETUP = 2057 , AWS_LS_HTTP_PROXY_NEGOTIATION = 2058 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_version { AWS_HTTP_VERSION_UNKNOWN = 0 , AWS_HTTP_VERSION_1_0 = 1 , AWS_HTTP_VERSION_1_1 = 2 , AWS_HTTP_VERSION_2 = 3 , AWS_HTTP_VERSION_COUNT = 4 , } extern "C" { # [doc = " Initializes internal datastructures used by aws-c-http.\n Must be called before using any functionality in aws-c-http."] pub fn aws_http_library_init (alloc : * mut aws_allocator) ; } extern "C" { # [doc = " Clean up internal datastructures used by aws-c-http.\n Must not be called until application is done using functionality in aws-c-http."] pub fn aws_http_library_clean_up () ; } extern "C" { # [doc = " Returns the description of common status codes.\n Ex: 404 -> \"Not Found\"\n An empty string is returned if the status code is not recognized."] pub fn aws_http_status_text (status_code : :: libc :: c_int) -> * const :: libc :: c_char ; } extern "C" { # [doc = " Shortcuts for common HTTP request methods"] pub static aws_http_method_get : aws_byte_cursor ; } extern "C" { pub static aws_http_method_head : aws_byte_cursor ; } extern "C" { pub static aws_http_method_post : aws_byte_cursor ; } extern "C" { pub static aws_http_method_put : aws_byte_cursor ; } extern "C" { pub static aws_http_method_delete : aws_byte_cursor ; } extern "C" { pub static aws_http_method_connect : aws_byte_cursor ; } extern "C" { pub static aws_http_method_options : aws_byte_cursor ; } extern "C" { pub static aws_http_header_method : aws_byte_cursor ; } extern "C" { pub static aws_http_header_scheme : aws_byte_cursor ; } extern "C" { pub static aws_http_header_authority : aws_byte_cursor ; } extern "C" { pub static aws_http_header_path : aws_byte_cursor ; } extern "C" { pub static aws_http_header_status : aws_byte_cursor ; } extern "C" { pub static aws_http_scheme_http : aws_byte_cursor ; } extern "C" { pub static aws_http_scheme_https : aws_byte_cursor ; } # [doc = " An HTTP connection.\n This type is used by both server-side and client-side connections.\n This type is also used by all supported versions of HTTP."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_connection { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_connection_manager { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_socket_options { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_tls_connection_options { _unused : [u8 ; 0] , } pub type aws_http_connection_manager_on_connection_setup_fn = :: std :: option :: Option < unsafe extern "C" fn (connection : * mut aws_http_connection , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_http_connection_manager_shutdown_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [doc = " Metrics for logging and debugging purpose."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http_manager_metrics { # [doc = " The number of additional concurrent requests that can be supported by the HTTP manager without needing to\n establish additional connections to the target server.\n\n For connection manager, it equals to connections that's idle.\n For stream manager, it equals to the number of streams that are possible to be made without creating new\n connection, although the implementation can create new connection without fully filling it."] pub available_concurrency : usize , pub pending_concurrency_acquires : usize , pub leased_concurrency : usize , } # [test] fn bindgen_test_layout_aws_http_manager_metrics () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_manager_metrics > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_manager_metrics > () , 24usize , concat ! ("Size of: " , stringify ! (aws_http_manager_metrics))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_manager_metrics > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_manager_metrics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . available_concurrency) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_manager_metrics) , "::" , stringify ! (available_concurrency))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . pending_concurrency_acquires) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_manager_metrics) , "::" , stringify ! (pending_concurrency_acquires))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . leased_concurrency) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_manager_metrics) , "::" , stringify ! (leased_concurrency))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_connection_manager_options { pub bootstrap : * mut aws_client_bootstrap , pub initial_window_size : usize , pub socket_options : * const aws_socket_options , # [doc = " Options to create secure (HTTPS) connections.\n For secure connections, set \"h2\" in the ALPN string for HTTP/2, otherwise HTTP/1.1 is used.\n\n Leave NULL to create cleartext (HTTP) connections.\n For cleartext connections, use `http2_prior_knowledge` (RFC-7540 3.4)\n to control whether that are treated as HTTP/1.1 or HTTP/2."] pub tls_connection_options : * const aws_tls_connection_options , # [doc = " Specify whether you have prior knowledge that cleartext (HTTP) connections are HTTP/2 (RFC-7540 3.4).\n If false, then cleartext connections are treated as HTTP/1.1.\n It is illegal to set this true when secure connections are being used.\n Note that upgrading from HTTP/1.1 to HTTP/2 is not supported (RFC-7540 3.2)."] pub http2_prior_knowledge : bool , pub monitoring_options : * const aws_http_connection_monitoring_options , pub host : aws_byte_cursor , pub port : u16 , # [doc = " Optional.\n HTTP/2 specific configuration. Check `struct aws_http2_connection_options` for details of each config"] pub initial_settings_array : * const aws_http2_setting , pub num_initial_settings : usize , pub max_closed_streams : usize , pub http2_conn_manual_window_management : bool , pub proxy_options : * const aws_http_proxy_options , pub proxy_ev_settings : * const proxy_env_var_settings , pub max_connections : usize , pub shutdown_complete_user_data : * mut :: libc :: c_void , pub shutdown_complete_callback : aws_http_connection_manager_shutdown_complete_fn , # [doc = " If set to true, the read back pressure mechanism will be enabled."] pub enable_read_back_pressure : bool , # [doc = " If set to a non-zero value, then connections that stay in the pool longer than the specified\n timeout will be closed automatically."] pub max_connection_idle_in_milliseconds : u64 , } # [test] fn bindgen_test_layout_aws_http_connection_manager_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_connection_manager_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_connection_manager_options > () , 160usize , concat ! ("Size of: " , stringify ! (aws_http_connection_manager_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_connection_manager_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_connection_manager_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_window_size) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (initial_window_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . socket_options) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (socket_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_connection_options) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (tls_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http2_prior_knowledge) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (http2_prior_knowledge))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . monitoring_options) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (monitoring_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_settings_array) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (initial_settings_array))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_initial_settings) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (num_initial_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_closed_streams) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (max_closed_streams))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http2_conn_manual_window_management) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (http2_conn_manual_window_management))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_options) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_settings) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (proxy_ev_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_connections) as usize - ptr as usize } , 120usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (max_connections))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_complete_user_data) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (shutdown_complete_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_complete_callback) as usize - ptr as usize } , 136usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (shutdown_complete_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_back_pressure) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (enable_read_back_pressure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_connection_idle_in_milliseconds) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (max_connection_idle_in_milliseconds))) ; } impl Default for aws_http_connection_manager_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_http_connection_manager_acquire (manager : * mut aws_http_connection_manager) ; } extern "C" { pub fn aws_http_connection_manager_release (manager : * mut aws_http_connection_manager) ; } extern "C" { pub fn aws_http_connection_manager_new (allocator : * mut aws_allocator , options : * const aws_http_connection_manager_options) -> * mut aws_http_connection_manager ; } extern "C" { pub fn aws_http_connection_manager_acquire_connection (manager : * mut aws_http_connection_manager , callback : aws_http_connection_manager_on_connection_setup_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_http_connection_manager_release_connection (manager : * mut aws_http_connection_manager , connection : * mut aws_http_connection) -> :: libc :: c_int ; } extern "C" { # [doc = " Fetch the current manager metrics from connection manager."] pub fn aws_http_connection_manager_fetch_metrics (manager : * const aws_http_connection_manager , out_metrics : * mut aws_http_manager_metrics) ; } # [doc = " Invoked upon the acquisition, or failure to acquire a retry token. This function will always be invoked if and only\n if aws_retry_strategy_acquire_retry_token() returns AWS_OP_SUCCESS. It will never be invoked synchronously from\n aws_retry_strategy_acquire_retry_token(). Token will always be NULL if error_code is non-zero, and vice-versa. If\n token is non-null, it will have a reference count of 1, and you must call aws_retry_token_release() on it later. See\n the comments for aws_retry_strategy_on_retry_ready_fn for more info."] pub type aws_retry_strategy_on_retry_token_acquired_fn = :: std :: option :: Option < unsafe extern "C" fn (retry_strategy : * mut aws_retry_strategy , error_code : :: libc :: c_int , token : * mut aws_retry_token , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked after a successful call to aws_retry_strategy_schedule_retry(). This function will always be invoked if and\n only if aws_retry_strategy_schedule_retry() returns AWS_OP_SUCCESS. It will never be invoked synchronously from\n aws_retry_strategy_schedule_retry(). After attempting the operation, either call aws_retry_strategy_schedule_retry()\n with an aws_retry_error_type or call aws_retry_token_record_success() and then release the token via.\n aws_retry_token_release()."] pub type aws_retry_strategy_on_retry_ready_fn = :: std :: option :: Option < unsafe extern "C" fn (token : * mut aws_retry_token , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Optional function to supply your own generate random implementation"] pub type aws_generate_random_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) -> u64 > ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_retry_error_type { # [doc = " This is a connection level error such as a socket timeout, socket connect error, tls negotiation timeout etc...\n Typically these should never be applied for non-idempotent request types since in this scenario, it's impossible\n to know whether the operation had a side effect on the server."] AWS_RETRY_ERROR_TYPE_TRANSIENT = 0 , # [doc = " This is an error where the server explicitly told the client to back off, such as a 429 or 503 Http error."] AWS_RETRY_ERROR_TYPE_THROTTLING = 1 , # [doc = " This is a server error that isn't explicitly throttling but is considered by the client\n to be something that should be retried."] AWS_RETRY_ERROR_TYPE_SERVER_ERROR = 2 , # [doc = " Doesn't count against any budgets. This could be something like a 401 challenge in Http."] AWS_RETRY_ERROR_TYPE_CLIENT_ERROR = 3 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_retry_strategy_vtable { pub destroy : :: std :: option :: Option < unsafe extern "C" fn (retry_strategy : * mut aws_retry_strategy) > , pub acquire_token : :: std :: option :: Option < unsafe extern "C" fn (retry_strategy : * mut aws_retry_strategy , partition_id : * const aws_byte_cursor , on_acquired : aws_retry_strategy_on_retry_token_acquired_fn , user_data : * mut :: libc :: c_void , timeout_ms : u64) -> :: libc :: c_int > , pub schedule_retry : :: std :: option :: Option < unsafe extern "C" fn (token : * mut aws_retry_token , error_type : aws_retry_error_type , retry_ready : aws_retry_strategy_on_retry_ready_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > , pub record_success : :: std :: option :: Option < unsafe extern "C" fn (token : * mut aws_retry_token) -> :: libc :: c_int > , pub release_token : :: std :: option :: Option < unsafe extern "C" fn (token : * mut aws_retry_token) > , } # [test] fn bindgen_test_layout_aws_retry_strategy_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_retry_strategy_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_retry_strategy_vtable > () , 40usize , concat ! ("Size of: " , stringify ! (aws_retry_strategy_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_retry_strategy_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_retry_strategy_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . acquire_token) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy_vtable) , "::" , stringify ! (acquire_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . schedule_retry) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy_vtable) , "::" , stringify ! (schedule_retry))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . record_success) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy_vtable) , "::" , stringify ! (record_success))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . release_token) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy_vtable) , "::" , stringify ! (release_token))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_retry_strategy { pub allocator : * mut aws_allocator , pub vtable : * mut aws_retry_strategy_vtable , pub ref_count : aws_atomic_var , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_retry_strategy () { const UNINIT : :: std :: mem :: MaybeUninit < aws_retry_strategy > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_retry_strategy > () , 32usize , concat ! ("Size of: " , stringify ! (aws_retry_strategy))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_retry_strategy > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_retry_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy) , "::" , stringify ! (impl_))) ; } impl Default for aws_retry_strategy { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_retry_token { pub allocator : * mut aws_allocator , pub retry_strategy : * mut aws_retry_strategy , pub ref_count : aws_atomic_var , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_retry_token () { const UNINIT : :: std :: mem :: MaybeUninit < aws_retry_token > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_retry_token > () , 32usize , concat ! ("Size of: " , stringify ! (aws_retry_token))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_retry_token > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_retry_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_retry_token) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . retry_strategy) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_retry_token) , "::" , stringify ! (retry_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_retry_token) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_retry_token) , "::" , stringify ! (impl_))) ; } impl Default for aws_retry_token { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [doc = " Jitter mode for exponential backoff.\n\n For a great writeup on these options see:\n https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_exponential_backoff_jitter_mode { AWS_EXPONENTIAL_BACKOFF_JITTER_DEFAULT = 0 , AWS_EXPONENTIAL_BACKOFF_JITTER_NONE = 1 , AWS_EXPONENTIAL_BACKOFF_JITTER_FULL = 2 , AWS_EXPONENTIAL_BACKOFF_JITTER_DECORRELATED = 3 , } # [doc = " Options for exponential backoff retry strategy. el_group must be set, any other option, if set to 0 will signify\n \"use defaults\""] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_exponential_backoff_retry_options { # [doc = " Event loop group to use for scheduling tasks."] pub el_group : * mut aws_event_loop_group , # [doc = " Max retries to allow. The default value is 10"] pub max_retries : usize , # [doc = " Scaling factor to add for the backoff. Default is 25ms"] pub backoff_scale_factor_ms : u32 , # [doc = " Max retry backoff in seconds. Default is 20 seconds"] pub max_backoff_secs : u32 , # [doc = " Jitter mode to use, see comments for aws_exponential_backoff_jitter_mode.\n Default is AWS_EXPONENTIAL_BACKOFF_JITTER_DEFAULT"] pub jitter_mode : aws_exponential_backoff_jitter_mode , # [doc = " Deprecated. Use generate_random_impl instead\n By default this will be set to use aws_device_random. If you want something else, set it here."] pub generate_random : :: std :: option :: Option < unsafe extern "C" fn () -> u64 > , pub generate_random_impl : aws_generate_random_fn , # [doc = " Optional user data for the generate random generate_random_impl."] pub generate_random_user_data : * mut :: libc :: c_void , # [doc = " Optional shutdown callback that gets invoked, with appropriate user data,\n when the resources used by the retry_strategy are no longer in use."] pub shutdown_options : * const aws_shutdown_callback_options , } # [test] fn bindgen_test_layout_aws_exponential_backoff_retry_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_exponential_backoff_retry_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_exponential_backoff_retry_options > () , 64usize , concat ! ("Size of: " , stringify ! (aws_exponential_backoff_retry_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_exponential_backoff_retry_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_exponential_backoff_retry_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . el_group) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (el_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_retries) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (max_retries))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . backoff_scale_factor_ms) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (backoff_scale_factor_ms))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_backoff_secs) as usize - ptr as usize } , 20usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (max_backoff_secs))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . jitter_mode) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (jitter_mode))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . generate_random) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (generate_random))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . generate_random_impl) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (generate_random_impl))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . generate_random_user_data) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (generate_random_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (shutdown_options))) ; } impl Default for aws_exponential_backoff_retry_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_standard_retry_options { pub backoff_retry_options : aws_exponential_backoff_retry_options , # [doc = " capacity for partitions. Defaults to 500"] pub initial_bucket_capacity : usize , } # [test] fn bindgen_test_layout_aws_standard_retry_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_standard_retry_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_standard_retry_options > () , 72usize , concat ! ("Size of: " , stringify ! (aws_standard_retry_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_standard_retry_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_standard_retry_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . backoff_retry_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_standard_retry_options) , "::" , stringify ! (backoff_retry_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_bucket_capacity) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_standard_retry_options) , "::" , stringify ! (initial_bucket_capacity))) ; } impl Default for aws_standard_retry_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Acquire a reference count on retry_strategy."] pub fn aws_retry_strategy_acquire (retry_strategy : * mut aws_retry_strategy) ; } extern "C" { # [doc = " Releases a reference count on retry_strategy."] pub fn aws_retry_strategy_release (retry_strategy : * mut aws_retry_strategy) ; } extern "C" { # [doc = " Attempts to acquire a retry token for use with retries. On success, on_acquired will be invoked when a token is\n available, or an error will be returned if the timeout expires. partition_id identifies operations that should be\n grouped together. This allows for more sophisticated strategies such as AIMD and circuit breaker patterns. Pass NULL\n to use the global partition."] pub fn aws_retry_strategy_acquire_retry_token (retry_strategy : * mut aws_retry_strategy , partition_id : * const aws_byte_cursor , on_acquired : aws_retry_strategy_on_retry_token_acquired_fn , user_data : * mut :: libc :: c_void , timeout_ms : u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Schedules a retry based on the backoff and token based strategies. retry_ready is invoked when the retry is either\n ready for execution or if it has been canceled due to application shutdown.\n\n This function can return an error to reject the retry attempt if, for example, a circuit breaker has opened. If this\n occurs users should fail their calls back to their callers.\n\n error_type is used for book keeping. See the comments above for aws_retry_error_type."] pub fn aws_retry_strategy_schedule_retry (token : * mut aws_retry_token , error_type : aws_retry_error_type , retry_ready : aws_retry_strategy_on_retry_ready_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Records a successful retry. This is used for making future decisions to open up token buckets, AIMD breakers etc...\n some strategies such as exponential backoff will ignore this, but you should always call it after a successful\n operation or your system will never recover during an outage."] pub fn aws_retry_token_record_success (token : * mut aws_retry_token) -> :: libc :: c_int ; } extern "C" { # [doc = " Increments reference count for token. This should be called any time you seat the token to a pointer you own."] pub fn aws_retry_token_acquire (token : * mut aws_retry_token) ; } extern "C" { # [doc = " Releases the reference count for token. This should always be invoked after either calling\n aws_retry_strategy_schedule_retry() and failing, or after calling aws_retry_token_record_success()."] pub fn aws_retry_token_release (token : * mut aws_retry_token) ; } extern "C" { # [doc = " Creates a retry strategy using exponential backoff. This strategy does not perform any bookkeeping on error types and\n success. There is no circuit breaker functionality in here. See the comments above for\n aws_exponential_backoff_retry_options."] pub fn aws_retry_strategy_new_exponential_backoff (allocator : * mut aws_allocator , config : * const aws_exponential_backoff_retry_options) -> * mut aws_retry_strategy ; } extern "C" { # [doc = " This is a retry implementation that cuts off traffic if it's\n detected that an endpoint partition is having availability\n problems. This is necessary to keep from making outages worse\n by scheduling work that's unlikely to succeed yet increases\n load on an already ailing system.\n\n We do this by creating a bucket for each partition. A partition\n is an arbitrary specifier. It can be anything: a region, a service,\n a combination of region and service, a literal dns name.... doesn't matter.\n\n Each bucket has a budget for maximum allowed retries. Different types of events\n carry different weights. Things that indicate an unhealthy partition such as\n transient errors (timeouts, unhealthy connection etc...) cost more.\n A retry for any other reason (service sending a 5xx response code) cost a bit less.\n When a retry is attempted this capacity is leased out to the retry. On success it is\n released back to the capacity pool. On failure, it remains leased.\n Operations that succeed without a retry slowly restore the capacity pool.\n\n If a partition runs out of capacity it is assumed unhealthy and retries will be blocked\n until capacity returns to the pool. To prevent a partition from staying unhealthy after\n an outage has recovered, new requests that succeed without a retry will increase the capacity\n slowly ( a new request gets a payback lease of 1, but the lease is never actually deducted from the capacity pool)."] pub fn aws_retry_strategy_new_standard (allocator : * mut aws_allocator , config : * const aws_standard_retry_options) -> * mut aws_retry_strategy ; } pub type aws_imds_client_shutdown_completed_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [doc = " Optional callback and user data to be invoked when an imds client has fully shut down"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_imds_client_shutdown_options { pub shutdown_callback : aws_imds_client_shutdown_completed_fn , pub shutdown_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_imds_client_shutdown_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_imds_client_shutdown_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_imds_client_shutdown_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_imds_client_shutdown_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_imds_client_shutdown_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_imds_client_shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_shutdown_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_user_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_shutdown_options) , "::" , stringify ! (shutdown_user_data))) ; } impl Default for aws_imds_client_shutdown_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options when creating an imds client"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_imds_client_options { pub shutdown_options : aws_imds_client_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , pub retry_strategy : * mut aws_retry_strategy , pub imds_version : aws_imds_protocol_version , pub function_table : * mut aws_auth_http_system_vtable , } # [test] fn bindgen_test_layout_aws_imds_client_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_imds_client_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_imds_client_options > () , 48usize , concat ! ("Size of: " , stringify ! (aws_imds_client_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_imds_client_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_imds_client_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . retry_strategy) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_options) , "::" , stringify ! (retry_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . imds_version) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_options) , "::" , stringify ! (imds_version))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_options) , "::" , stringify ! (function_table))) ; } impl Default for aws_imds_client_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_imds_client_on_get_resource_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (resource : * const aws_byte_buf , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-categories.html"] # [repr (C)] pub struct aws_imds_iam_profile { pub last_updated : aws_date_time , pub instance_profile_arn : aws_byte_cursor , pub instance_profile_id : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_imds_iam_profile () { const UNINIT : :: std :: mem :: MaybeUninit < aws_imds_iam_profile > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_imds_iam_profile > () , 168usize , concat ! ("Size of: " , stringify ! (aws_imds_iam_profile))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_imds_iam_profile > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_imds_iam_profile))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . last_updated) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_imds_iam_profile) , "::" , stringify ! (last_updated))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . instance_profile_arn) as usize - ptr as usize } , 136usize , concat ! ("Offset of field: " , stringify ! (aws_imds_iam_profile) , "::" , stringify ! (instance_profile_arn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . instance_profile_id) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_imds_iam_profile) , "::" , stringify ! (instance_profile_id))) ; } impl Default for aws_imds_iam_profile { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Block of per-instance EC2-specific data\n\n https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-identity-documents.html"] # [repr (C)] pub struct aws_imds_instance_info { pub marketplace_product_codes : aws_array_list , pub availability_zone : aws_byte_cursor , pub private_ip : aws_byte_cursor , pub version : aws_byte_cursor , pub instance_id : aws_byte_cursor , pub billing_products : aws_array_list , pub instance_type : aws_byte_cursor , pub account_id : aws_byte_cursor , pub image_id : aws_byte_cursor , pub pending_time : aws_date_time , pub architecture : aws_byte_cursor , pub kernel_id : aws_byte_cursor , pub ramdisk_id : aws_byte_cursor , pub region : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_imds_instance_info () { const UNINIT : :: std :: mem :: MaybeUninit < aws_imds_instance_info > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_imds_instance_info > () , 392usize , concat ! ("Size of: " , stringify ! (aws_imds_instance_info))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_imds_instance_info > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_imds_instance_info))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . marketplace_product_codes) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (marketplace_product_codes))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . availability_zone) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (availability_zone))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . private_ip) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (private_ip))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . version) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (version))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . instance_id) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (instance_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . billing_products) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (billing_products))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . instance_type) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (instance_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . account_id) as usize - ptr as usize } , 160usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (account_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . image_id) as usize - ptr as usize } , 176usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (image_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . pending_time) as usize - ptr as usize } , 192usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (pending_time))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . architecture) as usize - ptr as usize } , 328usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (architecture))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . kernel_id) as usize - ptr as usize } , 344usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (kernel_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ramdisk_id) as usize - ptr as usize } , 360usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (ramdisk_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . region) as usize - ptr as usize } , 376usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (region))) ; } impl Default for aws_imds_instance_info { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_imds_client_on_get_array_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (array : * const aws_array_list , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_imds_client_on_get_credentials_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (credentials : * const aws_credentials , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_imds_client_on_get_iam_profile_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (iam_profile_info : * const aws_imds_iam_profile , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_imds_client_on_get_instance_info_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (instance_info : * const aws_imds_instance_info , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " AWS EC2 Metadata Client is used to retrieve AWS EC2 Instance Metadata info."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_imds_client { _unused : [u8 ; 0] , } extern "C" { # [doc = " Creates a new imds client\n\n @param allocator memory allocator to use for creation and queries\n @param options configuration options for the imds client\n\n @return a newly-constructed imds client, or NULL on failure"] pub fn aws_imds_client_new (allocator : * mut aws_allocator , options : * const aws_imds_client_options) -> * mut aws_imds_client ; } extern "C" { # [doc = " Increments the ref count on the client\n\n @param client imds client to acquire a reference to"] pub fn aws_imds_client_acquire (client : * mut aws_imds_client) ; } extern "C" { # [doc = " Decrements the ref count on the client\n\n @param client imds client to release a reference to"] pub fn aws_imds_client_release (client : * mut aws_imds_client) ; } extern "C" { # [doc = " Queries a generic resource (string) from the ec2 instance metadata document\n\n @param client imds client to use for the query\n @param resource_path path of the resource to query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_resource_async (client : * mut aws_imds_client , resource_path : aws_byte_cursor , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the ami id of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_ami_id (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the ami launch index of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_ami_launch_index (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the ami manifest path of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_ami_manifest_path (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the list of ancestor ami ids of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_ancestor_ami_ids (client : * mut aws_imds_client , callback : aws_imds_client_on_get_array_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the instance-action of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_instance_action (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the instance id of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_instance_id (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the instance type of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_instance_type (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the mac address of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_mac_address (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the private ip address of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_private_ip_address (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the availability zone of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_availability_zone (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the product codes of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_product_codes (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the public key of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_public_key (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the ramdisk id of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_ramdisk_id (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the reservation id of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_reservation_id (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the list of the security groups of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_security_groups (client : * mut aws_imds_client , callback : aws_imds_client_on_get_array_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the list of block device mappings of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_block_device_mapping (client : * mut aws_imds_client , callback : aws_imds_client_on_get_array_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the attached iam role of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_attached_iam_role (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets temporary credentials based on the attached iam role of the ec2 instance\n\n @param client imds client to use for the query\n @param iam_role_name iam role name to get temporary credentials through\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_credentials (client : * mut aws_imds_client , iam_role_name : aws_byte_cursor , callback : aws_imds_client_on_get_credentials_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the iam profile information of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_iam_profile (client : * mut aws_imds_client , callback : aws_imds_client_on_get_iam_profile_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the user data of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_user_data (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the signature of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_instance_signature (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the instance information data block of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_instance_info (client : * mut aws_imds_client , callback : aws_imds_client_on_get_instance_info_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " The entry point function to perform a CRC32 (Ethernet, gzip) computation.\n Selects a suitable implementation based on hardware capabilities.\n Pass 0 in the previousCrc32 parameter as an initial value unless continuing\n to update a running crc in a subsequent call."] pub fn aws_checksums_crc32 (input : * const u8 , length : :: libc :: c_int , previousCrc32 : u32) -> u32 ; } extern "C" { # [doc = " The entry point function to perform a Castagnoli CRC32c (iSCSI) computation.\n Selects a suitable implementation based on hardware capabilities.\n Pass 0 in the previousCrc32 parameter as an initial value unless continuing\n to update a running crc in a subsequent call."] pub fn aws_checksums_crc32c (input : * const u8 , length : :: libc :: c_int , previousCrc32 : u32) -> u32 ; } pub type aws_log_channel_send_fn = :: std :: option :: Option < unsafe extern "C" fn (channel : * mut aws_log_channel , output : * mut aws_string) -> :: libc :: c_int > ; pub type aws_log_channel_clean_up_fn = :: std :: option :: Option < unsafe extern "C" fn (channel : * mut aws_log_channel) > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_log_channel_vtable { pub send : aws_log_channel_send_fn , pub clean_up : aws_log_channel_clean_up_fn , } # [test] fn bindgen_test_layout_aws_log_channel_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_channel_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_channel_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_log_channel_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_channel_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_channel_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . send) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel_vtable) , "::" , stringify ! (send))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clean_up) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel_vtable) , "::" , stringify ! (clean_up))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_channel { pub vtable : * mut aws_log_channel_vtable , pub allocator : * mut aws_allocator , pub writer : * mut aws_log_writer , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_log_channel () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_channel > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_channel > () , 32usize , concat ! ("Size of: " , stringify ! (aws_log_channel))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_channel > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_channel))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . writer) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel) , "::" , stringify ! (writer))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel) , "::" , stringify ! (impl_))) ; } impl Default for aws_log_channel { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_log_channel_init_foreground (channel : * mut aws_log_channel , allocator : * mut aws_allocator , writer : * mut aws_log_writer) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_channel_init_background (channel : * mut aws_log_channel , allocator : * mut aws_allocator , writer : * mut aws_log_writer) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_channel_clean_up (channel : * mut aws_log_channel) ; } pub type aws_log_formatter_format_fn = :: std :: option :: Option < unsafe extern "C" fn (formatter : * mut aws_log_formatter , formatted_output : * mut * mut aws_string , level : aws_log_level :: Type , subject : aws_log_subject_t , format : * const :: libc :: c_char , args : * mut __va_list_tag) -> :: libc :: c_int > ; pub type aws_log_formatter_clean_up_fn = :: std :: option :: Option < unsafe extern "C" fn (logger : * mut aws_log_formatter) > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_log_formatter_vtable { pub format : aws_log_formatter_format_fn , pub clean_up : aws_log_formatter_clean_up_fn , } # [test] fn bindgen_test_layout_aws_log_formatter_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_formatter_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_formatter_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_log_formatter_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_formatter_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_formatter_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . format) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter_vtable) , "::" , stringify ! (format))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clean_up) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter_vtable) , "::" , stringify ! (clean_up))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_formatter { pub vtable : * mut aws_log_formatter_vtable , pub allocator : * mut aws_allocator , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_log_formatter () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_formatter > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_formatter > () , 24usize , concat ! ("Size of: " , stringify ! (aws_log_formatter))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_formatter > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_formatter))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter) , "::" , stringify ! (impl_))) ; } impl Default for aws_log_formatter { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_formatter_standard_options { pub date_format : aws_date_format , } # [test] fn bindgen_test_layout_aws_log_formatter_standard_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_formatter_standard_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_formatter_standard_options > () , 4usize , concat ! ("Size of: " , stringify ! (aws_log_formatter_standard_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_formatter_standard_options > () , 4usize , concat ! ("Alignment of " , stringify ! (aws_log_formatter_standard_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . date_format) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter_standard_options) , "::" , stringify ! (date_format))) ; } impl Default for aws_log_formatter_standard_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_logging_standard_formatting_data { pub log_line_buffer : * mut :: libc :: c_char , pub total_length : usize , pub level : aws_log_level :: Type , pub subject_name : * const :: libc :: c_char , pub format : * const :: libc :: c_char , pub date_format : aws_date_format , pub allocator : * mut aws_allocator , pub amount_written : usize , } # [test] fn bindgen_test_layout_aws_logging_standard_formatting_data () { const UNINIT : :: std :: mem :: MaybeUninit < aws_logging_standard_formatting_data > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_logging_standard_formatting_data > () , 64usize , concat ! ("Size of: " , stringify ! (aws_logging_standard_formatting_data))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_logging_standard_formatting_data > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_logging_standard_formatting_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . log_line_buffer) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (log_line_buffer))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . total_length) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (total_length))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . level) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (level))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subject_name) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (subject_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . format) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (format))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . date_format) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (date_format))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . amount_written) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (amount_written))) ; } impl Default for aws_logging_standard_formatting_data { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_log_formatter_init_default (formatter : * mut aws_log_formatter , allocator : * mut aws_allocator , options : * mut aws_log_formatter_standard_options) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_formatter_clean_up (formatter : * mut aws_log_formatter) ; } extern "C" { pub fn aws_format_standard_log_line (formatting_data : * mut aws_logging_standard_formatting_data , args : * mut __va_list_tag) -> :: libc :: c_int ; } pub type aws_log_writer_write_fn = :: std :: option :: Option < unsafe extern "C" fn (writer : * mut aws_log_writer , output : * const aws_string) -> :: libc :: c_int > ; pub type aws_log_writer_clean_up_fn = :: std :: option :: Option < unsafe extern "C" fn (writer : * mut aws_log_writer) > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_log_writer_vtable { pub write : aws_log_writer_write_fn , pub clean_up : aws_log_writer_clean_up_fn , } # [test] fn bindgen_test_layout_aws_log_writer_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_writer_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_writer_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_log_writer_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_writer_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_writer_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . write) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer_vtable) , "::" , stringify ! (write))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clean_up) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer_vtable) , "::" , stringify ! (clean_up))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_writer { pub vtable : * mut aws_log_writer_vtable , pub allocator : * mut aws_allocator , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_log_writer () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_writer > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_writer > () , 24usize , concat ! ("Size of: " , stringify ! (aws_log_writer))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_writer > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_writer))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer) , "::" , stringify ! (impl_))) ; } impl Default for aws_log_writer { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_writer_file_options { pub filename : * const :: libc :: c_char , pub file : * mut FILE , } # [test] fn bindgen_test_layout_aws_log_writer_file_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_writer_file_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_writer_file_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_log_writer_file_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_writer_file_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_writer_file_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . filename) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer_file_options) , "::" , stringify ! (filename))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . file) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer_file_options) , "::" , stringify ! (file))) ; } impl Default for aws_log_writer_file_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_log_writer_init_stdout (writer : * mut aws_log_writer , allocator : * mut aws_allocator) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_writer_init_stderr (writer : * mut aws_log_writer , allocator : * mut aws_allocator) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_writer_init_file (writer : * mut aws_log_writer , allocator : * mut aws_allocator , options : * mut aws_log_writer_file_options) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_writer_clean_up (writer : * mut aws_log_writer) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_socket_endpoint { _unused : [u8 ; 0] , } # [doc = " Invoked when connect completes.\n\n If unsuccessful, error_code will be set, connection will be NULL,\n and the on_shutdown callback will never be invoked.\n\n If successful, error_code will be 0 and connection will be valid.\n The user is now responsible for the connection and must\n call aws_http_connection_release() when they are done with it.\n\n The connection uses one event-loop thread to do all its work.\n The thread invoking this callback will be the same thread that invokes all\n future callbacks for this connection and its streams."] pub type aws_http_on_client_connection_setup_fn = :: std :: option :: Option < unsafe extern "C" fn (connection : * mut aws_http_connection , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when the connection has finished shutting down.\n Never invoked if on_setup failed.\n This is always invoked on connection's event-loop thread.\n Note that the connection is not completely done until on_shutdown has been invoked\n AND aws_http_connection_release() has been called."] pub type aws_http_on_client_connection_shutdown_fn = :: std :: option :: Option < unsafe extern "C" fn (connection : * mut aws_http_connection , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when the HTTP/2 settings change is complete.\n If connection setup successfully this will always be invoked whether settings change successfully or unsuccessfully.\n If error_code is AWS_ERROR_SUCCESS (0), then the peer has acknowledged the settings and the change has been applied.\n If error_code is non-zero, then a connection error occurred before the settings could be fully acknowledged and\n applied. This is always invoked on the connection's event-loop thread."] pub type aws_http2_on_change_settings_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (http2_connection : * mut aws_http_connection , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when the HTTP/2 PING completes, whether peer has acknowledged it or not.\n If error_code is AWS_ERROR_SUCCESS (0), then the peer has acknowledged the PING and round_trip_time_ns will be the\n round trip time in nano seconds for the connection.\n If error_code is non-zero, then a connection error occurred before the PING get acknowledgment and round_trip_time_ns\n will be useless in this case."] pub type aws_http2_on_ping_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (http2_connection : * mut aws_http_connection , round_trip_time_ns : u64 , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when an HTTP/2 GOAWAY frame is received from peer.\n Implies that the peer has initiated shutdown, or encountered a serious error.\n Once a GOAWAY is received, no further streams may be created on this connection.\n\n @param http2_connection This HTTP/2 connection.\n @param last_stream_id ID of the last locally-initiated stream that peer will\n process. Any locally-initiated streams with a higher ID are ignored by\n peer, and are safe to retry on another connection.\n @param http2_error_code The HTTP/2 error code (RFC-7540 section 7) sent by peer.\n `enum aws_http2_error_code` lists official codes.\n @param debug_data The debug data sent by peer. It can be empty. (NOTE: this data is only valid for the lifetime of\n the callback. Make a deep copy if you wish to keep it longer.)\n @param user_data User-data passed to the callback."] pub type aws_http2_on_goaway_received_fn = :: std :: option :: Option < unsafe extern "C" fn (http2_connection : * mut aws_http_connection , last_stream_id : u32 , http2_error_code : u32 , debug_data : aws_byte_cursor , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when new HTTP/2 settings from peer have been applied.\n Settings_array is the array of aws_http2_settings that contains all the settings we just changed in the order we\n applied (the order settings arrived). Num_settings is the number of elements in that array."] pub type aws_http2_on_remote_settings_change_fn = :: std :: option :: Option < unsafe extern "C" fn (http2_connection : * mut aws_http_connection , settings_array : * const aws_http2_setting , num_settings : usize , user_data : * mut :: libc :: c_void) > ; # [doc = " Callback invoked on each statistics sample.\n\n connection_nonce is unique to each connection for disambiguation of each callback per connection."] pub type aws_http_statistics_observer_fn = :: std :: option :: Option < unsafe extern "C" fn (connection_nonce : usize , stats_list : * const aws_array_list , user_data : * mut :: libc :: c_void) > ; # [doc = " Configuration options for connection monitoring"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_connection_monitoring_options { # [doc = " minimum required throughput of the connection. Throughput is only measured against the interval of time where\n there is actual io to perform. Read and write throughput are measured and checked independently of one another."] pub minimum_throughput_bytes_per_second : u64 , pub allowable_throughput_failure_interval_seconds : u32 , # [doc = " invoked on each statistics publish by the underlying IO channel. Install this callback to receive the statistics\n for observation. This field is optional."] pub statistics_observer_fn : aws_http_statistics_observer_fn , # [doc = " user_data to be passed to statistics_observer_fn."] pub statistics_observer_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_http_connection_monitoring_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_connection_monitoring_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_connection_monitoring_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_http_connection_monitoring_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_connection_monitoring_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_connection_monitoring_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . minimum_throughput_bytes_per_second) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_monitoring_options) , "::" , stringify ! (minimum_throughput_bytes_per_second))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allowable_throughput_failure_interval_seconds) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_monitoring_options) , "::" , stringify ! (allowable_throughput_failure_interval_seconds))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . statistics_observer_fn) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_monitoring_options) , "::" , stringify ! (statistics_observer_fn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . statistics_observer_user_data) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_monitoring_options) , "::" , stringify ! (statistics_observer_user_data))) ; } impl Default for aws_http_connection_monitoring_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Options specific to HTTP/1.x connections."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http1_connection_options { # [doc = " Optional\n Capacity in bytes of the HTTP/1 connection's read buffer.\n The buffer grows if the flow-control window of the incoming HTTP-stream\n reaches zero. If the buffer reaches capacity, no further socket data is\n read until the HTTP-stream's window opens again, allowing data to resume flowing.\n\n Ignored if `manual_window_management` is false.\n If zero is specified (the default) then a default capacity is chosen.\n A capacity that is too small may hinder throughput.\n A capacity that is too big may waste memory without helping throughput."] pub read_buffer_capacity : usize , } # [test] fn bindgen_test_layout_aws_http1_connection_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http1_connection_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http1_connection_options > () , 8usize , concat ! ("Size of: " , stringify ! (aws_http1_connection_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http1_connection_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http1_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . read_buffer_capacity) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http1_connection_options) , "::" , stringify ! (read_buffer_capacity))) ; } # [doc = " Options specific to HTTP/2 connections."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http2_connection_options { # [doc = " Optional\n The data of settings to change for initial settings.\n Note: each setting has its boundary. If settings_array is not set, num_settings has to be 0 to send an empty\n SETTINGS frame."] pub initial_settings_array : * mut aws_http2_setting , # [doc = " Required\n The num of settings to change (Length of the initial_settings_array)."] pub num_initial_settings : usize , # [doc = " Optional.\n Invoked when the HTTP/2 initial settings change is complete.\n If failed to setup the connection, this will not be invoked.\n Otherwise, this will be invoked, whether settings change successfully or unsuccessfully.\n See `aws_http2_on_change_settings_complete_fn`."] pub on_initial_settings_completed : aws_http2_on_change_settings_complete_fn , # [doc = " Optional\n The max number of recently-closed streams to remember.\n Set it to zero to use the default setting, AWS_HTTP2_DEFAULT_MAX_CLOSED_STREAMS\n\n If the connection receives a frame for a closed stream,\n the frame will be ignored or cause a connection error,\n depending on the frame type and how the stream was closed.\n Remembering more streams reduces the chances that a late frame causes\n a connection error, but costs some memory."] pub max_closed_streams : usize , # [doc = " Optional.\n Invoked when a valid GOAWAY frame received.\n See `aws_http2_on_goaway_received_fn`."] pub on_goaway_received : aws_http2_on_goaway_received_fn , # [doc = " Optional.\n Invoked when new settings from peer have been applied.\n See `aws_http2_on_remote_settings_change_fn`."] pub on_remote_settings_change : aws_http2_on_remote_settings_change_fn , # [doc = " Optional.\n Set to true to manually manage the flow-control window of whole HTTP/2 connection.\n\n If false, the connection will maintain its flow-control windows such that\n no back-pressure is applied and data arrives as fast as possible.\n\n If true, the flow-control window of the whole connection will shrink as body data\n is received (headers, padding, and other metadata do not affect the window) for every streams\n created on this connection.\n The initial connection flow-control window is 65,535.\n Once the connection's flow-control window reaches to 0, all the streams on the connection stop receiving any\n further data.\n The user must call aws_http2_connection_update_window() to increment the connection's\n window and keep data flowing.\n Note: the padding of data frame counts to the flow-control window.\n But, the client will always automatically update the window for padding even for manual window update."] pub conn_manual_window_management : bool , } # [test] fn bindgen_test_layout_aws_http2_connection_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http2_connection_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http2_connection_options > () , 56usize , concat ! ("Size of: " , stringify ! (aws_http2_connection_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http2_connection_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http2_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_settings_array) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (initial_settings_array))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_initial_settings) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (num_initial_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_initial_settings_completed) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (on_initial_settings_completed))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_closed_streams) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (max_closed_streams))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_goaway_received) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (on_goaway_received))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_remote_settings_change) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (on_remote_settings_change))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . conn_manual_window_management) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (conn_manual_window_management))) ; } impl Default for aws_http2_connection_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Options for creating an HTTP client connection.\n Initialize with AWS_HTTP_CLIENT_CONNECTION_OPTIONS_INIT to set default values."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_client_connection_options { # [doc = " The sizeof() this struct, used for versioning.\n Set by AWS_HTTP_CLIENT_CONNECTION_OPTIONS_INIT."] pub self_size : usize , # [doc = " Required.\n Must outlive the connection."] pub allocator : * mut aws_allocator , # [doc = " Required.\n The connection keeps the bootstrap alive via ref-counting."] pub bootstrap : * mut aws_client_bootstrap , # [doc = " Required.\n aws_http_client_connect() makes a copy."] pub host_name : aws_byte_cursor , # [doc = " Required."] pub port : u16 , # [doc = " Required.\n aws_http_client_connect() makes a copy."] pub socket_options : * const aws_socket_options , # [doc = " Optional.\n aws_http_client_connect() deep-copies all contents,\n and keeps `aws_tls_ctx` alive via ref-counting."] pub tls_options : * const aws_tls_connection_options , # [doc = " Optional\n Configuration options related to http proxy usage.\n Relevant fields are copied internally."] pub proxy_options : * const aws_http_proxy_options , pub proxy_ev_settings : * const proxy_env_var_settings , # [doc = " Optional\n Configuration options related to connection health monitoring"] pub monitoring_options : * const aws_http_connection_monitoring_options , # [doc = " Set to true to manually manage the flow-control window of each stream.\n\n If false, the connection will maintain its flow-control windows such that\n no back-pressure is applied and data arrives as fast as possible.\n\n If true, the flow-control window of each stream will shrink as body data\n is received (headers, padding, and other metadata do not affect the window).\n `initial_window_size` determines the starting size of each stream's window for HTTP/1 stream, while HTTP/2 stream\n will use the settings AWS_HTTP2_SETTINGS_INITIAL_WINDOW_SIZE to inform the other side about read back pressure\n\n If a stream's flow-control window reaches 0, no further data will be received. The user must call\n aws_http_stream_update_window() to increment the stream's window and keep data flowing.\n\n If a HTTP/2 connection created, it will ONLY control the stream window\n management. Connection window management is controlled by\n conn_manual_window_management. Note: the padding of data frame counts to the flow-control window.\n But, the client will always automatically update the window for padding even for manual window update."] pub manual_window_management : bool , # [doc = " The starting size of each HTTP stream's flow-control window for HTTP/1 connection.\n Required if `manual_window_management` is true,\n ignored if `manual_window_management` is false.\n\n Always ignored when HTTP/2 connection created. The initial window size is controlled by the settings,\n `AWS_HTTP2_SETTINGS_INITIAL_WINDOW_SIZE`"] pub initial_window_size : usize , # [doc = " User data for callbacks\n Optional."] pub user_data : * mut :: libc :: c_void , # [doc = " Invoked when connect completes.\n Required.\n See `aws_http_on_client_connection_setup_fn`."] pub on_setup : aws_http_on_client_connection_setup_fn , # [doc = " Invoked when the connection has finished shutting down.\n Never invoked if setup failed.\n Optional.\n See `aws_http_on_client_connection_shutdown_fn`."] pub on_shutdown : aws_http_on_client_connection_shutdown_fn , # [doc = " Optional.\n When true, use prior knowledge to set up an HTTP/2 connection on a cleartext\n connection.\n When TLS is set and this is true, the connection will failed to be established,\n as prior knowledge only works for cleartext TLS.\n Refer to RFC7540 3.4"] pub prior_knowledge_http2 : bool , # [doc = " Optional.\n Pointer to the hash map containing the ALPN string to protocol to use.\n Hash from `struct aws_string *` to `enum aws_http_version`.\n If not set, only the predefined string `h2` and `http/1.1` will be recognized. Other negotiated ALPN string will\n result in a HTTP1/1 connection\n Note: Connection will keep a deep copy of the table and the strings."] pub alpn_string_map : * mut aws_hash_table , # [doc = " Options specific to HTTP/1.x connections.\n Optional.\n Ignored if connection is not HTTP/1.x.\n If connection is HTTP/1.x and options were not specified, default values are used."] pub http1_options : * const aws_http1_connection_options , # [doc = " Options specific to HTTP/2 connections.\n Optional.\n Ignored if connection is not HTTP/2.\n If connection is HTTP/2 and options were not specified, default values are used."] pub http2_options : * const aws_http2_connection_options , # [doc = " Optional.\n Requests the channel/connection be bound to a specific event loop rather than chosen sequentially from the\n event loop group associated with the client bootstrap."] pub requested_event_loop : * mut aws_event_loop , # [doc = " Optional\n Host resolution override that allows the user to override DNS behavior for this particular connection."] pub host_resolution_config : * const aws_host_resolution_config , } # [test] fn bindgen_test_layout_aws_http_client_connection_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_client_connection_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_client_connection_options > () , 176usize , concat ! ("Size of: " , stringify ! (aws_http_client_connection_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_client_connection_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_client_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . self_size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (self_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . socket_options) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (socket_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_options) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (tls_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_options) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_settings) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (proxy_ev_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . monitoring_options) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (monitoring_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . manual_window_management) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (manual_window_management))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_window_size) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (initial_window_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_setup) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (on_setup))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_shutdown) as usize - ptr as usize } , 120usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (on_shutdown))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . prior_knowledge_http2) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (prior_knowledge_http2))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alpn_string_map) as usize - ptr as usize } , 136usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (alpn_string_map))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http1_options) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (http1_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http2_options) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (http2_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . requested_event_loop) as usize - ptr as usize } , 160usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (requested_event_loop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolution_config) as usize - ptr as usize } , 168usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (host_resolution_config))) ; } impl Default for aws_http_client_connection_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } impl aws_http2_settings_id { pub const AWS_HTTP2_SETTINGS_HEADER_TABLE_SIZE : aws_http2_settings_id = aws_http2_settings_id :: AWS_HTTP2_SETTINGS_BEGIN_RANGE ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http2_settings_id { AWS_HTTP2_SETTINGS_BEGIN_RANGE = 1 , AWS_HTTP2_SETTINGS_ENABLE_PUSH = 2 , AWS_HTTP2_SETTINGS_MAX_CONCURRENT_STREAMS = 3 , AWS_HTTP2_SETTINGS_INITIAL_WINDOW_SIZE = 4 , AWS_HTTP2_SETTINGS_MAX_FRAME_SIZE = 5 , AWS_HTTP2_SETTINGS_MAX_HEADER_LIST_SIZE = 6 , AWS_HTTP2_SETTINGS_END_RANGE = 7 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http2_setting { pub id : aws_http2_settings_id , pub value : u32 , } # [test] fn bindgen_test_layout_aws_http2_setting () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http2_setting > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http2_setting > () , 8usize , concat ! ("Size of: " , stringify ! (aws_http2_setting))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http2_setting > () , 4usize , concat ! ("Alignment of " , stringify ! (aws_http2_setting))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . id) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http2_setting) , "::" , stringify ! (id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (aws_http2_setting) , "::" , stringify ! (value))) ; } impl Default for aws_http2_setting { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Asynchronously establish a client connection.\n The on_setup callback is invoked when the operation has created a connection or failed."] pub fn aws_http_client_connect (options : * const aws_http_client_connection_options) -> :: libc :: c_int ; } extern "C" { # [doc = " Users must release the connection when they are done with it.\n The connection's memory cannot be reclaimed until this is done.\n If the connection was not already shutting down, it will be shut down.\n\n Users should always wait for the on_shutdown() callback to be called before releasing any data passed to the\n http_connection (Eg aws_tls_connection_options, aws_socket_options) otherwise there will be race conditions between\n http_connection shutdown tasks and memory release tasks, causing Segfaults."] pub fn aws_http_connection_release (connection : * mut aws_http_connection) ; } extern "C" { # [doc = " Begin shutdown sequence of the connection if it hasn't already started. This will schedule shutdown tasks on the\n EventLoop that may send HTTP/TLS/TCP shutdown messages to peers if necessary, and will eventually cause internal\n connection memory to stop being accessed and on_shutdown() callback to be called.\n\n It's safe to call this function regardless of the connection state as long as you hold a reference to the connection."] pub fn aws_http_connection_close (connection : * mut aws_http_connection) ; } extern "C" { # [doc = " Stop accepting new requests for the connection. It will NOT start the shutdown process for the connection. The\n requests that are already open can still wait to be completed, but new requests will fail to be created,"] pub fn aws_http_connection_stop_new_requests (connection : * mut aws_http_connection) ; } extern "C" { # [doc = " Returns true unless the connection is closed or closing."] pub fn aws_http_connection_is_open (connection : * const aws_http_connection) -> bool ; } extern "C" { # [doc = " Return whether the connection can make a new requests.\n If false, then a new connection must be established to make further requests."] pub fn aws_http_connection_new_requests_allowed (connection : * const aws_http_connection) -> bool ; } extern "C" { # [doc = " Returns true if this is a client connection."] pub fn aws_http_connection_is_client (connection : * const aws_http_connection) -> bool ; } extern "C" { pub fn aws_http_connection_get_version (connection : * const aws_http_connection) -> aws_http_version ; } extern "C" { # [doc = " Returns the channel hosting the HTTP connection.\n Do not expose this function to language bindings."] pub fn aws_http_connection_get_channel (connection : * mut aws_http_connection) -> * mut aws_channel ; } extern "C" { # [doc = " Returns the remote endpoint of the HTTP connection."] pub fn aws_http_connection_get_remote_endpoint (connection : * const aws_http_connection) -> * const aws_socket_endpoint ; } extern "C" { # [doc = " Initialize an map copied from the *src map, which maps `struct aws_string *` to `enum aws_http_version`."] pub fn aws_http_alpn_map_init_copy (allocator : * mut aws_allocator , dest : * mut aws_hash_table , src : * mut aws_hash_table) -> :: libc :: c_int ; } extern "C" { # [doc = " Initialize an empty hash-table that maps `struct aws_string *` to `enum aws_http_version`.\n This map can used in aws_http_client_connections_options.alpn_string_map."] pub fn aws_http_alpn_map_init (allocator : * mut aws_allocator , map : * mut aws_hash_table) -> :: libc :: c_int ; } extern "C" { # [doc = " Checks http proxy options for correctness"] pub fn aws_http_options_validate_proxy_configuration (options : * const aws_http_client_connection_options) -> :: libc :: c_int ; } extern "C" { # [doc = " Send a SETTINGS frame (HTTP/2 only).\n SETTINGS will be applied locally when SETTINGS ACK is received from peer.\n\n @param http2_connection HTTP/2 connection.\n @param settings_array The array of settings to change. Note: each setting has its boundary.\n @param num_settings The num of settings to change in settings_array.\n @param on_completed Optional callback, see `aws_http2_on_change_settings_complete_fn`.\n @param user_data User-data pass to on_completed callback."] pub fn aws_http2_connection_change_settings (http2_connection : * mut aws_http_connection , settings_array : * const aws_http2_setting , num_settings : usize , on_completed : aws_http2_on_change_settings_complete_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Send a PING frame (HTTP/2 only).\n Round-trip-time is calculated when PING ACK is received from peer.\n\n @param http2_connection HTTP/2 connection.\n @param optional_opaque_data Optional payload for PING frame.\n Must be NULL, or exactly 8 bytes (AWS_HTTP2_PING_DATA_SIZE).\n If NULL, the 8 byte payload will be all zeroes.\n @param on_completed Optional callback, invoked when PING ACK is received from peer,\n or when a connection error prevents the PING ACK from being received.\n Callback always fires on the connection's event-loop thread.\n @param user_data User-data pass to on_completed callback."] pub fn aws_http2_connection_ping (http2_connection : * mut aws_http_connection , optional_opaque_data : * const aws_byte_cursor , on_completed : aws_http2_on_ping_complete_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the local settings we are using to affect the decoding.\n\n @param http2_connection HTTP/2 connection.\n @param out_settings fixed size array of aws_http2_setting gets set to the local settings"] pub fn aws_http2_connection_get_local_settings (http2_connection : * const aws_http_connection , out_settings : * mut aws_http2_setting) ; } extern "C" { # [doc = " Get the settings received from remote peer, which we are using to restricts the message to send.\n\n @param http2_connection HTTP/2 connection.\n @param out_settings fixed size array of aws_http2_setting gets set to the remote settings"] pub fn aws_http2_connection_get_remote_settings (http2_connection : * const aws_http_connection , out_settings : * mut aws_http2_setting) ; } extern "C" { # [doc = " Send a custom GOAWAY frame (HTTP/2 only).\n\n Note that the connection automatically attempts to send a GOAWAY during\n shutdown (unless a GOAWAY with a valid Last-Stream-ID has already been sent).\n\n This call can be used to gracefully warn the peer of an impending shutdown\n (http2_error=0, allow_more_streams=true), or to customize the final GOAWAY\n frame that is sent by this connection.\n\n The other end may not receive the goaway, if the connection already closed.\n\n @param http2_connection HTTP/2 connection.\n @param http2_error The HTTP/2 error code (RFC-7540 section 7) to send.\n `enum aws_http2_error_code` lists official codes.\n @param allow_more_streams If true, new peer-initiated streams will continue\n to be acknowledged and the GOAWAY's Last-Stream-ID will be set to a max value.\n If false, new peer-initiated streams will be ignored and the GOAWAY's\n Last-Stream-ID will be set to the latest acknowledged stream.\n @param optional_debug_data Optional debug data to send. Size must not exceed 16KB."] pub fn aws_http2_connection_send_goaway (http2_connection : * mut aws_http_connection , http2_error : u32 , allow_more_streams : bool , optional_debug_data : * const aws_byte_cursor) ; } extern "C" { # [doc = " Get data about the latest GOAWAY frame sent to peer (HTTP/2 only).\n If no GOAWAY has been sent, AWS_ERROR_HTTP_DATA_NOT_AVAILABLE will be raised.\n Note that GOAWAY frames are typically sent automatically by the connection\n during shutdown.\n\n @param http2_connection HTTP/2 connection.\n @param out_http2_error Gets set to HTTP/2 error code sent in most recent GOAWAY.\n @param out_last_stream_id Gets set to Last-Stream-ID sent in most recent GOAWAY."] pub fn aws_http2_connection_get_sent_goaway (http2_connection : * mut aws_http_connection , out_http2_error : * mut u32 , out_last_stream_id : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Get data about the latest GOAWAY frame received from peer (HTTP/2 only).\n If no GOAWAY has been received, or the GOAWAY payload is still in transmitting,\n AWS_ERROR_HTTP_DATA_NOT_AVAILABLE will be raised.\n\n @param http2_connection HTTP/2 connection.\n @param out_http2_error Gets set to HTTP/2 error code received in most recent GOAWAY.\n @param out_last_stream_id Gets set to Last-Stream-ID received in most recent GOAWAY."] pub fn aws_http2_connection_get_received_goaway (http2_connection : * mut aws_http_connection , out_http2_error : * mut u32 , out_last_stream_id : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Increment the connection's flow-control window to keep data flowing (HTTP/2 only).\n\n If the connection was created with `conn_manual_window_management` set true,\n the flow-control window of the connection will shrink as body data is received for all the streams created on it.\n (headers, padding, and other metadata do not affect the window).\n The initial connection flow-control window is 65,535.\n Once the connection's flow-control window reaches to 0, all the streams on the connection stop receiving any further\n data.\n\n If `conn_manual_window_management` is false, this call will have no effect.\n The connection maintains its flow-control windows such that\n no back-pressure is applied and data arrives as fast as possible.\n\n If you are not connected, this call will have no effect.\n\n Crashes when the connection is not http2 connection.\n The limit of the Maximum Size is 2**31 - 1. If the increment size cause the connection flow window exceeds the\n Maximum size, this call will result in the connection lost.\n\n @param http2_connection HTTP/2 connection.\n @param increment_size The size to increment for the connection's flow control window"] pub fn aws_http2_connection_update_window (http2_connection : * mut aws_http_connection , increment_size : u32) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_future_impl { _unused : [u8 ; 0] , } # [doc = " Completion callback for aws_future"] pub type aws_future_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; pub type aws_future_impl_result_clean_up_fn = :: std :: option :: Option < unsafe extern "C" fn (result_addr : * mut :: libc :: c_void) > ; pub type aws_future_impl_result_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (result : * mut :: libc :: c_void) > ; pub type aws_future_impl_result_release_fn = :: std :: option :: Option < unsafe extern "C" fn (result : * mut :: libc :: c_void) -> * mut :: libc :: c_void > ; extern "C" { pub fn aws_future_impl_new_by_value (alloc : * mut aws_allocator , sizeof_result : usize) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_new_by_value_with_clean_up (alloc : * mut aws_allocator , sizeof_result : usize , result_clean_up : aws_future_impl_result_clean_up_fn) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_new_pointer (alloc : * mut aws_allocator) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_new_pointer_with_destroy (alloc : * mut aws_allocator , result_destroy : aws_future_impl_result_destroy_fn) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_new_pointer_with_release (alloc : * mut aws_allocator , result_release : aws_future_impl_result_release_fn) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_release (promise : * mut aws_future_impl) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_acquire (promise : * mut aws_future_impl) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_set_error (promise : * mut aws_future_impl , error_code : :: libc :: c_int) ; } extern "C" { pub fn aws_future_impl_set_result_by_move (promise : * mut aws_future_impl , src_address : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_impl_is_done (future : * const aws_future_impl) -> bool ; } extern "C" { pub fn aws_future_impl_register_callback (future : * mut aws_future_impl , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_impl_register_callback_if_not_done (future : * mut aws_future_impl , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) -> bool ; } extern "C" { pub fn aws_future_impl_register_event_loop_callback (future : * mut aws_future_impl , event_loop : * mut aws_event_loop , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_impl_register_channel_callback (future : * mut aws_future_impl , channel : * mut aws_channel , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_impl_wait (future : * const aws_future_impl , timeout_ns : u64) -> bool ; } extern "C" { pub fn aws_future_impl_get_error (future : * const aws_future_impl) -> :: libc :: c_int ; } extern "C" { pub fn aws_future_impl_get_result_address (future : * const aws_future_impl) -> * mut :: libc :: c_void ; } extern "C" { pub fn aws_future_impl_get_result_by_move (future : * mut aws_future_impl , dst_address : * mut :: libc :: c_void) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_future_size { _unused : [u8 ; 0] , } extern "C" { pub fn aws_future_size_new (alloc : * mut aws_allocator) -> * mut aws_future_size ; } extern "C" { pub fn aws_future_size_set_result (future : * mut aws_future_size , result : usize) ; } extern "C" { pub fn aws_future_size_get_result (future : * const aws_future_size) -> usize ; } extern "C" { pub fn aws_future_size_acquire (future : * mut aws_future_size) -> * mut aws_future_size ; } extern "C" { pub fn aws_future_size_release (future : * mut aws_future_size) -> * mut aws_future_size ; } extern "C" { pub fn aws_future_size_set_error (future : * mut aws_future_size , error_code : :: libc :: c_int) ; } extern "C" { pub fn aws_future_size_is_done (future : * const aws_future_size) -> bool ; } extern "C" { pub fn aws_future_size_get_error (future : * const aws_future_size) -> :: libc :: c_int ; } extern "C" { pub fn aws_future_size_register_callback (future : * mut aws_future_size , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_size_register_callback_if_not_done (future : * mut aws_future_size , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) -> bool ; } extern "C" { pub fn aws_future_size_register_event_loop_callback (future : * mut aws_future_size , event_loop : * mut aws_event_loop , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_size_register_channel_callback (future : * mut aws_future_size , channel : * mut aws_channel , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_size_wait (future : * mut aws_future_size , timeout_ns : u64) -> bool ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_future_bool { _unused : [u8 ; 0] , } extern "C" { pub fn aws_future_bool_new (alloc : * mut aws_allocator) -> * mut aws_future_bool ; } extern "C" { pub fn aws_future_bool_set_result (future : * mut aws_future_bool , result : bool) ; } extern "C" { pub fn aws_future_bool_get_result (future : * const aws_future_bool) -> bool ; } extern "C" { pub fn aws_future_bool_acquire (future : * mut aws_future_bool) -> * mut aws_future_bool ; } extern "C" { pub fn aws_future_bool_release (future : * mut aws_future_bool) -> * mut aws_future_bool ; } extern "C" { pub fn aws_future_bool_set_error (future : * mut aws_future_bool , error_code : :: libc :: c_int) ; } extern "C" { pub fn aws_future_bool_is_done (future : * const aws_future_bool) -> bool ; } extern "C" { pub fn aws_future_bool_get_error (future : * const aws_future_bool) -> :: libc :: c_int ; } extern "C" { pub fn aws_future_bool_register_callback (future : * mut aws_future_bool , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_bool_register_callback_if_not_done (future : * mut aws_future_bool , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) -> bool ; } extern "C" { pub fn aws_future_bool_register_event_loop_callback (future : * mut aws_future_bool , event_loop : * mut aws_event_loop , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_bool_register_channel_callback (future : * mut aws_future_bool , channel : * mut aws_channel , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_bool_wait (future : * mut aws_future_bool , timeout_ns : u64) -> bool ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_future_void { _unused : [u8 ; 0] , } extern "C" { `# [doc = " aws_future"]` pub fn aws_future_void_new (alloc : * mut aws_allocator) -> * mut aws_future_void ; } extern "C" { pub fn aws_future_void_set_result (future : * mut aws_future_void) ; } extern "C" { pub fn aws_future_void_acquire (future : * mut aws_future_void) -> * mut aws_future_void ; } extern "C" { pub fn aws_future_void_release (future : * mut aws_future_void) -> * mut aws_future_void ; } extern "C" { pub fn aws_future_void_set_error (future : * mut aws_future_void , error_code : :: libc :: c_int) ; } extern "C" { pub fn aws_future_void_is_done (future : * const aws_future_void) -> bool ; } extern "C" { pub fn aws_future_void_get_error (future : * const aws_future_void) -> :: libc :: c_int ; } extern "C" { pub fn aws_future_void_register_callback (future : * mut aws_future_void , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_void_register_callback_if_not_done (future : * mut aws_future_void , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) -> bool ; } extern "C" { pub fn aws_future_void_register_event_loop_callback (future : * mut aws_future_void , event_loop : * mut aws_event_loop , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_void_register_channel_callback (future : * mut aws_future_void , channel : * mut aws_channel , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_void_wait (future : * mut aws_future_void , timeout_ns : u64) -> bool ; } # [doc = " A stream exists for the duration of a request/response exchange.\n A client creates a stream to send a request and receive a response.\n A server creates a stream to receive a request and send a response.\n In http/2, a push-promise stream can be sent by a server and received by a client."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_stream { _unused : [u8 ; 0] , } # [repr (u32)] # [non_exhaustive] # [doc = " Controls whether a header's strings may be compressed by encoding the index of\n strings in a cache, rather than encoding the literal string.\n\n This setting has no effect on HTTP/1.x connections.\n On HTTP/2 connections this controls HPACK behavior.\n See RFC-7541 Section 7.1 for security considerations."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_header_compression { # [doc = " Compress header by encoding the cached index of its strings,\n or by updating the cache to contain these strings for future reference.\n Best for headers that are sent repeatedly.\n This is the default setting."] AWS_HTTP_HEADER_COMPRESSION_USE_CACHE = 0 , # [doc = " Encode header strings literally.\n If an intermediary re-broadcasts the headers, it is permitted to use cache.\n Best for unique headers that are unlikely to repeat."] AWS_HTTP_HEADER_COMPRESSION_NO_CACHE = 1 , # [doc = " Encode header strings literally and forbid all intermediaries from using\n cache when re-broadcasting.\n Best for header fields that are highly valuable or sensitive to recovery."] AWS_HTTP_HEADER_COMPRESSION_NO_FORWARD_CACHE = 2 , } # [doc = " A lightweight HTTP header struct.\n Note that the underlying strings are not owned by the byte cursors."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_header { pub name : aws_byte_cursor , pub value : aws_byte_cursor , pub compression : aws_http_header_compression , } # [test] fn bindgen_test_layout_aws_http_header () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_header > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_header > () , 40usize , concat ! ("Size of: " , stringify ! (aws_http_header))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_header > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_header))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . name) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_header) , "::" , stringify ! (name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_header) , "::" , stringify ! (value))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . compression) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_header) , "::" , stringify ! (compression))) ; } impl Default for aws_http_header { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " A transformable block of HTTP headers.\n Provides a nice API for getting/setting header names and values.\n\n All strings are copied and stored within this datastructure.\n The index of a given header may change any time headers are modified.\n When iterating headers, the following ordering rules apply:\n\n - Headers with the same name will always be in the same order, relative to one another.\n If \"A: one\" is added before \"A: two\", then \"A: one\" will always precede \"A: two\".\n\n - Headers with different names could be in any order, relative to one another.\n If \"A: one\" is seen before \"B: bee\" in one iteration, you might see \"B: bee\" before \"A: one\" on the next."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_headers { _unused : [u8 ; 0] , } # [repr (u32)] # [non_exhaustive] # [doc = " Header block type.\n INFORMATIONAL: Header block for 1xx informational (interim) responses.\n MAIN: Main header block sent with request or response.\n TRAILING: Headers sent after the body of a request or response."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_header_block { AWS_HTTP_HEADER_BLOCK_MAIN = 0 , AWS_HTTP_HEADER_BLOCK_INFORMATIONAL = 1 , AWS_HTTP_HEADER_BLOCK_TRAILING = 2 , } # [doc = " The definition for an outgoing HTTP request or response.\n The message may be transformed (ex: signing the request) before its data is eventually sent.\n\n The message keeps internal copies of its trivial strings (method, path, headers)\n but does NOT take ownership of its body stream.\n\n A language binding would likely present this as an HttpMessage base class with\n HttpRequest and HttpResponse subclasses."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_message { _unused : [u8 ; 0] , } # [doc = " Function to invoke when a message transformation completes.\n This function MUST be invoked or the application will soft-lock.\n `message` and `complete_ctx` must be the same pointers provided to the `aws_http_message_transform_fn`.\n `error_code` should should be AWS_ERROR_SUCCESS if transformation was successful,\n otherwise pass a different AWS_ERROR_X value."] pub type aws_http_message_transform_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (message : * mut aws_http_message , error_code : :: libc :: c_int , complete_ctx : * mut :: libc :: c_void) > ; # [doc = " A function that may modify a request or response before it is sent.\n The transformation may be asynchronous or immediate.\n The user MUST invoke the `complete_fn` when transformation is complete or the application will soft-lock.\n When invoking the `complete_fn`, pass along the `message` and `complete_ctx` provided here and an error code.\n The error code should be AWS_ERROR_SUCCESS if transformation was successful,\n otherwise pass a different AWS_ERROR_X value."] pub type aws_http_message_transform_fn = :: std :: option :: Option < unsafe extern "C" fn (message : * mut aws_http_message , user_data : * mut :: libc :: c_void , complete_fn : aws_http_message_transform_complete_fn , complete_ctx : * mut :: libc :: c_void) > ; # [doc = " Invoked repeatedly times as headers are received.\n At this point, aws_http_stream_get_incoming_response_status() can be called for the client.\n And aws_http_stream_get_incoming_request_method() and aws_http_stream_get_incoming_request_uri() can be called for\n the server.\n This is always invoked on the HTTP connection's event-loop thread.\n\n Return AWS_OP_SUCCESS to continue processing the stream.\n Return AWS_OP_ERR to indicate failure and cancel the stream."] pub type aws_http_on_incoming_headers_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , header_block : aws_http_header_block , header_array : * const aws_http_header , num_headers : usize , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Invoked when the incoming header block of this type(informational/main/trailing) has been completely read.\n This is always invoked on the HTTP connection's event-loop thread.\n\n Return AWS_OP_SUCCESS to continue processing the stream.\n Return AWS_OP_ERR to indicate failure and cancel the stream."] pub type aws_http_on_incoming_header_block_done_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , header_block : aws_http_header_block , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Called repeatedly as body data is received.\n The data must be copied immediately if you wish to preserve it.\n This is always invoked on the HTTP connection's event-loop thread.\n\n Note that, if the connection is using manual_window_management then the window\n size has shrunk by the amount of body data received. If the window size\n reaches 0 no further data will be received. Increment the window size with\n aws_http_stream_update_window().\n\n Return AWS_OP_SUCCESS to continue processing the stream.\n Return AWS_OP_ERR to indicate failure and cancel the stream."] pub type aws_http_on_incoming_body_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , data : * const aws_byte_cursor , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Invoked when request has been completely read.\n This is always invoked on the HTTP connection's event-loop thread.\n\n Return AWS_OP_SUCCESS to continue processing the stream.\n Return AWS_OP_ERR to indicate failure and cancel the stream."] pub type aws_http_on_incoming_request_done_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Invoked when request/response stream is completely destroyed.\n This may be invoked synchronously when aws_http_stream_release() is called.\n This is invoked even if the stream is never activated."] pub type aws_http_on_stream_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when request/response stream destroy completely.\n This can be invoked within the same thead who release the refcount on http stream."] pub type aws_http_on_stream_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [doc = " Tracing metrics for aws_http_stream.\n Data maybe not be available if the data of stream was never sent/received before it completes."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http_stream_metrics { pub send_start_timestamp_ns : i64 , pub send_end_timestamp_ns : i64 , pub sending_duration_ns : i64 , pub receive_start_timestamp_ns : i64 , pub receive_end_timestamp_ns : i64 , pub receiving_duration_ns : i64 , pub stream_id : u32 , } # [test] fn bindgen_test_layout_aws_http_stream_metrics () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_stream_metrics > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_stream_metrics > () , 56usize , concat ! ("Size of: " , stringify ! (aws_http_stream_metrics))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_stream_metrics > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_stream_metrics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . send_start_timestamp_ns) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (send_start_timestamp_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . send_end_timestamp_ns) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (send_end_timestamp_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . sending_duration_ns) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (sending_duration_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . receive_start_timestamp_ns) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (receive_start_timestamp_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . receive_end_timestamp_ns) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (receive_end_timestamp_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . receiving_duration_ns) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (receiving_duration_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . stream_id) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (stream_id))) ; } # [doc = " Invoked right before request/response stream is complete to report the tracing metrics for aws_http_stream.\n This may be invoked synchronously when aws_http_stream_release() is called.\n This is invoked even if the stream is never activated.\n See `aws_http_stream_metrics` for details."] pub type aws_http_on_stream_metrics_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , metrics : * const aws_http_stream_metrics , user_data : * mut :: libc :: c_void) > ; # [doc = " Options for creating a stream which sends a request from the client and receives a response from the server."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_make_request_options { # [doc = " The sizeof() this struct, used for versioning.\n Required."] pub self_size : usize , # [doc = " Definition for outgoing request.\n Required.\n The request will be kept alive via refcounting until the request completes."] pub request : * mut aws_http_message , pub user_data : * mut :: libc :: c_void , # [doc = " Invoked repeatedly times as headers are received.\n Optional.\n See `aws_http_on_incoming_headers_fn`."] pub on_response_headers : aws_http_on_incoming_headers_fn , # [doc = " Invoked when response header block has been completely read.\n Optional.\n See `aws_http_on_incoming_header_block_done_fn`."] pub on_response_header_block_done : aws_http_on_incoming_header_block_done_fn , # [doc = " Invoked repeatedly as body data is received.\n Optional.\n See `aws_http_on_incoming_body_fn`."] pub on_response_body : aws_http_on_incoming_body_fn , # [doc = " Invoked right before stream is complete, whether successful or unsuccessful\n Optional.\n See `aws_http_on_stream_metrics_fn`"] pub on_metrics : aws_http_on_stream_metrics_fn , # [doc = " Invoked when request/response stream is complete, whether successful or unsuccessful\n Optional.\n See `aws_http_on_stream_complete_fn`."] pub on_complete : aws_http_on_stream_complete_fn , pub on_destroy : aws_http_on_stream_destroy_fn , # [doc = " When using HTTP/2, request body data will be provided over time. The stream will only be polled for writing\n when data has been supplied via `aws_http2_stream_write_data`"] pub http2_use_manual_data_writes : bool , } # [test] fn bindgen_test_layout_aws_http_make_request_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_make_request_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_make_request_options > () , 80usize , concat ! ("Size of: " , stringify ! (aws_http_make_request_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_make_request_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_make_request_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . self_size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (self_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . request) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (request))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_response_headers) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_response_headers))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_response_header_block_done) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_response_header_block_done))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_response_body) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_response_body))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_metrics) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_metrics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_complete) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_destroy) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http2_use_manual_data_writes) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (http2_use_manual_data_writes))) ; } impl Default for aws_http_make_request_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_request_handler_options { pub self_size : usize , # [doc = " Required."] pub server_connection : * mut aws_http_connection , # [doc = " user_data passed to callbacks.\n Optional."] pub user_data : * mut :: libc :: c_void , # [doc = " Invoked repeatedly times as headers are received.\n Optional.\n See `aws_http_on_incoming_headers_fn`."] pub on_request_headers : aws_http_on_incoming_headers_fn , # [doc = " Invoked when the request header block has been completely read.\n Optional.\n See `aws_http_on_incoming_header_block_done_fn`."] pub on_request_header_block_done : aws_http_on_incoming_header_block_done_fn , # [doc = " Invoked as body data is received.\n Optional.\n See `aws_http_on_incoming_body_fn`."] pub on_request_body : aws_http_on_incoming_body_fn , # [doc = " Invoked when request has been completely read.\n Optional.\n See `aws_http_on_incoming_request_done_fn`."] pub on_request_done : aws_http_on_incoming_request_done_fn , # [doc = " Invoked when request/response stream is complete, whether successful or unsuccessful\n Optional.\n See `aws_http_on_stream_complete_fn`."] pub on_complete : aws_http_on_stream_complete_fn , pub on_destroy : aws_http_on_stream_destroy_fn , } # [test] fn bindgen_test_layout_aws_http_request_handler_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_request_handler_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_request_handler_options > () , 72usize , concat ! ("Size of: " , stringify ! (aws_http_request_handler_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_request_handler_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_request_handler_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . self_size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (self_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . server_connection) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (server_connection))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_request_headers) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_request_headers))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_request_header_block_done) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_request_header_block_done))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_request_body) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_request_body))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_request_done) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_request_done))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_complete) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_destroy) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_destroy))) ; } impl Default for aws_http_request_handler_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Invoked when the data stream of an outgoing HTTP write operation is no longer in use.\n This is always invoked on the HTTP connection's event-loop thread.\n\n @param stream HTTP-stream this write operation was submitted to.\n @param error_code If error_code is AWS_ERROR_SUCCESS (0), the data was successfully sent.\n Any other error_code indicates that the HTTP-stream is in the process of terminating.\n If the error_code is AWS_ERROR_HTTP_STREAM_HAS_COMPLETED,\n the stream's termination has nothing to do with this write operation.\n Any other non-zero error code indicates a problem with this particular write\n operation's data.\n @param user_data User data for this write operation."] pub type aws_http_stream_write_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when the data of an outgoing HTTP/1.1 chunk is no longer in use.\n This is always invoked on the HTTP connection's event-loop thread.\n\n @param stream HTTP-stream this chunk was submitted to.\n @param error_code If error_code is AWS_ERROR_SUCCESS (0), the data was successfully sent.\n Any other error_code indicates that the HTTP-stream is in the process of terminating.\n If the error_code is AWS_ERROR_HTTP_STREAM_HAS_COMPLETED,\n the stream's termination has nothing to do with this chunk.\n Any other non-zero error code indicates a problem with this particular chunk's data.\n @param user_data User data for this chunk."] pub type aws_http1_stream_write_chunk_complete_fn = aws_http_stream_write_complete_fn ; # [doc = " HTTP/1.1 chunk extension for chunked encoding.\n Note that the underlying strings are not owned by the byte cursors."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http1_chunk_extension { pub key : aws_byte_cursor , pub value : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_http1_chunk_extension () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http1_chunk_extension > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http1_chunk_extension > () , 32usize , concat ! ("Size of: " , stringify ! (aws_http1_chunk_extension))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http1_chunk_extension > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http1_chunk_extension))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . key) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_extension) , "::" , stringify ! (key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_extension) , "::" , stringify ! (value))) ; } impl Default for aws_http1_chunk_extension { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Encoding options for an HTTP/1.1 chunked transfer encoding chunk."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http1_chunk_options { pub chunk_data : * mut aws_input_stream , pub chunk_data_size : u64 , # [doc = " A pointer to an array of chunked extensions.\n The num_extensions must match the length of the array.\n This data is deep-copied by aws_http1_stream_write_chunk(),\n it does not need to remain valid until on_complete is invoked."] pub extensions : * mut aws_http1_chunk_extension , # [doc = " The number of elements defined in the extensions array."] pub num_extensions : usize , # [doc = " Invoked when the chunk data is no longer in use, whether or not it was successfully sent.\n Optional.\n See `aws_http1_stream_write_chunk_complete_fn`."] pub on_complete : aws_http1_stream_write_chunk_complete_fn , # [doc = " User provided data passed to the on_complete callback on its invocation."] pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_http1_chunk_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http1_chunk_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http1_chunk_options > () , 48usize , concat ! ("Size of: " , stringify ! (aws_http1_chunk_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http1_chunk_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http1_chunk_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . chunk_data) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (chunk_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . chunk_data_size) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (chunk_data_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . extensions) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (extensions))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_extensions) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (num_extensions))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_complete) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (on_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (user_data))) ; } impl Default for aws_http1_chunk_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Invoked when the data of an outgoing HTTP2 data frame is no longer in use.\n This is always invoked on the HTTP connection's event-loop thread.\n\n @param stream HTTP2-stream this write was submitted to.\n @param error_code If error_code is AWS_ERROR_SUCCESS (0), the data was successfully sent.\n Any other error_code indicates that the HTTP-stream is in the process of terminating.\n If the error_code is AWS_ERROR_HTTP_STREAM_HAS_COMPLETED,\n the stream's termination has nothing to do with this write.\n Any other non-zero error code indicates a problem with this particular write's data.\n @param user_data User data for this write."] pub type aws_http2_stream_write_data_complete_fn = aws_http_stream_write_complete_fn ; # [doc = " Encoding options for manual H2 data frame writes"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http2_stream_write_data_options { # [doc = " The data to be sent.\n Optional.\n If not set, input stream with length 0 will be used."] pub data : * mut aws_input_stream , # [doc = " Set true when it's the last chunk to be sent.\n After a write with end_stream, no more data write will be accepted."] pub end_stream : bool , # [doc = " Invoked when the data stream is no longer in use, whether or not it was successfully sent.\n Optional.\n See `aws_http2_stream_write_data_complete_fn`."] pub on_complete : aws_http2_stream_write_data_complete_fn , # [doc = " User provided data passed to the on_complete callback on its invocation."] pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_http2_stream_write_data_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http2_stream_write_data_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http2_stream_write_data_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_http2_stream_write_data_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http2_stream_write_data_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http2_stream_write_data_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . data) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http2_stream_write_data_options) , "::" , stringify ! (data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . end_stream) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http2_stream_write_data_options) , "::" , stringify ! (end_stream))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_complete) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http2_stream_write_data_options) , "::" , stringify ! (on_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http2_stream_write_data_options) , "::" , stringify ! (user_data))) ; } impl Default for aws_http2_stream_write_data_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Return whether both names are equivalent.\n This is a case-insensitive string comparison.\n\n Example Matches:\n \"Content-Length\" == \"content-length\" // upper or lower case ok\n\n Example Mismatches:\n \"Content-Length\" != \" Content-Length\" // leading whitespace bad"] pub fn aws_http_header_name_eq (name_a : aws_byte_cursor , name_b : aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Create a new headers object.\n The caller has a hold on the object and must call aws_http_headers_release() when they are done with it."] pub fn aws_http_headers_new (allocator : * mut aws_allocator) -> * mut aws_http_headers ; } extern "C" { # [doc = " Acquire a hold on the object, preventing it from being deleted until\n aws_http_headers_release() is called by all those with a hold on it."] pub fn aws_http_headers_acquire (headers : * mut aws_http_headers) ; } extern "C" { # [doc = " Release a hold on the object.\n The object is deleted when all holds on it are released."] pub fn aws_http_headers_release (headers : * mut aws_http_headers) ; } extern "C" { # [doc = " Add a header.\n The underlying strings are copied."] pub fn aws_http_headers_add_header (headers : * mut aws_http_headers , header : * const aws_http_header) -> :: libc :: c_int ; } extern "C" { # [doc = " Add a header.\n The underlying strings are copied."] pub fn aws_http_headers_add (headers : * mut aws_http_headers , name : aws_byte_cursor , value : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Add an array of headers.\n The underlying strings are copied."] pub fn aws_http_headers_add_array (headers : * mut aws_http_headers , array : * const aws_http_header , count : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Set a header value.\n The header is added if necessary and any existing values for this name are removed.\n The underlying strings are copied."] pub fn aws_http_headers_set (headers : * mut aws_http_headers , name : aws_byte_cursor , value : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the total number of headers."] pub fn aws_http_headers_count (headers : * const aws_http_headers) -> usize ; } extern "C" { # [doc = " Get the header at the specified index.\n The index of a given header may change any time headers are modified.\n When iterating headers, the following ordering rules apply:\n\n - Headers with the same name will always be in the same order, relative to one another.\n If \"A: one\" is added before \"A: two\", then \"A: one\" will always precede \"A: two\".\n\n - Headers with different names could be in any order, relative to one another.\n If \"A: one\" is seen before \"B: bee\" in one iteration, you might see \"B: bee\" before \"A: one\" on the next.\n\n AWS_ERROR_INVALID_INDEX is raised if the index is invalid."] pub fn aws_http_headers_get_index (headers : * const aws_http_headers , index : usize , out_header : * mut aws_http_header) -> :: libc :: c_int ; } extern "C" { # [doc = " Get all values with this name, combined into one new aws_string that you are responsible for destroying.\n If there are multiple headers with this name, their values are appended with comma-separators.\n If there are no headers with this name, NULL is returned and AWS_ERROR_HTTP_HEADER_NOT_FOUND is raised."] pub fn aws_http_headers_get_all (headers : * const aws_http_headers , name : aws_byte_cursor) -> * mut aws_string ; } extern "C" { # [doc = " Get the first value for this name, ignoring any additional values.\n AWS_ERROR_HTTP_HEADER_NOT_FOUND is raised if the name is not found."] pub fn aws_http_headers_get (headers : * const aws_http_headers , name : aws_byte_cursor , out_value : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Test if header name exists or not in headers"] pub fn aws_http_headers_has (headers : * const aws_http_headers , name : aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Remove all headers with this name.\n AWS_ERROR_HTTP_HEADER_NOT_FOUND is raised if no headers with this name are found."] pub fn aws_http_headers_erase (headers : * mut aws_http_headers , name : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Remove the first header found with this name and value.\n AWS_ERROR_HTTP_HEADER_NOT_FOUND is raised if no such header is found."] pub fn aws_http_headers_erase_value (headers : * mut aws_http_headers , name : aws_byte_cursor , value : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Remove the header at the specified index.\n\n AWS_ERROR_INVALID_INDEX is raised if the index is invalid."] pub fn aws_http_headers_erase_index (headers : * mut aws_http_headers , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Clear all headers."] pub fn aws_http_headers_clear (headers : * mut aws_http_headers) ; } extern "C" { # [doc = " Get the `:method` value (HTTP/2 headers only)."] pub fn aws_http2_headers_get_request_method (h2_headers : * const aws_http_headers , out_method : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set `:method` (HTTP/2 headers only).\n The headers makes its own copy of the underlying string."] pub fn aws_http2_headers_set_request_method (h2_headers : * mut aws_http_headers , method : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_http2_headers_get_request_scheme (h2_headers : * const aws_http_headers , out_scheme : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set `:scheme` (request pseudo headers only).\n The pseudo headers makes its own copy of the underlying string."] pub fn aws_http2_headers_set_request_scheme (h2_headers : * mut aws_http_headers , scheme : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_http2_headers_get_request_authority (h2_headers : * const aws_http_headers , out_authority : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set `:authority` (request pseudo headers only).\n The pseudo headers makes its own copy of the underlying string."] pub fn aws_http2_headers_set_request_authority (h2_headers : * mut aws_http_headers , authority : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_http2_headers_get_request_path (h2_headers : * const aws_http_headers , out_path : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set `:path` (request pseudo headers only).\n The pseudo headers makes its own copy of the underlying string."] pub fn aws_http2_headers_set_request_path (h2_headers : * mut aws_http_headers , path : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Get `:status` (response pseudo headers only).\n If no status is set, AWS_ERROR_HTTP_DATA_NOT_AVAILABLE is raised."] pub fn aws_http2_headers_get_response_status (h2_headers : * const aws_http_headers , out_status_code : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Set `:status` (response pseudo headers only)."] pub fn aws_http2_headers_set_response_status (h2_headers : * mut aws_http_headers , status_code : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Create a new HTTP/1.1 request message.\n The message is blank, all properties (method, path, etc) must be set individually.\n If HTTP/1.1 message used in HTTP/2 connection, the transformation will be automatically applied.\n A HTTP/2 message will created and sent based on the HTTP/1.1 message.\n\n The caller has a hold on the object and must call aws_http_message_release() when they are done with it."] pub fn aws_http_message_new_request (allocator : * mut aws_allocator) -> * mut aws_http_message ; } extern "C" { # [doc = " Like aws_http_message_new_request(), but uses existing aws_http_headers instead of creating a new one.\n Acquires a hold on the headers, and releases it when the request is destroyed."] pub fn aws_http_message_new_request_with_headers (allocator : * mut aws_allocator , existing_headers : * mut aws_http_headers) -> * mut aws_http_message ; } extern "C" { # [doc = " Create a new HTTP/1.1 response message.\n The message is blank, all properties (status, headers, etc) must be set individually.\n\n The caller has a hold on the object and must call aws_http_message_release() when they are done with it."] pub fn aws_http_message_new_response (allocator : * mut aws_allocator) -> * mut aws_http_message ; } extern "C" { # [doc = " Create a new HTTP/2 request message.\n pseudo headers need to be set from aws_http2_headers_set_request_* to the headers of the aws_http_message.\n Will be errored out if used in HTTP/1.1 connection.\n\n The caller has a hold on the object and must call aws_http_message_release() when they are done with it."] pub fn aws_http2_message_new_request (allocator : * mut aws_allocator) -> * mut aws_http_message ; } extern "C" { # [doc = " Create a new HTTP/2 response message.\n pseudo headers need to be set from aws_http2_headers_set_response_status to the headers of the aws_http_message.\n Will be errored out if used in HTTP/1.1 connection.\n\n The caller has a hold on the object and must call aws_http_message_release() when they are done with it."] pub fn aws_http2_message_new_response (allocator : * mut aws_allocator) -> * mut aws_http_message ; } extern "C" { # [doc = " Create an HTTP/2 message from HTTP/1.1 message.\n pseudo headers will be created from the context and added to the headers of new message.\n Normal headers will be copied to the headers of new message.\n Note:\n - if `host` exist, it will be removed and `:authority` will be added using the information.\n - `:scheme` always defaults to \"https\". To use a different scheme create the HTTP/2 message directly"] pub fn aws_http2_message_new_from_http1 (alloc : * mut aws_allocator , http1_msg : * const aws_http_message) -> * mut aws_http_message ; } extern "C" { # [doc = " Acquire a hold on the object, preventing it from being deleted until\n aws_http_message_release() is called by all those with a hold on it.\n\n This function returns the passed in message (possibly NULL) so that acquire-and-assign can be done with a single\n statement."] pub fn aws_http_message_acquire (message : * mut aws_http_message) -> * mut aws_http_message ; } extern "C" { # [doc = " Release a hold on the object.\n The object is deleted when all holds on it are released.\n\n This function always returns NULL so that release-and-assign-NULL can be done with a single statement."] pub fn aws_http_message_release (message : * mut aws_http_message) -> * mut aws_http_message ; } extern "C" { # [doc = " Deprecated. This is equivalent to aws_http_message_release()."] pub fn aws_http_message_destroy (message : * mut aws_http_message) ; } extern "C" { pub fn aws_http_message_is_request (message : * const aws_http_message) -> bool ; } extern "C" { pub fn aws_http_message_is_response (message : * const aws_http_message) -> bool ; } extern "C" { # [doc = " Get the protocol version of the http message."] pub fn aws_http_message_get_protocol_version (message : * const aws_http_message) -> aws_http_version ; } extern "C" { # [doc = " Get the method (request messages only)."] pub fn aws_http_message_get_request_method (request_message : * const aws_http_message , out_method : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set the method (request messages only).\n The request makes its own copy of the underlying string."] pub fn aws_http_message_set_request_method (request_message : * mut aws_http_message , method : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_http_message_get_request_path (request_message : * const aws_http_message , out_path : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set the path-and-query value (request messages only).\n The request makes its own copy of the underlying string."] pub fn aws_http_message_set_request_path (request_message : * mut aws_http_message , path : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the status code (response messages only).\n If no status is set, AWS_ERROR_HTTP_DATA_NOT_AVAILABLE is raised."] pub fn aws_http_message_get_response_status (response_message : * const aws_http_message , out_status_code : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Set the status code (response messages only)."] pub fn aws_http_message_set_response_status (response_message : * mut aws_http_message , status_code : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the body stream.\n Returns NULL if no body stream is set."] pub fn aws_http_message_get_body_stream (message : * const aws_http_message) -> * mut aws_input_stream ; } extern "C" { # [doc = " Set the body stream.\n NULL is an acceptable value for messages with no body.\n Note: The message does NOT take ownership of the body stream.\n The stream must not be destroyed until the message is complete."] pub fn aws_http_message_set_body_stream (message : * mut aws_http_message , body_stream : * mut aws_input_stream) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_future_http_message { _unused : [u8 ; 0] , } extern "C" { pub fn aws_future_http_message_new (alloc : * mut aws_allocator) -> * mut aws_future_http_message ; } extern "C" { pub fn aws_future_http_message_set_result_by_move (future : * mut aws_future_http_message , pointer_address : * mut * mut aws_http_message) ; } extern "C" { pub fn aws_future_http_message_get_result_by_move (future : * mut aws_future_http_message) -> * mut aws_http_message ; } extern "C" { pub fn aws_future_http_message_peek_result (future : * const aws_future_http_message) -> * mut aws_http_message ; } extern "C" { pub fn aws_future_http_message_acquire (future : * mut aws_future_http_message) -> * mut aws_future_http_message ; } extern "C" { pub fn aws_future_http_message_release (future : * mut aws_future_http_message) -> * mut aws_future_http_message ; } extern "C" { pub fn aws_future_http_message_set_error (future : * mut aws_future_http_message , error_code : :: libc :: c_int) ; } extern "C" { pub fn aws_future_http_message_is_done (future : * const aws_future_http_message) -> bool ; } extern "C" { pub fn aws_future_http_message_get_error (future : * const aws_future_http_message) -> :: libc :: c_int ; } extern "C" { pub fn aws_future_http_message_register_callback (future : * mut aws_future_http_message , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_http_message_register_callback_if_not_done (future : * mut aws_future_http_message , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) -> bool ; } extern "C" { pub fn aws_future_http_message_register_event_loop_callback (future : * mut aws_future_http_message , event_loop : * mut aws_event_loop , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_http_message_register_channel_callback (future : * mut aws_future_http_message , channel : * mut aws_channel , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_http_message_wait (future : * mut aws_future_http_message , timeout_ns : u64) -> bool ; } extern "C" { # [doc = " Submit a chunk of data to be sent on an HTTP/1.1 stream.\n The stream must have specified \"chunked\" in a \"transfer-encoding\" header.\n For client streams, activate() must be called before any chunks are submitted.\n For server streams, the response must be submitted before any chunks.\n A final chunk with size 0 must be submitted to successfully complete the HTTP-stream.\n\n Returns AWS_OP_SUCCESS if the chunk has been submitted. The chunk's completion\n callback will be invoked when the HTTP-stream is done with the chunk data,\n whether or not it was successfully sent (see `aws_http1_stream_write_chunk_complete_fn`).\n The chunk data must remain valid until the completion callback is invoked.\n\n Returns AWS_OP_ERR and raises an error if the chunk could not be submitted.\n In this case, the chunk's completion callback will never be invoked.\n Note that it is always possible for the HTTP-stream to terminate unexpectedly\n prior to this call being made, in which case the error raised is\n AWS_ERROR_HTTP_STREAM_HAS_COMPLETED."] pub fn aws_http1_stream_write_chunk (http1_stream : * mut aws_http_stream , options : * const aws_http1_chunk_options) -> :: libc :: c_int ; } extern "C" { # [doc = " The stream must have specified `http2_use_manual_data_writes` during request creation.\n For client streams, activate() must be called before any frames are submitted.\n For server streams, the response headers must be submitted before any frames.\n A write with options that has end_stream set to be true will end the stream and prevent any further write.\n\n @return AWS_OP_SUCCESS if the write was queued\n AWS_OP_ERROR indicating the attempt raised an error code.\n AWS_ERROR_INVALID_STATE will be raised for invalid usage.\n AWS_ERROR_HTTP_STREAM_HAS_COMPLETED will be raised if the stream ended for reasons behind the scenes.\n\n Typical usage will be something like:\n options.http2_use_manual_data_writes = true;\n stream = aws_http_connection_make_request(connection, &options);\n aws_http_stream_activate(stream);\n ...\n struct aws_http2_stream_write_data_options write;\n aws_http2_stream_write_data(stream, &write);\n ...\n struct aws_http2_stream_write_data_options last_write;\n last_write.end_stream = true;\n aws_http2_stream_write_data(stream, &write);\n ...\n aws_http_stream_release(stream);"] pub fn aws_http2_stream_write_data (http2_stream : * mut aws_http_stream , options : * const aws_http2_stream_write_data_options) -> :: libc :: c_int ; } extern "C" { # [doc = " Add a list of headers to be added as trailing headers sent after the last chunk is sent.\n a \"Trailer\" header field which indicates the fields present in the trailer.\n\n Certain headers are forbidden in the trailer (e.g., Transfer-Encoding, Content-Length, Host). See RFC-7541\n Section 4.1.2 for more details.\n\n For client streams, activate() must be called before any chunks are submitted.\n\n For server streams, the response must be submitted before the trailer can be added\n\n aws_http1_stream_add_chunked_trailer must be called before the final size 0 chunk, and at the moment can only\n be called once, though this could change if need be.\n\n Returns AWS_OP_SUCCESS if the chunk has been submitted."] pub fn aws_http1_stream_add_chunked_trailer (http1_stream : * mut aws_http_stream , trailing_headers : * const aws_http_headers) -> :: libc :: c_int ; } extern "C" { # [doc = " This datastructure has more functions for inspecting and modifying headers than\n are available on the aws_http_message datastructure."] pub fn aws_http_message_get_headers (message : * const aws_http_message) -> * mut aws_http_headers ; } extern "C" { # [doc = " Get the message's const aws_http_headers."] pub fn aws_http_message_get_const_headers (message : * const aws_http_message) -> * const aws_http_headers ; } extern "C" { # [doc = " Get the number of headers."] pub fn aws_http_message_get_header_count (message : * const aws_http_message) -> usize ; } extern "C" { # [doc = " Get the header at the specified index.\n This function cannot fail if a valid index is provided.\n Otherwise, AWS_ERROR_INVALID_INDEX will be raised.\n\n The underlying strings are stored within the message."] pub fn aws_http_message_get_header (message : * const aws_http_message , out_header : * mut aws_http_header , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Add a header to the end of the array.\n The message makes its own copy of the underlying strings."] pub fn aws_http_message_add_header (message : * mut aws_http_message , header : aws_http_header) -> :: libc :: c_int ; } extern "C" { # [doc = " Add an array of headers to the end of the header array.\n The message makes its own copy of the underlying strings.\n\n This is a helper function useful when it's easier to define headers as a stack array, rather than calling add_header\n repeatedly."] pub fn aws_http_message_add_header_array (message : * mut aws_http_message , headers : * const aws_http_header , num_headers : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Remove the header at the specified index.\n Headers after this index are all shifted back one position.\n\n This function cannot fail if a valid index is provided.\n Otherwise, AWS_ERROR_INVALID_INDEX will be raised."] pub fn aws_http_message_erase_header (message : * mut aws_http_message , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Create a stream, with a client connection sending a request.\n The request does not start sending automatically once the stream is created. You must call\n aws_http_stream_activate to begin execution of the request.\n\n The `options` are copied during this call.\n\n Tip for language bindings: Do not bind the `options` struct. Use something more natural for your language,\n such as Builder Pattern in Java, or Python's ability to take many optional arguments by name.\n\n Note: The header of the request will be sent as it is when the message to send protocol matches the protocol of the\n connection.\n - No `user-agent` will be added.\n - No security check will be enforced. eg: `referer` header privacy should be enforced by the user-agent who adds the\n header\n - When HTTP/1 message sent on HTTP/2 connection, `aws_http2_message_new_from_http1` will be applied under the hood.\n - When HTTP/2 message sent on HTTP/1 connection, no change will be made."] pub fn aws_http_connection_make_request (client_connection : * mut aws_http_connection , options : * const aws_http_make_request_options) -> * mut aws_http_stream ; } extern "C" { # [doc = " Create a stream, with a server connection receiving and responding to a request.\n This function can only be called from the `aws_http_on_incoming_request_fn` callback.\n aws_http_stream_send_response() should be used to send a response."] pub fn aws_http_stream_new_server_request_handler (options : * const aws_http_request_handler_options) -> * mut aws_http_stream ; } extern "C" { # [doc = " Acquire refcount on the stream to prevent it from being cleaned up until it is released."] pub fn aws_http_stream_acquire (stream : * mut aws_http_stream) -> * mut aws_http_stream ; } extern "C" { # [doc = " Users must release the stream when they are done with it, or its memory will never be cleaned up.\n This will not cancel the stream, its callbacks will still fire if the stream is still in progress.\n\n Tips for language bindings:\n - Invoke this from the wrapper class's finalizer/destructor.\n - Do not let the wrapper class be destroyed until on_complete() has fired."] pub fn aws_http_stream_release (stream : * mut aws_http_stream) ; } extern "C" { # [doc = " Only used for client initiated streams (immediately following a call to aws_http_connection_make_request).\n\n Activates the request's outgoing stream processing."] pub fn aws_http_stream_activate (stream : * mut aws_http_stream) -> :: libc :: c_int ; } extern "C" { pub fn aws_http_stream_get_connection (stream : * const aws_http_stream) -> * mut aws_http_connection ; } extern "C" { pub fn aws_http_stream_get_incoming_response_status (stream : * const aws_http_stream , out_status : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { pub fn aws_http_stream_get_incoming_request_method (stream : * const aws_http_stream , out_method : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_http_stream_get_incoming_request_uri (stream : * const aws_http_stream , out_uri : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Send response (only callable from \"request handler\" streams)\n The response object must stay alive at least until the stream's on_complete is called."] pub fn aws_http_stream_send_response (stream : * mut aws_http_stream , response : * mut aws_http_message) -> :: libc :: c_int ; } extern "C" { # [doc = " Increment the stream's flow-control window to keep data flowing.\n\n If the connection was created with `manual_window_management` set true,\n the flow-control window of each stream will shrink as body data is received\n (headers, padding, and other metadata do not affect the window).\n The connection's `initial_window_size` determines the starting size of each stream's window.\n If a stream's flow-control window reaches 0, no further data will be received.\n\n If `manual_window_management` is false, this call will have no effect.\n The connection maintains its flow-control windows such that\n no back-pressure is applied and data arrives as fast as possible."] pub fn aws_http_stream_update_window (stream : * mut aws_http_stream , increment_size : usize) ; } extern "C" { # [doc = " Gets the HTTP/2 id associated with a stream. Even h1 streams have an id (using the same allocation procedure\n as http/2) for easier tracking purposes. For client streams, this will only be non-zero after a successful call\n to aws_http_stream_activate()"] pub fn aws_http_stream_get_id (stream : * const aws_http_stream) -> u32 ; } extern "C" { # [doc = " Reset the HTTP/2 stream (HTTP/2 only).\n Note that if the stream closes before this async call is fully processed, the RST_STREAM frame will not be sent.\n\n @param http2_stream HTTP/2 stream.\n @param http2_error aws_http2_error_code. Reason to reset the stream."] pub fn aws_http2_stream_reset (http2_stream : * mut aws_http_stream , http2_error : u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the error code received in rst_stream.\n Only valid if the stream has completed, and an RST_STREAM frame has received.\n\n @param http2_stream HTTP/2 stream.\n @param out_http2_error Gets to set to HTTP/2 error code received in rst_stream."] pub fn aws_http2_stream_get_received_reset_error_code (http2_stream : * mut aws_http_stream , out_http2_error : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the HTTP/2 error code sent in the RST_STREAM frame (HTTP/2 only).\n Only valid if the stream has completed, and has sent an RST_STREAM frame.\n\n @param http2_stream HTTP/2 stream.\n @param out_http2_error Gets to set to HTTP/2 error code sent in rst_stream."] pub fn aws_http2_stream_get_sent_reset_error_code (http2_stream : * mut aws_http_stream , out_http2_error : * mut u32) -> :: libc :: c_int ; } pub type aws_simple_completion_callback = :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_ref_count { pub ref_count : aws_atomic_var , pub object : * mut :: libc :: c_void , pub on_zero_fn : aws_simple_completion_callback , } # [test] fn bindgen_test_layout_aws_ref_count () { const UNINIT : :: std :: mem :: MaybeUninit < aws_ref_count > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_ref_count > () , 24usize , concat ! ("Size of: " , stringify ! (aws_ref_count))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_ref_count > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_ref_count) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . object) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_ref_count) , "::" , stringify ! (object))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_zero_fn) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_ref_count) , "::" , stringify ! (on_zero_fn))) ; } impl Default for aws_ref_count { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_shutdown_callback_options { pub shutdown_callback_fn : aws_simple_completion_callback , pub shutdown_callback_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_shutdown_callback_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_shutdown_callback_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_shutdown_callback_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_shutdown_callback_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_shutdown_callback_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_shutdown_callback_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback_fn) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_shutdown_callback_options) , "::" , stringify ! (shutdown_callback_fn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback_user_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_shutdown_callback_options) , "::" , stringify ! (shutdown_callback_user_data))) ; } impl Default for aws_shutdown_callback_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Initializes a ref-counter structure. After initialization, the ref count will be 1.\n\n @param ref_count ref-counter to initialize\n @param object object being ref counted\n @param on_zero_fn function to invoke when the ref count reaches zero"] pub fn aws_ref_count_init (ref_count : * mut aws_ref_count , object : * mut :: libc :: c_void , on_zero_fn : aws_simple_completion_callback) ; } extern "C" { # [doc = " Increments a ref-counter's ref count\n\n @param ref_count ref-counter to increment the count for\n @return the object being ref-counted"] pub fn aws_ref_count_acquire (ref_count : * mut aws_ref_count) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Decrements a ref-counter's ref count. Invokes the on_zero callback if the ref count drops to zero\n @param ref_count ref-counter to decrement the count for\n @return the value of the decremented ref count"] pub fn aws_ref_count_release (ref_count : * mut aws_ref_count) -> usize ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_async_input_stream { pub vtable : * const aws_async_input_stream_vtable , pub alloc : * mut aws_allocator , pub ref_count : aws_ref_count , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_async_input_stream () { const UNINIT : :: std :: mem :: MaybeUninit < aws_async_input_stream > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_async_input_stream > () , 48usize , concat ! ("Size of: " , stringify ! (aws_async_input_stream))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_async_input_stream > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_async_input_stream))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream) , "::" , stringify ! (impl_))) ; } impl Default for aws_async_input_stream { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_async_input_stream_vtable { # [doc = " Destroy the stream, its refcount has reached 0."] pub destroy : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_async_input_stream) > , # [doc = " Read once into the buffer.\n Complete the read when at least 1 byte is read, the buffer is full, or EOF is reached.\n Do not resize the buffer (do not use \"aws_byte_buf_xyz_dynamic()\" functions)\n Do not assume that buffer len starts at 0.\n You may assume that read() won't be called again until the current one completes.\n You may assume that the buffer has some space available.\n Return a future, which will contain an error code if something went wrong,\n or a result bool indicating whether EOF has been reached."] pub read : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_async_input_stream , dest : * mut aws_byte_buf) -> * mut aws_future_bool > , } # [test] fn bindgen_test_layout_aws_async_input_stream_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_async_input_stream_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_async_input_stream_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_async_input_stream_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_async_input_stream_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_async_input_stream_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . read) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream_vtable) , "::" , stringify ! (read))) ; } extern "C" { # [doc = " Initialize aws_async_input_stream \"base class\""] pub fn aws_async_input_stream_init_base (stream : * mut aws_async_input_stream , alloc : * mut aws_allocator , vtable : * const aws_async_input_stream_vtable , impl_ : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Increment reference count.\n You may pass in NULL (has no effect).\n Returns whatever pointer was passed in."] pub fn aws_async_input_stream_acquire (stream : * mut aws_async_input_stream) -> * mut aws_async_input_stream ; } extern "C" { # [doc = " Decrement reference count.\n You may pass in NULL (has no effect).\n Always returns NULL."] pub fn aws_async_input_stream_release (stream : * mut aws_async_input_stream) -> * mut aws_async_input_stream ; } extern "C" { # [doc = " Read once from the async stream into the buffer.\n The read completes when at least 1 byte is read, the buffer is full, or EOF is reached.\n Depending on implementation, the read could complete at any time.\n It may complete synchronously. It may complete on another thread.\n Returns a future, which will contain an error code if something went wrong,\n or a result bool indicating whether EOF has been reached.\n\n WARNING: The buffer must have space available.\n WARNING: Do not read again until the previous read is complete."] pub fn aws_async_input_stream_read (stream : * mut aws_async_input_stream , dest : * mut aws_byte_buf) -> * mut aws_future_bool ; } extern "C" { # [doc = " Read repeatedly from the async stream until the buffer is full, or EOF is reached.\n Depending on implementation, this could complete at any time.\n It may complete synchronously. It may complete on another thread.\n Returns a future, which will contain an error code if something went wrong,\n or a result bool indicating whether EOF has been reached.\n\n WARNING: The buffer must have space available.\n WARNING: Do not read again until the previous read is complete."] pub fn aws_async_input_stream_read_to_fill (stream : * mut aws_async_input_stream , dest : * mut aws_byte_buf) -> * mut aws_future_bool ; } pub type aws_crt_statistics_category_t = u32 ; pub const AWS_CRT_STATISTICS_CATEGORY_STRIDE_BITS : _bindgen_ty_22 = _bindgen_ty_22 :: AWS_CRT_STATISTICS_CATEGORY_STRIDE_BITS ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_22 { AWS_CRT_STATISTICS_CATEGORY_STRIDE_BITS = 8 , } # [repr (u32)] # [non_exhaustive] # [doc = " The common-specific range of the aws_crt_statistics_category cross-library enum.\n\n This enum functions as an RTTI value that lets statistics handler's interpret (via cast) a\n specific statistics structure if the RTTI value is understood.\n\n Common doesn't have any statistics structures presently, so its range is essentially empty.\n"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_crt_common_statistics_category { AWSCRT_STAT_CAT_INVALID = 0 , } # [doc = " Pattern-struct that functions as a base \"class\" for all statistics structures. To conform\n to the pattern, a statistics structure must have its first member be the category. In that\n case it becomes \"safe\" to cast from aws_crt_statistics_base to the specific statistics structure\n based on the category value."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_crt_statistics_base { pub category : aws_crt_statistics_category_t , } # [test] fn bindgen_test_layout_aws_crt_statistics_base () { const UNINIT : :: std :: mem :: MaybeUninit < aws_crt_statistics_base > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_crt_statistics_base > () , 4usize , concat ! ("Size of: " , stringify ! (aws_crt_statistics_base))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_crt_statistics_base > () , 4usize , concat ! ("Alignment of " , stringify ! (aws_crt_statistics_base))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . category) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_base) , "::" , stringify ! (category))) ; } # [doc = " The start and end time, in milliseconds-since-epoch, that a set of statistics was gathered over."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_crt_statistics_sample_interval { pub begin_time_ms : u64 , pub end_time_ms : u64 , } # [test] fn bindgen_test_layout_aws_crt_statistics_sample_interval () { const UNINIT : :: std :: mem :: MaybeUninit < aws_crt_statistics_sample_interval > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_crt_statistics_sample_interval > () , 16usize , concat ! ("Size of: " , stringify ! (aws_crt_statistics_sample_interval))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_crt_statistics_sample_interval > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_crt_statistics_sample_interval))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . begin_time_ms) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_sample_interval) , "::" , stringify ! (begin_time_ms))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . end_time_ms) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_sample_interval) , "::" , stringify ! (end_time_ms))) ; } pub type aws_crt_statistics_handler_process_statistics_fn = :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_crt_statistics_handler , interval : * mut aws_crt_statistics_sample_interval , stats : * mut aws_array_list , context : * mut :: libc :: c_void) > ; pub type aws_crt_statistics_handler_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_crt_statistics_handler) > ; pub type aws_crt_statistics_handler_get_report_interval_ms_fn = :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut aws_crt_statistics_handler) -> u64 > ; # [doc = " Vtable for functions that all statistics handlers must implement"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_crt_statistics_handler_vtable { pub process_statistics : aws_crt_statistics_handler_process_statistics_fn , pub destroy : aws_crt_statistics_handler_destroy_fn , pub get_report_interval_ms : aws_crt_statistics_handler_get_report_interval_ms_fn , } # [test] fn bindgen_test_layout_aws_crt_statistics_handler_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_crt_statistics_handler_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_crt_statistics_handler_vtable > () , 24usize , concat ! ("Size of: " , stringify ! (aws_crt_statistics_handler_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_crt_statistics_handler_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_crt_statistics_handler_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_statistics) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler_vtable) , "::" , stringify ! (process_statistics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_report_interval_ms) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler_vtable) , "::" , stringify ! (get_report_interval_ms))) ; } # [doc = " Base structure for all statistics handler implementations.\n\n A statistics handler is an object that listens to a stream of polymorphic (via the category RTTI enum) statistics\n structures emitted from some arbitrary source. In the initial implementation, statistics handlers are primarily\n attached to channels, where they monitor IO throughput and state data (from channel handlers) to determine a\n connection's health.\n\n Statistics handlers are a generalization of the timeout and bandwidth filters that are often associated with\n SDK network connections. Configurable, default implementations are defined at the protocol level (http, etc...)\n where they can be attached at connection (channel) creation time."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_crt_statistics_handler { pub vtable : * mut aws_crt_statistics_handler_vtable , pub allocator : * mut aws_allocator , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_crt_statistics_handler () { const UNINIT : :: std :: mem :: MaybeUninit < aws_crt_statistics_handler > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_crt_statistics_handler > () , 24usize , concat ! ("Size of: " , stringify ! (aws_crt_statistics_handler))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_crt_statistics_handler > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_crt_statistics_handler))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler) , "::" , stringify ! (impl_))) ; } impl Default for aws_crt_statistics_handler { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Submits a list of statistics objects to a statistics handler for processing\n\n handler - the statistics handler that will process the statistics objects\n interval - time period over which the statistics were gathered\n stats - list of pointers to structures that can be case to aws_crt_statistics_base (i.e. have category as a first\n member)\n context - (optional) additional context specific to where the statistics handler has been attached"] pub fn aws_crt_statistics_handler_process_statistics (handler : * mut aws_crt_statistics_handler , interval : * mut aws_crt_statistics_sample_interval , stats : * mut aws_array_list , context : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Queries the frequency (via an interval in milliseconds) which a statistics handler would like to be informed\n of statistics."] pub fn aws_crt_statistics_handler_get_report_interval_ms (handler : * mut aws_crt_statistics_handler) -> u64 ; } extern "C" { # [doc = " completely destroys a statistics handler. The handler's cleanup function must clean up the impl portion completely\n (including its allocation, if done separately)."] pub fn aws_crt_statistics_handler_destroy (handler : * mut aws_crt_statistics_handler) ; } pub type aws_priority_queue_compare_fn = :: std :: option :: Option < unsafe extern "C" fn (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> :: libc :: c_int > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_priority_queue { # [doc = " predicate that determines the priority of the elements in the queue."] pub pred : aws_priority_queue_compare_fn , # [doc = " The underlying container storing the queue elements."] pub container : aws_array_list , # [doc = " An array of pointers to backpointer elements. This array is initialized when\n the first call to aws_priority_queue_push_bp is made, and is subsequently maintained\n through any heap node manipulations.\n\n Each element is a struct aws_priority_queue_node *, pointing to a backpointer field\n owned by the calling code, or a NULL. The backpointer field is continually updated\n with information needed to locate and remove a specific node later on."] pub backpointers : aws_array_list , } # [test] fn bindgen_test_layout_aws_priority_queue () { const UNINIT : :: std :: mem :: MaybeUninit < aws_priority_queue > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_priority_queue > () , 88usize , concat ! ("Size of: " , stringify ! (aws_priority_queue))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_priority_queue > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_priority_queue))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . pred) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_priority_queue) , "::" , stringify ! (pred))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . container) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_priority_queue) , "::" , stringify ! (container))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . backpointers) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_priority_queue) , "::" , stringify ! (backpointers))) ; } impl Default for aws_priority_queue { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_priority_queue_node { # [doc = " The current index of the node in question, or SIZE_MAX if the node has been removed."] pub current_index : usize , } # [test] fn bindgen_test_layout_aws_priority_queue_node () { const UNINIT : :: std :: mem :: MaybeUninit < aws_priority_queue_node > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_priority_queue_node > () , 8usize , concat ! ("Size of: " , stringify ! (aws_priority_queue_node))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_priority_queue_node > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_priority_queue_node))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . current_index) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_priority_queue_node) , "::" , stringify ! (current_index))) ; } extern "C" { # [doc = " Initializes a priority queue struct for use. This mode will grow memory automatically (exponential model)\n Default size is the inital size of the queue\n item_size is the size of each element in bytes. Mixing items types is not supported by this API.\n pred is the function that will be used to determine priority."] pub fn aws_priority_queue_init_dynamic (queue : * mut aws_priority_queue , alloc : * mut aws_allocator , default_size : usize , item_size : usize , pred : aws_priority_queue_compare_fn) -> :: libc :: c_int ; } extern "C" { # [doc = " Initializes a priority queue struct for use. This mode will not allocate any additional memory. When the heap fills\n new enqueue operations will fail with AWS_ERROR_PRIORITY_QUEUE_FULL.\n\n Heaps initialized using this call do not support the aws_priority_queue_push_ref call with a non-NULL backpointer\n parameter.\n\n heap is the raw memory allocated for this priority_queue\n item_count is the maximum number of elements the raw heap can contain\n item_size is the size of each element in bytes. Mixing items types is not supported by this API.\n pred is the function that will be used to determine priority."] pub fn aws_priority_queue_init_static (queue : * mut aws_priority_queue , heap : * mut :: libc :: c_void , item_count : usize , item_size : usize , pred : aws_priority_queue_compare_fn) ; } extern "C" { # [doc = " Checks that the backpointer at a specific index of the queue is\n NULL or points to a correctly allocated aws_priority_queue_node."] pub fn aws_priority_queue_backpointer_index_valid (queue : * const aws_priority_queue , index : usize) -> bool ; } extern "C" { # [doc = " Checks that the backpointers of the priority queue are either NULL\n or correctly allocated to point at aws_priority_queue_nodes. This\n check is O(n), as it accesses every backpointer in a loop, and thus\n shouldn't be used carelessly."] pub fn aws_priority_queue_backpointers_valid_deep (queue : * const aws_priority_queue) -> bool ; } extern "C" { # [doc = " Checks that the backpointers of the priority queue satisfy validity\n constraints."] pub fn aws_priority_queue_backpointers_valid (queue : * const aws_priority_queue) -> bool ; } extern "C" { # [doc = " Set of properties of a valid aws_priority_queue."] pub fn aws_priority_queue_is_valid (queue : * const aws_priority_queue) -> bool ; } extern "C" { # [doc = " Cleans up any internally allocated memory and resets the struct for reuse or deletion."] pub fn aws_priority_queue_clean_up (queue : * mut aws_priority_queue) ; } extern "C" { # [doc = " Copies item into the queue and places it in the proper priority order. Complexity: O(log(n))."] pub fn aws_priority_queue_push (queue : * mut aws_priority_queue , item : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies item into the queue and places it in the proper priority order. Complexity: O(log(n)).\n\n If the backpointer parameter is non-null, the heap will continually update the pointed-to field\n with information needed to remove the node later on. *backpointer must remain valid until the node\n is removed from the heap, and may be updated on any mutating operation on the priority queue.\n\n If the node is removed, the backpointer will be set to a sentinel value that indicates that the\n node has already been removed. It is safe (and a no-op) to call aws_priority_queue_remove with\n such a sentinel value."] pub fn aws_priority_queue_push_ref (queue : * mut aws_priority_queue , item : * mut :: libc :: c_void , backpointer : * mut aws_priority_queue_node) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the element of the highest priority, and removes it from the queue.. Complexity: O(log(n)).\n If queue is empty, AWS_ERROR_PRIORITY_QUEUE_EMPTY will be raised."] pub fn aws_priority_queue_pop (queue : * mut aws_priority_queue , item : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes a specific node from the priority queue. Complexity: O(log(n))\n After removing a node (using either _remove or _pop), the backpointer set at push_ref time is set\n to a sentinel value. If this sentinel value is passed to aws_priority_queue_remove,\n AWS_ERROR_PRIORITY_QUEUE_BAD_NODE will be raised. Note, however, that passing uninitialized\n aws_priority_queue_nodes, or ones from different priority queues, results in undefined behavior."] pub fn aws_priority_queue_remove (queue : * mut aws_priority_queue , item : * mut :: libc :: c_void , node : * const aws_priority_queue_node) -> :: libc :: c_int ; } extern "C" { # [doc = " Obtains a pointer to the element of the highest priority. Complexity: constant time.\n If queue is empty, AWS_ERROR_PRIORITY_QUEUE_EMPTY will be raised."] pub fn aws_priority_queue_top (queue : * const aws_priority_queue , item : * mut * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Current number of elements in the queue"] pub fn aws_priority_queue_size (queue : * const aws_priority_queue) -> usize ; } extern "C" { # [doc = " Current allocated capacity for the queue, in dynamic mode this grows over time, in static mode, this will never\n change."] pub fn aws_priority_queue_capacity (queue : * const aws_priority_queue) -> usize ; } impl aws_task_status { pub const AWS_TASK_STATUS_RUN_READY : aws_task_status = aws_task_status (0) ; } impl aws_task_status { pub const AWS_TASK_STATUS_CANCELED : aws_task_status = aws_task_status (1) ; } # [repr (transparent)] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub struct aws_task_status (pub :: libc :: c_uint) ; # [doc = " A scheduled function."] pub type aws_task_fn = :: std :: option :: Option < unsafe extern "C" fn (task : * mut aws_task , arg : * mut :: libc :: c_void , arg1 : aws_task_status) > ; # [repr (C)] # [derive (Copy , Clone)] pub struct aws_task { pub fn_ : aws_task_fn , pub arg : * mut :: libc :: c_void , pub timestamp : u64 , pub node : aws_linked_list_node , pub priority_queue_node : aws_priority_queue_node , pub type_tag : * const :: libc :: c_char , pub abi_extension : aws_task__bindgen_ty_1 , } # [repr (C)] # [derive (Copy , Clone)] pub union aws_task__bindgen_ty_1 { pub scheduled : bool , pub reserved : usize , } # [test] fn bindgen_test_layout_aws_task__bindgen_ty_1 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_task__bindgen_ty_1 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_task__bindgen_ty_1 > () , 8usize , concat ! ("Size of: " , stringify ! (aws_task__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_task__bindgen_ty_1 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_task__bindgen_ty_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . scheduled) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_task__bindgen_ty_1) , "::" , stringify ! (scheduled))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . reserved) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_task__bindgen_ty_1) , "::" , stringify ! (reserved))) ; } impl Default for aws_task__bindgen_ty_1 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [test] fn bindgen_test_layout_aws_task () { const UNINIT : :: std :: mem :: MaybeUninit < aws_task > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_task > () , 64usize , concat ! ("Size of: " , stringify ! (aws_task))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_task > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_task))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . fn_) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (fn_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . arg) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (arg))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . timestamp) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (timestamp))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . node) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (node))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . priority_queue_node) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (priority_queue_node))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . type_tag) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (type_tag))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . abi_extension) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (abi_extension))) ; } impl Default for aws_task { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_task_scheduler { pub alloc : * mut aws_allocator , pub timed_queue : aws_priority_queue , pub timed_list : aws_linked_list , pub asap_list : aws_linked_list , } # [test] fn bindgen_test_layout_aws_task_scheduler () { const UNINIT : :: std :: mem :: MaybeUninit < aws_task_scheduler > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_task_scheduler > () , 160usize , concat ! ("Size of: " , stringify ! (aws_task_scheduler))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_task_scheduler > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_task_scheduler))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_task_scheduler) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . timed_queue) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_task_scheduler) , "::" , stringify ! (timed_queue))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . timed_list) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_task_scheduler) , "::" , stringify ! (timed_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . asap_list) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_task_scheduler) , "::" , stringify ! (asap_list))) ; } impl Default for aws_task_scheduler { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Init an aws_task"] pub fn aws_task_init (task : * mut aws_task , fn_ : aws_task_fn , arg : * mut :: libc :: c_void , type_tag : * const :: libc :: c_char) ; } extern "C" { pub fn aws_task_run (task : * mut aws_task , status : aws_task_status) ; } extern "C" { # [doc = " Initializes a task scheduler instance."] pub fn aws_task_scheduler_init (scheduler : * mut aws_task_scheduler , alloc : * mut aws_allocator) -> :: libc :: c_int ; } extern "C" { # [doc = " Empties and executes all queued tasks, passing the AWS_TASK_STATUS_CANCELED status to the task function.\n Cleans up any memory allocated, and prepares the instance for reuse or deletion."] pub fn aws_task_scheduler_clean_up (scheduler : * mut aws_task_scheduler) ; } extern "C" { pub fn aws_task_scheduler_is_valid (scheduler : * const aws_task_scheduler) -> bool ; } extern "C" { # [doc = " Returns whether the scheduler has any scheduled tasks.\n next_task_time (optional) will be set to time of the next task, note that 0 will be set if tasks were\n added via aws_task_scheduler_schedule_now() and UINT64_MAX will be set if no tasks are scheduled at all."] pub fn aws_task_scheduler_has_tasks (scheduler : * const aws_task_scheduler , next_task_time : * mut u64) -> bool ; } extern "C" { # [doc = " Schedules a task to run immediately.\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_task_scheduler_schedule_now (scheduler : * mut aws_task_scheduler , task : * mut aws_task) ; } extern "C" { # [doc = " Schedules a task to run at time_to_run.\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_task_scheduler_schedule_future (scheduler : * mut aws_task_scheduler , task : * mut aws_task , time_to_run : u64) ; } extern "C" { # [doc = " Removes task from the scheduler and invokes the task with the AWS_TASK_STATUS_CANCELED status."] pub fn aws_task_scheduler_cancel_task (scheduler : * mut aws_task_scheduler , task : * mut aws_task) ; } extern "C" { # [doc = " Sequentially execute all tasks scheduled to run at, or before current_time.\n AWS_TASK_STATUS_RUN_READY will be passed to the task function as the task status.\n\n If a task schedules another task, the new task will not be executed until the next call to this function."] pub fn aws_task_scheduler_run_all (scheduler : * mut aws_task_scheduler , current_time : u64) ; } extern "C" { # [doc = " Convert a status value to a c-string suitable for logging"] pub fn aws_task_status_to_c_str (status : aws_task_status) -> * const :: libc :: c_char ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_channel_direction { AWS_CHANNEL_DIR_READ = 0 , AWS_CHANNEL_DIR_WRITE = 1 , } pub type aws_channel_on_setup_completed_fn = :: std :: option :: Option < unsafe extern "C" fn (channel : * mut aws_channel , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_channel_on_shutdown_completed_fn = :: std :: option :: Option < unsafe extern "C" fn (channel : * mut aws_channel , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_channel_slot { pub alloc : * mut aws_allocator , pub channel : * mut aws_channel , pub adj_left : * mut aws_channel_slot , pub adj_right : * mut aws_channel_slot , pub handler : * mut aws_channel_handler , pub window_size : usize , pub upstream_message_overhead : usize , pub current_window_update_batch_size : usize , } # [test] fn bindgen_test_layout_aws_channel_slot () { const UNINIT : :: std :: mem :: MaybeUninit < aws_channel_slot > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_channel_slot > () , 64usize , concat ! ("Size of: " , stringify ! (aws_channel_slot))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_channel_slot > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_channel_slot))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . channel) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (channel))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . adj_left) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (adj_left))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . adj_right) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (adj_right))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . handler) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (handler))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . window_size) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (window_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . upstream_message_overhead) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (upstream_message_overhead))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . current_window_update_batch_size) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (current_window_update_batch_size))) ; } impl Default for aws_channel_slot { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_channel_task_fn = :: std :: option :: Option < unsafe extern "C" fn (channel_task : * mut aws_channel_task , arg : * mut :: libc :: c_void , status : aws_task_status) > ; # [repr (C)] # [derive (Copy , Clone)] pub struct aws_channel_task { pub wrapper_task : aws_task , pub task_fn : aws_channel_task_fn , pub arg : * mut :: libc :: c_void , pub type_tag : * const :: libc :: c_char , pub node : aws_linked_list_node , } # [test] fn bindgen_test_layout_aws_channel_task () { const UNINIT : :: std :: mem :: MaybeUninit < aws_channel_task > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_channel_task > () , 104usize , concat ! ("Size of: " , stringify ! (aws_channel_task))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_channel_task > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_channel_task))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . wrapper_task) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_channel_task) , "::" , stringify ! (wrapper_task))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . task_fn) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_channel_task) , "::" , stringify ! (task_fn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . arg) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_channel_task) , "::" , stringify ! (arg))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . type_tag) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_channel_task) , "::" , stringify ! (type_tag))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . node) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_channel_task) , "::" , stringify ! (node))) ; } impl Default for aws_channel_task { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_channel_handler_vtable { # [doc = " Called by the channel when a message is available for processing in the read direction. It is your\n responsibility to call aws_mem_release(message->allocator, message); on message when you are finished with it.\n\n Also keep in mind that your slot's internal window has been decremented. You'll want to call\n aws_channel_slot_increment_read_window() at some point in the future if you want to keep receiving data."] pub process_read_message : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , message : * mut aws_io_message) -> :: libc :: c_int > , # [doc = " Called by the channel when a message is available for processing in the write direction. It is your\n responsibility to call aws_mem_release(message->allocator, message); on message when you are finished with it."] pub process_write_message : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , message : * mut aws_io_message) -> :: libc :: c_int > , # [doc = " Called by the channel when a downstream handler has issued a window increment. You'll want to update your\n internal state and likely propagate a window increment message of your own by calling\n 'aws_channel_slot_increment_read_window()'"] pub increment_read_window : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , size : usize) -> :: libc :: c_int > , # [doc = " The channel calls shutdown on all handlers twice, once to shut down reading, and once to shut down writing.\n Shutdown always begins with the left-most handler, and proceeds to the right with dir set to\n AWS_CHANNEL_DIR_READ. Then shutdown is called on handlers from right to left with dir set to\n AWS_CHANNEL_DIR_WRITE.\n\n The shutdown process does not need to complete immediately and may rely on scheduled tasks.\n The handler must call aws_channel_slot_on_handler_shutdown_complete() when it is finished,\n which propagates shutdown to the next handler. If 'free_scarce_resources_immediately' is true,\n then resources vulnerable to denial-of-service attacks (such as sockets and file handles)\n must be closed immediately before the shutdown() call returns."] pub shutdown : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , dir : aws_channel_direction , error_code : :: libc :: c_int , free_scarce_resources_immediately : bool) -> :: libc :: c_int > , # [doc = " Called by the channel when the handler is added to a slot, to get the initial window size."] pub initial_window_size : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler) -> usize > , # [doc = " Called by the channel anytime a handler is added or removed, provides a hint for downstream\n handlers to avoid message fragmentation due to message overhead."] pub message_overhead : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler) -> usize > , # [doc = " Clean up any resources and deallocate yourself. The shutdown process will already be completed before this\n function is called."] pub destroy : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler) > , # [doc = " Directs the channel handler to reset all of the internal statistics it tracks about itself."] pub reset_statistics : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler) > , # [doc = " Adds a pointer to the handler's internal statistics (if they exist) to a list of statistics structures\n associated with the channel's handler chain."] pub gather_statistics : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler , stats_list : * mut aws_array_list) > , pub trigger_read : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler) > , } # [test] fn bindgen_test_layout_aws_channel_handler_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_channel_handler_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_channel_handler_vtable > () , 80usize , concat ! ("Size of: " , stringify ! (aws_channel_handler_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_channel_handler_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_channel_handler_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_read_message) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (process_read_message))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_write_message) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (process_write_message))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . increment_read_window) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (increment_read_window))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (shutdown))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_window_size) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (initial_window_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . message_overhead) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (message_overhead))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . reset_statistics) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (reset_statistics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . gather_statistics) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (gather_statistics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . trigger_read) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (trigger_read))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_channel_handler { pub vtable : * mut aws_channel_handler_vtable , pub alloc : * mut aws_allocator , pub slot : * mut aws_channel_slot , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_channel_handler () { const UNINIT : :: std :: mem :: MaybeUninit < aws_channel_handler > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_channel_handler > () , 32usize , concat ! ("Size of: " , stringify ! (aws_channel_handler))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_channel_handler > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_channel_handler))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . slot) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler) , "::" , stringify ! (slot))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler) , "::" , stringify ! (impl_))) ; } impl Default for aws_channel_handler { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Args for creating a new channel.\n event_loop to use for IO and tasks. on_setup_completed will be invoked when\n the setup process is finished It will be executed in the event loop's thread.\n on_shutdown_completed will be executed upon channel shutdown.\n\n enable_read_back_pressure toggles whether or not back pressure will be applied in the channel.\n Leave this option off unless you're using something like reactive-streams, since it is a slight throughput\n penalty.\n\n Unless otherwise\n specified all functions for channels and channel slots must be executed within that channel's event-loop's thread."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_channel_options { pub event_loop : * mut aws_event_loop , pub on_setup_completed : aws_channel_on_setup_completed_fn , pub on_shutdown_completed : aws_channel_on_shutdown_completed_fn , pub setup_user_data : * mut :: libc :: c_void , pub shutdown_user_data : * mut :: libc :: c_void , pub enable_read_back_pressure : bool , } # [test] fn bindgen_test_layout_aws_channel_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_channel_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_channel_options > () , 48usize , concat ! ("Size of: " , stringify ! (aws_channel_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_channel_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_channel_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . event_loop) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (event_loop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_setup_completed) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (on_setup_completed))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_shutdown_completed) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (on_shutdown_completed))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . setup_user_data) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (setup_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_user_data) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (shutdown_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_back_pressure) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (enable_read_back_pressure))) ; } impl Default for aws_channel_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub static mut g_aws_channel_max_fragment_size : usize ; } extern "C" { # [doc = " Initializes channel_task for use."] pub fn aws_channel_task_init (channel_task : * mut aws_channel_task , task_fn : aws_channel_task_fn , arg : * mut :: libc :: c_void , type_tag : * const :: libc :: c_char) ; } extern "C" { # [doc = " Allocates new channel, Unless otherwise specified all functions for channels and channel slots must be executed\n within that channel's event-loop's thread. channel_options are copied."] pub fn aws_channel_new (allocator : * mut aws_allocator , creation_args : * const aws_channel_options) -> * mut aws_channel ; } extern "C" { # [doc = " Mark the channel, along with all slots and handlers, for destruction.\n Must be called after shutdown has completed.\n Can be called from any thread assuming 'aws_channel_shutdown()' has completed.\n Note that memory will not be freed until all users which acquired holds on the channel via\n aws_channel_acquire_hold(), release them via aws_channel_release_hold()."] pub fn aws_channel_destroy (channel : * mut aws_channel) ; } extern "C" { # [doc = " Initiates shutdown of the channel. Shutdown will begin with the left-most slot. Each handler will invoke\n 'aws_channel_slot_on_handler_shutdown_complete' once they've finished their shutdown process for the read direction.\n Once the right-most slot has shutdown in the read direction, the process will start shutting down starting on the\n right-most slot. Once the left-most slot has shutdown in the write direction, 'callbacks->shutdown_completed' will be\n invoked in the event loop's thread.\n\n This function can be called from any thread."] pub fn aws_channel_shutdown (channel : * mut aws_channel , error_code : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Prevent a channel's memory from being freed.\n Any number of users may acquire a hold to prevent a channel and its handlers from being unexpectedly freed.\n Any user which acquires a hold must release it via aws_channel_release_hold().\n Memory will be freed once all holds are released and aws_channel_destroy() has been called."] pub fn aws_channel_acquire_hold (channel : * mut aws_channel) ; } extern "C" { # [doc = " Release a hold on the channel's memory, allowing it to be freed.\n This may be called before or after aws_channel_destroy()."] pub fn aws_channel_release_hold (channel : * mut aws_channel) ; } extern "C" { # [doc = " Allocates and initializes a new slot for use with the channel. If this is the first slot in the channel, it will\n automatically be added to the channel as the first slot. For all subsequent calls on a given channel, the slot will\n need to be added to the channel via. the aws_channel_slot_insert_right(), aws_channel_slot_insert_end(), and\n aws_channel_slot_insert_left() APIs."] pub fn aws_channel_slot_new (channel : * mut aws_channel) -> * mut aws_channel_slot ; } extern "C" { # [doc = " Fetches the event loop the channel is a part of."] pub fn aws_channel_get_event_loop (channel : * mut aws_channel) -> * mut aws_event_loop ; } extern "C" { # [doc = " Fetches the current timestamp from the event-loop's clock, in nanoseconds."] pub fn aws_channel_current_clock_time (channel : * mut aws_channel , time_nanos : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Retrieves an object by key from the event loop's local storage."] pub fn aws_channel_fetch_local_object (channel : * mut aws_channel , key : * const :: libc :: c_void , obj : * mut aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Stores an object by key in the event loop's local storage."] pub fn aws_channel_put_local_object (channel : * mut aws_channel , key : * const :: libc :: c_void , obj : * const aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes an object by key from the event loop's local storage."] pub fn aws_channel_remove_local_object (channel : * mut aws_channel , key : * const :: libc :: c_void , removed_obj : * mut aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Acquires a message from the event loop's message pool. size_hint is merely a hint, it may be smaller than you\n requested and you are responsible for checking the bounds of it. If the returned message is not large enough, you\n must send multiple messages."] pub fn aws_channel_acquire_message_from_pool (channel : * mut aws_channel , message_type : aws_io_message_type , size_hint : usize) -> * mut aws_io_message ; } extern "C" { # [doc = " Schedules a task to run on the event loop as soon as possible.\n This is the ideal way to move a task into the correct thread. It's also handy for context switches.\n This function is safe to call from any thread.\n\n If called from the channel's event loop, the task will get directly added to the run-now list.\n If called from outside the channel's event loop, the task will go into a cross-thread task queue.\n\n If tasks must be serialized relative to some source synchronization, you may not want to use this API\n because tasks submitted from the event loop thread can \"jump ahead\" of tasks submitted from external threads\n due to this optimization. If this is a problem, you can either refactor your submission logic or use\n the aws_channel_schedule_task_now_serialized variant which does not perform this optimization.\n\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_channel_schedule_task_now (channel : * mut aws_channel , task : * mut aws_channel_task) ; } extern "C" { # [doc = " Schedules a task to run on the event loop as soon as possible.\n\n This variant always uses the cross thread queue rather than conditionally skipping it when already in\n the destination event loop. While not \"optimal\", this allows us to serialize task execution no matter where\n the task was submitted from: if you are submitting tasks from a critical section, the serialized order that you\n submit is guaranteed to be the order that they execute on the event loop.\n\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_channel_schedule_task_now_serialized (channel : * mut aws_channel , task : * mut aws_channel_task) ; } extern "C" { # [doc = " Schedules a task to run on the event loop at the specified time.\n This is the ideal way to move a task into the correct thread. It's also handy for context switches.\n Use aws_channel_current_clock_time() to get the current time in nanoseconds.\n This function is safe to call from any thread.\n\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_channel_schedule_task_future (channel : * mut aws_channel , task : * mut aws_channel_task , run_at_nanos : u64) ; } extern "C" { # [doc = " Instrument a channel with a statistics handler. While instrumented with a statistics handler, the channel\n will periodically report per-channel-handler-specific statistics about handler performance and state.\n\n Assigning a statistics handler to a channel is a transfer of ownership -- the channel will clean up\n the handler appropriately. Statistics handlers may be changed dynamically (for example, the upgrade\n from a vanilla http channel to a websocket channel), but this function may only be called from the\n event loop thread that the channel is a part of.\n\n The first possible hook to set a statistics handler is the channel's creation callback."] pub fn aws_channel_set_statistics_handler (channel : * mut aws_channel , handler : * mut aws_crt_statistics_handler) -> :: libc :: c_int ; } extern "C" { # [doc = " Returns true if the caller is on the event loop's thread. If false, you likely need to use\n aws_channel_schedule_task(). This function is safe to call from any thread."] pub fn aws_channel_thread_is_callers_thread (channel : * mut aws_channel) -> bool ; } extern "C" { # [doc = " Sets the handler for a slot, the slot will also call get_current_window_size() and propagate a window update\n upstream."] pub fn aws_channel_slot_set_handler (slot : * mut aws_channel_slot , handler : * mut aws_channel_handler) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes slot from the channel and deallocates the slot and its handler."] pub fn aws_channel_slot_remove (slot : * mut aws_channel_slot) -> :: libc :: c_int ; } extern "C" { # [doc = " Replaces remove with new_slot. Deallocates remove and its handler."] pub fn aws_channel_slot_replace (remove : * mut aws_channel_slot , new_slot : * mut aws_channel_slot) -> :: libc :: c_int ; } extern "C" { # [doc = " inserts 'to_add' to the position immediately to the right of slot. Note that the first call to\n aws_channel_slot_new() adds it to the channel implicitly."] pub fn aws_channel_slot_insert_right (slot : * mut aws_channel_slot , to_add : * mut aws_channel_slot) -> :: libc :: c_int ; } extern "C" { # [doc = " Inserts to 'to_add' the end of the channel. Note that the first call to\n aws_channel_slot_new() adds it to the channel implicitly."] pub fn aws_channel_slot_insert_end (channel : * mut aws_channel , to_add : * mut aws_channel_slot) -> :: libc :: c_int ; } extern "C" { # [doc = " inserts 'to_add' to the position immediately to the left of slot. Note that the first call to\n aws_channel_slot_new() adds it to the channel implicitly."] pub fn aws_channel_slot_insert_left (slot : * mut aws_channel_slot , to_add : * mut aws_channel_slot) -> :: libc :: c_int ; } extern "C" { # [doc = " Sends a message to the adjacent slot in the channel based on dir. Also does window size checking.\n\n NOTE: if this function returns an error code, it is the caller's responsibility to release message\n back to the pool. If this function returns AWS_OP_SUCCESS, the recipient of the message has taken\n ownership of the message. So, for example, don't release a message to the pool and then return an error.\n If you encounter an error condition in this case, shutdown the channel with the appropriate error code."] pub fn aws_channel_slot_send_message (slot : * mut aws_channel_slot , message : * mut aws_io_message , dir : aws_channel_direction) -> :: libc :: c_int ; } extern "C" { # [doc = " Convenience function that invokes aws_channel_acquire_message_from_pool(),\n asking for the largest reasonable DATA message that can be sent in the write direction,\n with upstream overhead accounted for."] pub fn aws_channel_slot_acquire_max_message_for_write (slot : * mut aws_channel_slot) -> * mut aws_io_message ; } extern "C" { # [doc = " Issues a window update notification upstream (to the left.)"] pub fn aws_channel_slot_increment_read_window (slot : * mut aws_channel_slot , window : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Called by handlers once they have finished their shutdown in the 'dir' direction. Propagates the shutdown process\n to the next handler in the channel."] pub fn aws_channel_slot_on_handler_shutdown_complete (slot : * mut aws_channel_slot , dir : aws_channel_direction , err_code : :: libc :: c_int , free_scarce_resources_immediately : bool) -> :: libc :: c_int ; } extern "C" { # [doc = " Initiates shutdown on slot. callbacks->on_shutdown_completed will be called\n once the shutdown process is completed."] pub fn aws_channel_slot_shutdown (slot : * mut aws_channel_slot , dir : aws_channel_direction , err_code : :: libc :: c_int , free_scarce_resources_immediately : bool) -> :: libc :: c_int ; } extern "C" { # [doc = " Fetches the downstream read window. This gives you the information necessary to honor the read window. If you call\n send_message() and it exceeds this window, the message will be rejected."] pub fn aws_channel_slot_downstream_read_window (slot : * mut aws_channel_slot) -> usize ; } extern "C" { # [doc = " Fetches the current overhead of upstream handlers. This provides a hint to avoid fragmentation if you care."] pub fn aws_channel_slot_upstream_message_overhead (slot : * mut aws_channel_slot) -> usize ; } extern "C" { # [doc = " Calls destroy on handler's vtable"] pub fn aws_channel_handler_destroy (handler : * mut aws_channel_handler) ; } extern "C" { # [doc = " Calls process_read_message on handler's vtable"] pub fn aws_channel_handler_process_read_message (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , message : * mut aws_io_message) -> :: libc :: c_int ; } extern "C" { # [doc = " Calls process_write_message on handler's vtable."] pub fn aws_channel_handler_process_write_message (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , message : * mut aws_io_message) -> :: libc :: c_int ; } extern "C" { # [doc = " Calls on_window_update on handler's vtable."] pub fn aws_channel_handler_increment_read_window (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , size : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " calls shutdown_direction on handler's vtable."] pub fn aws_channel_handler_shutdown (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , dir : aws_channel_direction , error_code : :: libc :: c_int , free_scarce_resources_immediately : bool) -> :: libc :: c_int ; } extern "C" { # [doc = " Calls initial_window_size on handler's vtable."] pub fn aws_channel_handler_initial_window_size (handler : * mut aws_channel_handler) -> usize ; } extern "C" { pub fn aws_channel_get_first_slot (channel : * mut aws_channel) -> * mut aws_channel_slot ; } extern "C" { # [doc = " A way for external processes to force a read by the data-source channel handler. Necessary in certain cases, like\n when a server channel finishes setting up its initial handlers, a read may have already been triggered on the\n socket (the client's CLIENT_HELLO tls payload, for example) and absent further data/notifications, this data\n would never get processed."] pub fn aws_channel_trigger_read (channel : * mut aws_channel) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_address_record_type { AWS_ADDRESS_RECORD_TYPE_A = 0 , AWS_ADDRESS_RECORD_TYPE_AAAA = 1 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_get_host_address_flags { AWS_GET_HOST_ADDRESS_COUNT_RECORD_TYPE_A = 1 , AWS_GET_HOST_ADDRESS_COUNT_RECORD_TYPE_AAAA = 2 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_address { pub allocator : * mut aws_allocator , pub host : * const aws_string , pub address : * const aws_string , pub record_type : aws_address_record_type , pub expiry : u64 , pub use_count : usize , pub connection_failure_count : usize , pub weight : u8 , } # [test] fn bindgen_test_layout_aws_host_address () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_address > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_address > () , 64usize , concat ! ("Size of: " , stringify ! (aws_host_address))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_address > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_address))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . address) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (address))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . record_type) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (record_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . expiry) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (expiry))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . use_count) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (use_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connection_failure_count) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (connection_failure_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . weight) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (weight))) ; } impl Default for aws_host_address { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Invoked once an address has been resolved for host. The type in host_addresses is struct aws_host_address (by-value).\n The caller does not own this memory and you must copy the host address before returning from this function if you\n plan to use it later. For convenience, we've provided the aws_host_address_copy() and aws_host_address_clean_up()\n functions."] pub type aws_on_host_resolved_result_fn = :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , host_name : * const aws_string , err_code : :: libc :: c_int , host_addresses : * const aws_array_list , user_data : * mut :: libc :: c_void) > ; # [doc = " Function signature for configuring your own resolver (the default just uses getaddrinfo()). The type in\n output_addresses is struct aws_host_address (by-value). We assume this function blocks, hence this absurdly\n complicated design."] pub type aws_resolve_host_implementation_fn = :: std :: option :: Option < unsafe extern "C" fn (allocator : * mut aws_allocator , host_name : * const aws_string , output_addresses : * mut aws_array_list , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_resolution_config { pub impl_ : aws_resolve_host_implementation_fn , pub max_ttl : usize , pub impl_data : * mut :: libc :: c_void , pub resolve_frequency_ns : u64 , } # [test] fn bindgen_test_layout_aws_host_resolution_config () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_resolution_config > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_resolution_config > () , 32usize , concat ! ("Size of: " , stringify ! (aws_host_resolution_config))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_resolution_config > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_resolution_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolution_config) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_ttl) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolution_config) , "::" , stringify ! (max_ttl))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_data) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolution_config) , "::" , stringify ! (impl_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . resolve_frequency_ns) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolution_config) , "::" , stringify ! (resolve_frequency_ns))) ; } impl Default for aws_host_resolution_config { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_listener { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_listener_options { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_resolver_purge_host_options { pub host : * const aws_string , pub on_host_purge_complete_callback : aws_simple_completion_callback , pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_host_resolver_purge_host_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_resolver_purge_host_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_resolver_purge_host_options > () , 24usize , concat ! ("Size of: " , stringify ! (aws_host_resolver_purge_host_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_resolver_purge_host_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_resolver_purge_host_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_purge_host_options) , "::" , stringify ! (host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_host_purge_complete_callback) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_purge_host_options) , "::" , stringify ! (on_host_purge_complete_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_purge_host_options) , "::" , stringify ! (user_data))) ; } impl Default for aws_host_resolver_purge_host_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " should you absolutely disdain the default implementation, feel free to implement your own."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_host_resolver_vtable { # [doc = " clean up everything you allocated, but not resolver itself."] pub destroy : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver) > , # [doc = " resolve the host by host_name, the user owns host_name, so it needs to be copied if you persist it,\n invoke res with the result. This function should never block."] pub resolve_host : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , host_name : * const aws_string , res : aws_on_host_resolved_result_fn , config : * const aws_host_resolution_config , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > , # [doc = " gives your implementation a hint that an address has some failed connections occuring. Do whatever you want (or\n nothing) about it."] pub record_connection_failure : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , address : * const aws_host_address) -> :: libc :: c_int > , # [doc = " @Deprecated Use purge_cache_with_callback instead\n wipe out anything you have cached."] pub purge_cache : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver) -> :: libc :: c_int > , # [doc = " wipe out anything you have cached."] pub purge_cache_with_callback : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , on_purge_cache_complete_callback : aws_simple_completion_callback , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > , # [doc = " wipe out anything cached for a specific host"] pub purge_host_cache : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , options : * const aws_host_resolver_purge_host_options) -> :: libc :: c_int > , # [doc = " get number of addresses for a given host."] pub get_host_address_count : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , host_name : * const aws_string , flags : u32) -> usize > , } # [test] fn bindgen_test_layout_aws_host_resolver_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_resolver_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_resolver_vtable > () , 56usize , concat ! ("Size of: " , stringify ! (aws_host_resolver_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_resolver_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_resolver_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . resolve_host) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (resolve_host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . record_connection_failure) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (record_connection_failure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . purge_cache) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (purge_cache))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . purge_cache_with_callback) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (purge_cache_with_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . purge_host_cache) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (purge_host_cache))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_host_address_count) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (get_host_address_count))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_resolver { pub allocator : * mut aws_allocator , pub impl_ : * mut :: libc :: c_void , pub vtable : * mut aws_host_resolver_vtable , pub ref_count : aws_ref_count , pub shutdown_options : aws_shutdown_callback_options , } # [test] fn bindgen_test_layout_aws_host_resolver () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_resolver > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_resolver > () , 64usize , concat ! ("Size of: " , stringify ! (aws_host_resolver))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_resolver > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_resolver))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver) , "::" , stringify ! (shutdown_options))) ; } impl Default for aws_host_resolver { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_resolver_default_options { pub max_entries : usize , pub el_group : * mut aws_event_loop_group , pub shutdown_options : * const aws_shutdown_callback_options , pub system_clock_override_fn : aws_io_clock_fn , } # [test] fn bindgen_test_layout_aws_host_resolver_default_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_resolver_default_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_resolver_default_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_host_resolver_default_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_resolver_default_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_resolver_default_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_entries) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_default_options) , "::" , stringify ! (max_entries))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . el_group) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_default_options) , "::" , stringify ! (el_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_default_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . system_clock_override_fn) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_default_options) , "::" , stringify ! (system_clock_override_fn))) ; } impl Default for aws_host_resolver_default_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Copies `from` to `to`."] pub fn aws_host_address_copy (from : * const aws_host_address , to : * mut aws_host_address) -> :: libc :: c_int ; } extern "C" { # [doc = " Moves `from` to `to`. After this call, from is no longer usable. Though, it could be resused for another\n move or copy operation."] pub fn aws_host_address_move (from : * mut aws_host_address , to : * mut aws_host_address) ; } extern "C" { # [doc = " Cleans up the memory for `address`"] pub fn aws_host_address_clean_up (address : * mut aws_host_address) ; } extern "C" { # [doc = " WARNING! do not call this function directly (getaddrinfo()): it blocks. Provide a pointer to this function for other\n resolution functions."] pub fn aws_default_dns_resolve (allocator : * mut aws_allocator , host_name : * const aws_string , output_addresses : * mut aws_array_list , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Creates a host resolver with the default behavior. Here's the behavior:\n\n Since there's not a reliable way to do non-blocking DNS without a ton of risky work that would need years of testing\n on every Unix system in existence, we work around it by doing a threaded implementation.\n\n When you request an address, it checks the cache. If the entry isn't in the cache it creates a new one.\n Each entry has a potentially short lived back-ground thread based on ttl for the records. Once we've populated the\n cache and you keep the resolver active, the resolution callback will be invoked immediately. When it's idle, it will\n take a little while in the background thread to fetch more, evaluate TTLs etc... In that case your callback will be\n invoked from the background thread.\n\n --------------------------------------------------------------------------------------------------------------------\n\n A few things to note about TTLs and connection failures.\n\n We attempt to honor your max ttl but will not honor it if dns queries are failing or all of your connections are\n marked as failed. Once we are able to query dns again, we will re-evaluate the TTLs.\n\n Upon notification connection failures, we move them to a separate list. Eventually we retry them when it's likely\n that the endpoint is healthy again or we don't really have another choice, but we try to keep them out of your\n hot path.\n\n ---------------------------------------------------------------------------------------------------------------------\n\n Finally, this entire design attempts to prevent problems where developers have to choose between large TTLs and thus\n sticky hosts or short TTLs and good fleet utilization but now higher latencies. In this design, we resolve every\n second in the background (only while you're actually using the record), but we do not expire the earlier resolved\n addresses until max ttl has passed.\n\n This for example, should enable you to hit thousands of hosts in the Amazon S3 fleet instead of just one or two."] pub fn aws_host_resolver_new_default (allocator : * mut aws_allocator , options : * const aws_host_resolver_default_options) -> * mut aws_host_resolver ; } extern "C" { # [doc = " Increments the reference count on the host resolver, allowing the caller to take a reference to it.\n\n Returns the same host resolver passed in."] pub fn aws_host_resolver_acquire (resolver : * mut aws_host_resolver) -> * mut aws_host_resolver ; } extern "C" { # [doc = " Decrements a host resolver's ref count. When the ref count drops to zero, the resolver will be destroyed."] pub fn aws_host_resolver_release (resolver : * mut aws_host_resolver) ; } extern "C" { # [doc = " calls resolve_host on the vtable. config will be copied."] pub fn aws_host_resolver_resolve_host (resolver : * mut aws_host_resolver , host_name : * const aws_string , res : aws_on_host_resolved_result_fn , config : * const aws_host_resolution_config , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " calls record_connection_failure on the vtable."] pub fn aws_host_resolver_record_connection_failure (resolver : * mut aws_host_resolver , address : * const aws_host_address) -> :: libc :: c_int ; } extern "C" { # [doc = " @Deprecated Use purge_cache_with_callback instead\n calls purge_cache on the vtable."] pub fn aws_host_resolver_purge_cache (resolver : * mut aws_host_resolver) -> :: libc :: c_int ; } extern "C" { # [doc = " Calls aws_host_resolver_purge_cache_with_callback on the vtable which will wipe out everything host resolver has\n cached."] pub fn aws_host_resolver_purge_cache_with_callback (resolver : * mut aws_host_resolver , on_purge_cache_complete_callback : aws_simple_completion_callback , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes the cache for a host asynchronously."] pub fn aws_host_resolver_purge_host_cache (resolver : * mut aws_host_resolver , options : * const aws_host_resolver_purge_host_options) -> :: libc :: c_int ; } extern "C" { # [doc = " get number of addresses for a given host."] pub fn aws_host_resolver_get_host_address_count (resolver : * mut aws_host_resolver , host_name : * const aws_string , flags : u32) -> usize ; } extern "C" { # [doc = " Returns the default host resolution config used internally if none specified.\n\n @return default host resolution config"] pub fn aws_host_resolver_init_default_resolution_config () -> aws_host_resolution_config ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_socket { _unused : [u8 ; 0] , } # [doc = " Generic event function for channel lifecycle events.\n\n Callbacks are provided for:\n (1) Channel creation\n (2) Channel setup - If TLS is being used, this function is called once the socket has connected, the channel has\n been initialized, and TLS has been successfully negotiated. A TLS handler has already been added to the channel. If\n TLS negotiation fails, this function will be called with the corresponding error code. If TLS is not being used, this\n function is called once the socket has connected and the channel has been initialized.\n (3) Channel shutdown\n\n These callbacks are always invoked within the thread of the event-loop that the channel is assigned to.\n\n This function does NOT always imply \"success\" -- if error_code is AWS_OP_SUCCESS then everything was successful,\n otherwise an error condition occurred."] pub type aws_client_bootstrap_on_channel_event_fn = :: std :: option :: Option < unsafe extern "C" fn (bootstrap : * mut aws_client_bootstrap , error_code : :: libc :: c_int , channel : * mut aws_channel , user_data : * mut :: libc :: c_void) > ; # [doc = " If ALPN is being used this function will be invoked by the channel once an ALPN message is received. The returned\n channel_handler will be added to, and managed by, the channel."] pub type aws_channel_on_protocol_negotiated_fn = :: std :: option :: Option < unsafe extern "C" fn (new_slot : * mut aws_channel_slot , protocol : * mut aws_byte_buf , user_data : * mut :: libc :: c_void) -> * mut aws_channel_handler > ; # [doc = " Called after client bootstrap has been completely cleaned up, after its last refcount is released."] pub type aws_client_bootstrap_shutdown_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [doc = " aws_client_bootstrap handles creation and setup of channels that communicate via socket with a specific endpoint."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_client_bootstrap { pub allocator : * mut aws_allocator , pub event_loop_group : * mut aws_event_loop_group , pub host_resolver : * mut aws_host_resolver , pub host_resolver_config : aws_host_resolution_config , pub on_protocol_negotiated : aws_channel_on_protocol_negotiated_fn , pub ref_count : aws_ref_count , pub on_shutdown_complete : aws_client_bootstrap_shutdown_complete_fn , pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_client_bootstrap () { const UNINIT : :: std :: mem :: MaybeUninit < aws_client_bootstrap > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_client_bootstrap > () , 104usize , concat ! ("Size of: " , stringify ! (aws_client_bootstrap))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_client_bootstrap > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_client_bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . event_loop_group) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (event_loop_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolver) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (host_resolver))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolver_config) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (host_resolver_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_protocol_negotiated) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (on_protocol_negotiated))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_shutdown_complete) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (on_shutdown_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (user_data))) ; } impl Default for aws_client_bootstrap { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " aws_client_bootstrap creation options."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_client_bootstrap_options { pub event_loop_group : * mut aws_event_loop_group , pub host_resolver : * mut aws_host_resolver , pub host_resolution_config : * const aws_host_resolution_config , pub on_shutdown_complete : aws_client_bootstrap_shutdown_complete_fn , pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_client_bootstrap_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_client_bootstrap_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_client_bootstrap_options > () , 40usize , concat ! ("Size of: " , stringify ! (aws_client_bootstrap_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_client_bootstrap_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_client_bootstrap_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . event_loop_group) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap_options) , "::" , stringify ! (event_loop_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolver) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap_options) , "::" , stringify ! (host_resolver))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolution_config) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap_options) , "::" , stringify ! (host_resolution_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_shutdown_complete) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap_options) , "::" , stringify ! (on_shutdown_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap_options) , "::" , stringify ! (user_data))) ; } impl Default for aws_client_bootstrap_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " If TLS is being used, this function is called once the socket has received an incoming connection, the channel has\n been initialized, and TLS has been successfully negotiated. A TLS handler has already been added to the channel. If\n TLS negotiation fails, this function will be called with the corresponding error code.\n\n If TLS is not being used, this function is called once the socket has received an incoming connection and the channel\n has been initialized.\n\n This function is always called within the thread of the event-loop that the new channel is assigned to upon success.\n\n On failure, the channel might not be assigned to an event loop yet, and will thus be invoked on the listener's\n event-loop thread.\n\n This function does NOT mean \"success\", if error_code is AWS_OP_SUCCESS then everything was successful, otherwise an\n error condition occurred.\n\n If an error occurred, you do not need to shutdown the channel. The `aws_channel_client_shutdown_callback` will be\n invoked once the channel has finished shutting down."] pub type aws_server_bootstrap_on_accept_channel_setup_fn = :: std :: option :: Option < unsafe extern "C" fn (bootstrap : * mut aws_server_bootstrap , error_code : :: libc :: c_int , channel : * mut aws_channel , user_data : * mut :: libc :: c_void) > ; # [doc = " Once the channel shuts down, this function will be invoked within the thread of\n the event-loop that the channel is assigned to.\n\n Note: this function is only invoked if the channel was successfully setup,\n e.g. aws_server_bootstrap_on_accept_channel_setup_fn() was invoked without an error code."] pub type aws_server_bootstrap_on_accept_channel_shutdown_fn = :: std :: option :: Option < unsafe extern "C" fn (bootstrap : * mut aws_server_bootstrap , error_code : :: libc :: c_int , channel : * mut aws_channel , user_data : * mut :: libc :: c_void) > ; # [doc = " Once the server listener socket is finished destroying, and all the existing connections are closed, this fuction\n will be invoked."] pub type aws_server_bootstrap_on_server_listener_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (bootstrap : * mut aws_server_bootstrap , user_data : * mut :: libc :: c_void) > ; # [doc = " aws_server_bootstrap manages listening sockets, creating and setting up channels to handle each incoming connection."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_server_bootstrap { pub allocator : * mut aws_allocator , pub event_loop_group : * mut aws_event_loop_group , pub on_protocol_negotiated : aws_channel_on_protocol_negotiated_fn , pub ref_count : aws_ref_count , } # [test] fn bindgen_test_layout_aws_server_bootstrap () { const UNINIT : :: std :: mem :: MaybeUninit < aws_server_bootstrap > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_server_bootstrap > () , 48usize , concat ! ("Size of: " , stringify ! (aws_server_bootstrap))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_server_bootstrap > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_server_bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_server_bootstrap) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . event_loop_group) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_server_bootstrap) , "::" , stringify ! (event_loop_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_protocol_negotiated) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_server_bootstrap) , "::" , stringify ! (on_protocol_negotiated))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_server_bootstrap) , "::" , stringify ! (ref_count))) ; } impl Default for aws_server_bootstrap { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Socket-based channel creation options.\n\n bootstrap - configs name resolution and which event loop group the connection will be seated into\n host_name - host to connect to; if a dns address, will be resolved prior to connecting\n port - port to connect to\n socket_options - socket properties, including type (tcp vs. udp vs. unix domain) and connect timeout. TLS\n connections are currently restricted to tcp (AWS_SOCKET_STREAM) only.\n tls_options - (optional) tls context to apply after connection establishment. If NULL, the connection will\n not be protected by TLS.\n creation_callback - (optional) callback invoked when the channel is first created. This is always right after\n the connection was successfully established. *Does NOT* get called if the initial connect failed.\n setup_callback - callback invoked once the channel is ready for use and TLS has been negotiated or if an error\n is encountered\n shutdown_callback - callback invoked once the channel has shutdown.\n enable_read_back_pressure - controls whether or not back pressure will be applied in the channel\n user_data - arbitrary data to pass back to the various callbacks\n requested_event_loop - if set, the connection will be placed on the requested event loop rather than one\n chosen internally from the bootstrap's associated event loop group. It is an error to pass in an event loop\n that is not associated with the bootstrap's event loop group.\n\n Immediately after the `shutdown_callback` returns, the channel is cleaned up automatically. All callbacks are invoked\n in the thread of the event-loop that the new channel is assigned to.\n"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_socket_channel_bootstrap_options { pub bootstrap : * mut aws_client_bootstrap , pub host_name : * const :: libc :: c_char , pub port : u16 , pub socket_options : * const aws_socket_options , pub tls_options : * const aws_tls_connection_options , pub creation_callback : aws_client_bootstrap_on_channel_event_fn , pub setup_callback : aws_client_bootstrap_on_channel_event_fn , pub shutdown_callback : aws_client_bootstrap_on_channel_event_fn , pub enable_read_back_pressure : bool , pub user_data : * mut :: libc :: c_void , pub requested_event_loop : * mut aws_event_loop , pub host_resolution_override_config : * const aws_host_resolution_config , } # [test] fn bindgen_test_layout_aws_socket_channel_bootstrap_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_socket_channel_bootstrap_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_socket_channel_bootstrap_options > () , 96usize , concat ! ("Size of: " , stringify ! (aws_socket_channel_bootstrap_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_socket_channel_bootstrap_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_socket_channel_bootstrap_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . socket_options) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (socket_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_options) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (tls_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . creation_callback) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (creation_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . setup_callback) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (setup_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_back_pressure) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (enable_read_back_pressure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . requested_event_loop) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (requested_event_loop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolution_override_config) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (host_resolution_override_config))) ; } impl Default for aws_socket_channel_bootstrap_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Arguments to setup a server socket listener which will also negotiate and configure TLS.\n This creates a socket listener bound to `host` and 'port' using socket options `options`, and TLS options\n `tls_options`. `incoming_callback` will be invoked once an incoming channel is ready for use and TLS is\n finished negotiating, or if an error is encountered. `shutdown_callback` will be invoked once the channel has\n shutdown. `destroy_callback` will be invoked after the server socket listener is destroyed, and all associated\n connections and channels have finished shutting down. Immediately after the `shutdown_callback` returns, the channel\n is cleaned up automatically. All callbacks are invoked in the thread of the event-loop that listener is assigned to.\n\n Upon shutdown of your application, you'll want to call `aws_server_bootstrap_destroy_socket_listener` with the return\n value from this function.\n\n The socket type in `options` must be AWS_SOCKET_STREAM if tls_options is set.\n DTLS is not currently supported for tls."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_server_socket_channel_bootstrap_options { pub bootstrap : * mut aws_server_bootstrap , pub host_name : * const :: libc :: c_char , pub port : u16 , pub socket_options : * const aws_socket_options , pub tls_options : * const aws_tls_connection_options , pub incoming_callback : aws_server_bootstrap_on_accept_channel_setup_fn , pub shutdown_callback : aws_server_bootstrap_on_accept_channel_shutdown_fn , pub destroy_callback : aws_server_bootstrap_on_server_listener_destroy_fn , pub enable_read_back_pressure : bool , pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_server_socket_channel_bootstrap_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_server_socket_channel_bootstrap_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_server_socket_channel_bootstrap_options > () , 80usize , concat ! ("Size of: " , stringify ! (aws_server_socket_channel_bootstrap_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_server_socket_channel_bootstrap_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_server_socket_channel_bootstrap_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . socket_options) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (socket_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_options) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (tls_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . incoming_callback) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (incoming_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy_callback) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (destroy_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_back_pressure) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (enable_read_back_pressure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (user_data))) ; } impl Default for aws_server_socket_channel_bootstrap_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Create the client bootstrap."] pub fn aws_client_bootstrap_new (allocator : * mut aws_allocator , options : * const aws_client_bootstrap_options) -> * mut aws_client_bootstrap ; } extern "C" { # [doc = " Increments a client bootstrap's ref count, allowing the caller to take a reference to it.\n\n Returns the same client bootstrap passed in."] pub fn aws_client_bootstrap_acquire (bootstrap : * mut aws_client_bootstrap) -> * mut aws_client_bootstrap ; } extern "C" { # [doc = " Decrements a client bootstrap's ref count. When the ref count drops to zero, the bootstrap will be destroyed."] pub fn aws_client_bootstrap_release (bootstrap : * mut aws_client_bootstrap) ; } extern "C" { # [doc = " When using TLS, if ALPN is used, this callback will be invoked from the channel. The returned handler will be added\n to the channel."] pub fn aws_client_bootstrap_set_alpn_callback (bootstrap : * mut aws_client_bootstrap , on_protocol_negotiated : aws_channel_on_protocol_negotiated_fn) -> :: libc :: c_int ; } extern "C" { # [doc = " Sets up a client socket channel."] pub fn aws_client_bootstrap_new_socket_channel (options : * mut aws_socket_channel_bootstrap_options) -> :: libc :: c_int ; } extern "C" { # [doc = " Initializes the server bootstrap with `allocator` and `el_group`. This object manages listeners, server connections,\n and channels."] pub fn aws_server_bootstrap_new (allocator : * mut aws_allocator , el_group : * mut aws_event_loop_group) -> * mut aws_server_bootstrap ; } extern "C" { # [doc = " Increments a server bootstrap's ref count, allowing the caller to take a reference to it.\n\n Returns the same server bootstrap passed in."] pub fn aws_server_bootstrap_acquire (bootstrap : * mut aws_server_bootstrap) -> * mut aws_server_bootstrap ; } extern "C" { # [doc = " Decrements a server bootstrap's ref count. When the ref count drops to zero, the bootstrap will be destroyed."] pub fn aws_server_bootstrap_release (bootstrap : * mut aws_server_bootstrap) ; } extern "C" { # [doc = " When using TLS, if ALPN is used, this callback will be invoked from the channel. The returned handler will be added\n to the channel."] pub fn aws_server_bootstrap_set_alpn_callback (bootstrap : * mut aws_server_bootstrap , on_protocol_negotiated : aws_channel_on_protocol_negotiated_fn) -> :: libc :: c_int ; } extern "C" { # [doc = " Sets up a server socket listener. If you are planning on using TLS, use\n `aws_server_bootstrap_new_tls_socket_listener` instead. This creates a socket listener bound to `local_endpoint`\n using socket options `options`. `incoming_callback` will be invoked once an incoming channel is ready for use or if\n an error is encountered. `shutdown_callback` will be invoked once the channel has shutdown. `destroy_callback` will\n be invoked after the server socket listener is destroyed, and all associated connections and channels have finished\n shutting down. Immediately after the `shutdown_callback` returns, the channel is cleaned up automatically. All\n callbacks are invoked the thread of the event-loop that the listening socket is assigned to\n\n Upon shutdown of your application, you'll want to call `aws_server_bootstrap_destroy_socket_listener` with the return\n value from this function.\n\n bootstrap_options is copied."] pub fn aws_server_bootstrap_new_socket_listener (bootstrap_options : * const aws_server_socket_channel_bootstrap_options) -> * mut aws_socket ; } extern "C" { # [doc = " Shuts down 'listener' and cleans up any resources associated with it. Any incoming channels on `listener` will still\n be active. `destroy_callback` will be invoked after the server socket listener is destroyed, and all associated\n connections and channels have finished shutting down."] pub fn aws_server_bootstrap_destroy_socket_listener (bootstrap : * mut aws_server_bootstrap , listener : * mut aws_socket) ; } pub const AWS_COMMON_HASH_TABLE_ITER_CONTINUE : _bindgen_ty_23 = _bindgen_ty_23 :: AWS_COMMON_HASH_TABLE_ITER_CONTINUE ; pub const AWS_COMMON_HASH_TABLE_ITER_DELETE : _bindgen_ty_23 = _bindgen_ty_23 :: AWS_COMMON_HASH_TABLE_ITER_DELETE ; pub const AWS_COMMON_HASH_TABLE_ITER_ERROR : _bindgen_ty_23 = _bindgen_ty_23 :: AWS_COMMON_HASH_TABLE_ITER_ERROR ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_23 { AWS_COMMON_HASH_TABLE_ITER_CONTINUE = 1 , AWS_COMMON_HASH_TABLE_ITER_DELETE = 2 , AWS_COMMON_HASH_TABLE_ITER_ERROR = 4 , } # [doc = " Hash table data structure. This module provides an automatically resizing\n hash table implementation for general purpose use. The hash table stores a\n mapping between void * keys and values; it is expected that in most cases,\n these will point to a structure elsewhere in the heap, instead of inlining a\n key or value into the hash table element itself.\n\n Currently, this hash table implements a variant of robin hood hashing, but\n we do not guarantee that this won't change in the future.\n\n Associated with each hash function are four callbacks:\n\n hash_fn - A hash function from the keys to a uint64_t. It is critical that\n the hash function for a key does not change while the key is in the hash\n table; violating this results in undefined behavior. Collisions are\n tolerated, though naturally with reduced performance.\n\n equals_fn - An equality comparison function. This function must be\n reflexive and consistent with hash_fn.\n\n destroy_key_fn, destroy_value_fn - Optional callbacks invoked when the\n table is cleared or cleaned up and at the caller's option when an element\n is removed from the table. Either or both may be set to NULL, which\n has the same effect as a no-op destroy function.\n\n This datastructure can be safely moved between threads, subject to the\n requirements of the underlying allocator. It is also safe to invoke\n non-mutating operations on the hash table from multiple threads. A suitable\n memory barrier must be used when transitioning from single-threaded mutating\n usage to multithreaded usage."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct hash_table_state { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_hash_table { pub p_impl : * mut hash_table_state , } # [test] fn bindgen_test_layout_aws_hash_table () { const UNINIT : :: std :: mem :: MaybeUninit < aws_hash_table > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_hash_table > () , 8usize , concat ! ("Size of: " , stringify ! (aws_hash_table))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_hash_table > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_hash_table))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . p_impl) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_hash_table) , "::" , stringify ! (p_impl))) ; } impl Default for aws_hash_table { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Represents an element in the hash table. Various operations on the hash\n table may provide pointers to elements stored within the hash table;\n generally, calling code may alter value, but must not alter key (or any\n information used to compute key's hash code).\n\n Pointers to elements within the hash are invalidated whenever an operation\n which may change the number of elements in the hash is invoked (i.e. put,\n delete, clear, and clean_up), regardless of whether the number of elements\n actually changes."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_hash_element { pub key : * const :: libc :: c_void , pub value : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_hash_element () { const UNINIT : :: std :: mem :: MaybeUninit < aws_hash_element > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_hash_element > () , 16usize , concat ! ("Size of: " , stringify ! (aws_hash_element))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_hash_element > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_hash_element))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . key) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_hash_element) , "::" , stringify ! (key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_hash_element) , "::" , stringify ! (value))) ; } impl Default for aws_hash_element { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_hash_iter_status { AWS_HASH_ITER_STATUS_DONE = 0 , AWS_HASH_ITER_STATUS_DELETE_CALLED = 1 , AWS_HASH_ITER_STATUS_READY_FOR_USE = 2 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_hash_iter { pub map : * const aws_hash_table , pub element : aws_hash_element , pub slot : usize , pub limit : usize , pub status : aws_hash_iter_status , pub unused_0 : :: libc :: c_int , pub unused_1 : * mut :: libc :: c_void , pub unused_2 : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_hash_iter () { const UNINIT : :: std :: mem :: MaybeUninit < aws_hash_iter > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_hash_iter > () , 64usize , concat ! ("Size of: " , stringify ! (aws_hash_iter))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_hash_iter > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_hash_iter))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . map) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (map))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . element) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (element))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . slot) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (slot))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . limit) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (limit))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . status) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (status))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . unused_0) as usize - ptr as usize } , 44usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (unused_0))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . unused_1) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (unused_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . unused_2) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (unused_2))) ; } impl Default for aws_hash_iter { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Prototype for a key hashing function pointer."] pub type aws_hash_fn = :: std :: option :: Option < unsafe extern "C" fn (key : * const :: libc :: c_void) -> u64 > ; # [doc = " Prototype for a hash table equality check function pointer.\n\n This type is usually used for a function that compares two hash table\n keys, but note that the same type is used for a function that compares\n two hash table values in aws_hash_table_eq.\n\n Equality functions used in a hash table must be reflexive (i.e., a == b if\n and only if b == a), and must be consistent with the hash function in use."] pub type aws_hash_callback_eq_fn = :: std :: option :: Option < unsafe extern "C" fn (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> bool > ; # [doc = " Prototype for a hash table key or value destructor function pointer.\n\n This function is used to destroy elements in the hash table when the\n table is cleared or cleaned up.\n\n Note that functions which remove individual elements from the hash\n table provide options of whether or not to invoke the destructors\n on the key and value of a removed element."] pub type aws_hash_callback_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (key_or_value : * mut :: libc :: c_void) > ; extern "C" { # [doc = " Initializes a hash map with initial capacity for 'size' elements\n without resizing. Uses hash_fn to compute the hash of each element.\n equals_fn to compute equality of two keys. Whenever an element is\n removed without being returned, destroy_key_fn is run on the pointer\n to the key and destroy_value_fn is run on the pointer to the value.\n Either or both may be NULL if a callback is not desired in this case."] pub fn aws_hash_table_init (map : * mut aws_hash_table , alloc : * mut aws_allocator , size : usize , hash_fn : aws_hash_fn , equals_fn : aws_hash_callback_eq_fn , destroy_key_fn : aws_hash_callback_destroy_fn , destroy_value_fn : aws_hash_callback_destroy_fn) -> :: libc :: c_int ; } extern "C" { # [doc = " Deletes every element from map and frees all associated memory.\n destroy_fn will be called for each element. aws_hash_table_init\n must be called before reusing the hash table.\n\n This method is idempotent."] pub fn aws_hash_table_clean_up (map : * mut aws_hash_table) ; } extern "C" { # [doc = " Safely swaps two hash tables. Note that we swap the entirety of the hash\n table, including which allocator is associated.\n\n Neither hash table is required to be initialized; if one or both is\n uninitialized, then the uninitialized state is also swapped."] pub fn aws_hash_table_swap (a : * mut aws_hash_table , b : * mut aws_hash_table) ; } extern "C" { # [doc = " Moves the hash table in 'from' to 'to'. After this move, 'from' will\n be identical to the state of the original 'to' hash table, and 'to'\n will be in the same state as if it had been passed to aws_hash_table_clean_up\n (that is, it will have no memory allocated, and it will be safe to\n either discard it or call aws_hash_table_clean_up again).\n\n Note that 'to' will not be cleaned up. You should make sure that 'to'\n is either uninitialized or cleaned up before moving a hashtable into\n it."] pub fn aws_hash_table_move (to : * mut aws_hash_table , from : * mut aws_hash_table) ; } extern "C" { # [doc = " Returns the current number of entries in the table."] pub fn aws_hash_table_get_entry_count (map : * const aws_hash_table) -> usize ; } extern "C" { # [doc = " Returns an iterator to be used for iterating through a hash table.\n Iterator will already point to the first element of the table it finds,\n which can be accessed as iter.element.\n\n This function cannot fail, but if there are no elements in the table,\n the returned iterator will return true for aws_hash_iter_done(&iter)."] pub fn aws_hash_iter_begin (map : * const aws_hash_table) -> aws_hash_iter ; } extern "C" { # [doc = " Returns true if iterator is done iterating through table, false otherwise.\n If this is true, the iterator will not include an element of the table."] pub fn aws_hash_iter_done (iter : * const aws_hash_iter) -> bool ; } extern "C" { # [doc = " Updates iterator so that it points to next element of hash table.\n\n This and the two previous functions are designed to be used together with\n the following idiom:\n\n for (struct aws_hash_iter iter = aws_hash_iter_begin(&map);\n !aws_hash_iter_done(&iter); aws_hash_iter_next(&iter)) {\n const key_type key = *(const key_type *)iter.element.key;\n value_type value = *(value_type *)iter.element.value;\n // etc.\n }\n\n Note that calling this on an iter which is \"done\" is idempotent:\n i.e. it will return another iter which is \"done\"."] pub fn aws_hash_iter_next (iter : * mut aws_hash_iter) ; } extern "C" { # [doc = " Deletes the element currently pointed-to by the hash iterator.\n After calling this method, the element member of the iterator\n should not be accessed until the next call to aws_hash_iter_next.\n\n @param destroy_contents If true, the destructors for the key and value\n will be called."] pub fn aws_hash_iter_delete (iter : * mut aws_hash_iter , destroy_contents : bool) ; } extern "C" { # [doc = " Attempts to locate an element at key. If the element is found, a\n pointer to the value is placed in *p_elem; if it is not found,\n *pElem is set to NULL. Either way, AWS_OP_SUCCESS is returned.\n\n This method does not change the state of the hash table. Therefore, it\n is safe to call _find from multiple threads on the same hash table,\n provided no mutating operations happen in parallel.\n\n Calling code may update the value in the hash table by modifying **pElem\n after a successful find. However, this pointer is not guaranteed to\n remain usable after a subsequent call to _put, _delete, _clear, or\n _clean_up."] pub fn aws_hash_table_find (map : * const aws_hash_table , key : * const :: libc :: c_void , p_elem : * mut * mut aws_hash_element) -> :: libc :: c_int ; } extern "C" { # [doc = " Attempts to locate an element at key. If no such element was found,\n creates a new element, with value initialized to NULL. In either case, a\n pointer to the element is placed in *p_elem.\n\n If was_created is non-NULL, *was_created is set to 0 if an existing\n element was found, or 1 is a new element was created.\n\n Returns AWS_OP_SUCCESS if an item was found or created.\n Raises AWS_ERROR_OOM if hash table expansion was required and memory\n allocation failed."] pub fn aws_hash_table_create (map : * mut aws_hash_table , key : * const :: libc :: c_void , p_elem : * mut * mut aws_hash_element , was_created : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Inserts a new element at key, with the given value. If another element\n exists at that key, the old element will be overwritten; both old key and\n value objects will be destroyed.\n\n If was_created is non-NULL, *was_created is set to 0 if an existing\n element was found, or 1 is a new element was created.\n\n Returns AWS_OP_SUCCESS if an item was found or created.\n Raises AWS_ERROR_OOM if hash table expansion was required and memory"] pub fn aws_hash_table_put (map : * mut aws_hash_table , key : * const :: libc :: c_void , value : * mut :: libc :: c_void , was_created : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes element at key. Always returns AWS_OP_SUCCESS.\n\n If pValue is non-NULL, the existing value (if any) is moved into\n (*value) before removing from the table, and destroy_fn is _not_\n invoked. If pValue is NULL, then (if the element existed) destroy_fn\n will be invoked on the element being removed.\n\n If was_present is non-NULL, it is set to 0 if the element was\n not present, or 1 if it was present (and is now removed)."] pub fn aws_hash_table_remove (map : * mut aws_hash_table , key : * const :: libc :: c_void , p_value : * mut aws_hash_element , was_present : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes element already known (typically by find()).\n\n p_value should point to a valid element returned by create() or find().\n\n NOTE: DO NOT call this method from inside of a aws_hash_table_foreach callback, return\n AWS_COMMON_HASH_TABLE_ITER_DELETE instead."] pub fn aws_hash_table_remove_element (map : * mut aws_hash_table , p_value : * mut aws_hash_element) -> :: libc :: c_int ; } extern "C" { # [doc = " Iterates through every element in the map and invokes the callback on\n that item. Iteration is performed in an arbitrary, implementation-defined\n order, and is not guaranteed to be consistent across invocations.\n\n The callback may change the value associated with the key by overwriting\n the value pointed-to by value. In this case, the on_element_removed\n callback will not be invoked, unless the callback invokes\n AWS_COMMON_HASH_TABLE_ITER_DELETE (in which case the on_element_removed\n is given the updated value).\n\n The callback must return a bitmask of zero or more of the following values\n ORed together:\n\n # AWS_COMMON_HASH_TABLE_ITER_CONTINUE - Continues iteration to the next\n element (if not set, iteration stops)\n # AWS_COMMON_HASH_TABLE_ITER_DELETE - Deletes the current value and\n continues iteration. destroy_fn will NOT be invoked.\n # AWS_COMMON_HASH_TABLE_ITER_ERROR - Stop iteration with error.\n No action will be taken for the current value and the value before this.\n No rolling back. The deleted value before will NOT be back.\n aws_hash_table_foreach returns AWS_OP_ERR after stropping the iteration.\n\n Invoking any method which may change the contents of the hashtable\n during iteration results in undefined behavior. However, you may safely\n invoke non-mutating operations during an iteration.\n\n This operation is mutating only if AWS_COMMON_HASH_TABLE_ITER_DELETE\n is returned at some point during iteration. Otherwise, it is non-mutating\n and is safe to invoke in parallel with other non-mutating operations."] pub fn aws_hash_table_foreach (map : * mut aws_hash_table , callback : :: std :: option :: Option < unsafe extern "C" fn (context : * mut :: libc :: c_void , p_element : * mut aws_hash_element) -> :: libc :: c_int > , context : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Compares two hash tables for equality. Both hash tables must have equivalent\n key comparators; values will be compared using the comparator passed into this\n function. The key hash function does not need to be equivalent between the\n two hash tables."] pub fn aws_hash_table_eq (a : * const aws_hash_table , b : * const aws_hash_table , value_eq : aws_hash_callback_eq_fn) -> bool ; } extern "C" { # [doc = " Removes every element from the hash map. destroy_fn will be called for\n each element."] pub fn aws_hash_table_clear (map : * mut aws_hash_table) ; } extern "C" { # [doc = " Convenience hash function for NULL-terminated C-strings"] pub fn aws_hash_c_string (item : * const :: libc :: c_void) -> u64 ; } extern "C" { # [doc = " Convenience hash function for struct aws_strings.\n Hash is same as used on the string bytes by aws_hash_c_string."] pub fn aws_hash_string (item : * const :: libc :: c_void) -> u64 ; } extern "C" { # [doc = " Convenience hash function for struct aws_byte_cursor.\n Hash is same as used on the string bytes by aws_hash_c_string."] pub fn aws_hash_byte_cursor_ptr (item : * const :: libc :: c_void) -> u64 ; } extern "C" { # [doc = " Convenience hash function which hashes the pointer value directly,\n without dereferencing. This can be used in cases where pointer identity\n is desired, or where a uintptr_t is encoded into a const void *."] pub fn aws_hash_ptr (item : * const :: libc :: c_void) -> u64 ; } extern "C" { pub fn aws_hash_combine (item1 : u64 , item2 : u64) -> u64 ; } extern "C" { # [doc = " Convenience eq callback for NULL-terminated C-strings"] pub fn aws_hash_callback_c_str_eq (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> bool ; } extern "C" { # [doc = " Convenience eq callback for AWS strings"] pub fn aws_hash_callback_string_eq (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> bool ; } extern "C" { # [doc = " Convenience destroy callback for AWS strings"] pub fn aws_hash_callback_string_destroy (a : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Equality function which compares pointer equality."] pub fn aws_ptr_eq (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> bool ; } extern "C" { # [doc = " Best-effort check of hash_table_state data-structure invariants"] pub fn aws_hash_table_is_valid (map : * const aws_hash_table) -> bool ; } extern "C" { # [doc = " Given a pointer to a hash_iter, checks that it is well-formed, with all data-structure invariants."] pub fn aws_hash_iter_is_valid (iter : * const aws_hash_iter) -> bool ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_io_event_type { AWS_IO_EVENT_TYPE_READABLE = 1 , AWS_IO_EVENT_TYPE_WRITABLE = 2 , AWS_IO_EVENT_TYPE_REMOTE_HANG_UP = 4 , AWS_IO_EVENT_TYPE_CLOSED = 8 , AWS_IO_EVENT_TYPE_ERROR = 16 , } pub type aws_event_loop_on_event_fn = :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle , events : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_event_loop_vtable { pub destroy : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop) > , pub run : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop) -> :: libc :: c_int > , pub stop : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop) -> :: libc :: c_int > , pub wait_for_stop_completion : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop) -> :: libc :: c_int > , pub schedule_task_now : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , task : * mut aws_task) > , pub schedule_task_future : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , task : * mut aws_task , run_at_nanos : u64) > , pub cancel_task : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , task : * mut aws_task) > , pub subscribe_to_io_events : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle , events : :: libc :: c_int , on_event : aws_event_loop_on_event_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > , pub unsubscribe_from_io_events : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle) -> :: libc :: c_int > , pub free_io_event_resources : :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > , pub is_on_callers_thread : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop) -> bool > , } # [test] fn bindgen_test_layout_aws_event_loop_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_event_loop_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_event_loop_vtable > () , 88usize , concat ! ("Size of: " , stringify ! (aws_event_loop_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_event_loop_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_event_loop_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . run) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (run))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . stop) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (stop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . wait_for_stop_completion) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (wait_for_stop_completion))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . schedule_task_now) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (schedule_task_now))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . schedule_task_future) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (schedule_task_future))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cancel_task) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (cancel_task))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subscribe_to_io_events) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (subscribe_to_io_events))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . unsubscribe_from_io_events) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (unsubscribe_from_io_events))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . free_io_event_resources) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (free_io_event_resources))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . is_on_callers_thread) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (is_on_callers_thread))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_event_loop { pub vtable : * mut aws_event_loop_vtable , pub alloc : * mut aws_allocator , pub clock : aws_io_clock_fn , pub local_data : aws_hash_table , pub current_load_factor : aws_atomic_var , pub latest_tick_start : u64 , pub current_tick_latency_sum : usize , pub next_flush_time : aws_atomic_var , pub impl_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_event_loop () { const UNINIT : :: std :: mem :: MaybeUninit < aws_event_loop > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_event_loop > () , 72usize , concat ! ("Size of: " , stringify ! (aws_event_loop))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_event_loop > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_event_loop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clock) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (clock))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . local_data) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (local_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . current_load_factor) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (current_load_factor))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . latest_tick_start) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (latest_tick_start))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . current_tick_latency_sum) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (current_tick_latency_sum))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . next_flush_time) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (next_flush_time))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_data) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (impl_data))) ; } impl Default for aws_event_loop { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_event_loop_on_local_object_removed_fn = :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut aws_event_loop_local_object) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_event_loop_local_object { pub key : * const :: libc :: c_void , pub object : * mut :: libc :: c_void , pub on_object_removed : aws_event_loop_on_local_object_removed_fn , } # [test] fn bindgen_test_layout_aws_event_loop_local_object () { const UNINIT : :: std :: mem :: MaybeUninit < aws_event_loop_local_object > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_event_loop_local_object > () , 24usize , concat ! ("Size of: " , stringify ! (aws_event_loop_local_object))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_event_loop_local_object > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_event_loop_local_object))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . key) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_local_object) , "::" , stringify ! (key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . object) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_local_object) , "::" , stringify ! (object))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_object_removed) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_local_object) , "::" , stringify ! (on_object_removed))) ; } impl Default for aws_event_loop_local_object { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_event_loop_options { pub clock : aws_io_clock_fn , pub thread_options : * mut aws_thread_options , } # [test] fn bindgen_test_layout_aws_event_loop_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_event_loop_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_event_loop_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_event_loop_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_event_loop_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_event_loop_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clock) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_options) , "::" , stringify ! (clock))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . thread_options) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_options) , "::" , stringify ! (thread_options))) ; } impl Default for aws_event_loop_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_new_event_loop_fn = :: std :: option :: Option < unsafe extern "C" fn (alloc : * mut aws_allocator , options : * const aws_event_loop_options , new_loop_user_data : * mut :: libc :: c_void) -> * mut aws_event_loop > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_event_loop_group { pub allocator : * mut aws_allocator , pub event_loops : aws_array_list , pub ref_count : aws_ref_count , pub shutdown_options : aws_shutdown_callback_options , } # [test] fn bindgen_test_layout_aws_event_loop_group () { const UNINIT : :: std :: mem :: MaybeUninit < aws_event_loop_group > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_event_loop_group > () , 88usize , concat ! ("Size of: " , stringify ! (aws_event_loop_group))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_event_loop_group > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_event_loop_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_group) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . event_loops) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_group) , "::" , stringify ! (event_loops))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_group) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_group) , "::" , stringify ! (shutdown_options))) ; } impl Default for aws_event_loop_group { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Creates an instance of the default event loop implementation for the current architecture and operating system."] pub fn aws_event_loop_new_default (alloc : * mut aws_allocator , clock : aws_io_clock_fn) -> * mut aws_event_loop ; } extern "C" { # [doc = " Creates an instance of the default event loop implementation for the current architecture and operating system using\n extendable options."] pub fn aws_event_loop_new_default_with_options (alloc : * mut aws_allocator , options : * const aws_event_loop_options) -> * mut aws_event_loop ; } extern "C" { # [doc = " Invokes the destroy() fn for the event loop implementation.\n If the event loop is still in a running state, this function will block waiting on the event loop to shutdown.\n If you do not want this function to block, call aws_event_loop_stop() manually first.\n If the event loop is shared by multiple threads then destroy must be called by exactly one thread. All other threads\n must ensure their API calls to the event loop happen-before the call to destroy."] pub fn aws_event_loop_destroy (event_loop : * mut aws_event_loop) ; } extern "C" { # [doc = " Initializes common event-loop data structures.\n This is only called from the *new() function of event loop implementations."] pub fn aws_event_loop_init_base (event_loop : * mut aws_event_loop , alloc : * mut aws_allocator , clock : aws_io_clock_fn) -> :: libc :: c_int ; } extern "C" { # [doc = " Common cleanup code for all implementations.\n This is only called from the *destroy() function of event loop implementations."] pub fn aws_event_loop_clean_up_base (event_loop : * mut aws_event_loop) ; } extern "C" { # [doc = " Fetches an object from the event-loop's data store. Key will be taken as the memory address of the memory pointed to\n by key. This function is not thread safe and should be called inside the event-loop's thread."] pub fn aws_event_loop_fetch_local_object (event_loop : * mut aws_event_loop , key : * mut :: libc :: c_void , obj : * mut aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Puts an item object the event-loop's data store. Key will be taken as the memory address of the memory pointed to by\n key. The lifetime of item must live until remove or a put item overrides it. This function is not thread safe and\n should be called inside the event-loop's thread."] pub fn aws_event_loop_put_local_object (event_loop : * mut aws_event_loop , obj : * mut aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes an object from the event-loop's data store. Key will be taken as the memory address of the memory pointed to\n by key. If removed_item is not null, the removed item will be moved to it if it exists. Otherwise, the default\n deallocation strategy will be used. This function is not thread safe and should be called inside the event-loop's\n thread."] pub fn aws_event_loop_remove_local_object (event_loop : * mut aws_event_loop , key : * mut :: libc :: c_void , removed_obj : * mut aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Triggers the running of the event loop. This function must not block. The event loop is not active until this\n function is invoked. This function can be called again on an event loop after calling aws_event_loop_stop() and\n aws_event_loop_wait_for_stop_completion()."] pub fn aws_event_loop_run (event_loop : * mut aws_event_loop) -> :: libc :: c_int ; } extern "C" { # [doc = " Triggers the event loop to stop, but does not wait for the loop to stop completely.\n This function may be called from outside or inside the event loop thread. It is safe to call multiple times.\n This function is called from destroy().\n\n If you do not call destroy(), an event loop can be run again by calling stop(), wait_for_stop_completion(), run()."] pub fn aws_event_loop_stop (event_loop : * mut aws_event_loop) -> :: libc :: c_int ; } extern "C" { # [doc = " For event-loop implementations to use for providing metrics info to the base event-loop. This enables the\n event-loop load balancer to take into account load when vending another event-loop to a caller.\n\n Call this function at the beginning of your event-loop tick: after wake-up, but before processing any IO or tasks."] pub fn aws_event_loop_register_tick_start (event_loop : * mut aws_event_loop) ; } extern "C" { # [doc = " For event-loop implementations to use for providing metrics info to the base event-loop. This enables the\n event-loop load balancer to take into account load when vending another event-loop to a caller.\n\n Call this function at the end of your event-loop tick: after processing IO and tasks."] pub fn aws_event_loop_register_tick_end (event_loop : * mut aws_event_loop) ; } extern "C" { # [doc = " Returns the current load factor (however that may be calculated). If the event-loop is not invoking\n aws_event_loop_register_tick_start() and aws_event_loop_register_tick_end(), this value will always be 0."] pub fn aws_event_loop_get_load_factor (event_loop : * mut aws_event_loop) -> usize ; } extern "C" { # [doc = " Blocks until the event loop stops completely.\n If you want to call aws_event_loop_run() again, you must call this after aws_event_loop_stop().\n It is not safe to call this function from inside the event loop thread."] pub fn aws_event_loop_wait_for_stop_completion (event_loop : * mut aws_event_loop) -> :: libc :: c_int ; } extern "C" { # [doc = " The event loop will schedule the task and run it on the event loop thread as soon as possible.\n Note that cancelled tasks may execute outside the event loop thread.\n This function may be called from outside or inside the event loop thread.\n\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_event_loop_schedule_task_now (event_loop : * mut aws_event_loop , task : * mut aws_task) ; } extern "C" { # [doc = " The event loop will schedule the task and run it at the specified time.\n Use aws_event_loop_current_clock_time() to query the current time in nanoseconds.\n Note that cancelled tasks may execute outside the event loop thread.\n This function may be called from outside or inside the event loop thread.\n\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_event_loop_schedule_task_future (event_loop : * mut aws_event_loop , task : * mut aws_task , run_at_nanos : u64) ; } extern "C" { # [doc = " Cancels task.\n This function must be called from the event loop's thread, and is only guaranteed\n to work properly on tasks scheduled from within the event loop's thread.\n The task will be executed with the AWS_TASK_STATUS_CANCELED status inside this call."] pub fn aws_event_loop_cancel_task (event_loop : * mut aws_event_loop , task : * mut aws_task) ; } extern "C" { # [doc = " Subscribes on_event to events on the event-loop for handle. events is a bitwise concatenation of the events that were\n received. The definition for these values can be found in aws_io_event_type. Currently, only\n AWS_IO_EVENT_TYPE_READABLE and AWS_IO_EVENT_TYPE_WRITABLE are honored. You always are registered for error conditions\n and closure. This function may be called from outside or inside the event loop thread. However, the unsubscribe\n function must be called inside the event-loop's thread."] pub fn aws_event_loop_subscribe_to_io_events (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle , events : :: libc :: c_int , on_event : aws_event_loop_on_event_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Unsubscribes handle from event-loop notifications.\n This function is not thread safe and should be called inside the event-loop's thread.\n\n NOTE: if you are using io completion ports, this is a risky call. We use it in places, but only when we're certain\n there's no pending events. If you want to use it, it's your job to make sure you don't have pending events before\n calling it."] pub fn aws_event_loop_unsubscribe_from_io_events (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle) -> :: libc :: c_int ; } extern "C" { # [doc = " Cleans up resources (user_data) associated with the I/O eventing subsystem for a given handle. This should only\n ever be necessary in the case where you are cleaning up an event loop during shutdown and its thread has already\n been joined."] pub fn aws_event_loop_free_io_event_resources (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle) ; } extern "C" { # [doc = " Returns true if the event loop's thread is the same thread that called this function, otherwise false."] pub fn aws_event_loop_thread_is_callers_thread (event_loop : * mut aws_event_loop) -> bool ; } extern "C" { # [doc = " Gets the current timestamp for the event loop's clock, in nanoseconds. This function is thread-safe."] pub fn aws_event_loop_current_clock_time (event_loop : * mut aws_event_loop , time_nanos : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Creates an event loop group, with clock, number of loops to manage, and the function to call for creating a new\n event loop."] pub fn aws_event_loop_group_new (alloc : * mut aws_allocator , clock : aws_io_clock_fn , el_count : u16 , new_loop_fn : aws_new_event_loop_fn , new_loop_user_data : * mut :: libc :: c_void , shutdown_options : * const aws_shutdown_callback_options) -> * mut aws_event_loop_group ; } extern "C" { # [doc = " Creates an event loop group, with clock, number of loops to manage, the function to call for creating a new\n event loop, and also pins all loops to hw threads on the same cpu_group (e.g. NUMA nodes). Note:\n If el_count exceeds the number of hw threads in the cpu_group it will be ignored on the assumption that if you\n care about NUMA, you don't want hyper-threads doing your IO and you especially don't want IO on a different node."] pub fn aws_event_loop_group_new_pinned_to_cpu_group (alloc : * mut aws_allocator , clock : aws_io_clock_fn , el_count : u16 , cpu_group : u16 , new_loop_fn : aws_new_event_loop_fn , new_loop_user_data : * mut :: libc :: c_void , shutdown_options : * const aws_shutdown_callback_options) -> * mut aws_event_loop_group ; } extern "C" { # [doc = " Initializes an event loop group with platform defaults. If max_threads == 0, then the\n loop count will be the number of available processors on the machine / 2 (to exclude hyper-threads).\n Otherwise, max_threads will be the number of event loops in the group."] pub fn aws_event_loop_group_new_default (alloc : * mut aws_allocator , max_threads : u16 , shutdown_options : * const aws_shutdown_callback_options) -> * mut aws_event_loop_group ; } extern "C" { # [doc = " Creates an event loop group, with clock, number of loops to manage, the function to call for creating a new\n event loop, and also pins all loops to hw threads on the same cpu_group (e.g. NUMA nodes). Note:\n If el_count exceeds the number of hw threads in the cpu_group it will be clamped to the number of hw threads\n on the assumption that if you care about NUMA, you don't want hyper-threads doing your IO and you especially\n don't want IO on a different node.\n\n If max_threads == 0, then the\n loop count will be the number of available processors in the cpu_group / 2 (to exclude hyper-threads)"] pub fn aws_event_loop_group_new_default_pinned_to_cpu_group (alloc : * mut aws_allocator , max_threads : u16 , cpu_group : u16 , shutdown_options : * const aws_shutdown_callback_options) -> * mut aws_event_loop_group ; } extern "C" { # [doc = " Increments the reference count on the event loop group, allowing the caller to take a reference to it.\n\n Returns the same event loop group passed in."] pub fn aws_event_loop_group_acquire (el_group : * mut aws_event_loop_group) -> * mut aws_event_loop_group ; } extern "C" { # [doc = " Decrements an event loop group's ref count. When the ref count drops to zero, the event loop group will be\n destroyed."] pub fn aws_event_loop_group_release (el_group : * mut aws_event_loop_group) ; } extern "C" { pub fn aws_event_loop_group_get_loop_at (el_group : * mut aws_event_loop_group , index : usize) -> * mut aws_event_loop ; } extern "C" { pub fn aws_event_loop_group_get_loop_count (el_group : * mut aws_event_loop_group) -> usize ; } extern "C" { # [doc = " Fetches the next loop for use. The purpose is to enable load balancing across loops. You should not depend on how\n this load balancing is done as it is subject to change in the future. Currently it uses the \"best-of-two\" algorithm\n based on the load factor of each loop."] pub fn aws_event_loop_group_get_next_loop (el_group : * mut aws_event_loop_group) -> * mut aws_event_loop ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_stream_seek_basis { AWS_SSB_BEGIN = 0 , AWS_SSB_END = 2 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_stream_status { pub is_end_of_stream : bool , pub is_valid : bool , } # [test] fn bindgen_test_layout_aws_stream_status () { const UNINIT : :: std :: mem :: MaybeUninit < aws_stream_status > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_stream_status > () , 2usize , concat ! ("Size of: " , stringify ! (aws_stream_status))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_stream_status > () , 1usize , concat ! ("Alignment of " , stringify ! (aws_stream_status))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . is_end_of_stream) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_stream_status) , "::" , stringify ! (is_end_of_stream))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . is_valid) as usize - ptr as usize } , 1usize , concat ! ("Offset of field: " , stringify ! (aws_stream_status) , "::" , stringify ! (is_valid))) ; } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_input_stream_vtable { pub seek : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream , offset : i64 , basis : aws_stream_seek_basis) -> :: libc :: c_int > , # [doc = " Stream as much data as will fit into the destination buffer and update its length.\n The destination buffer's capacity MUST NOT be changed.\n\n Return AWS_OP_SUCCESS if the read is successful.\n If AWS_OP_ERR is returned, the stream is assumed to be invalid and any data written to the buffer is ignored.\n\n If no more data is currently available, or the end of the stream has been reached, simply return AWS_OP_SUCCESS\n without touching the destination buffer."] pub read : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream , dest : * mut aws_byte_buf) -> :: libc :: c_int > , pub get_status : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream , status : * mut aws_stream_status) -> :: libc :: c_int > , pub get_length : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream , out_length : * mut i64) -> :: libc :: c_int > , # [doc = " Optional.\n If not set, the default aws_ref_count_acquire/release will be used.\n Set for high level language binding that has its own refcounting implementation and needs to be kept alive from\n C.\n If set, ref_count member will not be used."] pub acquire : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream) > , pub release : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream) > , } # [test] fn bindgen_test_layout_aws_input_stream_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_input_stream_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_input_stream_vtable > () , 48usize , concat ! ("Size of: " , stringify ! (aws_input_stream_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_input_stream_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_input_stream_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . seek) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (seek))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . read) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (read))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_status) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (get_status))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_length) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (get_length))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . acquire) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (acquire))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . release) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (release))) ; } # [doc = " Base class for input streams.\n Note: when you implement one input stream, the ref_count needs to be initialized to clean up the resource when\n reaches to zero."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_input_stream { pub impl_ : * mut :: libc :: c_void , pub vtable : * const aws_input_stream_vtable , pub ref_count : aws_ref_count , } # [test] fn bindgen_test_layout_aws_input_stream () { const UNINIT : :: std :: mem :: MaybeUninit < aws_input_stream > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_input_stream > () , 40usize , concat ! ("Size of: " , stringify ! (aws_input_stream))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_input_stream > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_input_stream))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream) , "::" , stringify ! (ref_count))) ; } impl Default for aws_input_stream { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Increments the reference count on the input stream, allowing the caller to take a reference to it.\n\n Returns the same input stream passed in."] pub fn aws_input_stream_acquire (stream : * mut aws_input_stream) -> * mut aws_input_stream ; } extern "C" { # [doc = " Decrements a input stream's ref count. When the ref count drops to zero, the input stream will be destroyed.\n\n Returns NULL always."] pub fn aws_input_stream_release (stream : * mut aws_input_stream) -> * mut aws_input_stream ; } extern "C" { pub fn aws_input_stream_seek (stream : * mut aws_input_stream , offset : i64 , basis : aws_stream_seek_basis) -> :: libc :: c_int ; } extern "C" { pub fn aws_input_stream_read (stream : * mut aws_input_stream , dest : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { pub fn aws_input_stream_get_status (stream : * mut aws_input_stream , status : * mut aws_stream_status) -> :: libc :: c_int ; } extern "C" { pub fn aws_input_stream_get_length (stream : * mut aws_input_stream , out_length : * mut i64) -> :: libc :: c_int ; } extern "C" { pub fn aws_input_stream_destroy (stream : * mut aws_input_stream) ; } extern "C" { pub fn aws_input_stream_new_from_cursor (allocator : * mut aws_allocator , cursor : * const aws_byte_cursor) -> * mut aws_input_stream ; } extern "C" { pub fn aws_input_stream_new_from_file (allocator : * mut aws_allocator , file_name : * const :: libc :: c_char) -> * mut aws_input_stream ; } extern "C" { pub fn aws_input_stream_new_from_open_file (allocator : * mut aws_allocator , file : * mut FILE) -> * mut aws_input_stream ; } # [doc = " Data representing a URI. uri_str is always allocated and filled in.\n The other portions are merely storing offsets into uri_str."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_uri { pub self_size : usize , pub allocator : * mut aws_allocator , pub uri_str : aws_byte_buf , pub scheme : aws_byte_cursor , pub authority : aws_byte_cursor , pub userinfo : aws_byte_cursor , pub user : aws_byte_cursor , pub password : aws_byte_cursor , pub host_name : aws_byte_cursor , pub port : u16 , pub path : aws_byte_cursor , pub query_string : aws_byte_cursor , pub path_and_query : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_uri () { const UNINIT : :: std :: mem :: MaybeUninit < aws_uri > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_uri > () , 200usize , concat ! ("Size of: " , stringify ! (aws_uri))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_uri > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_uri))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . self_size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (self_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . uri_str) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (uri_str))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . scheme) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (scheme))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . authority) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (authority))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . userinfo) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (userinfo))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (user))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . password) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (password))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . path) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (path))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . query_string) as usize - ptr as usize } , 168usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (query_string))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . path_and_query) as usize - ptr as usize } , 184usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (path_and_query))) ; } impl Default for aws_uri { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " key/value pairs for a query string. If the query fragment was not in format key=value, the fragment value\n will be stored in key"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_uri_param { pub key : aws_byte_cursor , pub value : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_uri_param () { const UNINIT : :: std :: mem :: MaybeUninit < aws_uri_param > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_uri_param > () , 32usize , concat ! ("Size of: " , stringify ! (aws_uri_param))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_uri_param > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_uri_param))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . key) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_uri_param) , "::" , stringify ! (key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_uri_param) , "::" , stringify ! (value))) ; } impl Default for aws_uri_param { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Arguments for building a URI instance. All members must\n be initialized before passing them to aws_uri_init().\n\n query_string and query_params are exclusive to each other. If you set\n query_string, do not prepend it with '?'"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_uri_builder_options { pub scheme : aws_byte_cursor , pub path : aws_byte_cursor , pub host_name : aws_byte_cursor , pub port : u16 , pub query_params : * mut aws_array_list , pub query_string : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_uri_builder_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_uri_builder_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_uri_builder_options > () , 80usize , concat ! ("Size of: " , stringify ! (aws_uri_builder_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_uri_builder_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_uri_builder_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . scheme) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (scheme))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . path) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (path))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . query_params) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (query_params))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . query_string) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (query_string))) ; } impl Default for aws_uri_builder_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Parses 'uri_str' and initializes uri. Returns AWS_OP_SUCCESS, on success, AWS_OP_ERR on failure.\n After calling this function, the parts can be accessed."] pub fn aws_uri_init_parse (uri : * mut aws_uri , allocator : * mut aws_allocator , uri_str : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Initializes uri to values specified in options. Returns AWS_OP_SUCCESS, on success, AWS_OP_ERR on failure.\n After calling this function, the parts can be accessed."] pub fn aws_uri_init_from_builder_options (uri : * mut aws_uri , allocator : * mut aws_allocator , options : * mut aws_uri_builder_options) -> :: libc :: c_int ; } extern "C" { pub fn aws_uri_clean_up (uri : * mut aws_uri) ; } extern "C" { # [doc = " Returns the scheme portion of the uri (e.g. http, https, ftp, ftps, etc...). If the scheme was not present\n in the uri, the returned value will be empty. It is the users job to determine the appropriate defaults\n if this field is empty, based on protocol, port, etc..."] pub fn aws_uri_scheme (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " Returns the authority portion of the uri (host[:port]). If it was not present, this was a request uri. In that\n case, the value will be empty."] pub fn aws_uri_authority (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " Returns the path portion of the uri, including any leading '/'. If not present, this value will be empty."] pub fn aws_uri_path (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " Returns the query string portion of the uri, minus the '?'. If not present, this value will be empty."] pub fn aws_uri_query_string (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " Returns the 'host_name' portion of the authority. If no authority was present, this value will be empty."] pub fn aws_uri_host_name (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " Returns the port portion of the authority if it was present, otherwise, returns 0.\n If this is 0, it is the users job to determine the correct port based on scheme and protocol."] pub fn aws_uri_port (uri : * const aws_uri) -> u16 ; } extern "C" { # [doc = " Returns the path and query portion of the uri (i.e., the thing you send across the wire)."] pub fn aws_uri_path_and_query (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " For iterating over the params in the uri query string.\n `param` is an in/out argument used to track progress, it MUST be zeroed out to start.\n If true is returned, `param` contains the value of the next param.\n If false is returned, there are no further params.\n\n Edge cases:\n 1) Entries without '=' sign are treated as having a key and no value.\n Example: First param in query string \"a&b=c\" has key=\"a\" value=\"\"\n\n 2) Blank entries are skipped.\n Example: The only param in query string \"&&a=b\" is key=\"a\" value=\"b\""] pub fn aws_uri_query_string_next_param (uri : * const aws_uri , param : * mut aws_uri_param) -> bool ; } extern "C" { # [doc = " Parses query string and stores the parameters in 'out_params'. Returns AWS_OP_SUCCESS on success and\n AWS_OP_ERR on failure. The user is responsible for initializing out_params with item size of struct aws_query_param.\n The user is also responsible for cleaning up out_params when finished."] pub fn aws_uri_query_string_params (uri : * const aws_uri , out_params : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Writes the uri path encoding of a cursor to a buffer. This is the modified version of rfc3986 used by\n sigv4 signing."] pub fn aws_byte_buf_append_encoding_uri_path (buffer : * mut aws_byte_buf , cursor : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Writes the uri query param encoding (passthrough alnum + '-' '_' '~' '.') of a UTF-8 cursor to a buffer\n For example, reading \"a b_c\" would write \"a%20b_c\"."] pub fn aws_byte_buf_append_encoding_uri_param (buffer : * mut aws_byte_buf , cursor : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Writes the uri decoding of a UTF-8 cursor to a buffer,\n replacing %xx escapes by their single byte equivalent.\n For example, reading \"a%20b_c\" would write \"a b_c\"."] pub fn aws_byte_buf_append_decoding_uri (buffer : * mut aws_byte_buf , cursor : * const aws_byte_cursor) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_errors { AWS_ERROR_S3_MISSING_CONTENT_RANGE_HEADER = 14336 , AWS_ERROR_S3_INVALID_CONTENT_RANGE_HEADER = 14337 , AWS_ERROR_S3_MISSING_CONTENT_LENGTH_HEADER = 14338 , AWS_ERROR_S3_INVALID_CONTENT_LENGTH_HEADER = 14339 , AWS_ERROR_S3_MISSING_ETAG = 14340 , AWS_ERROR_S3_INTERNAL_ERROR = 14341 , AWS_ERROR_S3_SLOW_DOWN = 14342 , AWS_ERROR_S3_INVALID_RESPONSE_STATUS = 14343 , AWS_ERROR_S3_MISSING_UPLOAD_ID = 14344 , AWS_ERROR_S3_PROXY_PARSE_FAILED = 14345 , AWS_ERROR_S3_UNSUPPORTED_PROXY_SCHEME = 14346 , AWS_ERROR_S3_CANCELED = 14347 , AWS_ERROR_S3_INVALID_RANGE_HEADER = 14348 , AWS_ERROR_S3_MULTIRANGE_HEADER_UNSUPPORTED = 14349 , AWS_ERROR_S3_RESPONSE_CHECKSUM_MISMATCH = 14350 , AWS_ERROR_S3_CHECKSUM_CALCULATION_FAILED = 14351 , AWS_ERROR_S3_PAUSED = 14352 , AWS_ERROR_S3_LIST_PARTS_PARSE_FAILED = 14353 , AWS_ERROR_S3_RESUMED_PART_CHECKSUM_MISMATCH = 14354 , AWS_ERROR_S3_RESUME_FAILED = 14355 , AWS_ERROR_S3_OBJECT_MODIFIED = 14356 , AWS_ERROR_S3_NON_RECOVERABLE_ASYNC_ERROR = 14357 , AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE = 14358 , AWS_ERROR_S3_INCORRECT_CONTENT_LENGTH = 14359 , AWS_ERROR_S3_END_RANGE = 15359 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_subject { AWS_LS_S3_GENERAL = 14336 , AWS_LS_S3_CLIENT = 14337 , AWS_LS_S3_CLIENT_STATS = 14338 , AWS_LS_S3_REQUEST = 14339 , AWS_LS_S3_META_REQUEST = 14340 , AWS_LS_S3_ENDPOINT = 14341 , AWS_LS_S3_LAST = 15359 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_cpu_group_info { pub cpu_group : u16 , pub nic_name_array : * const aws_byte_cursor , pub nic_name_array_length : usize , } # [test] fn bindgen_test_layout_aws_s3_cpu_group_info () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_cpu_group_info > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_cpu_group_info > () , 24usize , concat ! ("Size of: " , stringify ! (aws_s3_cpu_group_info))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_cpu_group_info > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_cpu_group_info))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cpu_group) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_cpu_group_info) , "::" , stringify ! (cpu_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . nic_name_array) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_cpu_group_info) , "::" , stringify ! (nic_name_array))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . nic_name_array_length) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_cpu_group_info) , "::" , stringify ! (nic_name_array_length))) ; } impl Default for aws_s3_cpu_group_info { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_compute_platform_info { pub instance_type : aws_byte_cursor , pub max_throughput_gbps : u16 , pub cpu_group_info_array : * const aws_s3_cpu_group_info , pub cpu_group_info_array_length : usize , } # [test] fn bindgen_test_layout_aws_s3_compute_platform_info () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_compute_platform_info > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_compute_platform_info > () , 40usize , concat ! ("Size of: " , stringify ! (aws_s3_compute_platform_info))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_compute_platform_info > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_compute_platform_info))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . instance_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_compute_platform_info) , "::" , stringify ! (instance_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_throughput_gbps) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_compute_platform_info) , "::" , stringify ! (max_throughput_gbps))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cpu_group_info_array) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_compute_platform_info) , "::" , stringify ! (cpu_group_info_array))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cpu_group_info_array_length) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_compute_platform_info) , "::" , stringify ! (cpu_group_info_array_length))) ; } impl Default for aws_s3_compute_platform_info { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Initializes internal datastructures used by aws-c-s3.\n Must be called before using any functionality in aws-c-s3."] pub fn aws_s3_library_init (allocator : * mut aws_allocator) ; } extern "C" { # [doc = " Retrieves the pre-configured metadata for an ec2 instance type. If no such pre-configuration exists, returns NULL."] pub fn aws_s3_get_compute_platform_info_for_instance_type (instance_type_name : aws_byte_cursor) -> * mut aws_s3_compute_platform_info ; } extern "C" { # [doc = " Shuts down the internal datastructures used by aws-c-s3."] pub fn aws_s3_library_clean_up () ; } pub type aws_should_sign_header_fn = :: std :: option :: Option < unsafe extern "C" fn (name : * const aws_byte_cursor , userdata : * mut :: libc :: c_void) -> bool > ; # [repr (u32)] # [non_exhaustive] # [doc = " A primitive RTTI indicator for signing configuration structs\n\n There must be one entry per config structure type and it's a fatal error\n to put the wrong value in the \"config_type\" member of your config structure."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_signing_config_type { AWS_SIGNING_CONFIG_AWS = 1 , } # [doc = " All signing configuration structs must match this by having\n the config_type member as the first member."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_signing_config_base { pub config_type : aws_signing_config_type , } # [test] fn bindgen_test_layout_aws_signing_config_base () { const UNINIT : :: std :: mem :: MaybeUninit < aws_signing_config_base > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_signing_config_base > () , 4usize , concat ! ("Size of: " , stringify ! (aws_signing_config_base))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_signing_config_base > () , 4usize , concat ! ("Alignment of " , stringify ! (aws_signing_config_base))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_base) , "::" , stringify ! (config_type))) ; } impl Default for aws_signing_config_base { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [doc = " What version of the AWS signing process should we use."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_signing_algorithm { AWS_SIGNING_ALGORITHM_V4 = 0 , AWS_SIGNING_ALGORITHM_V4_ASYMMETRIC = 1 , } # [repr (u32)] # [non_exhaustive] # [doc = " What sort of signature should be computed from the signable?"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_signature_type { # [doc = " A signature for a full http request should be computed, with header updates applied to the signing result."] AWS_ST_HTTP_REQUEST_HEADERS = 0 , # [doc = " A signature for a full http request should be computed, with query param updates applied to the signing result."] AWS_ST_HTTP_REQUEST_QUERY_PARAMS = 1 , # [doc = " Compute a signature for a payload chunk. The signable's input stream should be the chunk data and the\n signable should contain the most recent signature value (either the original http request or the most recent\n chunk) in the \"previous-signature\" property."] AWS_ST_HTTP_REQUEST_CHUNK = 2 , # [doc = " Compute a signature for an event stream event. The signable's input stream should be the encoded event-stream\n message (headers + payload), the signable should contain the most recent signature value (either the original\n http request or the most recent event) in the \"previous-signature\" property.\n\n This option is only supported for Sigv4 for now."] AWS_ST_HTTP_REQUEST_EVENT = 3 , # [doc = " Compute a signature for an http request via it's already-computed canonical request. Only the authorization\n signature header is added to the signing result."] AWS_ST_CANONICAL_REQUEST_HEADERS = 4 , # [doc = " Compute a signature for an http request via it's already-computed canonical request. Only the authorization\n signature query param is added to the signing result."] AWS_ST_CANONICAL_REQUEST_QUERY_PARAMS = 5 , # [doc = " Compute a signature for the trailing headers.\n the signable should contain the most recent signature value (either the original http request or the most recent\n chunk) in the \"previous-signature\" property."] AWS_ST_HTTP_REQUEST_TRAILING_HEADERS = 6 , } extern "C" { # [doc = " The SHA-256 of an empty string:\n 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_empty_sha256 : aws_byte_cursor ; } extern "C" { # [doc = " 'UNSIGNED-PAYLOAD'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_unsigned_payload : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-UNSIGNED-PAYLOAD-TRAILER'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_streaming_unsigned_payload_trailer : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-AWS4-HMAC-SHA256-PAYLOAD'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_streaming_aws4_hmac_sha256_payload : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-AWS4-HMAC-SHA256-PAYLOAD-TRAILER'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_streaming_aws4_hmac_sha256_payload_trailer : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-AWS4-ECDSA-P256-SHA256-PAYLOAD'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_streaming_aws4_ecdsa_p256_sha256_payload : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-AWS4-ECDSA-P256-SHA256-PAYLOAD-TRAILER'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_streaming_aws4_ecdsa_p256_sha256_payload_trailer : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-AWS4-HMAC-SHA256-EVENTS'\n For use with `aws_signing_config_aws.signed_body_value`.\n\n Event signing is only supported for Sigv4 for now."] pub static g_aws_signed_body_value_streaming_aws4_hmac_sha256_events : aws_byte_cursor ; } # [repr (u32)] # [non_exhaustive] # [doc = " Controls if signing adds a header containing the canonical request's body value"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_signed_body_header_type { # [doc = " Do not add a header"] AWS_SBHT_NONE = 0 , # [doc = " Add the \"x-amz-content-sha256\" header with the canonical request's body value"] AWS_SBHT_X_AMZ_CONTENT_SHA256 = 1 , } # [doc = " A configuration structure for use in AWS-related signing. Currently covers sigv4 only, but is not required to."] # [repr (C)] pub struct aws_signing_config_aws { # [doc = " What kind of config structure is this?"] pub config_type : aws_signing_config_type , # [doc = " What signing algorithm to use."] pub algorithm : aws_signing_algorithm , # [doc = " What sort of signature should be computed?"] pub signature_type : aws_signature_type , pub region : aws_byte_cursor , # [doc = " name of service to sign a request for"] pub service : aws_byte_cursor , # [doc = " Raw date to use during the signing process."] pub date : aws_date_time , # [doc = " Optional function to control which headers are a part of the canonical request.\n Skipping auth-required headers will result in an unusable signature. Headers injected by the signing process\n are not skippable.\n\n This function does not override the internal check function (x-amzn-trace-id, user-agent), but rather\n supplements it. In particular, a header will get signed if and only if it returns true to both\n the internal check (skips x-amzn-trace-id, user-agent) and this function (if defined)."] pub should_sign_header : aws_should_sign_header_fn , pub should_sign_header_ud : * mut :: libc :: c_void , pub flags : aws_signing_config_aws__bindgen_ty_1 , # [doc = " Optional string to use as the canonical request's body value.\n If string is empty, a value will be calculated from the payload during signing.\n Typically, this is the SHA-256 of the (request/chunk/event) payload, written as lowercase hex.\n If this has been precalculated, it can be set here. Special values used by certain services can also be set\n (e.g. \"UNSIGNED-PAYLOAD\" \"STREAMING-AWS4-HMAC-SHA256-PAYLOAD\" \"STREAMING-AWS4-HMAC-SHA256-EVENTS\")."] pub signed_body_value : aws_byte_cursor , # [doc = " Controls what body \"hash\" header, if any, should be added to the canonical request and the signed request:\n AWS_SBHT_NONE - no header should be added\n AWS_SBHT_X_AMZ_CONTENT_SHA256 - the body \"hash\" should be added in the X-Amz-Content-Sha256 header"] pub signed_body_header : aws_signed_body_header_type , pub credentials : * const aws_credentials , pub credentials_provider : * mut aws_credentials_provider , # [doc = " If non-zero and the signing transform is query param, then signing will add X-Amz-Expires to the query\n string, equal to the value specified here. If this value is zero or if header signing is being used then\n this parameter has no effect."] pub expiration_in_seconds : u64 , } # [repr (C)] # [repr (align (4))] # [derive (Debug , Default , Copy , Clone)] pub struct aws_signing_config_aws__bindgen_ty_1 { pub _bitfield_align_1 : [u8 ; 0] , pub _bitfield_1 : __BindgenBitfieldUnit < [u8 ; 1usize] > , pub __bindgen_padding_0 : [u8 ; 3usize] , } # [test] fn bindgen_test_layout_aws_signing_config_aws__bindgen_ty_1 () { assert_eq ! (:: std :: mem :: size_of :: < aws_signing_config_aws__bindgen_ty_1 > () , 4usize , concat ! ("Size of: " , stringify ! (aws_signing_config_aws__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_signing_config_aws__bindgen_ty_1 > () , 4usize , concat ! ("Alignment of " , stringify ! (aws_signing_config_aws__bindgen_ty_1))) ; } impl aws_signing_config_aws__bindgen_ty_1 { # [inline] pub fn use_double_uri_encode (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (0usize , 1u8) as u32) } } # [inline] pub fn set_use_double_uri_encode (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (0usize , 1u8 , val as u64) } } # [inline] pub fn should_normalize_uri_path (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (1usize , 1u8) as u32) } } # [inline] pub fn set_should_normalize_uri_path (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (1usize , 1u8 , val as u64) } } # [inline] pub fn omit_session_token (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (2usize , 1u8) as u32) } } # [inline] pub fn set_omit_session_token (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (2usize , 1u8 , val as u64) } } # [inline] pub fn new_bitfield_1 (use_double_uri_encode : u32 , should_normalize_uri_path : u32 , omit_session_token : u32) -> __BindgenBitfieldUnit < [u8 ; 1usize] > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [u8 ; 1usize] > = Default :: default () ; __bindgen_bitfield_unit . set (0usize , 1u8 , { let use_double_uri_encode : u32 = unsafe { :: std :: mem :: transmute (use_double_uri_encode) } ; use_double_uri_encode as u64 }) ; __bindgen_bitfield_unit . set (1usize , 1u8 , { let should_normalize_uri_path : u32 = unsafe { :: std :: mem :: transmute (should_normalize_uri_path) } ; should_normalize_uri_path as u64 }) ; __bindgen_bitfield_unit . set (2usize , 1u8 , { let omit_session_token : u32 = unsafe { :: std :: mem :: transmute (omit_session_token) } ; omit_session_token as u64 }) ; __bindgen_bitfield_unit } } # [test] fn bindgen_test_layout_aws_signing_config_aws () { const UNINIT : :: std :: mem :: MaybeUninit < aws_signing_config_aws > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_signing_config_aws > () , 256usize , concat ! ("Size of: " , stringify ! (aws_signing_config_aws))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_signing_config_aws > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_signing_config_aws))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (config_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . algorithm) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (algorithm))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . signature_type) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (signature_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . region) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (region))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . service) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (service))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . date) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (date))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . should_sign_header) as usize - ptr as usize } , 184usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (should_sign_header))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . should_sign_header_ud) as usize - ptr as usize } , 192usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (should_sign_header_ud))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . flags) as usize - ptr as usize } , 200usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (flags))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . signed_body_value) as usize - ptr as usize } , 208usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (signed_body_value))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . signed_body_header) as usize - ptr as usize } , 224usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (signed_body_header))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . credentials) as usize - ptr as usize } , 232usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (credentials))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . credentials_provider) as usize - ptr as usize } , 240usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (credentials_provider))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . expiration_in_seconds) as usize - ptr as usize } , 248usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (expiration_in_seconds))) ; } impl Default for aws_signing_config_aws { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Returns a c-string that describes the supplied signing algorithm\n\n @param algorithm signing algorithm to get a friendly string name for\n\n @return friendly string name of the supplied algorithm, or \"Unknown\" if the algorithm is not recognized"] pub fn aws_signing_algorithm_to_string (algorithm : aws_signing_algorithm) -> * const :: libc :: c_char ; } extern "C" { # [doc = " Checks a signing configuration for invalid settings combinations.\n\n @param config signing configuration to validate\n\n @return - AWS_OP_SUCCESS if the configuration is valid, AWS_OP_ERR otherwise"] pub fn aws_validate_aws_signing_config_aws (config : * const aws_signing_config_aws) -> :: libc :: c_int ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_request { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_meta_request { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_request_metrics { _unused : [u8 ; 0] , } # [repr (u32)] # [non_exhaustive] # [doc = " A Meta Request represents a group of generated requests that are being done on behalf of the\n original request. For example, one large GetObject request can be transformed into a series\n of ranged GetObject requests that are executed in parallel to improve throughput.\n\n The aws_s3_meta_request_type is a hint of transformation to be applied."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_meta_request_type { # [doc = " The Default meta request type sends any request to S3 as-is (with no transformation). For example,\n it can be used to pass a CreateBucket request."] AWS_S3_META_REQUEST_TYPE_DEFAULT = 0 , # [doc = " The GetObject request will be split into a series of ranged GetObject requests that are\n executed in parallel to improve throughput, when possible."] AWS_S3_META_REQUEST_TYPE_GET_OBJECT = 1 , # [doc = " The PutObject request will be split into MultiPart uploads that are executed in parallel\n to improve throughput, when possible.\n Note: put object supports both known and unknown body length. The client\n relies on Content-Length header to determine length of the body.\n Request with unknown content length are always sent using multipart\n upload regardless of final number of parts and do have the following limitations:\n - multipart threshold is ignored and all request are made through mpu,\n even if they only need one part\n - pause/resume is not supported\n - meta request will throw error if checksum header is provider (due to\n general limitation of checksum not being usable if meta request is\n getting split)"] AWS_S3_META_REQUEST_TYPE_PUT_OBJECT = 2 , # [doc = " The CopyObject meta request performs a multi-part copy\n using multiple S3 UploadPartCopy requests in parallel, or bypasses\n a CopyObject request to S3 if the object size is not large enough for\n a multipart upload.\n Note: copy support is still in development and has following limitations:\n - host header must use virtual host addressing style (path style is not\n supported) and both source and dest buckets must have dns compliant name\n - only {bucket}/{key} format is supported for source and passing arn as\n source will not work\n - source bucket is assumed to be in the same region as dest"] AWS_S3_META_REQUEST_TYPE_COPY_OBJECT = 3 , # [doc = " The CopyObject meta request performs a multi-part copy\n using multiple S3 UploadPartCopy requests in parallel, or bypasses\n a CopyObject request to S3 if the object size is not large enough for\n a multipart upload.\n Note: copy support is still in development and has following limitations:\n - host header must use virtual host addressing style (path style is not\n supported) and both source and dest buckets must have dns compliant name\n - only {bucket}/{key} format is supported for source and passing arn as\n source will not work\n - source bucket is assumed to be in the same region as dest"] AWS_S3_META_REQUEST_TYPE_MAX = 4 , } # [repr (u32)] # [non_exhaustive] # [doc = " The type of S3 request made. Used by metrics."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_request_type { AWS_S3_REQUEST_TYPE_DEFAULT = 0 , AWS_S3_REQUEST_TYPE_HEAD_OBJECT = 1 , AWS_S3_REQUEST_TYPE_GET_OBJECT = 2 , AWS_S3_REQUEST_TYPE_LIST_PARTS = 3 , AWS_S3_REQUEST_TYPE_CREATE_MULTIPART_UPLOAD = 4 , AWS_S3_REQUEST_TYPE_UPLOAD_PART = 5 , AWS_S3_REQUEST_TYPE_ABORT_MULTIPART_UPLOAD = 6 , AWS_S3_REQUEST_TYPE_COMPLETE_MULTIPART_UPLOAD = 7 , AWS_S3_REQUEST_TYPE_UPLOAD_PART_COPY = 8 , AWS_S3_REQUEST_TYPE_MAX = 9 , } # [doc = " Invoked to provide response headers received during execution of the meta request, both for\n success and error HTTP status codes.\n\n Return AWS_OP_SUCCESS to continue processing the request.\n\n Return aws_raise_error(E) to cancel the request.\n The error you raise will be reflected in `aws_s3_meta_request_result.error_code`.\n If you're not sure which error to raise, use AWS_ERROR_S3_CANCELED."] pub type aws_s3_meta_request_headers_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , headers : * const aws_http_headers , response_status : :: libc :: c_int , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Invoked to provide the response body as it is received.\n\n Note: If you set `enable_read_backpressure` true on the S3 client,\n you must maintain the flow-control window.\n The flow-control window shrinks as you receive body data via this callback.\n Whenever the flow-control window reaches 0 you will stop downloading data.\n Use aws_s3_meta_request_increment_read_window() to increment the window and keep data flowing.\n Maintain a larger window to keep up a high download throughput,\n parts cannot download in parallel unless the window is large enough to hold multiple parts.\n Maintain a smaller window to limit the amount of data buffered in memory.\n\n If `manual_window_management` is false, you do not need to maintain the flow-control window.\n No back-pressure is applied and data arrives as fast as possible.\n\n Return AWS_OP_SUCCESS to continue processing the request.\n\n Return aws_raise_error(E) to cancel the request.\n The error you raise will be reflected in `aws_s3_meta_request_result.error_code`.\n If you're not sure which error to raise, use AWS_ERROR_S3_CANCELED."] pub type aws_s3_meta_request_receive_body_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , body : * const aws_byte_cursor , range_start : u64 , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Invoked when the entire meta request execution is complete."] pub type aws_s3_meta_request_finish_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , meta_request_result : * const aws_s3_meta_request_result , user_data : * mut :: libc :: c_void) > ; # [doc = " Information sent in the meta_request progress callback."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_s3_meta_request_progress { pub bytes_transferred : u64 , pub content_length : u64 , } # [test] fn bindgen_test_layout_aws_s3_meta_request_progress () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_meta_request_progress > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_meta_request_progress > () , 16usize , concat ! ("Size of: " , stringify ! (aws_s3_meta_request_progress))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_meta_request_progress > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_meta_request_progress))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bytes_transferred) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_progress) , "::" , stringify ! (bytes_transferred))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . content_length) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_progress) , "::" , stringify ! (content_length))) ; } # [doc = " Invoked to report progress of a meta-request.\n For PutObject, progress refers to bytes uploaded.\n For CopyObject, progress refers to bytes copied.\n For GetObject, progress refers to bytes downloaded.\n For anything else, progress refers to response body bytes received."] pub type aws_s3_meta_request_progress_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , progress : * const aws_s3_meta_request_progress , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked to report the telemetry of the meta request once a single request finishes. Invoked from the thread of the\n connection that request made from.\n Note: *metrics is only valid for the duration of the callback. If you need to keep it around, use\n `aws_s3_request_metrics_acquire`"] pub type aws_s3_meta_request_telemetry_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , metrics : * mut aws_s3_request_metrics , user_data : * mut :: libc :: c_void) > ; pub type aws_s3_meta_request_shutdown_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; pub type aws_s3_client_shutdown_complete_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_meta_request_tls_mode { AWS_MR_TLS_ENABLED = 0 , AWS_MR_TLS_DISABLED = 1 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_meta_request_compute_content_md5 { AWS_MR_CONTENT_MD5_DISABLED = 0 , AWS_MR_CONTENT_MD5_ENABLED = 1 , } impl aws_s3_checksum_algorithm { pub const AWS_SCA_CRC32C : aws_s3_checksum_algorithm = aws_s3_checksum_algorithm :: AWS_SCA_INIT ; } impl aws_s3_checksum_algorithm { pub const AWS_SCA_END : aws_s3_checksum_algorithm = aws_s3_checksum_algorithm :: AWS_SCA_SHA256 ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_checksum_algorithm { AWS_SCA_NONE = 0 , AWS_SCA_INIT = 1 , AWS_SCA_CRC32 = 2 , AWS_SCA_SHA1 = 3 , AWS_SCA_SHA256 = 4 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_checksum_location { AWS_SCL_NONE = 0 , AWS_SCL_HEADER = 1 , AWS_SCL_TRAILER = 2 , } # [doc = " Info about a single part, for you to review before the upload completes."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_upload_part_review { pub size : u64 , pub checksum : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_s3_upload_part_review () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_upload_part_review > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_upload_part_review > () , 24usize , concat ! ("Size of: " , stringify ! (aws_s3_upload_part_review))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_upload_part_review > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_upload_part_review))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_part_review) , "::" , stringify ! (size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . checksum) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_part_review) , "::" , stringify ! (checksum))) ; } impl Default for aws_s3_upload_part_review { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Info for you to review before an upload completes.\n\n WARNING: This feature is experimental/unstable.\n At this time, review is only available for multipart upload\n (when Content-Length is above the `multipart_upload_threshold`,\n or Content-Length not specified)."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_upload_review { pub checksum_algorithm : aws_s3_checksum_algorithm , pub part_count : usize , pub part_array : * mut aws_s3_upload_part_review , } # [test] fn bindgen_test_layout_aws_s3_upload_review () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_upload_review > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_upload_review > () , 24usize , concat ! ("Size of: " , stringify ! (aws_s3_upload_review))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_upload_review > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_upload_review))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . checksum_algorithm) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_review) , "::" , stringify ! (checksum_algorithm))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_count) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_review) , "::" , stringify ! (part_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_array) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_review) , "::" , stringify ! (part_array))) ; } impl Default for aws_s3_upload_review { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Optional callback, for you to review an upload before it completes.\n For example, you can review each part's checksum and fail the upload if\n you do not agree with them.\n\n @param meta_request pointer to the aws_s3_meta_request of the upload.\n @param info Detailed info about the upload.\n\n Return AWS_OP_SUCCESS to continue processing the request.\n\n Return aws_raise_error(E) to cancel the request.\n The error you raise will be reflected in `aws_s3_meta_request_result.error_code`.\n If you're not sure which error to raise, use AWS_ERROR_S3_CANCELED.\n\n WARNING: This feature is experimental/unstable.\n At this time, the callback is only invoked for multipart upload\n (when Content-Length is above the `multipart_upload_threshold`,\n or Content-Length not specified)."] pub type aws_s3_meta_request_upload_review_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , review : * const aws_s3_upload_review , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_s3_tcp_keep_alive_options { pub keep_alive_interval_sec : u16 , pub keep_alive_timeout_sec : u16 , pub keep_alive_max_failed_probes : u16 , } # [test] fn bindgen_test_layout_aws_s3_tcp_keep_alive_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_tcp_keep_alive_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_tcp_keep_alive_options > () , 6usize , concat ! ("Size of: " , stringify ! (aws_s3_tcp_keep_alive_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_tcp_keep_alive_options > () , 2usize , concat ! ("Alignment of " , stringify ! (aws_s3_tcp_keep_alive_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . keep_alive_interval_sec) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_tcp_keep_alive_options) , "::" , stringify ! (keep_alive_interval_sec))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . keep_alive_timeout_sec) as usize - ptr as usize } , 2usize , concat ! ("Offset of field: " , stringify ! (aws_s3_tcp_keep_alive_options) , "::" , stringify ! (keep_alive_timeout_sec))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . keep_alive_max_failed_probes) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (aws_s3_tcp_keep_alive_options) , "::" , stringify ! (keep_alive_max_failed_probes))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_client_config { pub max_active_connections_override : u32 , pub region : aws_byte_cursor , pub client_bootstrap : * mut aws_client_bootstrap , pub tls_mode : aws_s3_meta_request_tls_mode , pub tls_connection_options : * mut aws_tls_connection_options , pub signing_config : * mut aws_signing_config_aws , pub part_size : u64 , pub max_part_size : u64 , pub multipart_upload_threshold : u64 , pub throughput_target_gbps : f64 , pub retry_strategy : * mut aws_retry_strategy , # [doc = " TODO: move MD5 config to checksum config.\n For multi-part upload, content-md5 will be calculated if the AWS_MR_CONTENT_MD5_ENABLED is specified\n or initial request has content-md5 header.\n For single-part upload, keep the content-md5 in the initial request unchanged."] pub compute_content_md5 : aws_s3_meta_request_compute_content_md5 , pub shutdown_callback : aws_s3_client_shutdown_complete_callback_fn , pub shutdown_callback_user_data : * mut :: libc :: c_void , # [doc = " Optional.\n Proxy configuration for http connection.\n If the connection_type is AWS_HPCT_HTTP_LEGACY, it will be converted to AWS_HPCT_HTTP_TUNNEL if tls_mode is\n ENABLED. Otherwise, it will be converted to AWS_HPCT_HTTP_FORWARD."] pub proxy_options : * mut aws_http_proxy_options , # [doc = " Optional.\n Configuration for fetching proxy configuration from environment.\n By Default proxy_ev_settings.aws_http_proxy_env_var_type is set to AWS_HPEV_ENABLE which means read proxy\n configuration from environment.\n Only works when proxy_options is not set. If both are set, configuration from proxy_options is used."] pub proxy_ev_settings : * mut proxy_env_var_settings , # [doc = " Optional.\n If set to 0, default value is used."] pub connect_timeout_ms : u32 , # [doc = " Optional.\n Set keepalive to periodically transmit messages for detecting a disconnected peer."] pub tcp_keep_alive_options : * mut aws_s3_tcp_keep_alive_options , # [doc = " Optional.\n Configuration options for connection monitoring.\n If the transfer speed falls below the specified minimum_throughput_bytes_per_second, the operation is aborted.\n If set to NULL, default values are used."] pub monitoring_options : * mut aws_http_connection_monitoring_options , # [doc = " Enable backpressure and prevent response data from downloading faster than you can handle it.\n\n If false (default), no backpressure is applied and data will download as fast as possible.\n\n If true, each meta request has a flow-control window that shrinks as\n response body data is downloaded (headers do not affect the window).\n `initial_read_window` determines the starting size of each meta request's window.\n You will stop downloading data whenever the flow-control window reaches 0\n You must call aws_s3_meta_request_increment_read_window() to keep data flowing.\n\n WARNING: This feature is experimental.\n Currently, backpressure is only applied to GetObject requests which are split into multiple parts,\n and you may still receive some data after the window reaches 0."] pub enable_read_backpressure : bool , # [doc = " The starting size of each meta request's flow-control window, in bytes.\n Ignored unless `enable_read_backpressure` is true."] pub initial_read_window : usize , } # [test] fn bindgen_test_layout_aws_s3_client_config () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client_config > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client_config > () , 176usize , concat ! ("Size of: " , stringify ! (aws_s3_client_config))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client_config > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_active_connections_override) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (max_active_connections_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . region) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (region))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client_bootstrap) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (client_bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_mode) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (tls_mode))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_connection_options) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (tls_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . signing_config) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (signing_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_size) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_part_size) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (max_part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . multipart_upload_threshold) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (multipart_upload_threshold))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . throughput_target_gbps) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (throughput_target_gbps))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . retry_strategy) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (retry_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . compute_content_md5) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (compute_content_md5))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback_user_data) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (shutdown_callback_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_options) as usize - ptr as usize } , 120usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_settings) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (proxy_ev_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connect_timeout_ms) as usize - ptr as usize } , 136usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (connect_timeout_ms))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tcp_keep_alive_options) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (tcp_keep_alive_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . monitoring_options) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (monitoring_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_backpressure) as usize - ptr as usize } , 160usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (enable_read_backpressure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_read_window) as usize - ptr as usize } , 168usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (initial_read_window))) ; } impl Default for aws_s3_client_config { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_checksum_config { # [doc = " The location of client added checksum header.\n\n If AWS_SCL_NONE. No request payload checksum will be add and calculated.\n\n If AWS_SCL_HEADER, the checksum will be calculated by client and added related header to the request sent.\n\n If AWS_SCL_TRAILER, the payload will be aws_chunked encoded, The checksum will be calculate while reading the\n payload by client. Related header will be added to the trailer part of the encoded payload. Note the payload of\n the original request cannot be aws-chunked encoded already. Otherwise, error will be raised."] pub location : aws_s3_checksum_location , # [doc = " The checksum algorithm used.\n Must be set if location is not AWS_SCL_NONE. Must be AWS_SCA_NONE if location is AWS_SCL_NONE."] pub checksum_algorithm : aws_s3_checksum_algorithm , # [doc = " Enable checksum mode header will be attached to GET requests, this will tell s3 to send back checksums headers if\n they exist. Calculate the corresponding checksum on the response bodies. The meta request will finish with a did\n validate field and set the error code to AWS_ERROR_S3_RESPONSE_CHECKSUM_MISMATCH if the calculated\n checksum, and checksum found in the response header do not match."] pub validate_response_checksum : bool , # [doc = " Optional array of `enum aws_s3_checksum_algorithm`.\n\n Ignored when validate_response_checksum is not set.\n If not set all the algorithms will be selected as default behavior.\n Owned by the caller.\n\n The list of algorithms for user to pick up when validate the checksum. Client will pick up the algorithm from the\n list with the priority based on performance, and the algorithm sent by server. The priority based on performance\n is [CRC32C, CRC32, SHA1, SHA256].\n\n If the response checksum was validated by client, the result will indicate which algorithm was picked."] pub validate_checksum_algorithms : * mut aws_array_list , } # [test] fn bindgen_test_layout_aws_s3_checksum_config () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_checksum_config > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_checksum_config > () , 24usize , concat ! ("Size of: " , stringify ! (aws_s3_checksum_config))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_checksum_config > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_checksum_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . location) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_checksum_config) , "::" , stringify ! (location))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . checksum_algorithm) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (aws_s3_checksum_config) , "::" , stringify ! (checksum_algorithm))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . validate_response_checksum) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_checksum_config) , "::" , stringify ! (validate_response_checksum))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . validate_checksum_algorithms) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_checksum_config) , "::" , stringify ! (validate_checksum_algorithms))) ; } impl Default for aws_s3_checksum_config { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Options for a new meta request, ie, file transfer that will be handled by the high performance client.\n\n There are several ways to pass the request's body data:\n 1) If the data is already in memory, set the body-stream on `message`.\n 2) If the data is on disk, set `send_filepath` for best performance.\n 3) If the data will be be produced in asynchronous chunks, set `send_async_stream`."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_meta_request_options { pub type_ : aws_s3_meta_request_type , pub signing_config : * const aws_signing_config_aws , pub message : * mut aws_http_message , # [doc = " Optional.\n If set, this file is sent as the request body.\n This gives the best performance when sending data from a file.\n Do not set if the body is being passed by other means (see note above)."] pub send_filepath : aws_byte_cursor , # [doc = " Optional - EXPERIMENTAL/UNSTABLE\n If set, the request body comes from this async stream.\n Use this when outgoing data will be produced in asynchronous chunks.\n Do not set if the body is being passed by other means (see note above)."] pub send_async_stream : * mut aws_async_input_stream , # [doc = " Optional.\n if set, the flexible checksum will be performed by client based on the config."] pub checksum_config : * const aws_s3_checksum_config , pub user_data : * mut :: libc :: c_void , # [doc = " Optional.\n Invoked to provide response headers received during execution of the meta request.\n Note: this callback will not be fired for cases when resuming an\n operation that was already completed (ex. pausing put object after it\n uploaded all data and then resuming it)\n See `aws_s3_meta_request_headers_callback_fn`."] pub headers_callback : aws_s3_meta_request_headers_callback_fn , # [doc = " Invoked to provide the response body as it is received.\n See `aws_s3_meta_request_receive_body_callback_fn`."] pub body_callback : aws_s3_meta_request_receive_body_callback_fn , # [doc = " Invoked when the entire meta request execution is complete.\n See `aws_s3_meta_request_finish_fn`."] pub finish_callback : aws_s3_meta_request_finish_fn , pub shutdown_callback : aws_s3_meta_request_shutdown_fn , # [doc = " Invoked to report progress of the meta request execution.\n See `aws_s3_meta_request_progress_fn`."] pub progress_callback : aws_s3_meta_request_progress_fn , # [doc = " Optional.\n To get telemetry metrics when a single request finishes.\n If set the request will keep track of the metrics from `aws_s3_request_metrics`, and fire the callback when the\n request finishes receiving response.\n See `aws_s3_meta_request_telemetry_fn`\n\n Notes:\n - The callback will be invoked multiple times from different threads."] pub telemetry_callback : aws_s3_meta_request_telemetry_fn , # [doc = " Optional.\n Callback for reviewing an upload before it completes.\n WARNING: experimental/unstable\n See `aws_s3_upload_review_fn`"] pub upload_review_callback : aws_s3_meta_request_upload_review_fn , # [doc = " Optional.\n Endpoint override for request. Can be used to override scheme and port of\n the endpoint.\n There is some overlap between Host header and Endpoint and corner cases\n are handled as follows:\n - Only Host header is set - Host is used to construct endpoint. https is\n default with corresponding port\n - Only endpoint is set - Host header is created from endpoint. Port and\n Scheme from endpoint is used.\n - Both Host and Endpoint is set - Host header must match Authority of\n Endpoint uri. Port and Scheme from endpoint is used."] pub endpoint : * mut aws_uri , # [doc = " Optional.\n For meta requests that support pause/resume (e.g. PutObject), serialized resume token returned by\n aws_s3_meta_request_pause() can be provided here.\n Note: If PutObject request specifies a checksum algorithm, client will calculate checksums while skipping parts\n from the buffer and compare them them to previously uploaded part checksums."] pub resume_token : * mut aws_s3_meta_request_resume_token , } # [test] fn bindgen_test_layout_aws_s3_meta_request_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_meta_request_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_meta_request_options > () , 136usize , concat ! ("Size of: " , stringify ! (aws_s3_meta_request_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_meta_request_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_meta_request_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . type_) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (type_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . signing_config) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (signing_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . message) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (message))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . send_filepath) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (send_filepath))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . send_async_stream) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (send_async_stream))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . checksum_config) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (checksum_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . headers_callback) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (headers_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . body_callback) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (body_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . finish_callback) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (finish_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . progress_callback) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (progress_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . telemetry_callback) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (telemetry_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . upload_review_callback) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (upload_review_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoint) as usize - ptr as usize } , 120usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (endpoint))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . resume_token) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (resume_token))) ; } impl Default for aws_s3_meta_request_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_meta_request_result { pub error_response_headers : * mut aws_http_headers , pub error_response_body : * mut aws_byte_buf , pub response_status : :: libc :: c_int , pub did_validate : bool , pub validation_algorithm : aws_s3_checksum_algorithm , pub error_code : :: libc :: c_int , } # [test] fn bindgen_test_layout_aws_s3_meta_request_result () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_meta_request_result > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_meta_request_result > () , 32usize , concat ! ("Size of: " , stringify ! (aws_s3_meta_request_result))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_meta_request_result > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_meta_request_result))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_response_headers) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (error_response_headers))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_response_body) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (error_response_body))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . response_status) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (response_status))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . did_validate) as usize - ptr as usize } , 20usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (did_validate))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . validation_algorithm) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (validation_algorithm))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_code) as usize - ptr as usize } , 28usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (error_code))) ; } impl Default for aws_s3_meta_request_result { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_s3_client_new (allocator : * mut aws_allocator , client_config : * const aws_s3_client_config) -> * mut aws_s3_client ; } extern "C" { # [doc = " Add a reference, keeping this object alive.\n The reference must be released when you are done with it, or it's memory will never be cleaned up.\n You must not pass in NULL.\n Always returns the same pointer that was passed in."] pub fn aws_s3_client_acquire (client : * mut aws_s3_client) -> * mut aws_s3_client ; } extern "C" { # [doc = " Release a reference.\n When the reference count drops to 0, this object will be cleaned up.\n It's OK to pass in NULL (nothing happens).\n Always returns NULL."] pub fn aws_s3_client_release (client : * mut aws_s3_client) -> * mut aws_s3_client ; } extern "C" { pub fn aws_s3_client_make_meta_request (client : * mut aws_s3_client , options : * const aws_s3_meta_request_options) -> * mut aws_s3_meta_request ; } extern "C" { # [doc = " Increment the flow-control window, so that response data continues downloading.\n\n If the client was created with `enable_read_backpressure` set true,\n each meta request has a flow-control window that shrinks as response\n body data is downloaded (headers do not affect the size of the window).\n The client's `initial_read_window` determines the starting size of each meta request's window.\n If a meta request's flow-control window reaches 0, no further data will be downloaded.\n If the `initial_read_window` is 0, the request will not start until the window is incremented.\n Maintain a larger window to keep up a high download throughput,\n parts cannot download in parallel unless the window is large enough to hold multiple parts.\n Maintain a smaller window to limit the amount of data buffered in memory.\n\n If `enable_read_backpressure` is false this call will have no effect,\n no backpressure is being applied and data is being downloaded as fast as possible.\n\n WARNING: This feature is experimental.\n Currently, backpressure is only applied to GetObject requests which are split into multiple parts,\n and you may still receive some data after the window reaches 0."] pub fn aws_s3_meta_request_increment_read_window (meta_request : * mut aws_s3_meta_request , bytes : u64) ; } extern "C" { pub fn aws_s3_meta_request_cancel (meta_request : * mut aws_s3_meta_request) ; } extern "C" { # [doc = " Note: pause is currently only supported on upload requests.\n In order to pause an ongoing upload, call aws_s3_meta_request_pause() that\n will return resume token. Token can be used to query the state of operation\n at the pausing time.\n To resume an upload that was paused, supply resume token in the meta\n request options structure member aws_s3_meta_request_options.resume_token.\n The upload can be resumed either from the same client or a different one.\n Corner cases for resume upload are as follows:\n - upload is not MPU - fail with AWS_ERROR_UNSUPPORTED_OPERATION\n - pausing before MPU is created - NULL resume token returned. NULL resume\n token is equivalent to restarting upload\n - pausing in the middle of part transfer - return resume token. scheduling of\n new part uploads stops.\n - pausing after completeMPU started - return resume token. if s3 cannot find\n find associated MPU id when resuming with that token and num of parts\n uploaded equals to total num parts, then operation is a no op. Otherwise\n operation fails.\n Note: for no op case the call will succeed and finish/shutdown request callbacks will\n fire, but on headers callback will not fire.\n Note: similar to cancel pause does not cancel requests already in flight and\n and parts might complete after pause is requested.\n @param meta_request pointer to the aws_s3_meta_request of the upload to be paused\n @param resume_token resume token\n @return either AWS_OP_ERR or AWS_OP_SUCCESS"] pub fn aws_s3_meta_request_pause (meta_request : * mut aws_s3_meta_request , out_resume_token : * mut * mut aws_s3_meta_request_resume_token) -> :: libc :: c_int ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_upload_resume_token_options { pub upload_id : aws_byte_cursor , pub part_size : u64 , pub total_num_parts : usize , # [doc = " Optional.\n\n Note: during resume num_parts_uploaded is used for sanity checking against\n uploads on s3 side.\n In cases where upload id does not exist (already resumed using this token\n or pause called after upload completes, etc...) and num_parts_uploaded\n equals to total num parts, resume will become a noop."] pub num_parts_completed : usize , } # [test] fn bindgen_test_layout_aws_s3_upload_resume_token_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_upload_resume_token_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_upload_resume_token_options > () , 40usize , concat ! ("Size of: " , stringify ! (aws_s3_upload_resume_token_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_upload_resume_token_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_upload_resume_token_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . upload_id) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_resume_token_options) , "::" , stringify ! (upload_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_size) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_resume_token_options) , "::" , stringify ! (part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . total_num_parts) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_resume_token_options) , "::" , stringify ! (total_num_parts))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_parts_completed) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_resume_token_options) , "::" , stringify ! (num_parts_completed))) ; } impl Default for aws_s3_upload_resume_token_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Create upload resume token from persisted data.\n Note: Data required for resume token varies per operation."] pub fn aws_s3_meta_request_resume_token_new_upload (allocator : * mut aws_allocator , options : * const aws_s3_upload_resume_token_options) -> * mut aws_s3_meta_request_resume_token ; } extern "C" { pub fn aws_s3_meta_request_resume_token_acquire (resume_token : * mut aws_s3_meta_request_resume_token) -> * mut aws_s3_meta_request_resume_token ; } extern "C" { pub fn aws_s3_meta_request_resume_token_release (resume_token : * mut aws_s3_meta_request_resume_token) -> * mut aws_s3_meta_request_resume_token ; } extern "C" { pub fn aws_s3_meta_request_resume_token_type (resume_token : * mut aws_s3_meta_request_resume_token) -> aws_s3_meta_request_type ; } extern "C" { pub fn aws_s3_meta_request_resume_token_part_size (resume_token : * mut aws_s3_meta_request_resume_token) -> u64 ; } extern "C" { pub fn aws_s3_meta_request_resume_token_total_num_parts (resume_token : * mut aws_s3_meta_request_resume_token) -> usize ; } extern "C" { pub fn aws_s3_meta_request_resume_token_num_parts_completed (resume_token : * mut aws_s3_meta_request_resume_token) -> usize ; } extern "C" { pub fn aws_s3_meta_request_resume_token_upload_id (resume_token : * mut aws_s3_meta_request_resume_token) -> aws_byte_cursor ; } extern "C" { # [doc = " Add a reference, keeping this object alive.\n The reference must be released when you are done with it, or it's memory will never be cleaned up.\n You must not pass in NULL.\n Always returns the same pointer that was passed in."] pub fn aws_s3_meta_request_acquire (meta_request : * mut aws_s3_meta_request) -> * mut aws_s3_meta_request ; } extern "C" { # [doc = " Release a reference.\n When the reference count drops to 0, this object will be cleaned up.\n It's OK to pass in NULL (nothing happens).\n Always returns NULL."] pub fn aws_s3_meta_request_release (meta_request : * mut aws_s3_meta_request) -> * mut aws_s3_meta_request ; } extern "C" { # [doc = " Initialize the configuration for a default S3 signing."] pub fn aws_s3_init_default_signing_config (signing_config : * mut aws_signing_config_aws , region : aws_byte_cursor , credentials_provider : * mut aws_credentials_provider) ; } extern "C" { # [doc = " Add a reference, keeping this object alive.\n The reference must be released when you are done with it, or it's memory will never be cleaned up.\n Always returns the same pointer that was passed in."] pub fn aws_s3_request_metrics_acquire (metrics : * mut aws_s3_request_metrics) -> * mut aws_s3_request_metrics ; } extern "C" { # [doc = " Release a reference.\n When the reference count drops to 0, this object will be cleaned up.\n It's OK to pass in NULL (nothing happens).\n Always returns NULL."] pub fn aws_s3_request_metrics_release (metrics : * mut aws_s3_request_metrics) -> * mut aws_s3_request_metrics ; } extern "C" { # [doc = " Getters for s3 request metrics ************************************************/\n/**\n Get the request ID from aws_s3_request_metrics.\n If unavailable, AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE will be raised.\n If available, out_request_id will be set to a string. Be warned this string's lifetime is tied to the metrics\n object."] pub fn aws_s3_request_metrics_get_request_id (metrics : * const aws_s3_request_metrics , out_request_id : * mut * const aws_string) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_start_timestamp_ns (metrics : * const aws_s3_request_metrics , out_start_time : * mut u64) ; } extern "C" { pub fn aws_s3_request_metrics_get_end_timestamp_ns (metrics : * const aws_s3_request_metrics , out_end_time : * mut u64) ; } extern "C" { pub fn aws_s3_request_metrics_get_total_duration_ns (metrics : * const aws_s3_request_metrics , out_total_duration : * mut u64) ; } extern "C" { pub fn aws_s3_request_metrics_get_send_start_timestamp_ns (metrics : * const aws_s3_request_metrics , out_send_start_time : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_send_end_timestamp_ns (metrics : * const aws_s3_request_metrics , out_send_end_time : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_sending_duration_ns (metrics : * const aws_s3_request_metrics , out_sending_duration : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_receive_start_timestamp_ns (metrics : * const aws_s3_request_metrics , out_receive_start_time : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_receive_end_timestamp_ns (metrics : * const aws_s3_request_metrics , out_receive_end_time : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_receiving_duration_ns (metrics : * const aws_s3_request_metrics , out_receiving_duration : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_response_status_code (metrics : * const aws_s3_request_metrics , out_response_status : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_response_headers (metrics : * const aws_s3_request_metrics , out_response_headers : * mut * mut aws_http_headers) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the path and query of the request.\n If unavailable, AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE will be raised.\n If available, out_request_path_query will be set to a string. Be warned this string's lifetime is tied to the metrics\n object."] pub fn aws_s3_request_metrics_get_request_path_query (metrics : * const aws_s3_request_metrics , out_request_path_query : * mut * const aws_string) ; } extern "C" { # [doc = " Get the host_address of the request.\n If unavailable, AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE will be raised.\n If available, out_host_address will be set to a string. Be warned this string's lifetime is tied to the metrics\n object."] pub fn aws_s3_request_metrics_get_host_address (metrics : * const aws_s3_request_metrics , out_host_address : * mut * const aws_string) ; } extern "C" { # [doc = " Get the IP address of the request connected to.\n If unavailable, AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE will be raised.\n If available, out_ip_address will be set to a string. Be warned this string's lifetime is tied to the metrics object."] pub fn aws_s3_request_metrics_get_ip_address (metrics : * const aws_s3_request_metrics , out_ip_address : * mut * const aws_string) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_connection_id (metrics : * const aws_s3_request_metrics , out_connection_id : * mut usize) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_thread_id (metrics : * const aws_s3_request_metrics , out_thread_id : * mut aws_thread_id_t) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_request_stream_id (metrics : * const aws_s3_request_metrics , out_stream_id : * mut u32) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_request_type (metrics : * const aws_s3_request_metrics , out_request_type : * mut aws_s3_request_type) ; } extern "C" { pub fn aws_s3_request_metrics_get_error_code (metrics : * const aws_s3_request_metrics) -> :: libc :: c_int ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_endpoints_request_context { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_endpoints_rule_engine { _unused : [u8 ; 0] , } extern "C" { # [doc = " Creates a new S3 endpoint resolver.\n Warning: Before using this header, you have to enable it by\n setting cmake config AWS_ENABLE_S3_ENDPOINT_RESOLVER=ON"] pub fn aws_s3_endpoint_resolver_new (allocator : * mut aws_allocator) -> * mut aws_endpoints_rule_engine ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_endpoints_ruleset { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_partitions_config { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_endpoints_parameter { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_endpoints_resolved_endpoint { _unused : [u8 ; 0] , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_endpoints_parameter_type { AWS_ENDPOINTS_PARAMETER_STRING = 0 , AWS_ENDPOINTS_PARAMETER_BOOLEAN = 1 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_endpoints_resolved_endpoint_type { AWS_ENDPOINTS_RESOLVED_ENDPOINT = 0 , AWS_ENDPOINTS_RESOLVED_ERROR = 1 , } extern "C" { pub fn aws_endpoints_get_supported_ruleset_version () -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_parameter_get_type (parameter : * const aws_endpoints_parameter) -> aws_endpoints_parameter_type ; } extern "C" { pub fn aws_endpoints_parameter_get_built_in (parameter : * const aws_endpoints_parameter) -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_parameter_get_default_string (parameter : * const aws_endpoints_parameter , out_cursor : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_parameter_get_default_boolean (parameter : * const aws_endpoints_parameter , out_bool : * mut * const bool) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_parameter_get_is_required (parameter : * const aws_endpoints_parameter) -> bool ; } extern "C" { pub fn aws_endpoints_parameter_get_documentation (parameter : * const aws_endpoints_parameter) -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_parameters_get_is_deprecated (parameter : * const aws_endpoints_parameter) -> bool ; } extern "C" { pub fn aws_endpoints_parameter_get_deprecated_message (parameter : * const aws_endpoints_parameter) -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_parameter_get_deprecated_since (parameter : * const aws_endpoints_parameter) -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_ruleset_new_from_string (allocator : * mut aws_allocator , ruleset_json : aws_byte_cursor) -> * mut aws_endpoints_ruleset ; } extern "C" { pub fn aws_endpoints_ruleset_acquire (ruleset : * mut aws_endpoints_ruleset) -> * mut aws_endpoints_ruleset ; } extern "C" { pub fn aws_endpoints_ruleset_release (ruleset : * mut aws_endpoints_ruleset) -> * mut aws_endpoints_ruleset ; } extern "C" { pub fn aws_endpoints_ruleset_get_parameters (ruleset : * mut aws_endpoints_ruleset) -> * const aws_hash_table ; } extern "C" { pub fn aws_endpoints_ruleset_get_version (ruleset : * const aws_endpoints_ruleset) -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_ruleset_get_service_id (ruleset : * const aws_endpoints_ruleset) -> aws_byte_cursor ; } extern "C" { # [doc = " Create new rule engine for a given ruleset.\n In cases of failure NULL is returned and last error is set."] pub fn aws_endpoints_rule_engine_new (allocator : * mut aws_allocator , ruleset : * mut aws_endpoints_ruleset , partitions_config : * mut aws_partitions_config) -> * mut aws_endpoints_rule_engine ; } extern "C" { pub fn aws_endpoints_rule_engine_acquire (rule_engine : * mut aws_endpoints_rule_engine) -> * mut aws_endpoints_rule_engine ; } extern "C" { pub fn aws_endpoints_rule_engine_release (rule_engine : * mut aws_endpoints_rule_engine) -> * mut aws_endpoints_rule_engine ; } extern "C" { pub fn aws_endpoints_request_context_new (allocator : * mut aws_allocator) -> * mut aws_endpoints_request_context ; } extern "C" { pub fn aws_endpoints_request_context_acquire (request_context : * mut aws_endpoints_request_context) -> * mut aws_endpoints_request_context ; } extern "C" { pub fn aws_endpoints_request_context_release (request_context : * mut aws_endpoints_request_context) -> * mut aws_endpoints_request_context ; } extern "C" { pub fn aws_endpoints_request_context_add_string (allocator : * mut aws_allocator , context : * mut aws_endpoints_request_context , name : aws_byte_cursor , value : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_request_context_add_boolean (allocator : * mut aws_allocator , context : * mut aws_endpoints_request_context , name : aws_byte_cursor , value : bool) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_rule_engine_resolve (engine : * mut aws_endpoints_rule_engine , context : * const aws_endpoints_request_context , out_resolved_endpoint : * mut * mut aws_endpoints_resolved_endpoint) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_acquire (resolved_endpoint : * mut aws_endpoints_resolved_endpoint) -> * mut aws_endpoints_resolved_endpoint ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_release (resolved_endpoint : * mut aws_endpoints_resolved_endpoint) -> * mut aws_endpoints_resolved_endpoint ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_get_type (resolved_endpoint : * const aws_endpoints_resolved_endpoint) -> aws_endpoints_resolved_endpoint_type ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_get_url (resolved_endpoint : * const aws_endpoints_resolved_endpoint , out_url : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_get_properties (resolved_endpoint : * const aws_endpoints_resolved_endpoint , out_properties : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_get_headers (resolved_endpoint : * const aws_endpoints_resolved_endpoint , out_headers : * mut * const aws_hash_table) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_get_error (resolved_endpoint : * const aws_endpoints_resolved_endpoint , out_error : * mut aws_byte_cursor) -> :: libc :: c_int ; } # [repr (C)] pub struct aws_mutex { pub mutex_handle : pthread_mutex_t , pub initialized : bool , } # [test] fn bindgen_test_layout_aws_mutex () { const UNINIT : :: std :: mem :: MaybeUninit < aws_mutex > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_mutex > () , 48usize , concat ! ("Size of: " , stringify ! (aws_mutex))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_mutex > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_mutex))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . mutex_handle) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_mutex) , "::" , stringify ! (mutex_handle))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initialized) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_mutex) , "::" , stringify ! (initialized))) ; } impl Default for aws_mutex { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Initializes a new platform instance of mutex."] pub fn aws_mutex_init (mutex : * mut aws_mutex) -> :: libc :: c_int ; } extern "C" { # [doc = " Cleans up internal resources."] pub fn aws_mutex_clean_up (mutex : * mut aws_mutex) ; } extern "C" { # [doc = " Blocks until it acquires the lock. While on some platforms such as Windows,\n this may behave as a reentrant mutex, you should not treat it like one. On\n platforms it is possible for it to be non-reentrant, it will be."] pub fn aws_mutex_lock (mutex : * mut aws_mutex) -> :: libc :: c_int ; } extern "C" { # [doc = " Attempts to acquire the lock but returns immediately if it can not.\n While on some platforms such as Windows, this may behave as a reentrant mutex,\n you should not treat it like one. On platforms it is possible for it to be non-reentrant, it will be.\n Note: For windows, minimum support server version is Windows Server 2008 R2 [desktop apps | UWP apps]"] pub fn aws_mutex_try_lock (mutex : * mut aws_mutex) -> :: libc :: c_int ; } extern "C" { # [doc = " Releases the lock."] pub fn aws_mutex_unlock (mutex : * mut aws_mutex) -> :: libc :: c_int ; } # [repr (i32)] # [non_exhaustive] # [doc = " Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n SPDX-License-Identifier: Apache-2.0."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_status_code { AWS_HTTP_STATUS_CODE_UNKNOWN = - 1 , AWS_HTTP_STATUS_CODE_100_CONTINUE = 100 , AWS_HTTP_STATUS_CODE_101_SWITCHING_PROTOCOLS = 101 , AWS_HTTP_STATUS_CODE_102_PROCESSING = 102 , AWS_HTTP_STATUS_CODE_103_EARLY_HINTS = 103 , AWS_HTTP_STATUS_CODE_200_OK = 200 , AWS_HTTP_STATUS_CODE_201_CREATED = 201 , AWS_HTTP_STATUS_CODE_202_ACCEPTED = 202 , AWS_HTTP_STATUS_CODE_203_NON_AUTHORITATIVE_INFORMATION = 203 , AWS_HTTP_STATUS_CODE_204_NO_CONTENT = 204 , AWS_HTTP_STATUS_CODE_205_RESET_CONTENT = 205 , AWS_HTTP_STATUS_CODE_206_PARTIAL_CONTENT = 206 , AWS_HTTP_STATUS_CODE_207_MULTI_STATUS = 207 , AWS_HTTP_STATUS_CODE_208_ALREADY_REPORTED = 208 , AWS_HTTP_STATUS_CODE_226_IM_USED = 226 , AWS_HTTP_STATUS_CODE_300_MULTIPLE_CHOICES = 300 , AWS_HTTP_STATUS_CODE_301_MOVED_PERMANENTLY = 301 , AWS_HTTP_STATUS_CODE_302_FOUND = 302 , AWS_HTTP_STATUS_CODE_303_SEE_OTHER = 303 , AWS_HTTP_STATUS_CODE_304_NOT_MODIFIED = 304 , AWS_HTTP_STATUS_CODE_305_USE_PROXY = 305 , AWS_HTTP_STATUS_CODE_307_TEMPORARY_REDIRECT = 307 , AWS_HTTP_STATUS_CODE_308_PERMANENT_REDIRECT = 308 , AWS_HTTP_STATUS_CODE_400_BAD_REQUEST = 400 , AWS_HTTP_STATUS_CODE_401_UNAUTHORIZED = 401 , AWS_HTTP_STATUS_CODE_402_PAYMENT_REQUIRED = 402 , AWS_HTTP_STATUS_CODE_403_FORBIDDEN = 403 , AWS_HTTP_STATUS_CODE_404_NOT_FOUND = 404 , AWS_HTTP_STATUS_CODE_405_METHOD_NOT_ALLOWED = 405 , AWS_HTTP_STATUS_CODE_406_NOT_ACCEPTABLE = 406 , AWS_HTTP_STATUS_CODE_407_PROXY_AUTHENTICATION_REQUIRED = 407 , AWS_HTTP_STATUS_CODE_408_REQUEST_TIMEOUT = 408 , AWS_HTTP_STATUS_CODE_409_CONFLICT = 409 , AWS_HTTP_STATUS_CODE_410_GONE = 410 , AWS_HTTP_STATUS_CODE_411_LENGTH_REQUIRED = 411 , AWS_HTTP_STATUS_CODE_412_PRECONDITION_FAILED = 412 , AWS_HTTP_STATUS_CODE_413_REQUEST_ENTITY_TOO_LARGE = 413 , AWS_HTTP_STATUS_CODE_414_REQUEST_URI_TOO_LONG = 414 , AWS_HTTP_STATUS_CODE_415_UNSUPPORTED_MEDIA_TYPE = 415 , AWS_HTTP_STATUS_CODE_416_REQUESTED_RANGE_NOT_SATISFIABLE = 416 , AWS_HTTP_STATUS_CODE_417_EXPECTATION_FAILED = 417 , AWS_HTTP_STATUS_CODE_421_MISDIRECTED_REQUEST = 421 , AWS_HTTP_STATUS_CODE_422_UNPROCESSABLE_ENTITY = 422 , AWS_HTTP_STATUS_CODE_423_LOCKED = 423 , AWS_HTTP_STATUS_CODE_424_FAILED_DEPENDENCY = 424 , AWS_HTTP_STATUS_CODE_425_TOO_EARLY = 425 , AWS_HTTP_STATUS_CODE_426_UPGRADE_REQUIRED = 426 , AWS_HTTP_STATUS_CODE_428_PRECONDITION_REQUIRED = 428 , AWS_HTTP_STATUS_CODE_429_TOO_MANY_REQUESTS = 429 , AWS_HTTP_STATUS_CODE_431_REQUEST_HEADER_FIELDS_TOO_LARGE = 431 , AWS_HTTP_STATUS_CODE_451_UNAVAILABLE_FOR_LEGAL_REASON = 451 , AWS_HTTP_STATUS_CODE_500_INTERNAL_SERVER_ERROR = 500 , AWS_HTTP_STATUS_CODE_501_NOT_IMPLEMENTED = 501 , AWS_HTTP_STATUS_CODE_502_BAD_GATEWAY = 502 , AWS_HTTP_STATUS_CODE_503_SERVICE_UNAVAILABLE = 503 , AWS_HTTP_STATUS_CODE_504_GATEWAY_TIMEOUT = 504 , AWS_HTTP_STATUS_CODE_505_HTTP_VERSION_NOT_SUPPORTED = 505 , AWS_HTTP_STATUS_CODE_506_VARIANT_ALSO_NEGOTIATES = 506 , AWS_HTTP_STATUS_CODE_507_INSUFFICIENT_STORAGE = 507 , AWS_HTTP_STATUS_CODE_508_LOOP_DETECTED = 508 , AWS_HTTP_STATUS_CODE_510_NOT_EXTENDED = 510 , AWS_HTTP_STATUS_CODE_511_NETWORK_AUTHENTICATION_REQUIRED = 511 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_config { _unused : [u8 ; 0] , } # [repr (u32)] # [non_exhaustive] # [doc = " @Deprecated - Supported proxy authentication modes. Superceded by proxy strategy."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_proxy_authentication_type { AWS_HPAT_NONE = 0 , AWS_HPAT_BASIC = 1 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_proxy_env_var_type { # [doc = " Default.\n Disable reading from environment variable for proxy."] AWS_HPEV_DISABLE = 0 , # [doc = " Enable get proxy URL from environment variable, when the manual proxy options of connection manager is not set.\n env HTTPS_PROXY/https_proxy will be checked when the main connection use tls.\n env HTTP_PROXY/http_proxy will be checked when the main connection NOT use tls.\n The lower case version has precedence."] AWS_HPEV_ENABLE = 1 , } # [repr (u32)] # [non_exhaustive] # [doc = " Supported proxy connection types"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_proxy_connection_type { # [doc = " Deprecated, but 0-valued for backwards compatibility\n\n If tls options are provided (for the main connection) then treat the proxy as a tunneling proxy\n If tls options are not provided (for the main connection), then treat the proxy as a forwarding proxy"] AWS_HPCT_HTTP_LEGACY = 0 , # [doc = " Use the proxy to forward http requests. Attempting to use both this mode and TLS on the tunnel destination\n is a configuration error."] AWS_HPCT_HTTP_FORWARD = 1 , # [doc = " Use the proxy to establish a connection to a remote endpoint via a CONNECT request through the proxy.\n Works for both plaintext and tls connections."] AWS_HPCT_HTTP_TUNNEL = 2 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct proxy_env_var_settings { pub env_var_type : aws_http_proxy_env_var_type , pub connection_type : aws_http_proxy_connection_type , pub tls_options : * const aws_tls_connection_options , } # [test] fn bindgen_test_layout_proxy_env_var_settings () { const UNINIT : :: std :: mem :: MaybeUninit < proxy_env_var_settings > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < proxy_env_var_settings > () , 16usize , concat ! ("Size of: " , stringify ! (proxy_env_var_settings))) ; assert_eq ! (:: std :: mem :: align_of :: < proxy_env_var_settings > () , 8usize , concat ! ("Alignment of " , stringify ! (proxy_env_var_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . env_var_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (proxy_env_var_settings) , "::" , stringify ! (env_var_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connection_type) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (proxy_env_var_settings) , "::" , stringify ! (connection_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_options) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (proxy_env_var_settings) , "::" , stringify ! (tls_options))) ; } impl Default for proxy_env_var_settings { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Options for http proxy server usage"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_options { # [doc = " Type of proxy connection to make"] pub connection_type : aws_http_proxy_connection_type , # [doc = " Proxy host to connect to"] pub host : aws_byte_cursor , # [doc = " Port to make the proxy connection to"] pub port : u16 , # [doc = " Optional.\n TLS configuration for the Local <-> Proxy connection\n Must be distinct from the the TLS options in the parent aws_http_connection_options struct"] pub tls_options : * const aws_tls_connection_options , # [doc = " Optional\n Advanced option that allows the user to create a custom strategy that gives low-level control of\n certain logical flows within the proxy logic.\n\n For tunneling proxies it allows custom retry and adaptive negotiation of CONNECT requests.\n For forwarding proxies it allows custom request transformations."] pub proxy_strategy : * mut aws_http_proxy_strategy , # [doc = " @Deprecated - What type of proxy authentication to use, if any.\n Replaced by instantiating a proxy_strategy"] pub auth_type : aws_http_proxy_authentication_type , # [doc = " @Deprecated - Optional user name to use for basic authentication\n Replaced by instantiating a proxy_strategy via aws_http_proxy_strategy_new_basic_auth()"] pub auth_username : aws_byte_cursor , # [doc = " @Deprecated - Optional password to use for basic authentication\n Replaced by instantiating a proxy_strategy via aws_http_proxy_strategy_new_basic_auth()"] pub auth_password : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_http_proxy_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_options > () , 88usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connection_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (connection_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_options) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (tls_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_strategy) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (proxy_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . auth_type) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (auth_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . auth_username) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (auth_username))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . auth_password) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (auth_password))) ; } impl Default for aws_http_proxy_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Synchronous (for now) callback function to fetch a token used in modifying CONNECT requests"] pub type aws_http_proxy_negotiation_get_token_sync_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void , out_error_code : * mut :: libc :: c_int) -> * mut aws_string > ; # [doc = " Synchronous (for now) callback function to fetch a token used in modifying CONNECT request. Includes a (byte string)\n context intended to be used as part of a challenge-response flow."] pub type aws_http_proxy_negotiation_get_challenge_token_sync_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void , challenge_context : * const aws_byte_cursor , out_error_code : * mut :: libc :: c_int) -> * mut aws_string > ; # [doc = " Proxy negotiation logic must call this function to indicate an unsuccessful outcome"] pub type aws_http_proxy_negotiation_terminate_fn = :: std :: option :: Option < unsafe extern "C" fn (message : * mut aws_http_message , error_code : :: libc :: c_int , internal_proxy_user_data : * mut :: libc :: c_void) > ; # [doc = " Proxy negotiation logic must call this function to forward the potentially-mutated request back to the proxy\n connection logic."] pub type aws_http_proxy_negotiation_http_request_forward_fn = :: std :: option :: Option < unsafe extern "C" fn (message : * mut aws_http_message , internal_proxy_user_data : * mut :: libc :: c_void) > ; # [doc = " User-supplied transform callback which implements the proxy request flow and ultimately, across all execution\n pathways, invokes either the terminate function or the forward function appropriately.\n\n For tunneling proxy connections, this request flow transform only applies to the CONNECT stage of proxy\n connection establishment.\n\n For forwarding proxy connections, this request flow transform applies to every single http request that goes\n out on the connection.\n\n Forwarding proxy connections cannot yet support a truly async request transform without major surgery on http\n stream creation, so for now, we split into an async version (for tunneling proxies) and a separate\n synchronous version for forwarding proxies. Also forwarding proxies are a kind of legacy dead-end in some\n sense.\n"] pub type aws_http_proxy_negotiation_http_request_transform_async_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator , message : * mut aws_http_message , negotiation_termination_callback : aws_http_proxy_negotiation_terminate_fn , negotiation_http_request_forward_callback : aws_http_proxy_negotiation_http_request_forward_fn , internal_proxy_user_data : * mut :: libc :: c_void) > ; pub type aws_http_proxy_negotiation_http_request_transform_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator , message : * mut aws_http_message) -> :: libc :: c_int > ; # [doc = " Tunneling proxy connections only. A callback that lets the negotiator examine the headers in the\n response to the most recent CONNECT request as they arrive."] pub type aws_http_proxy_negotiation_connect_on_incoming_headers_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator , header_block : aws_http_header_block , header_array : * const aws_http_header , num_headers : usize) -> :: libc :: c_int > ; # [doc = " Tunneling proxy connections only. A callback that lets the negotiator examine the status code of the\n response to the most recent CONNECT request."] pub type aws_http_proxy_negotiator_connect_status_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator , status_code : aws_http_status_code) -> :: libc :: c_int > ; # [doc = " Tunneling proxy connections only. A callback that lets the negotiator examine the body of the response\n to the most recent CONNECT request."] pub type aws_http_proxy_negotiator_connect_on_incoming_body_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator , data : * const aws_byte_cursor) -> :: libc :: c_int > ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_proxy_negotiation_retry_directive { AWS_HPNRD_STOP = 0 , AWS_HPNRD_NEW_CONNECTION = 1 , AWS_HPNRD_CURRENT_CONNECTION = 2 , } pub type aws_http_proxy_negotiator_get_retry_directive_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator) -> aws_http_proxy_negotiation_retry_directive > ; # [doc = " Vtable for forwarding-based proxy negotiators"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http_proxy_negotiator_forwarding_vtable { pub forward_request_transform : aws_http_proxy_negotiation_http_request_transform_fn , } # [test] fn bindgen_test_layout_aws_http_proxy_negotiator_forwarding_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_negotiator_forwarding_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_negotiator_forwarding_vtable > () , 8usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_negotiator_forwarding_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_negotiator_forwarding_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_negotiator_forwarding_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . forward_request_transform) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_forwarding_vtable) , "::" , stringify ! (forward_request_transform))) ; } # [doc = " Vtable for tunneling-based proxy negotiators"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http_proxy_negotiator_tunnelling_vtable { pub connect_request_transform : aws_http_proxy_negotiation_http_request_transform_async_fn , pub on_incoming_headers_callback : aws_http_proxy_negotiation_connect_on_incoming_headers_fn , pub on_status_callback : aws_http_proxy_negotiator_connect_status_fn , pub on_incoming_body_callback : aws_http_proxy_negotiator_connect_on_incoming_body_fn , pub get_retry_directive : aws_http_proxy_negotiator_get_retry_directive_fn , } # [test] fn bindgen_test_layout_aws_http_proxy_negotiator_tunnelling_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_negotiator_tunnelling_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_negotiator_tunnelling_vtable > () , 40usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_negotiator_tunnelling_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connect_request_transform) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable) , "::" , stringify ! (connect_request_transform))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_incoming_headers_callback) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable) , "::" , stringify ! (on_incoming_headers_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_status_callback) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable) , "::" , stringify ! (on_status_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_incoming_body_callback) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable) , "::" , stringify ! (on_incoming_body_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_retry_directive) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable) , "::" , stringify ! (get_retry_directive))) ; } # [repr (C)] # [derive (Copy , Clone)] pub struct aws_http_proxy_negotiator { pub ref_count : aws_ref_count , pub impl_ : * mut :: libc :: c_void , pub strategy_vtable : aws_http_proxy_negotiator__bindgen_ty_1 , } # [repr (C)] # [derive (Copy , Clone)] pub union aws_http_proxy_negotiator__bindgen_ty_1 { pub forwarding_vtable : * mut aws_http_proxy_negotiator_forwarding_vtable , pub tunnelling_vtable : * mut aws_http_proxy_negotiator_tunnelling_vtable , } # [test] fn bindgen_test_layout_aws_http_proxy_negotiator__bindgen_ty_1 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_negotiator__bindgen_ty_1 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_negotiator__bindgen_ty_1 > () , 8usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_negotiator__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_negotiator__bindgen_ty_1 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_negotiator__bindgen_ty_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . forwarding_vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator__bindgen_ty_1) , "::" , stringify ! (forwarding_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tunnelling_vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator__bindgen_ty_1) , "::" , stringify ! (tunnelling_vtable))) ; } impl Default for aws_http_proxy_negotiator__bindgen_ty_1 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [test] fn bindgen_test_layout_aws_http_proxy_negotiator () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_negotiator > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_negotiator > () , 40usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_negotiator))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_negotiator > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_negotiator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . strategy_vtable) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator) , "::" , stringify ! (strategy_vtable))) ; } impl Default for aws_http_proxy_negotiator { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_http_proxy_strategy_create_negotiator_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_strategy : * mut aws_http_proxy_strategy , allocator : * mut aws_allocator) -> * mut aws_http_proxy_negotiator > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http_proxy_strategy_vtable { pub create_negotiator : aws_http_proxy_strategy_create_negotiator_fn , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_vtable > () , 8usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . create_negotiator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_vtable) , "::" , stringify ! (create_negotiator))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy { pub ref_count : aws_ref_count , pub vtable : * mut aws_http_proxy_strategy_vtable , pub impl_ : * mut :: libc :: c_void , pub proxy_connection_type : aws_http_proxy_connection_type , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy > () , 48usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_connection_type) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy) , "::" , stringify ! (proxy_connection_type))) ; } impl Default for aws_http_proxy_strategy { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy_basic_auth_options { pub proxy_connection_type : aws_http_proxy_connection_type , pub user_name : aws_byte_cursor , pub password : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_basic_auth_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_basic_auth_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_basic_auth_options > () , 40usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_basic_auth_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_basic_auth_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_basic_auth_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_connection_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_basic_auth_options) , "::" , stringify ! (proxy_connection_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_name) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_basic_auth_options) , "::" , stringify ! (user_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . password) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_basic_auth_options) , "::" , stringify ! (password))) ; } impl Default for aws_http_proxy_strategy_basic_auth_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy_tunneling_kerberos_options { pub get_token : aws_http_proxy_negotiation_get_token_sync_fn , pub get_token_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_tunneling_kerberos_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_tunneling_kerberos_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_tunneling_kerberos_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_tunneling_kerberos_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_tunneling_kerberos_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_tunneling_kerberos_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_token) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_kerberos_options) , "::" , stringify ! (get_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_token_user_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_kerberos_options) , "::" , stringify ! (get_token_user_data))) ; } impl Default for aws_http_proxy_strategy_tunneling_kerberos_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy_tunneling_ntlm_options { pub get_token : aws_http_proxy_negotiation_get_token_sync_fn , pub get_challenge_token : aws_http_proxy_negotiation_get_challenge_token_sync_fn , pub get_challenge_token_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_tunneling_ntlm_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_tunneling_ntlm_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_tunneling_ntlm_options > () , 24usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_tunneling_ntlm_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_tunneling_ntlm_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_tunneling_ntlm_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_token) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_ntlm_options) , "::" , stringify ! (get_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_challenge_token) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_ntlm_options) , "::" , stringify ! (get_challenge_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_challenge_token_user_data) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_ntlm_options) , "::" , stringify ! (get_challenge_token_user_data))) ; } impl Default for aws_http_proxy_strategy_tunneling_ntlm_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy_tunneling_adaptive_options { pub kerberos_options : * mut aws_http_proxy_strategy_tunneling_kerberos_options , pub ntlm_options : * mut aws_http_proxy_strategy_tunneling_ntlm_options , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_tunneling_adaptive_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_tunneling_adaptive_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_tunneling_adaptive_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_tunneling_adaptive_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_tunneling_adaptive_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_tunneling_adaptive_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . kerberos_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_adaptive_options) , "::" , stringify ! (kerberos_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ntlm_options) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_adaptive_options) , "::" , stringify ! (ntlm_options))) ; } impl Default for aws_http_proxy_strategy_tunneling_adaptive_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy_tunneling_sequence_options { pub strategies : * mut * mut aws_http_proxy_strategy , pub strategy_count : u32 , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_tunneling_sequence_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_tunneling_sequence_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_tunneling_sequence_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_tunneling_sequence_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_tunneling_sequence_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_tunneling_sequence_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . strategies) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_sequence_options) , "::" , stringify ! (strategies))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . strategy_count) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_sequence_options) , "::" , stringify ! (strategy_count))) ; } impl Default for aws_http_proxy_strategy_tunneling_sequence_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Take a reference to an http proxy negotiator\n @param proxy_negotiator negotiator to take a reference to\n @return the strategy"] pub fn aws_http_proxy_negotiator_acquire (proxy_negotiator : * mut aws_http_proxy_negotiator) -> * mut aws_http_proxy_negotiator ; } extern "C" { # [doc = " Release a reference to an http proxy negotiator\n @param proxy_negotiator negotiator to release a reference to"] pub fn aws_http_proxy_negotiator_release (proxy_negotiator : * mut aws_http_proxy_negotiator) ; } extern "C" { # [doc = " Creates a new proxy negotiator from a proxy strategy\n @param allocator memory allocator to use\n @param strategy strategy to creation a new negotiator for\n @return a new proxy negotiator if successful, otherwise NULL"] pub fn aws_http_proxy_strategy_create_negotiator (strategy : * mut aws_http_proxy_strategy , allocator : * mut aws_allocator) -> * mut aws_http_proxy_negotiator ; } extern "C" { # [doc = " Take a reference to an http proxy strategy\n @param proxy_strategy strategy to take a reference to\n @return the strategy"] pub fn aws_http_proxy_strategy_acquire (proxy_strategy : * mut aws_http_proxy_strategy) -> * mut aws_http_proxy_strategy ; } extern "C" { # [doc = " Release a reference to an http proxy strategy\n @param proxy_strategy strategy to release a reference to"] pub fn aws_http_proxy_strategy_release (proxy_strategy : * mut aws_http_proxy_strategy) ; } extern "C" { # [doc = " A constructor for a proxy strategy that performs basic authentication by adding the appropriate\n header and header value to requests or CONNECT requests.\n\n @param allocator memory allocator to use\n @param config basic authentication configuration info\n @return a new proxy strategy if successfully constructed, otherwise NULL"] pub fn aws_http_proxy_strategy_new_basic_auth (allocator : * mut aws_allocator , config : * mut aws_http_proxy_strategy_basic_auth_options) -> * mut aws_http_proxy_strategy ; } extern "C" { # [doc = " Constructor for an adaptive tunneling proxy strategy. This strategy attempts a vanilla CONNECT and if that\n fails it may make followup CONNECT attempts using kerberos or ntlm tokens, based on configuration and proxy\n response properties.\n\n @param allocator memory allocator to use\n @param config configuration options for the strategy\n @return a new proxy strategy if successfully constructed, otherwise NULL"] pub fn aws_http_proxy_strategy_new_tunneling_adaptive (allocator : * mut aws_allocator , config : * mut aws_http_proxy_strategy_tunneling_adaptive_options) -> * mut aws_http_proxy_strategy ; } extern "C" { # [doc = " Create a persistent proxy configuration from http connection options\n @param allocator memory allocator to use\n @param options http connection options to source proxy configuration from\n @return"] pub fn aws_http_proxy_config_new_from_connection_options (allocator : * mut aws_allocator , options : * const aws_http_client_connection_options) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Create a persistent proxy configuration from http connection manager options\n @param allocator memory allocator to use\n @param options http connection manager options to source proxy configuration from\n @return"] pub fn aws_http_proxy_config_new_from_manager_options (allocator : * mut aws_allocator , options : * const aws_http_connection_manager_options) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Create a persistent proxy configuration from non-persistent proxy options. The resulting\n proxy configuration assumes a tunneling connection type.\n\n @param allocator memory allocator to use\n @param options http proxy options to source proxy configuration from\n @return"] pub fn aws_http_proxy_config_new_tunneling_from_proxy_options (allocator : * mut aws_allocator , options : * const aws_http_proxy_options) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Create a persistent proxy configuration from non-persistent proxy options.\n Legacy connection type of proxy options will be rejected.\n\n @param allocator memory allocator to use\n @param options http proxy options to source proxy configuration from\n @return"] pub fn aws_http_proxy_config_new_from_proxy_options (allocator : * mut aws_allocator , options : * const aws_http_proxy_options) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Create a persistent proxy configuration from non-persistent proxy options.\n\n @param allocator memory allocator to use\n @param options http proxy options to source proxy configuration from\n @param is_tls_connection tls connection info of the main connection to determine connection_type\n when the connection_type is legacy.\n @return"] pub fn aws_http_proxy_config_new_from_proxy_options_with_tls_info (allocator : * mut aws_allocator , proxy_options : * const aws_http_proxy_options , is_tls_connection : bool) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Clones an existing proxy configuration. A refactor could remove this (do a \"move\" between the old and new user\n data in the one spot it's used) but that should wait until we have better test cases for the logic where this\n gets invoked (ntlm/kerberos chains).\n\n @param allocator memory allocator to use\n @param proxy_config http proxy configuration to clone\n @return"] pub fn aws_http_proxy_config_new_clone (allocator : * mut aws_allocator , proxy_config : * const aws_http_proxy_config) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Destroys an http proxy configuration\n @param config http proxy configuration to destroy"] pub fn aws_http_proxy_config_destroy (config : * mut aws_http_proxy_config) ; } extern "C" { # [doc = " Initializes non-persistent http proxy options from a persistent http proxy configuration\n @param options http proxy options to initialize\n @param config the http proxy config to use as an initialization source"] pub fn aws_http_proxy_options_init_from_config (options : * mut aws_http_proxy_options , config : * const aws_http_proxy_config) ; } extern "C" { # [doc = " Establish an arbitrary protocol connection through an http proxy via tunneling CONNECT. Alpn is\n not required for this connection process to succeed, but we encourage its use if available.\n\n @param channel_options configuration options for the socket level connection\n @param proxy_options configuration options for the proxy connection\n\n @return AWS_OP_SUCCESS if the asynchronous channel kickoff succeeded, AWS_OP_ERR otherwise"] pub fn aws_http_proxy_new_socket_channel (channel_options : * mut aws_socket_channel_bootstrap_options , proxy_options : * const aws_http_proxy_options) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_connection_finish_code { AWS_S3_CONNECTION_FINISH_CODE_SUCCESS = 0 , AWS_S3_CONNECTION_FINISH_CODE_FAILED = 1 , AWS_S3_CONNECTION_FINISH_CODE_RETRY = 2 , } pub type aws_s3_endpoint_shutdown_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_endpoint_options { pub host_name : * mut aws_string , pub shutdown_callback : aws_s3_endpoint_shutdown_fn , pub client_bootstrap : * mut aws_client_bootstrap , pub tls_connection_options : * const aws_tls_connection_options , pub dns_host_address_ttl_seconds : usize , pub client : * mut aws_s3_client , pub max_connections : u32 , pub port : u16 , # [doc = " Optional.\n Proxy configuration for http connection."] pub proxy_config : * mut aws_http_proxy_config , # [doc = " Optional.\n Configuration for fetching proxy configuration from environment.\n By Default proxy_ev_settings.aws_http_proxy_env_var_type is set to AWS_HPEV_ENABLE which means read proxy\n configuration from environment.\n Only works when proxy_config is not set. If both are set, configuration from proxy_config is used."] pub proxy_ev_settings : * mut proxy_env_var_settings , # [doc = " Optional.\n If set to 0, default value is used."] pub connect_timeout_ms : u32 , # [doc = " Optional.\n Set keepalive to periodically transmit messages for detecting a disconnected peer."] pub tcp_keep_alive_options : * mut aws_s3_tcp_keep_alive_options , # [doc = " Optional.\n Configuration options for connection monitoring.\n If the transfer speed falls below the specified minimum_throughput_bytes_per_second, the operation is aborted."] pub monitoring_options : * mut aws_http_connection_monitoring_options , } # [test] fn bindgen_test_layout_aws_s3_endpoint_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_endpoint_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_endpoint_options > () , 96usize , concat ! ("Size of: " , stringify ! (aws_s3_endpoint_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_endpoint_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_endpoint_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client_bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (client_bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_connection_options) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (tls_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . dns_host_address_ttl_seconds) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (dns_host_address_ttl_seconds))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (client))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_connections) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (max_connections))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 52usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_config) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (proxy_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_settings) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (proxy_ev_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connect_timeout_ms) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (connect_timeout_ms))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tcp_keep_alive_options) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (tcp_keep_alive_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . monitoring_options) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (monitoring_options))) ; } impl Default for aws_s3_endpoint_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_s3_endpoint_system_vtable { pub acquire : :: std :: option :: Option < unsafe extern "C" fn (endpoint : * mut aws_s3_endpoint , already_holding_lock : bool) > , pub release : :: std :: option :: Option < unsafe extern "C" fn (endpoint : * mut aws_s3_endpoint) > , } # [test] fn bindgen_test_layout_aws_s3_endpoint_system_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_endpoint_system_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_endpoint_system_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_s3_endpoint_system_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_endpoint_system_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_endpoint_system_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . acquire) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_system_vtable) , "::" , stringify ! (acquire))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . release) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_system_vtable) , "::" , stringify ! (release))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_endpoint { pub client_synced_data : aws_s3_endpoint__bindgen_ty_1 , pub allocator : * mut aws_allocator , pub host_name : * mut aws_string , pub http_connection_manager : * mut aws_http_connection_manager , pub client : * mut aws_s3_client , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_s3_endpoint__bindgen_ty_1 { pub ref_count : usize , } # [test] fn bindgen_test_layout_aws_s3_endpoint__bindgen_ty_1 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_endpoint__bindgen_ty_1 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_endpoint__bindgen_ty_1 > () , 8usize , concat ! ("Size of: " , stringify ! (aws_s3_endpoint__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_endpoint__bindgen_ty_1 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_endpoint__bindgen_ty_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint__bindgen_ty_1) , "::" , stringify ! (ref_count))) ; } # [test] fn bindgen_test_layout_aws_s3_endpoint () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_endpoint > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_endpoint > () , 40usize , concat ! ("Size of: " , stringify ! (aws_s3_endpoint))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_endpoint > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_endpoint))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client_synced_data) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint) , "::" , stringify ! (client_synced_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http_connection_manager) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint) , "::" , stringify ! (http_connection_manager))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint) , "::" , stringify ! (client))) ; } impl Default for aws_s3_endpoint { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_connection { pub endpoint : * mut aws_s3_endpoint , pub http_connection : * mut aws_http_connection , pub request : * mut aws_s3_request , pub retry_token : * mut aws_retry_token , } # [test] fn bindgen_test_layout_aws_s3_connection () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_connection > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_connection > () , 32usize , concat ! ("Size of: " , stringify ! (aws_s3_connection))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_connection > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_connection))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoint) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_connection) , "::" , stringify ! (endpoint))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http_connection) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_connection) , "::" , stringify ! (http_connection))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . request) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_connection) , "::" , stringify ! (request))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . retry_token) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_connection) , "::" , stringify ! (retry_token))) ; } impl Default for aws_s3_connection { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_s3_client_vtable { pub meta_request_factory : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client , options : * const aws_s3_meta_request_options) -> * mut aws_s3_meta_request > , pub create_connection_for_request : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client , request : * mut aws_s3_request) > , pub acquire_http_connection : :: std :: option :: Option < unsafe extern "C" fn (conn_manager : * mut aws_http_connection_manager , on_connection_acquired_callback : aws_http_connection_manager_on_connection_setup_fn , user_data : * mut :: libc :: c_void) > , pub get_host_address_count : :: std :: option :: Option < unsafe extern "C" fn (host_resolver : * mut aws_host_resolver , host_name : * const aws_string , flags : u32) -> usize > , pub schedule_process_work_synced : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client) > , pub process_work : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client) > , pub endpoint_shutdown_callback : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client) > , pub finish_destroy : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client) > , } # [test] fn bindgen_test_layout_aws_s3_client_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client_vtable > () , 64usize , concat ! ("Size of: " , stringify ! (aws_s3_client_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . meta_request_factory) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (meta_request_factory))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . create_connection_for_request) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (create_connection_for_request))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . acquire_http_connection) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (acquire_http_connection))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_host_address_count) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (get_host_address_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . schedule_process_work_synced) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (schedule_process_work_synced))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_work) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (process_work))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoint_shutdown_callback) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (endpoint_shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . finish_destroy) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (finish_destroy))) ; } # [repr (C)] pub struct aws_s3_client { pub allocator : * mut aws_allocator , pub vtable : * mut aws_s3_client_vtable , pub ref_count : aws_ref_count , pub client_bootstrap : * mut aws_client_bootstrap , pub process_work_event_loop : * mut aws_event_loop , pub body_streaming_elg : * mut aws_event_loop_group , pub region : * mut aws_string , pub part_size : usize , pub max_part_size : u64 , pub multipart_upload_threshold : u64 , pub tls_connection_options : * mut aws_tls_connection_options , pub cached_signing_config : * mut aws_cached_signing_config_aws , pub throughput_target_gbps : f64 , pub ideal_vip_count : u32 , # [doc = " For multi-part upload, content-md5 will be calculated if the AWS_MR_CONTENT_MD5_ENABLED is specified\n or initial request has content-md5 header.\n For single-part upload, if the content-md5 header is specified, it will remain unchanged. If the header is not\n specified, and this is set to AWS_MR_CONTENT_MD5_ENABLED, it will be calculated."] pub compute_content_md5 : aws_s3_meta_request_compute_content_md5 , pub max_active_connections_override : u32 , pub max_allowed_connections : aws_atomic_var , pub retry_strategy : * mut aws_retry_strategy , # [doc = " Optional.\n Proxy configuration for http connection."] pub proxy_config : * mut aws_http_proxy_config , # [doc = " Optional.\n Configuration for fetching proxy configuration from environment.\n By Default proxy_ev_settings.aws_http_proxy_env_var_type is set to AWS_HPEV_ENABLE which means read proxy\n configuration from environment.\n Only works when proxy_config is not set. If both are set, configuration from proxy_config is used."] pub proxy_ev_settings : * mut proxy_env_var_settings , # [doc = " Optional.\n If set to 0, default value is used."] pub connect_timeout_ms : u32 , # [doc = " Optional.\n Set keepalive to periodically transmit messages for detecting a disconnected peer."] pub tcp_keep_alive_options : * mut aws_s3_tcp_keep_alive_options , # [doc = " Configuration options for connection monitoring.\n If the transfer speed falls below the specified minimum_throughput_bytes_per_second, the operation is aborted.\n If user passes in NULL, default values are used."] pub monitoring_options : aws_http_connection_monitoring_options , pub proxy_ev_tls_options : * mut aws_tls_connection_options , pub shutdown_callback : aws_s3_client_shutdown_complete_callback_fn , pub shutdown_callback_user_data : * mut :: libc :: c_void , pub enable_read_backpressure : bool , pub initial_read_window : usize , pub stats : aws_s3_client__bindgen_ty_1 , pub synced_data : aws_s3_client__bindgen_ty_2 , pub threaded_data : aws_s3_client__bindgen_ty_3 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_client__bindgen_ty_1 { pub num_requests_in_flight : aws_atomic_var , pub num_requests_network_io : [aws_atomic_var ; 4usize] , pub num_requests_stream_queued_waiting : aws_atomic_var , pub num_requests_streaming_response : aws_atomic_var , } # [test] fn bindgen_test_layout_aws_s3_client__bindgen_ty_1 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client__bindgen_ty_1 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client__bindgen_ty_1 > () , 56usize , concat ! ("Size of: " , stringify ! (aws_s3_client__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client__bindgen_ty_1 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client__bindgen_ty_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_requests_in_flight) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_1) , "::" , stringify ! (num_requests_in_flight))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_requests_network_io) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_1) , "::" , stringify ! (num_requests_network_io))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_requests_stream_queued_waiting) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_1) , "::" , stringify ! (num_requests_stream_queued_waiting))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_requests_streaming_response) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_1) , "::" , stringify ! (num_requests_streaming_response))) ; } impl Default for aws_s3_client__bindgen_ty_1 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] pub struct aws_s3_client__bindgen_ty_2 { pub lock : aws_mutex , pub endpoints : aws_hash_table , pub num_failed_prepare_requests : u32 , pub pending_meta_request_work : aws_linked_list , pub prepared_requests : aws_linked_list , pub process_work_task : aws_task , pub num_endpoints_allocated : u32 , pub _bitfield_align_1 : [u8 ; 0] , pub _bitfield_1 : __BindgenBitfieldUnit < [u8 ; 1usize] > , pub __bindgen_padding_0 : [u8 ; 3usize] , } # [test] fn bindgen_test_layout_aws_s3_client__bindgen_ty_2 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client__bindgen_ty_2 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client__bindgen_ty_2 > () , 200usize , concat ! ("Size of: " , stringify ! (aws_s3_client__bindgen_ty_2))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client__bindgen_ty_2 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client__bindgen_ty_2))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . lock) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (lock))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoints) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (endpoints))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_failed_prepare_requests) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (num_failed_prepare_requests))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . pending_meta_request_work) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (pending_meta_request_work))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . prepared_requests) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (prepared_requests))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_work_task) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (process_work_task))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_endpoints_allocated) as usize - ptr as usize } , 192usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (num_endpoints_allocated))) ; } impl Default for aws_s3_client__bindgen_ty_2 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } impl aws_s3_client__bindgen_ty_2 { # [inline] pub fn active (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (0usize , 1u8) as u32) } } # [inline] pub fn set_active (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (0usize , 1u8 , val as u64) } } # [inline] pub fn start_destroy_executing (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (1usize , 1u8) as u32) } } # [inline] pub fn set_start_destroy_executing (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (1usize , 1u8 , val as u64) } } # [inline] pub fn process_work_task_scheduled (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (2usize , 1u8) as u32) } } # [inline] pub fn set_process_work_task_scheduled (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (2usize , 1u8 , val as u64) } } # [inline] pub fn process_work_task_in_progress (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (3usize , 1u8) as u32) } } # [inline] pub fn set_process_work_task_in_progress (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (3usize , 1u8 , val as u64) } } # [inline] pub fn body_streaming_elg_allocated (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (4usize , 1u8) as u32) } } # [inline] pub fn set_body_streaming_elg_allocated (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (4usize , 1u8 , val as u64) } } # [inline] pub fn finish_destroy (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (5usize , 1u8) as u32) } } # [inline] pub fn set_finish_destroy (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (5usize , 1u8 , val as u64) } } # [inline] pub fn new_bitfield_1 (active : u32 , start_destroy_executing : u32 , process_work_task_scheduled : u32 , process_work_task_in_progress : u32 , body_streaming_elg_allocated : u32 , finish_destroy : u32) -> __BindgenBitfieldUnit < [u8 ; 1usize] > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [u8 ; 1usize] > = Default :: default () ; __bindgen_bitfield_unit . set (0usize , 1u8 , { let active : u32 = unsafe { :: std :: mem :: transmute (active) } ; active as u64 }) ; __bindgen_bitfield_unit . set (1usize , 1u8 , { let start_destroy_executing : u32 = unsafe { :: std :: mem :: transmute (start_destroy_executing) } ; start_destroy_executing as u64 }) ; __bindgen_bitfield_unit . set (2usize , 1u8 , { let process_work_task_scheduled : u32 = unsafe { :: std :: mem :: transmute (process_work_task_scheduled) } ; process_work_task_scheduled as u64 }) ; __bindgen_bitfield_unit . set (3usize , 1u8 , { let process_work_task_in_progress : u32 = unsafe { :: std :: mem :: transmute (process_work_task_in_progress) } ; process_work_task_in_progress as u64 }) ; __bindgen_bitfield_unit . set (4usize , 1u8 , { let body_streaming_elg_allocated : u32 = unsafe { :: std :: mem :: transmute (body_streaming_elg_allocated) } ; body_streaming_elg_allocated as u64 }) ; __bindgen_bitfield_unit . set (5usize , 1u8 , { let finish_destroy : u32 = unsafe { :: std :: mem :: transmute (finish_destroy) } ; finish_destroy as u64 }) ; __bindgen_bitfield_unit } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_client__bindgen_ty_3 { pub request_queue : aws_linked_list , pub meta_requests : aws_linked_list , pub request_queue_size : u32 , pub num_requests_being_prepared : u32 , } # [test] fn bindgen_test_layout_aws_s3_client__bindgen_ty_3 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client__bindgen_ty_3 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client__bindgen_ty_3 > () , 72usize , concat ! ("Size of: " , stringify ! (aws_s3_client__bindgen_ty_3))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client__bindgen_ty_3 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client__bindgen_ty_3))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . request_queue) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_3) , "::" , stringify ! (request_queue))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . meta_requests) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_3) , "::" , stringify ! (meta_requests))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . request_queue_size) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_3) , "::" , stringify ! (request_queue_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_requests_being_prepared) as usize - ptr as usize } , 68usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_3) , "::" , stringify ! (num_requests_being_prepared))) ; } impl Default for aws_s3_client__bindgen_ty_3 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [test] fn bindgen_test_layout_aws_s3_client () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client > () , 584usize , concat ! ("Size of: " , stringify ! (aws_s3_client))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client_bootstrap) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (client_bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_work_event_loop) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (process_work_event_loop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . body_streaming_elg) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (body_streaming_elg))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . region) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (region))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_size) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_part_size) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (max_part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . multipart_upload_threshold) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (multipart_upload_threshold))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_connection_options) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (tls_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cached_signing_config) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (cached_signing_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . throughput_target_gbps) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (throughput_target_gbps))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ideal_vip_count) as usize - ptr as usize } , 120usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (ideal_vip_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . compute_content_md5) as usize - ptr as usize } , 124usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (compute_content_md5))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_active_connections_override) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (max_active_connections_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_allowed_connections) as usize - ptr as usize } , 136usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (max_allowed_connections))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . retry_strategy) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (retry_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_config) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (proxy_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_settings) as usize - ptr as usize } , 160usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (proxy_ev_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connect_timeout_ms) as usize - ptr as usize } , 168usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (connect_timeout_ms))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tcp_keep_alive_options) as usize - ptr as usize } , 176usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (tcp_keep_alive_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . monitoring_options) as usize - ptr as usize } , 184usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (monitoring_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_tls_options) as usize - ptr as usize } , 216usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (proxy_ev_tls_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 224usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback_user_data) as usize - ptr as usize } , 232usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (shutdown_callback_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_backpressure) as usize - ptr as usize } , 240usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (enable_read_backpressure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_read_window) as usize - ptr as usize } , 248usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (initial_read_window))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . stats) as usize - ptr as usize } , 256usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (stats))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . synced_data) as usize - ptr as usize } , 312usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (synced_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . threaded_data) as usize - ptr as usize } , 512usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (threaded_data))) ; } impl Default for aws_s3_client { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_meta_request_resume_token { pub allocator : * mut aws_allocator , pub ref_count : aws_ref_count , pub type_ : aws_s3_meta_request_type , pub multipart_upload_id : * mut aws_string , pub part_size : usize , pub total_num_parts : usize , pub num_parts_completed : usize , } # [test] fn bindgen_test_layout_aws_s3_meta_request_resume_token () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_meta_request_resume_token > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_meta_request_resume_token > () , 72usize , concat ! ("Size of: " , stringify ! (aws_s3_meta_request_resume_token))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_meta_request_resume_token > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_meta_request_resume_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . type_) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (type_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . multipart_upload_id) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (multipart_upload_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_size) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . total_num_parts) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (total_num_parts))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_parts_completed) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (num_parts_completed))) ; } impl Default for aws_s3_meta_request_resume_token { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_s3_client_notify_connection_finished (client : * mut aws_s3_client , connection : * mut aws_s3_connection , error_code : :: libc :: c_int , finish_code : aws_s3_connection_finish_code) ; } extern "C" { pub fn aws_s3_meta_request_resume_token_new (allocator : * mut aws_allocator) -> * mut aws_s3_meta_request_resume_token ; } extern "C" { pub fn aws_s3_set_dns_ttl (ttl : usize) ; } extern "C" { pub fn aws_s3_client_get_max_requests_prepare (client : * mut aws_s3_client) -> u32 ; } extern "C" { pub fn aws_s3_client_get_max_active_connections (client : * mut aws_s3_client , meta_request : * mut aws_s3_meta_request) -> u32 ; } extern "C" { pub fn aws_s3_client_get_max_requests_in_flight (client : * mut aws_s3_client) -> u32 ; } extern "C" { pub fn aws_s3_client_queue_requests_threaded (client : * mut aws_s3_client , request_list : * mut aws_linked_list , queue_front : bool) -> u32 ; } extern "C" { pub fn aws_s3_client_dequeue_request_threaded (client : * mut aws_s3_client) -> * mut aws_s3_request ; } extern "C" { pub fn aws_s3_client_schedule_process_work (client : * mut aws_s3_client) ; } extern "C" { pub fn aws_s3_client_update_meta_requests_threaded (client : * mut aws_s3_client) ; } extern "C" { pub fn aws_s3_client_update_connections_threaded (client : * mut aws_s3_client) ; } extern "C" { pub fn aws_s3_endpoint_new (allocator : * mut aws_allocator , options : * const aws_s3_endpoint_options) -> * mut aws_s3_endpoint ; } extern "C" { pub fn aws_s3_client_lock_synced_data (client : * mut aws_s3_client) ; } extern "C" { pub fn aws_s3_client_unlock_synced_data (client : * mut aws_s3_client) ; } extern "C" { pub fn aws_s3_endpoint_set_system_vtable (vtable : * const aws_s3_endpoint_system_vtable) ; } extern "C" { pub fn aws_s3_endpoint_acquire (endpoint : * mut aws_s3_endpoint , already_holding_lock : bool) -> * mut aws_s3_endpoint ; } extern "C" { pub fn aws_s3_endpoint_release (endpoint : * mut aws_s3_endpoint) ; } extern "C" { pub static g_max_num_connections_per_vip : u32 ; } extern "C" { pub static g_num_conns_per_vip_meta_request_look_up : [u32 ; 0usize] ; } pub type __builtin_va_list = [__va_list_tag ; 1usize] ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct __va_list_tag { pub gp_offset : :: libc :: c_uint , pub fp_offset : :: libc :: c_uint , pub overflow_arg_area : * mut :: libc :: c_void , pub reg_save_area : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout___va_list_tag () { const UNINIT : :: std :: mem :: MaybeUninit < __va_list_tag > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < __va_list_tag > () , 24usize , concat ! ("Size of: " , stringify ! (__va_list_tag))) ; assert_eq ! (:: std :: mem :: align_of :: < __va_list_tag > () , 8usize , concat ! ("Alignment of " , stringify ! (__va_list_tag))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . gp_offset) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (__va_list_tag) , "::" , stringify ! (gp_offset))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . fp_offset) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (__va_list_tag) , "::" , stringify ! (fp_offset))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . overflow_arg_area) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (__va_list_tag) , "::" , stringify ! (overflow_arg_area))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . reg_save_area) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (__va_list_tag) , "::" , stringify ! (reg_save_area))) ; } impl Default for __va_list_tag { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " (Optional)\n Use a cached merged profile collection. A merge collection has both config file\n (~/.aws/config) and credentials file based profile collection (~/.aws/credentials) using\n `aws_profile_collection_new_from_merge`.\n If this option is provided, `config_file_name_override` and `credentials_file_name_override` will be ignored."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_profile_collection { pub _address : u8 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_tls_ctx { pub _address : u8 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_cached_signing_config_aws { pub _address : u8 , } [INFO] [stdout] | + + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unclosed HTML tag `T` [INFO] [stdout] --> /opt/rustwide/target/debug/build/mountpoint-s3-crt-sys-f5c1badc4e97417b/out/bindings.rs:5:346649 [INFO] [stdout] | [INFO] [stdout] 5 | ... aws_future_impl { _unused : [u8 ; 0] , } # [doc = " Completion callback for aws_future"] pub type aws_future_callback_fn = :: std ... [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: try marking as source code [INFO] [stdout] | [INFO] [stdout] 5 | # [repr (C)] # [derive (Copy , Clone , Debug , Default , Eq , Hash , Ord , PartialEq , PartialOrd)] pub struct __BindgenBitfieldUnit < Storage > { storage : Storage , } impl < Storage > __BindgenBitfieldUnit < Storage > { # [inline] pub const fn new (storage : Storage) -> Self { Self { storage } } } impl < Storage > __BindgenBitfieldUnit < Storage > where Storage : AsRef < [u8] > + AsMut < [u8] >, { # [inline] pub fn get_bit (& self , index : usize) -> bool { debug_assert ! (index / 8 < self . storage . as_ref () . len ()) ; let byte_index = index / 8 ; let byte = self . storage . as_ref () [byte_index] ; let bit_index = if cfg ! (target_endian = "big") { 7 - (index % 8) } else { index % 8 } ; let mask = 1 << bit_index ; byte & mask == mask } # [inline] pub fn set_bit (& mut self , index : usize , val : bool) { debug_assert ! (index / 8 < self . storage . as_ref () . len ()) ; let byte_index = index / 8 ; let byte = & mut self . storage . as_mut () [byte_index] ; let bit_index = if cfg ! (target_endian = "big") { 7 - (index % 8) } else { index % 8 } ; let mask = 1 << bit_index ; if val { * byte |= mask ; } else { * byte &= ! mask ; } } # [inline] pub fn get (& self , bit_offset : usize , bit_width : u8) -> u64 { debug_assert ! (bit_width <= 64) ; debug_assert ! (bit_offset / 8 < self . storage . as_ref () . len ()) ; debug_assert ! ((bit_offset + (bit_width as usize)) / 8 <= self . storage . as_ref () . len ()) ; let mut val = 0 ; for i in 0 .. (bit_width as usize) { if self . get_bit (i + bit_offset) { let index = if cfg ! (target_endian = "big") { bit_width as usize - 1 - i } else { i } ; val |= 1 << index ; } } val } # [inline] pub fn set (& mut self , bit_offset : usize , bit_width : u8 , val : u64) { debug_assert ! (bit_width <= 64) ; debug_assert ! (bit_offset / 8 < self . storage . as_ref () . len ()) ; debug_assert ! ((bit_offset + (bit_width as usize)) / 8 <= self . storage . as_ref () . len ()) ; for i in 0 .. (bit_width as usize) { let mask = 1 << i ; let val_bit_is_set = val & mask == mask ; let index = if cfg ! (target_endian = "big") { bit_width as usize - 1 - i } else { i } ; self . set_bit (index + bit_offset , val_bit_is_set) ; } } } pub const PRInSTR : & [u8 ; 5] = b"%.*s\0" ; pub const AWS_PACKAGE_SLOTS : i32 = 16 ; pub const AWS_C_COMMON_PACKAGE_ID : i32 = 0 ; pub const AWS_OP_SUCCESS : i32 = 0 ; pub const AWS_OP_ERR : i32 = - 1 ; pub const AWS_ERROR_ENUM_STRIDE_BITS : i32 = 10 ; pub const AWS_ERROR_ENUM_STRIDE : i32 = 1024 ; pub const SIZE_BITS : i32 = 64 ; pub const AWS_C_IO_PACKAGE_ID : i32 = 1 ; pub const AWS_THREAD_NAME_RECOMMENDED_STRLEN : i32 = 15 ; pub const AWS_THREAD_ONCE_STATIC_INIT : i32 = 0 ; pub const AWS_LOG_LEVEL_NONE : i32 = 0 ; pub const AWS_LOG_LEVEL_FATAL : i32 = 1 ; pub const AWS_LOG_LEVEL_ERROR : i32 = 2 ; pub const AWS_LOG_LEVEL_WARN : i32 = 3 ; pub const AWS_LOG_LEVEL_INFO : i32 = 4 ; pub const AWS_LOG_LEVEL_DEBUG : i32 = 5 ; pub const AWS_LOG_LEVEL_TRACE : i32 = 6 ; pub const AWS_C_SDKUTILS_PACKAGE_ID : i32 = 15 ; pub const AWS_C_AUTH_PACKAGE_ID : i32 = 6 ; pub const AWS_C_HTTP_PACKAGE_ID : i32 = 2 ; pub const AWS_HTTP2_DEFAULT_MAX_CLOSED_STREAMS : i32 = 32 ; pub const AWS_HTTP2_PING_DATA_SIZE : i32 = 8 ; pub const AWS_HTTP2_SETTINGS_COUNT : i32 = 6 ; pub const AWS_C_S3_PACKAGE_ID : i32 = 14 ; pub const AWS_S3_CLIENT_VERSION : & [u8 ; 6] = b"0.1.x\0" ; pub const AWS_CACHE_LINE : _bindgen_ty_18 = _bindgen_ty_18 :: AWS_CACHE_LINE ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_18 { AWS_CACHE_LINE = 64 , } pub type va_list = __builtin_va_list ; pub type __gnuc_va_list = __builtin_va_list ; extern "C" { pub fn aws_fatal_assert (cond_str : * const :: libc :: c_char , file : * const :: libc :: c_char , line : :: libc :: c_int) -> ! ; } pub type pthread_once_t = :: libc :: c_int ; # [doc = " @deprecated Use int64_t instead for offsets in public APIs."] pub type aws_off_t = i64 ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_allocator { pub mem_acquire : :: std :: option :: Option < unsafe extern "C" fn (allocator : * mut aws_allocator , size : usize) -> * mut :: libc :: c_void > , pub mem_release : :: std :: option :: Option < unsafe extern "C" fn (allocator : * mut aws_allocator , ptr : * mut :: libc :: c_void) > , pub mem_realloc : :: std :: option :: Option < unsafe extern "C" fn (allocator : * mut aws_allocator , oldptr : * mut :: libc :: c_void , oldsize : usize , newsize : usize) -> * mut :: libc :: c_void > , pub mem_calloc : :: std :: option :: Option < unsafe extern "C" fn (allocator : * mut aws_allocator , num : usize , size : usize) -> * mut :: libc :: c_void > , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_allocator () { const UNINIT : :: std :: mem :: MaybeUninit < aws_allocator > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_allocator > () , 40usize , concat ! ("Size of: " , stringify ! (aws_allocator))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_allocator > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . mem_acquire) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_allocator) , "::" , stringify ! (mem_acquire))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . mem_release) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_allocator) , "::" , stringify ! (mem_release))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . mem_realloc) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_allocator) , "::" , stringify ! (mem_realloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . mem_calloc) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_allocator) , "::" , stringify ! (mem_calloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_allocator) , "::" , stringify ! (impl_))) ; } impl Default for aws_allocator { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Inexpensive (constant time) check of data-structure invariants."] pub fn aws_allocator_is_valid (alloc : * const aws_allocator) -> bool ; } extern "C" { pub fn aws_default_allocator () -> * mut aws_allocator ; } extern "C" { # [doc = " Returns at least `size` of memory ready for usage. In versions v0.6.8 and prior, this function was allowed to return\n NULL. In later versions, if allocator->mem_acquire() returns NULL, this function will assert and exit. To handle\n conditions where OOM is not a fatal error, allocator->mem_acquire() is responsible for finding/reclaiming/running a\n GC etc...before returning."] pub fn aws_mem_acquire (allocator : * mut aws_allocator , size : usize) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Allocates a block of memory for an array of num elements, each of them size bytes long, and initializes all its bits\n to zero. In versions v0.6.8 and prior, this function was allowed to return NULL.\n In later versions, if allocator->mem_calloc() returns NULL, this function will assert and exit. To handle\n conditions where OOM is not a fatal error, allocator->mem_calloc() is responsible for finding/reclaiming/running a\n GC etc...before returning."] pub fn aws_mem_calloc (allocator : * mut aws_allocator , num : usize , size : usize) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Allocates many chunks of bytes into a single block. Expects to be called with alternating void ** (dest), size_t\n (size). The first void ** will be set to the root of the allocation. Alignment is assumed to be sizeof(intmax_t).\n\n This is useful for allocating structs using the pimpl pattern, as you may allocate the public object and impl object\n in the same contiguous block of memory.\n\n Returns a pointer to the allocation.\n\n In versions v0.6.8 and prior, this function was allowed to return\n NULL. In later versions, if allocator->mem_acquire() returns NULL, this function will assert and exit. To handle\n conditions where OOM is not a fatal error, allocator->mem_acquire() is responsible for finding/reclaiming/running a\n GC etc...before returning."] pub fn aws_mem_acquire_many (allocator : * mut aws_allocator , count : usize , ...) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Releases ptr back to whatever allocated it.\n Nothing happens if ptr is NULL."] pub fn aws_mem_release (allocator : * mut aws_allocator , ptr : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Attempts to adjust the size of the pointed-to memory buffer from oldsize to\n newsize. The pointer (*ptr) may be changed if the memory needs to be\n reallocated.\n\n In versions v0.6.8 and prior, this function was allowed to return\n NULL. In later versions, if allocator->mem_realloc() returns NULL, this function will assert and exit. To handle\n conditions where OOM is not a fatal error, allocator->mem_realloc() is responsible for finding/reclaiming/running a\n GC etc...before returning."] pub fn aws_mem_realloc (allocator : * mut aws_allocator , ptr : * mut * mut :: libc :: c_void , oldsize : usize , newsize : usize) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_mem_trace_level { AWS_MEMTRACE_NONE = 0 , AWS_MEMTRACE_BYTES = 1 , AWS_MEMTRACE_STACKS = 2 , } extern "C" { pub fn aws_mem_tracer_new (allocator : * mut aws_allocator , deprecated : * mut aws_allocator , level : aws_mem_trace_level , frames_per_stack : usize) -> * mut aws_allocator ; } extern "C" { pub fn aws_mem_tracer_destroy (trace_allocator : * mut aws_allocator) -> * mut aws_allocator ; } extern "C" { pub fn aws_mem_tracer_dump (trace_allocator : * mut aws_allocator) ; } extern "C" { pub fn aws_mem_tracer_bytes (trace_allocator : * mut aws_allocator) -> usize ; } extern "C" { pub fn aws_mem_tracer_count (trace_allocator : * mut aws_allocator) -> usize ; } extern "C" { pub fn aws_small_block_allocator_new (allocator : * mut aws_allocator , multi_threaded : bool) -> * mut aws_allocator ; } extern "C" { pub fn aws_small_block_allocator_destroy (sba_allocator : * mut aws_allocator) ; } extern "C" { pub fn aws_small_block_allocator_bytes_active (sba_allocator : * mut aws_allocator) -> usize ; } extern "C" { pub fn aws_small_block_allocator_bytes_reserved (sba_allocator : * mut aws_allocator) -> usize ; } extern "C" { pub fn aws_small_block_allocator_page_size (sba_allocator : * mut aws_allocator) -> usize ; } extern "C" { pub fn aws_small_block_allocator_page_size_available (sba_allocator : * mut aws_allocator) -> usize ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_error_info { pub error_code : :: libc :: c_int , pub literal_name : * const :: libc :: c_char , pub error_str : * const :: libc :: c_char , pub lib_name : * const :: libc :: c_char , pub formatted_name : * const :: libc :: c_char , } # [test] fn bindgen_test_layout_aws_error_info () { const UNINIT : :: std :: mem :: MaybeUninit < aws_error_info > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_error_info > () , 40usize , concat ! ("Size of: " , stringify ! (aws_error_info))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_error_info > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_error_info))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_code) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_error_info) , "::" , stringify ! (error_code))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . literal_name) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_error_info) , "::" , stringify ! (literal_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_str) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_error_info) , "::" , stringify ! (error_str))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . lib_name) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_error_info) , "::" , stringify ! (lib_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . formatted_name) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_error_info) , "::" , stringify ! (formatted_name))) ; } impl Default for aws_error_info { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_error_info_list { pub error_list : * const aws_error_info , pub count : u16 , } # [test] fn bindgen_test_layout_aws_error_info_list () { const UNINIT : :: std :: mem :: MaybeUninit < aws_error_info_list > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_error_info_list > () , 16usize , concat ! ("Size of: " , stringify ! (aws_error_info_list))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_error_info_list > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_error_info_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_list) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_error_info_list) , "::" , stringify ! (error_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . count) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_error_info_list) , "::" , stringify ! (count))) ; } impl Default for aws_error_info_list { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_error_handler_fn = :: std :: option :: Option < unsafe extern "C" fn (err : :: libc :: c_int , ctx : * mut :: libc :: c_void) > ; extern "C" { pub fn aws_last_error () -> :: libc :: c_int ; } extern "C" { pub fn aws_error_str (err : :: libc :: c_int) -> * const :: libc :: c_char ; } extern "C" { pub fn aws_error_name (err : :: libc :: c_int) -> * const :: libc :: c_char ; } extern "C" { pub fn aws_error_lib_name (err : :: libc :: c_int) -> * const :: libc :: c_char ; } extern "C" { pub fn aws_error_debug_str (err : :: libc :: c_int) -> * const :: libc :: c_char ; } extern "C" { pub fn aws_raise_error_private (err : :: libc :: c_int) ; } extern "C" { pub fn aws_raise_error (err : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { pub fn aws_reset_error () ; } extern "C" { pub fn aws_restore_error (err : :: libc :: c_int) ; } extern "C" { pub fn aws_set_global_error_handler_fn (handler : aws_error_handler_fn , ctx : * mut :: libc :: c_void) -> aws_error_handler_fn ; } extern "C" { pub fn aws_set_thread_local_error_handler_fn (handler : aws_error_handler_fn , ctx : * mut :: libc :: c_void) -> aws_error_handler_fn ; } extern "C" { # [doc = " TODO: this needs to be a private function (wait till we have the cmake story\n better before moving it though). It should be external for the purpose of\n other libs we own, but customers should not be able to hit it without going\n out of their way to do so."] pub fn aws_register_error_info (error_info : * const aws_error_info_list) ; } extern "C" { pub fn aws_unregister_error_info (error_info : * const aws_error_info_list) ; } extern "C" { # [doc = " Convert a c library io error into an aws error, and raise it.\n If no conversion is found, AWS_ERROR_SYS_CALL_FAILURE is raised.\n Always returns AWS_OP_ERR."] pub fn aws_translate_and_raise_io_error (error_no : :: libc :: c_int) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_common_error { AWS_ERROR_SUCCESS = 0 , AWS_ERROR_OOM = 1 , AWS_ERROR_NO_SPACE = 2 , AWS_ERROR_UNKNOWN = 3 , AWS_ERROR_SHORT_BUFFER = 4 , AWS_ERROR_OVERFLOW_DETECTED = 5 , AWS_ERROR_UNSUPPORTED_OPERATION = 6 , AWS_ERROR_INVALID_BUFFER_SIZE = 7 , AWS_ERROR_INVALID_HEX_STR = 8 , AWS_ERROR_INVALID_BASE64_STR = 9 , AWS_ERROR_INVALID_INDEX = 10 , AWS_ERROR_THREAD_INVALID_SETTINGS = 11 , AWS_ERROR_THREAD_INSUFFICIENT_RESOURCE = 12 , AWS_ERROR_THREAD_NO_PERMISSIONS = 13 , AWS_ERROR_THREAD_NOT_JOINABLE = 14 , AWS_ERROR_THREAD_NO_SUCH_THREAD_ID = 15 , AWS_ERROR_THREAD_DEADLOCK_DETECTED = 16 , AWS_ERROR_MUTEX_NOT_INIT = 17 , AWS_ERROR_MUTEX_TIMEOUT = 18 , AWS_ERROR_MUTEX_CALLER_NOT_OWNER = 19 , AWS_ERROR_MUTEX_FAILED = 20 , AWS_ERROR_COND_VARIABLE_INIT_FAILED = 21 , AWS_ERROR_COND_VARIABLE_TIMED_OUT = 22 , AWS_ERROR_COND_VARIABLE_ERROR_UNKNOWN = 23 , AWS_ERROR_CLOCK_FAILURE = 24 , AWS_ERROR_LIST_EMPTY = 25 , AWS_ERROR_DEST_COPY_TOO_SMALL = 26 , AWS_ERROR_LIST_EXCEEDS_MAX_SIZE = 27 , AWS_ERROR_LIST_STATIC_MODE_CANT_SHRINK = 28 , AWS_ERROR_PRIORITY_QUEUE_FULL = 29 , AWS_ERROR_PRIORITY_QUEUE_EMPTY = 30 , AWS_ERROR_PRIORITY_QUEUE_BAD_NODE = 31 , AWS_ERROR_HASHTBL_ITEM_NOT_FOUND = 32 , AWS_ERROR_INVALID_DATE_STR = 33 , AWS_ERROR_INVALID_ARGUMENT = 34 , AWS_ERROR_RANDOM_GEN_FAILED = 35 , AWS_ERROR_MALFORMED_INPUT_STRING = 36 , AWS_ERROR_UNIMPLEMENTED = 37 , AWS_ERROR_INVALID_STATE = 38 , AWS_ERROR_ENVIRONMENT_GET = 39 , AWS_ERROR_ENVIRONMENT_SET = 40 , AWS_ERROR_ENVIRONMENT_UNSET = 41 , AWS_ERROR_STREAM_UNSEEKABLE = 42 , AWS_ERROR_NO_PERMISSION = 43 , AWS_ERROR_FILE_INVALID_PATH = 44 , AWS_ERROR_MAX_FDS_EXCEEDED = 45 , AWS_ERROR_SYS_CALL_FAILURE = 46 , AWS_ERROR_C_STRING_BUFFER_NOT_NULL_TERMINATED = 47 , AWS_ERROR_STRING_MATCH_NOT_FOUND = 48 , AWS_ERROR_DIVIDE_BY_ZERO = 49 , AWS_ERROR_INVALID_FILE_HANDLE = 50 , AWS_ERROR_OPERATION_INTERUPTED = 51 , AWS_ERROR_DIRECTORY_NOT_EMPTY = 52 , AWS_ERROR_PLATFORM_NOT_SUPPORTED = 53 , AWS_ERROR_INVALID_UTF8 = 54 , AWS_ERROR_GET_HOME_DIRECTORY_FAILED = 55 , AWS_ERROR_INVALID_XML = 56 , AWS_ERROR_END_COMMON_RANGE = 1023 , } extern "C" { # [doc = " Returns whether each byte is zero."] pub fn aws_is_mem_zeroed (buf : * const :: libc :: c_void , bufsize : usize) -> bool ; } extern "C" { # [doc = " Securely zeroes a memory buffer. This function will attempt to ensure that\n the compiler will not optimize away this zeroing operation."] pub fn aws_secure_zero (pBuf : * mut :: libc :: c_void , bufsize : usize) ; } extern "C" { # [doc = " Initializes internal data structures used by aws-c-common.\n Must be called before using any functionality in aws-c-common."] pub fn aws_common_library_init (allocator : * mut aws_allocator) ; } extern "C" { # [doc = " Shuts down the internal data structures used by aws-c-common."] pub fn aws_common_library_clean_up () ; } extern "C" { pub fn aws_common_fatal_assert_library_initialized () ; } extern "C" { # [doc = " Multiplies a * b. If the result overflows, returns 2^64 - 1."] pub fn aws_mul_u64_saturating (a : u64 , b : u64) -> u64 ; } extern "C" { # [doc = " If a * b overflows, returns AWS_OP_ERR; otherwise multiplies\n a * b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_mul_u64_checked (a : u64 , b : u64 , r : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Multiplies a * b. If the result overflows, returns 2^32 - 1."] pub fn aws_mul_u32_saturating (a : u32 , b : u32) -> u32 ; } extern "C" { # [doc = " If a * b overflows, returns AWS_OP_ERR; otherwise multiplies\n a * b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_mul_u32_checked (a : u32 , b : u32 , r : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Adds a + b. If the result overflows returns 2^64 - 1."] pub fn aws_add_u64_saturating (a : u64 , b : u64) -> u64 ; } extern "C" { # [doc = " If a + b overflows, returns AWS_OP_ERR; otherwise adds\n a + b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_add_u64_checked (a : u64 , b : u64 , r : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Adds a + b. If the result overflows returns 2^32 - 1."] pub fn aws_add_u32_saturating (a : u32 , b : u32) -> u32 ; } extern "C" { # [doc = " If a + b overflows, returns AWS_OP_ERR; otherwise adds\n a + b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_add_u32_checked (a : u32 , b : u32 , r : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Subtracts a - b. If the result overflows returns 0."] pub fn aws_sub_u64_saturating (a : u64 , b : u64) -> u64 ; } extern "C" { # [doc = " If a - b overflows, returns AWS_OP_ERR; otherwise subtracts\n a - b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_sub_u64_checked (a : u64 , b : u64 , r : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Subtracts a - b. If the result overflows returns 0."] pub fn aws_sub_u32_saturating (a : u32 , b : u32) -> u32 ; } extern "C" { # [doc = " If a - b overflows, returns AWS_OP_ERR; otherwise subtracts\n a - b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_sub_u32_checked (a : u32 , b : u32 , r : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Multiplies a * b. If the result overflows, returns SIZE_MAX."] pub fn aws_mul_size_saturating (a : usize , b : usize) -> usize ; } extern "C" { # [doc = " Multiplies a * b and returns the result in *r. If the result\n overflows, returns AWS_OP_ERR; otherwise returns AWS_OP_SUCCESS."] pub fn aws_mul_size_checked (a : usize , b : usize , r : * mut usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Adds a + b. If the result overflows returns SIZE_MAX."] pub fn aws_add_size_saturating (a : usize , b : usize) -> usize ; } extern "C" { # [doc = " Adds a + b and returns the result in *r. If the result\n overflows, returns AWS_OP_ERR; otherwise returns AWS_OP_SUCCESS."] pub fn aws_add_size_checked (a : usize , b : usize , r : * mut usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Adds [num] arguments (expected to be of size_t), and returns the result in *r.\n If the result overflows, returns AWS_OP_ERR; otherwise returns AWS_OP_SUCCESS."] pub fn aws_add_size_checked_varargs (num : usize , r : * mut usize , ...) -> :: libc :: c_int ; } extern "C" { # [doc = " Subtracts a - b. If the result overflows returns 0."] pub fn aws_sub_size_saturating (a : usize , b : usize) -> usize ; } extern "C" { # [doc = " If a - b overflows, returns AWS_OP_ERR; otherwise subtracts\n a - b, returns the result in *r, and returns AWS_OP_SUCCESS."] pub fn aws_sub_size_checked (a : usize , b : usize , r : * mut usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Function to check if x is power of 2"] pub fn aws_is_power_of_two (x : usize) -> bool ; } extern "C" { # [doc = " Function to find the smallest result that is power of 2 >= n. Returns AWS_OP_ERR if this cannot\n be done without overflow"] pub fn aws_round_up_to_power_of_two (n : usize , result : * mut usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Counts the number of leading 0 bits in an integer. 0 will return the size of the integer in bits."] pub fn aws_clz_u32 (n : u32) -> usize ; } extern "C" { pub fn aws_clz_i32 (n : i32) -> usize ; } extern "C" { pub fn aws_clz_u64 (n : u64) -> usize ; } extern "C" { pub fn aws_clz_i64 (n : i64) -> usize ; } extern "C" { pub fn aws_clz_size (n : usize) -> usize ; } extern "C" { # [doc = " Counts the number of trailing 0 bits in an integer. 0 will return the size of the integer in bits."] pub fn aws_ctz_u32 (n : u32) -> usize ; } extern "C" { pub fn aws_ctz_i32 (n : i32) -> usize ; } extern "C" { pub fn aws_ctz_u64 (n : u64) -> usize ; } extern "C" { pub fn aws_ctz_i64 (n : i64) -> usize ; } extern "C" { pub fn aws_ctz_size (n : usize) -> usize ; } extern "C" { pub fn aws_min_u8 (a : u8 , b : u8) -> u8 ; } extern "C" { pub fn aws_max_u8 (a : u8 , b : u8) -> u8 ; } extern "C" { pub fn aws_min_i8 (a : i8 , b : i8) -> i8 ; } extern "C" { pub fn aws_max_i8 (a : i8 , b : i8) -> i8 ; } extern "C" { pub fn aws_min_u16 (a : u16 , b : u16) -> u16 ; } extern "C" { pub fn aws_max_u16 (a : u16 , b : u16) -> u16 ; } extern "C" { pub fn aws_min_i16 (a : i16 , b : i16) -> i16 ; } extern "C" { pub fn aws_max_i16 (a : i16 , b : i16) -> i16 ; } extern "C" { pub fn aws_min_u32 (a : u32 , b : u32) -> u32 ; } extern "C" { pub fn aws_max_u32 (a : u32 , b : u32) -> u32 ; } extern "C" { pub fn aws_min_i32 (a : i32 , b : i32) -> i32 ; } extern "C" { pub fn aws_max_i32 (a : i32 , b : i32) -> i32 ; } extern "C" { pub fn aws_min_u64 (a : u64 , b : u64) -> u64 ; } extern "C" { pub fn aws_max_u64 (a : u64 , b : u64) -> u64 ; } extern "C" { pub fn aws_min_i64 (a : i64 , b : i64) -> i64 ; } extern "C" { pub fn aws_max_i64 (a : i64 , b : i64) -> i64 ; } extern "C" { pub fn aws_min_size (a : usize , b : usize) -> usize ; } extern "C" { pub fn aws_max_size (a : usize , b : usize) -> usize ; } extern "C" { pub fn aws_min_int (a : :: libc :: c_int , b : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { pub fn aws_max_int (a : :: libc :: c_int , b : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { pub fn aws_min_float (a : f32 , b : f32) -> f32 ; } extern "C" { pub fn aws_max_float (a : f32 , b : f32) -> f32 ; } extern "C" { pub fn aws_min_double (a : f64 , b : f64) -> f64 ; } extern "C" { pub fn aws_max_double (a : f64 , b : f64) -> f64 ; } pub const AWS_ARRAY_LIST_DEBUG_FILL : _bindgen_ty_19 = _bindgen_ty_19 :: AWS_ARRAY_LIST_DEBUG_FILL ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_19 { AWS_ARRAY_LIST_DEBUG_FILL = 221 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_array_list { pub alloc : * mut aws_allocator , pub current_size : usize , pub length : usize , pub item_size : usize , pub data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_array_list () { const UNINIT : :: std :: mem :: MaybeUninit < aws_array_list > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_array_list > () , 40usize , concat ! ("Size of: " , stringify ! (aws_array_list))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_array_list > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_array_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_array_list) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . current_size) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_array_list) , "::" , stringify ! (current_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . length) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_array_list) , "::" , stringify ! (length))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . item_size) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_array_list) , "::" , stringify ! (item_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . data) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_array_list) , "::" , stringify ! (data))) ; } impl Default for aws_array_list { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Prototype for a comparator function for sorting elements.\n\n a and b should be cast to pointers to the element type held in the list\n before being dereferenced. The function should compare the elements and\n return a positive number if a > b, zero if a = b, and a negative number\n if a < b."] pub type aws_array_list_comparator_fn = :: std :: option :: Option < unsafe extern "C" fn (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> :: libc :: c_int > ; extern "C" { # [doc = " Initializes an array list with an array of size initial_item_allocation * item_size. In this mode, the array size\n will grow by a factor of 2 upon insertion if space is not available. initial_item_allocation is the number of\n elements you want space allocated for. item_size is the size of each element in bytes. Mixing items types is not\n supported by this API."] pub fn aws_array_list_init_dynamic (list : * mut aws_array_list , alloc : * mut aws_allocator , initial_item_allocation : usize , item_size : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Initializes an array list with a preallocated array of void *. item_count is the number of elements in the array,\n and item_size is the size in bytes of each element. Mixing items types is not supported\n by this API. Once this list is full, new items will be rejected."] pub fn aws_array_list_init_static (list : * mut aws_array_list , raw_array : * mut :: libc :: c_void , item_count : usize , item_size : usize) ; } extern "C" { # [doc = " Initializes an array list with a preallocated array of *already-initialized* elements. item_count is the number of\n elements in the array, and item_size is the size in bytes of each element.\n\n Once initialized, nothing further can be added to the list, since it will be full and cannot resize.\n\n Primary use case is to treat an already-initialized C array as an array list."] pub fn aws_array_list_init_static_from_initialized (list : * mut aws_array_list , raw_array : * mut :: libc :: c_void , item_count : usize , item_size : usize) ; } extern "C" { # [doc = " Set of properties of a valid aws_array_list."] pub fn aws_array_list_is_valid (list : * const aws_array_list) -> bool ; } extern "C" { # [doc = " Deallocates any memory that was allocated for this list, and resets list for reuse or deletion."] pub fn aws_array_list_clean_up (list : * mut aws_array_list) ; } extern "C" { # [doc = " Erases and then deallocates any memory that was allocated for this list, and resets list for reuse or deletion."] pub fn aws_array_list_clean_up_secure (list : * mut aws_array_list) ; } extern "C" { # [doc = " Pushes the memory pointed to by val onto the end of internal list"] pub fn aws_array_list_push_back (list : * mut aws_array_list , val : * const :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the element at the front of the list if it exists. If list is empty, AWS_ERROR_LIST_EMPTY will be raised"] pub fn aws_array_list_front (list : * const aws_array_list , val : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Pushes the memory pointed to by val onto the front of internal list.\n This call results in shifting all of the elements in the list. Avoid this call unless that\n is intended behavior."] pub fn aws_array_list_push_front (list : * mut aws_array_list , val : * const :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Deletes the element at the front of the list if it exists. If list is empty, AWS_ERROR_LIST_EMPTY will be raised.\n This call results in shifting all of the elements at the end of the array to the front. Avoid this call unless that\n is intended behavior."] pub fn aws_array_list_pop_front (list : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Delete N elements from the front of the list.\n Remaining elements are shifted to the front of the list.\n If the list has less than N elements, the list is cleared.\n This call is more efficient than calling aws_array_list_pop_front() N times."] pub fn aws_array_list_pop_front_n (list : * mut aws_array_list , n : usize) ; } extern "C" { # [doc = " Deletes the element this index in the list if it exists.\n If element does not exist, AWS_ERROR_INVALID_INDEX will be raised.\n This call results in shifting all remaining elements towards the front.\n Avoid this call unless that is intended behavior."] pub fn aws_array_list_erase (list : * mut aws_array_list , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the element at the end of the list if it exists. If list is empty, AWS_ERROR_LIST_EMPTY will be raised."] pub fn aws_array_list_back (list : * const aws_array_list , val : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Deletes the element at the end of the list if it exists. If list is empty, AWS_ERROR_LIST_EMPTY will be raised."] pub fn aws_array_list_pop_back (list : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Clears all elements in the array and resets length to zero. Size does not change in this operation."] pub fn aws_array_list_clear (list : * mut aws_array_list) ; } extern "C" { # [doc = " If in dynamic mode, shrinks the allocated array size to the minimum amount necessary to store its elements."] pub fn aws_array_list_shrink_to_fit (list : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the elements from from to to. If to is in static mode, it must at least be the same length as from. Any data\n in to will be overwritten in this copy."] pub fn aws_array_list_copy (from : * const aws_array_list , to : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Swap contents between two dynamic lists. Both lists must use the same allocator."] pub fn aws_array_list_swap_contents (list_a : * mut aws_array_list , list_b : * mut aws_array_list) ; } extern "C" { # [doc = " Returns the number of elements that can fit in the internal array. If list is initialized in dynamic mode,\n the capacity changes over time."] pub fn aws_array_list_capacity (list : * const aws_array_list) -> usize ; } extern "C" { # [doc = " Returns the number of elements in the internal array."] pub fn aws_array_list_length (list : * const aws_array_list) -> usize ; } extern "C" { # [doc = " Copies the memory at index to val. If element does not exist, AWS_ERROR_INVALID_INDEX will be raised."] pub fn aws_array_list_get_at (list : * const aws_array_list , val : * mut :: libc :: c_void , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the memory address of the element at index to *val. If element does not exist, AWS_ERROR_INVALID_INDEX will be\n raised."] pub fn aws_array_list_get_at_ptr (list : * const aws_array_list , val : * mut * mut :: libc :: c_void , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Ensures that the array list has enough capacity to store a value at the specified index. If there is not already\n enough capacity, and the list is in dynamic mode, this function will attempt to allocate more memory, expanding the\n list. In static mode, if 'index' is beyond the maximum index, AWS_ERROR_INVALID_INDEX will be raised."] pub fn aws_array_list_ensure_capacity (list : * mut aws_array_list , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the the memory pointed to by val into the array at index. If in dynamic mode, the size will grow by a factor\n of two when the array is full. In static mode, AWS_ERROR_INVALID_INDEX will be raised if the index is past the bounds\n of the array."] pub fn aws_array_list_set_at (list : * mut aws_array_list , val : * const :: libc :: c_void , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Swap elements at the specified indices, which must be within the bounds of the array."] pub fn aws_array_list_swap (list : * mut aws_array_list , a : usize , b : usize) ; } extern "C" { # [doc = " Sort elements in the list in-place according to the comparator function."] pub fn aws_array_list_sort (list : * mut aws_array_list , compare_fn : aws_array_list_comparator_fn) ; } extern "C" { # [doc = " Returns 1 if machine is big endian, 0 if little endian.\n If you compile with even -O1 optimization, this check is completely optimized\n out at compile time and code which calls \"if (aws_is_big_endian())\" will do\n the right thing without branching."] pub fn aws_is_big_endian () -> :: libc :: c_int ; } extern "C" { # [doc = " Convert 64 bit integer from host to network byte order."] pub fn aws_hton64 (x : u64) -> u64 ; } extern "C" { # [doc = " Convert 64 bit integer from network to host byte order."] pub fn aws_ntoh64 (x : u64) -> u64 ; } extern "C" { # [doc = " Convert 32 bit integer from host to network byte order."] pub fn aws_hton32 (x : u32) -> u32 ; } extern "C" { # [doc = " Convert 32 bit float from host to network byte order."] pub fn aws_htonf32 (x : f32) -> f32 ; } extern "C" { # [doc = " Convert 64 bit double from host to network byte order."] pub fn aws_htonf64 (x : f64) -> f64 ; } extern "C" { # [doc = " Convert 32 bit integer from network to host byte order."] pub fn aws_ntoh32 (x : u32) -> u32 ; } extern "C" { # [doc = " Convert 32 bit float from network to host byte order."] pub fn aws_ntohf32 (x : f32) -> f32 ; } extern "C" { # [doc = " Convert 32 bit float from network to host byte order."] pub fn aws_ntohf64 (x : f64) -> f64 ; } extern "C" { # [doc = " Convert 16 bit integer from host to network byte order."] pub fn aws_hton16 (x : u16) -> u16 ; } extern "C" { # [doc = " Convert 16 bit integer from network to host byte order."] pub fn aws_ntoh16 (x : u16) -> u16 ; } # [doc = " Represents a length-delimited binary string or buffer. If byte buffer points\n to constant memory or memory that should otherwise not be freed by this\n struct, set allocator to NULL and free function will be a no-op.\n\n This structure used to define the output for all functions that write to a buffer.\n\n Note that this structure allocates memory at the buffer pointer only. The\n struct itself does not get dynamically allocated and must be either\n maintained or copied to avoid losing access to the memory."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_byte_buf { pub len : usize , pub buffer : * mut u8 , pub capacity : usize , pub allocator : * mut aws_allocator , } # [test] fn bindgen_test_layout_aws_byte_buf () { const UNINIT : :: std :: mem :: MaybeUninit < aws_byte_buf > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_byte_buf > () , 32usize , concat ! ("Size of: " , stringify ! (aws_byte_buf))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_byte_buf > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_byte_buf))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . len) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_byte_buf) , "::" , stringify ! (len))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . buffer) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_byte_buf) , "::" , stringify ! (buffer))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . capacity) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_byte_buf) , "::" , stringify ! (capacity))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_byte_buf) , "::" , stringify ! (allocator))) ; } impl Default for aws_byte_buf { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Represents a movable pointer within a larger binary string or buffer.\n\n This structure is used to define buffers for reading."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_byte_cursor { pub len : usize , pub ptr : * mut u8 , } # [test] fn bindgen_test_layout_aws_byte_cursor () { const UNINIT : :: std :: mem :: MaybeUninit < aws_byte_cursor > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_byte_cursor > () , 16usize , concat ! ("Size of: " , stringify ! (aws_byte_cursor))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_byte_cursor > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_byte_cursor))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . len) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_byte_cursor) , "::" , stringify ! (len))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ptr) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_byte_cursor) , "::" , stringify ! (ptr))) ; } impl Default for aws_byte_cursor { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Signature for function argument to trim APIs"] pub type aws_byte_predicate_fn = :: std :: option :: Option < unsafe extern "C" fn (value : u8) -> bool > ; extern "C" { # [doc = " Compare two arrays.\n Return whether their contents are equivalent.\n NULL may be passed as the array pointer if its length is declared to be 0."] pub fn aws_array_eq (array_a : * const :: libc :: c_void , len_a : usize , array_b : * const :: libc :: c_void , len_b : usize) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of two arrays.\n Return whether their contents are equivalent.\n NULL may be passed as the array pointer if its length is declared to be 0.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_array_eq_ignore_case (array_a : * const :: libc :: c_void , len_a : usize , array_b : * const :: libc :: c_void , len_b : usize) -> bool ; } extern "C" { # [doc = " Compare an array and a null-terminated string.\n Returns true if their contents are equivalent.\n The array should NOT contain a null-terminator, or the comparison will always return false.\n NULL may be passed as the array pointer if its length is declared to be 0."] pub fn aws_array_eq_c_str (array : * const :: libc :: c_void , array_len : usize , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of an array and a null-terminated string.\n Return whether their contents are equivalent.\n The array should NOT contain a null-terminator, or the comparison will always return false.\n NULL may be passed as the array pointer if its length is declared to be 0.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_array_eq_c_str_ignore_case (array : * const :: libc :: c_void , array_len : usize , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { pub fn aws_byte_buf_init (buf : * mut aws_byte_buf , allocator : * mut aws_allocator , capacity : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Initializes an aws_byte_buf structure base on another valid one.\n Requires: *src and *allocator are valid objects.\n Ensures: *dest is a valid aws_byte_buf with a new backing array dest->buffer\n which is a copy of the elements from src->buffer."] pub fn aws_byte_buf_init_copy (dest : * mut aws_byte_buf , allocator : * mut aws_allocator , src : * const aws_byte_buf) -> :: libc :: c_int ; } extern "C" { # [doc = " Reads 'filename' into 'out_buf'. If successful, 'out_buf' is allocated and filled with the data;\n It is your responsibility to call 'aws_byte_buf_clean_up()' on it. Otherwise, 'out_buf' remains\n unused. In the very unfortunate case where some API needs to treat out_buf as a c_string, a null terminator\n is appended, but is not included as part of the length field."] pub fn aws_byte_buf_init_from_file (out_buf : * mut aws_byte_buf , alloc : * mut aws_allocator , filename : * const :: libc :: c_char) -> :: libc :: c_int ; } extern "C" { # [doc = " Evaluates the set of properties that define the shape of all valid aws_byte_buf structures.\n It is also a cheap check, in the sense it run in constant time (i.e., no loops or recursion)."] pub fn aws_byte_buf_is_valid (buf : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Evaluates the set of properties that define the shape of all valid aws_byte_cursor structures.\n It is also a cheap check, in the sense it runs in constant time (i.e., no loops or recursion)."] pub fn aws_byte_cursor_is_valid (cursor : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Copies src buffer into dest and sets the correct len and capacity.\n A new memory zone is allocated for dest->buffer. When dest is no longer needed it will have to be cleaned-up using\n aws_byte_buf_clean_up(dest).\n Dest capacity and len will be equal to the src len. Allocator of the dest will be identical with parameter allocator.\n If src buffer is null the dest will have a null buffer with a len and a capacity of 0\n Returns AWS_OP_SUCCESS in case of success or AWS_OP_ERR when memory can't be allocated."] pub fn aws_byte_buf_init_copy_from_cursor (dest : * mut aws_byte_buf , allocator : * mut aws_allocator , src : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Init buffer with contents of multiple cursors, and update cursors to reference the memory stored in the buffer.\n Each cursor arg must be an `struct aws_byte_cursor *`. NULL must be passed as the final arg.\n NOTE: Do not append/grow/resize buffers initialized this way, or the cursors will end up referencing invalid memory.\n Returns AWS_OP_SUCCESS in case of success.\n AWS_OP_ERR is returned if memory can't be allocated or the total cursor length exceeds SIZE_MAX."] pub fn aws_byte_buf_init_cache_and_update_cursors (dest : * mut aws_byte_buf , allocator : * mut aws_allocator , ...) -> :: libc :: c_int ; } extern "C" { pub fn aws_byte_buf_clean_up (buf : * mut aws_byte_buf) ; } extern "C" { # [doc = " Equivalent to calling aws_byte_buf_secure_zero and then aws_byte_buf_clean_up\n on the buffer."] pub fn aws_byte_buf_clean_up_secure (buf : * mut aws_byte_buf) ; } extern "C" { # [doc = " Resets the len of the buffer to 0, but does not free the memory. The buffer can then be reused.\n Optionally zeroes the contents, if the \"zero_contents\" flag is true."] pub fn aws_byte_buf_reset (buf : * mut aws_byte_buf , zero_contents : bool) ; } extern "C" { # [doc = " Sets all bytes of buffer to zero and resets len to zero."] pub fn aws_byte_buf_secure_zero (buf : * mut aws_byte_buf) ; } extern "C" { # [doc = " Compare two aws_byte_buf structures.\n Return whether their contents are equivalent."] pub fn aws_byte_buf_eq (a : * const aws_byte_buf , b : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of two aws_byte_buf structures.\n Return whether their contents are equivalent.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_buf_eq_ignore_case (a : * const aws_byte_buf , b : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Compare an aws_byte_buf and a null-terminated string.\n Returns true if their contents are equivalent.\n The buffer should NOT contain a null-terminator, or the comparison will always return false."] pub fn aws_byte_buf_eq_c_str (buf : * const aws_byte_buf , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of an aws_byte_buf and a null-terminated string.\n Return whether their contents are equivalent.\n The buffer should NOT contain a null-terminator, or the comparison will always return false.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_buf_eq_c_str_ignore_case (buf : * const aws_byte_buf , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " No copies, no buffer allocations. Iterates over input_str, and returns the\n next substring between split_on instances relative to previous substr.\n Behaves similar to strtok with substr being used as state for next split.\n\n Returns true each time substr is set and false when there is no more splits\n (substr is set to empty in that case).\n\n Example usage.\n struct aws_byte_cursor substr = {0};\n while (aws_byte_cursor_next_split(&input_str, ';', &substr)) {\n // ...use substr...\n }\n\n Note: It is the user's responsibility zero-initialize substr before the first call.\n\n Edge case rules are as follows:\n empty input will have single empty split. ex. \"\" splits into \"\"\n if input starts with split_on then first split is empty. ex \";A\" splits into \"\", \"A\"\n adjacent split tokens result in empty split. ex \"A;;B\" splits into \"A\", \"\", \"B\"\n If the input ends with split_on, last split is empty. ex. \"A;\" splits into \"A\", \"\"\n\n It is the user's responsibility to make sure the input buffer stays in memory\n long enough to use the results."] pub fn aws_byte_cursor_next_split (input_str : * const aws_byte_cursor , split_on : :: libc :: c_char , substr : * mut aws_byte_cursor) -> bool ; } extern "C" { # [doc = " No copies, no buffer allocations. Fills in output with a list of\n aws_byte_cursor instances where buffer is an offset into the input_str and\n len is the length of that string in the original buffer.\n\n Edge case rules are as follows:\n if the input begins with split_on, an empty cursor will be the first entry in\n output. if the input has two adjacent split_on tokens, an empty cursor will\n be inserted into the output. if the input ends with split_on, an empty cursor\n will be appended to the output.\n\n It is the user's responsibility to properly initialize output. Recommended number of preallocated elements from\n output is your most likely guess for the upper bound of the number of elements resulting from the split.\n\n The type that will be stored in output is struct aws_byte_cursor (you'll need\n this for the item size param).\n\n It is the user's responsibility to make sure the input buffer stays in memory\n long enough to use the results."] pub fn aws_byte_cursor_split_on_char (input_str : * const aws_byte_cursor , split_on : :: libc :: c_char , output : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " No copies, no buffer allocations. Fills in output with a list of aws_byte_cursor instances where buffer is\n an offset into the input_str and len is the length of that string in the original buffer. N is the max number of\n splits, if this value is zero, it will add all splits to the output.\n\n Edge case rules are as follows:\n if the input begins with split_on, an empty cursor will be the first entry in output\n if the input has two adjacent split_on tokens, an empty cursor will be inserted into the output.\n if the input ends with split_on, an empty cursor will be appended to the output.\n\n It is the user's responsibility to properly initialize output. Recommended number of preallocated elements from\n output is your most likely guess for the upper bound of the number of elements resulting from the split.\n\n If the output array is not large enough, input_str will be updated to point to the first character after the last\n processed split_on instance.\n\n The type that will be stored in output is struct aws_byte_cursor (you'll need this for the item size param).\n\n It is the user's responsibility to make sure the input buffer stays in memory long enough to use the results."] pub fn aws_byte_cursor_split_on_char_n (input_str : * const aws_byte_cursor , split_on : :: libc :: c_char , n : usize , output : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Search for an exact byte match inside a cursor. The first match will be returned. Returns AWS_OP_SUCCESS\n on successful match and first_find will be set to the offset in input_str, and length will be the remaining length\n from input_str past the returned offset. If the match was not found, AWS_OP_ERR will be returned and\n AWS_ERROR_STRING_MATCH_NOT_FOUND will be raised."] pub fn aws_byte_cursor_find_exact (input_str : * const aws_byte_cursor , to_find : * const aws_byte_cursor , first_find : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Shrinks a byte cursor from the right for as long as the supplied predicate is true"] pub fn aws_byte_cursor_right_trim_pred (source : * const aws_byte_cursor , predicate : aws_byte_predicate_fn) -> aws_byte_cursor ; } extern "C" { # [doc = " Shrinks a byte cursor from the left for as long as the supplied predicate is true"] pub fn aws_byte_cursor_left_trim_pred (source : * const aws_byte_cursor , predicate : aws_byte_predicate_fn) -> aws_byte_cursor ; } extern "C" { # [doc = " Shrinks a byte cursor from both sides for as long as the supplied predicate is true"] pub fn aws_byte_cursor_trim_pred (source : * const aws_byte_cursor , predicate : aws_byte_predicate_fn) -> aws_byte_cursor ; } extern "C" { # [doc = " Returns true if the byte cursor's range of bytes all satisfy the predicate"] pub fn aws_byte_cursor_satisfies_pred (source : * const aws_byte_cursor , predicate : aws_byte_predicate_fn) -> bool ; } extern "C" { # [doc = " Copies from to to. If to is too small, AWS_ERROR_DEST_COPY_TOO_SMALL will be\n returned. dest->len will contain the amount of data actually copied to dest.\n\n from and to may be the same buffer, permitting copying a buffer into itself."] pub fn aws_byte_buf_append (to : * mut aws_byte_buf , from : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies from to to while converting bytes via the passed in lookup table.\n If to is too small, AWS_ERROR_DEST_COPY_TOO_SMALL will be\n returned. to->len will contain its original size plus the amount of data actually copied to to.\n\n from and to should not be the same buffer (overlap is not handled)\n lookup_table must be at least 256 bytes"] pub fn aws_byte_buf_append_with_lookup (to : * mut aws_byte_buf , from : * const aws_byte_cursor , lookup_table : * const u8) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies from to to. If to is too small, the buffer will be grown appropriately and\n the old contents copied to, before the new contents are appended.\n\n If the grow fails (overflow or OOM), then an error will be returned.\n\n from and to may be the same buffer, permitting copying a buffer into itself."] pub fn aws_byte_buf_append_dynamic (to : * mut aws_byte_buf , from : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies `from` to `to`. If `to` is too small, the buffer will be grown appropriately and\n the old contents copied over, before the new contents are appended.\n\n If the grow fails (overflow or OOM), then an error will be returned.\n\n If the buffer is grown, the old buffer will be securely cleared before getting freed.\n\n `from` and `to` may be the same buffer, permitting copying a buffer into itself."] pub fn aws_byte_buf_append_dynamic_secure (to : * mut aws_byte_buf , from : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies a single byte into `to`. If `to` is too small, the buffer will be grown appropriately and\n the old contents copied over, before the byte is appended.\n\n If the grow fails (overflow or OOM), then an error will be returned."] pub fn aws_byte_buf_append_byte_dynamic (buffer : * mut aws_byte_buf , value : u8) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies a single byte into `to`. If `to` is too small, the buffer will be grown appropriately and\n the old contents copied over, before the byte is appended.\n\n If the grow fails (overflow or OOM), then an error will be returned.\n\n If the buffer is grown, the old buffer will be securely cleared before getting freed."] pub fn aws_byte_buf_append_byte_dynamic_secure (buffer : * mut aws_byte_buf , value : u8) -> :: libc :: c_int ; } extern "C" { # [doc = " Copy contents of cursor to buffer, then update cursor to reference the memory stored in the buffer.\n If buffer is too small, AWS_ERROR_DEST_COPY_TOO_SMALL will be returned.\n\n The cursor is permitted to reference memory from earlier in the buffer."] pub fn aws_byte_buf_append_and_update (to : * mut aws_byte_buf , from_and_update : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Appends '\\0' at the end of the buffer."] pub fn aws_byte_buf_append_null_terminator (buf : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { # [doc = " Attempts to increase the capacity of a buffer to the requested capacity\n\n If the the buffer's capacity is currently larger than the request capacity, the\n function does nothing (no shrink is performed)."] pub fn aws_byte_buf_reserve (buffer : * mut aws_byte_buf , requested_capacity : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Convenience function that attempts to increase the capacity of a buffer relative to the current\n length.\n\n aws_byte_buf_reserve_relative(buf, x) ~~ aws_byte_buf_reserve(buf, buf->len + x)\n"] pub fn aws_byte_buf_reserve_relative (buffer : * mut aws_byte_buf , additional_length : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Concatenates a variable number of struct aws_byte_buf * into destination.\n Number of args must be greater than 1. If dest is too small,\n AWS_ERROR_DEST_COPY_TOO_SMALL will be returned. dest->len will contain the\n amount of data actually copied to dest."] pub fn aws_byte_buf_cat (dest : * mut aws_byte_buf , number_of_args : usize , ...) -> :: libc :: c_int ; } extern "C" { # [doc = " Compare two aws_byte_cursor structures.\n Return whether their contents are equivalent."] pub fn aws_byte_cursor_eq (a : * const aws_byte_cursor , b : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of two aws_byte_cursor structures.\n Return whether their contents are equivalent.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_cursor_eq_ignore_case (a : * const aws_byte_cursor , b : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Compare an aws_byte_cursor and an aws_byte_buf.\n Return whether their contents are equivalent."] pub fn aws_byte_cursor_eq_byte_buf (a : * const aws_byte_cursor , b : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of an aws_byte_cursor and an aws_byte_buf.\n Return whether their contents are equivalent.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_cursor_eq_byte_buf_ignore_case (a : * const aws_byte_cursor , b : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Compare an aws_byte_cursor and a null-terminated string.\n Returns true if their contents are equivalent.\n The cursor should NOT contain a null-terminator, or the comparison will always return false."] pub fn aws_byte_cursor_eq_c_str (cursor : * const aws_byte_cursor , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Perform a case-insensitive string comparison of an aws_byte_cursor and a null-terminated string.\n Return whether their contents are equivalent.\n The cursor should NOT contain a null-terminator, or the comparison will always return false.\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_cursor_eq_c_str_ignore_case (cursor : * const aws_byte_cursor , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Return true if the input starts with the prefix (exact byte comparison)."] pub fn aws_byte_cursor_starts_with (input : * const aws_byte_cursor , prefix : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Return true if the input starts with the prefix (case-insensitive).\n The \"C\" locale is used for comparing upper and lowercase letters.\n Data is assumed to be ASCII text, UTF-8 will work fine too."] pub fn aws_byte_cursor_starts_with_ignore_case (input : * const aws_byte_cursor , prefix : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Case-insensitive hash function for array containing ASCII or UTF-8 text."] pub fn aws_hash_array_ignore_case (array : * const :: libc :: c_void , len : usize) -> u64 ; } extern "C" { # [doc = " Case-insensitive hash function for aws_byte_cursors stored in an aws_hash_table.\n For case-sensitive hashing, use aws_hash_byte_cursor_ptr()."] pub fn aws_hash_byte_cursor_ptr_ignore_case (item : * const :: libc :: c_void) -> u64 ; } extern "C" { # [doc = " Returns a lookup table for bytes that is the identity transformation with the exception\n of uppercase ascii characters getting replaced with lowercase characters. Used in\n caseless comparisons."] pub fn aws_lookup_table_to_lower_get () -> * const u8 ; } extern "C" { # [doc = " Returns lookup table to go from ASCII/UTF-8 hex character to a number (0-15).\n Non-hex characters map to 255.\n Valid examples:\n '0' -> 0\n 'F' -> 15\n 'f' -> 15\n Invalid examples:\n ' ' -> 255\n 'Z' -> 255\n '\\0' -> 255"] pub fn aws_lookup_table_hex_to_num_get () -> * const u8 ; } extern "C" { # [doc = " Lexical (byte value) comparison of two byte cursors"] pub fn aws_byte_cursor_compare_lexical (lhs : * const aws_byte_cursor , rhs : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Lexical (byte value) comparison of two byte cursors where the raw values are sent through a lookup table first"] pub fn aws_byte_cursor_compare_lookup (lhs : * const aws_byte_cursor , rhs : * const aws_byte_cursor , lookup_table : * const u8) -> :: libc :: c_int ; } extern "C" { # [doc = " For creating a byte buffer from a null-terminated string literal."] pub fn aws_byte_buf_from_c_str (c_str : * const :: libc :: c_char) -> aws_byte_buf ; } extern "C" { pub fn aws_byte_buf_from_array (bytes : * const :: libc :: c_void , len : usize) -> aws_byte_buf ; } extern "C" { pub fn aws_byte_buf_from_empty_array (bytes : * const :: libc :: c_void , capacity : usize) -> aws_byte_buf ; } extern "C" { pub fn aws_byte_cursor_from_buf (buf : * const aws_byte_buf) -> aws_byte_cursor ; } extern "C" { pub fn aws_byte_cursor_from_c_str (c_str : * const :: libc :: c_char) -> aws_byte_cursor ; } extern "C" { pub fn aws_byte_cursor_from_array (bytes : * const :: libc :: c_void , len : usize) -> aws_byte_cursor ; } extern "C" { # [doc = " Tests if the given aws_byte_cursor has at least len bytes remaining. If so,\n *buf is advanced by len bytes (incrementing ->ptr and decrementing ->len),\n and an aws_byte_cursor referring to the first len bytes of the original *buf\n is returned. Otherwise, an aws_byte_cursor with ->ptr = NULL, ->len = 0 is\n returned.\n\n Note that if len is above (SIZE_MAX / 2), this function will also treat it as\n a buffer overflow, and return NULL without changing *buf."] pub fn aws_byte_cursor_advance (cursor : * mut aws_byte_cursor , len : usize) -> aws_byte_cursor ; } extern "C" { # [doc = " Behaves identically to aws_byte_cursor_advance, but avoids speculative\n execution potentially reading out-of-bounds pointers (by returning an\n empty ptr in such speculated paths).\n\n This should generally be done when using an untrusted or\n data-dependent value for 'len', to avoid speculating into a path where\n cursor->ptr points outside the true ptr length."] pub fn aws_byte_cursor_advance_nospec (cursor : * mut aws_byte_cursor , len : usize) -> aws_byte_cursor ; } extern "C" { # [doc = " Reads specified length of data from byte cursor and copies it to the\n destination array.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read (cur : * mut aws_byte_cursor , dest : * mut :: libc :: c_void , len : usize) -> bool ; } extern "C" { # [doc = " Reads as many bytes from cursor as size of buffer, and copies them to buffer.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_and_fill_buffer (cur : * mut aws_byte_cursor , dest : * mut aws_byte_buf) -> bool ; } extern "C" { # [doc = " Reads a single byte from cursor, placing it in *var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_u8 (cur : * mut aws_byte_cursor , var : * mut u8) -> bool ; } extern "C" { # [doc = " Reads a 16-bit value in network byte order from cur, and places it in host\n byte order into var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_be16 (cur : * mut aws_byte_cursor , var : * mut u16) -> bool ; } extern "C" { # [doc = " Reads an unsigned 24-bit value (3 bytes) in network byte order from cur,\n and places it in host byte order into 32-bit var.\n Ex: if cur's next 3 bytes are {0xAA, 0xBB, 0xCC}, then var becomes 0x00AABBCC.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_be24 (cur : * mut aws_byte_cursor , var : * mut u32) -> bool ; } extern "C" { # [doc = " Reads a 32-bit value in network byte order from cur, and places it in host\n byte order into var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_be32 (cur : * mut aws_byte_cursor , var : * mut u32) -> bool ; } extern "C" { # [doc = " Reads a 64-bit value in network byte order from cur, and places it in host\n byte order into var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_be64 (cur : * mut aws_byte_cursor , var : * mut u64) -> bool ; } extern "C" { # [doc = " Reads a 32-bit value in network byte order from cur, and places it in host\n byte order into var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_float_be32 (cur : * mut aws_byte_cursor , var : * mut f32) -> bool ; } extern "C" { # [doc = " Reads a 64-bit value in network byte order from cur, and places it in host\n byte order into var.\n\n On success, returns true and updates the cursor pointer/length accordingly.\n If there is insufficient space in the cursor, returns false, leaving the\n cursor unchanged."] pub fn aws_byte_cursor_read_float_be64 (cur : * mut aws_byte_cursor , var : * mut f64) -> bool ; } extern "C" { # [doc = " Reads 2 hex characters from ASCII/UTF-8 text to produce an 8-bit number.\n Accepts both lowercase 'a'-'f' and uppercase 'A'-'F'.\n For example: \"0F\" produces 15.\n\n On success, returns true and advances the cursor by 2.\n If there is insufficient space in the cursor or an invalid character\n is encountered, returns false, leaving the cursor unchanged."] pub fn aws_byte_cursor_read_hex_u8 (cur : * mut aws_byte_cursor , var : * mut u8) -> bool ; } extern "C" { # [doc = " Appends a sub-buffer to the specified buffer.\n\n If the buffer has at least `len' bytes remaining (buffer->capacity - buffer->len >= len),\n then buffer->len is incremented by len, and an aws_byte_buf is assigned to *output corresponding\n to the last len bytes of the input buffer. The aws_byte_buf at *output will have a null\n allocator, a zero initial length, and a capacity of 'len'. The function then returns true.\n\n If there is insufficient space, then this function nulls all fields in *output and returns\n false."] pub fn aws_byte_buf_advance (buffer : * mut aws_byte_buf , output : * mut aws_byte_buf , len : usize) -> bool ; } extern "C" { # [doc = " Write specified number of bytes from array to byte buffer.\n\n On success, returns true and updates the buffer length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write (buf : * mut aws_byte_buf , src : * const u8 , len : usize) -> bool ; } extern "C" { # [doc = " Copies all bytes from buffer to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_from_whole_buffer (buf : * mut aws_byte_buf , src : aws_byte_buf) -> bool ; } extern "C" { # [doc = " Copies all bytes from buffer to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_from_whole_cursor (buf : * mut aws_byte_buf , src : aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Without increasing buf's capacity, write as much as possible from advancing_cursor into buf.\n\n buf's len is updated accordingly.\n advancing_cursor is advanced so it contains the remaining unwritten parts.\n Returns the section of advancing_cursor which was written.\n\n This function cannot fail. If buf is full (len == capacity) or advancing_len has 0 length,\n then buf and advancing_cursor are not altered and a cursor with 0 length is returned.\n\n Example: Given a buf with 2 bytes of space available and advancing_cursor with contents \"abc\".\n \"ab\" will be written to buf and buf->len will increase 2 and become equal to buf->capacity.\n advancing_cursor will advance so its contents become the unwritten \"c\".\n The returned cursor's contents will be the \"ab\" from the original advancing_cursor."] pub fn aws_byte_buf_write_to_capacity (buf : * mut aws_byte_buf , advancing_cursor : * mut aws_byte_cursor) -> aws_byte_cursor ; } extern "C" { # [doc = " Copies one byte to buffer.\n\n On success, returns true and updates the cursor /length\naccordingly.\n\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_u8 (buf : * mut aws_byte_buf , c : u8) -> bool ; } extern "C" { # [doc = " Writes one byte repeatedly to buffer (like memset)\n\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_u8_n (buf : * mut aws_byte_buf , c : u8 , count : usize) -> bool ; } extern "C" { # [doc = " Writes a 16-bit integer in network byte order (big endian) to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_be16 (buf : * mut aws_byte_buf , x : u16) -> bool ; } extern "C" { # [doc = " Writes low 24-bits (3 bytes) of an unsigned integer in network byte order (big endian) to buffer.\n Ex: If x is 0x00AABBCC then {0xAA, 0xBB, 0xCC} is written to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, or x's value cannot fit in 3 bytes,\n returns false, leaving the buffer unchanged."] pub fn aws_byte_buf_write_be24 (buf : * mut aws_byte_buf , x : u32) -> bool ; } extern "C" { # [doc = " Writes a 32-bit integer in network byte order (big endian) to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_be32 (buf : * mut aws_byte_buf , x : u32) -> bool ; } extern "C" { # [doc = " Writes a 32-bit float in network byte order (big endian) to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_float_be32 (buf : * mut aws_byte_buf , x : f32) -> bool ; } extern "C" { # [doc = " Writes a 64-bit integer in network byte order (big endian) to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_be64 (buf : * mut aws_byte_buf , x : u64) -> bool ; } extern "C" { # [doc = " Writes a 64-bit float in network byte order (big endian) to buffer.\n\n On success, returns true and updates the buffer /length accordingly.\n If there is insufficient space in the buffer, returns false, leaving the\n buffer unchanged."] pub fn aws_byte_buf_write_float_be64 (buf : * mut aws_byte_buf , x : f64) -> bool ; } extern "C" { # [doc = " Like isalnum(), but ignores C locale.\n Returns true if ch has the value of ASCII/UTF-8: 'a'-'z', 'A'-'Z', or '0'-'9'."] pub fn aws_isalnum (ch : u8) -> bool ; } extern "C" { # [doc = " Like isalpha(), but ignores C locale.\n Returns true if ch has the value of ASCII/UTF-8: 'a'-'z' or 'A'-'Z'."] pub fn aws_isalpha (ch : u8) -> bool ; } extern "C" { # [doc = " Like isdigit().\n Returns true if ch has the value of ASCII/UTF-8: '0'-'9'.\n\n Note: C's built-in isdigit() is also supposed to ignore the C locale,\n but cppreference.com claims \"some implementations (e.g. Microsoft in 1252 codepage)\n may classify additional single-byte characters as digits\""] pub fn aws_isdigit (ch : u8) -> bool ; } extern "C" { # [doc = " Like isxdigit().\n Returns true if ch has the value of ASCII/UTF-8: '0'-'9', 'a'-'f', or 'A'-'F'.\n\n Note: C's built-in isxdigit() is also supposed to ignore the C locale,\n but cppreference.com claims \"some implementations (e.g. Microsoft in 1252 codepage)\n may classify additional single-byte characters as digits\""] pub fn aws_isxdigit (ch : u8) -> bool ; } extern "C" { # [doc = " Like isspace(), but ignores C locale.\n Return true if ch has the value of ASCII/UTF-8: space (0x20), form feed (0x0C),\n line feed (0x0A), carriage return (0x0D), horizontal tab (0x09), or vertical tab (0x0B)."] pub fn aws_isspace (ch : u8) -> bool ; } extern "C" { # [doc = " Read entire cursor as ASCII/UTF-8 unsigned base-10 number.\n Stricter than strtoull(), which allows whitespace and inputs that start with \"0x\"\n\n Examples:\n \"0\" -> 0\n \"123\" -> 123\n \"00004\" -> 4 // leading zeros ok\n\n Rejects things like:\n \"-1\" // negative numbers not allowed\n \"1,000\" // only characters 0-9 allowed\n \"\" // blank string not allowed\n \" 0 \" // whitespace not allowed\n \"0x0\" // hex not allowed\n \"FF\" // hex not allowed\n \"999999999999999999999999999999999999999999\" // larger than max u64"] pub fn aws_byte_cursor_utf8_parse_u64 (cursor : aws_byte_cursor , dst : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Read entire cursor as ASCII/UTF-8 unsigned base-16 number with NO \"0x\" prefix.\n\n Examples:\n \"F\" -> 15\n \"000000ff\" -> 255 // leading zeros ok\n \"Ff\" -> 255 // mixed case ok\n \"123\" -> 291\n \"FFFFFFFFFFFFFFFF\" -> 18446744073709551616 // max u64\n\n Rejects things like:\n \"0x0\" // 0x prefix not allowed\n \"\" // blank string not allowed\n \" F \" // whitespace not allowed\n \"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF\" // larger than max u64"] pub fn aws_byte_cursor_utf8_parse_u64_hex (cursor : aws_byte_cursor , dst : * mut u64) -> :: libc :: c_int ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_linked_list_node { pub next : * mut aws_linked_list_node , pub prev : * mut aws_linked_list_node , } # [test] fn bindgen_test_layout_aws_linked_list_node () { const UNINIT : :: std :: mem :: MaybeUninit < aws_linked_list_node > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_linked_list_node > () , 16usize , concat ! ("Size of: " , stringify ! (aws_linked_list_node))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_linked_list_node > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_linked_list_node))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . next) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_linked_list_node) , "::" , stringify ! (next))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . prev) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_linked_list_node) , "::" , stringify ! (prev))) ; } impl Default for aws_linked_list_node { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_linked_list { pub head : aws_linked_list_node , pub tail : aws_linked_list_node , } # [test] fn bindgen_test_layout_aws_linked_list () { const UNINIT : :: std :: mem :: MaybeUninit < aws_linked_list > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_linked_list > () , 32usize , concat ! ("Size of: " , stringify ! (aws_linked_list))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_linked_list > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_linked_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . head) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_linked_list) , "::" , stringify ! (head))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tail) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_linked_list) , "::" , stringify ! (tail))) ; } impl Default for aws_linked_list { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Set node's next and prev pointers to NULL."] pub fn aws_linked_list_node_reset (node : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Tests if the list is empty."] pub fn aws_linked_list_empty (list : * const aws_linked_list) -> bool ; } extern "C" { # [doc = " Checks that a linked list is valid."] pub fn aws_linked_list_is_valid (list : * const aws_linked_list) -> bool ; } extern "C" { # [doc = " Checks that the prev of the next pointer of a node points to the\n node. As this checks whether the [next] connection of a node is\n bidirectional, it returns false if used for the list tail."] pub fn aws_linked_list_node_next_is_valid (node : * const aws_linked_list_node) -> bool ; } extern "C" { # [doc = " Checks that the next of the prev pointer of a node points to the\n node. Similarly to the above, this returns false if used for the\n head of a list."] pub fn aws_linked_list_node_prev_is_valid (node : * const aws_linked_list_node) -> bool ; } extern "C" { # [doc = " Checks that a linked list satisfies double linked list connectivity\n constraints. This check is O(n) as it traverses the whole linked\n list to ensure that tail is reachable from head (and vice versa)\n and that every connection is bidirectional.\n\n Note: This check *cannot* go into an infinite loop, because we\n ensure that the connection to the next node is\n bidirectional. Therefore, if a node's [a] a.next is a previous node\n [b] in the list, b.prev != &a and so this check would fail, thus\n terminating the loop."] pub fn aws_linked_list_is_valid_deep (list : * const aws_linked_list) -> bool ; } extern "C" { # [doc = " Initializes the list. List will be empty after this call."] pub fn aws_linked_list_init (list : * mut aws_linked_list) ; } extern "C" { # [doc = " Returns an iteration pointer for the first element in the list."] pub fn aws_linked_list_begin (list : * const aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Returns an iteration pointer for one past the last element in the list."] pub fn aws_linked_list_end (list : * const aws_linked_list) -> * const aws_linked_list_node ; } extern "C" { # [doc = " Returns a pointer for the last element in the list.\n Used to begin iterating the list in reverse. Ex:\n for (i = aws_linked_list_rbegin(list); i != aws_linked_list_rend(list); i = aws_linked_list_prev(i)) {...}"] pub fn aws_linked_list_rbegin (list : * const aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Returns the pointer to one before the first element in the list.\n Used to end iterating the list in reverse."] pub fn aws_linked_list_rend (list : * const aws_linked_list) -> * const aws_linked_list_node ; } extern "C" { # [doc = " Returns the next element in the list."] pub fn aws_linked_list_next (node : * const aws_linked_list_node) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Returns the previous element in the list."] pub fn aws_linked_list_prev (node : * const aws_linked_list_node) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Inserts to_add immediately after after."] pub fn aws_linked_list_insert_after (after : * mut aws_linked_list_node , to_add : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Swaps the order two nodes in the linked list."] pub fn aws_linked_list_swap_nodes (a : * mut aws_linked_list_node , b : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Inserts to_add immediately before before."] pub fn aws_linked_list_insert_before (before : * mut aws_linked_list_node , to_add : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Removes the specified node from the list (prev/next point to each other) and\n returns the next node in the list."] pub fn aws_linked_list_remove (node : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Append new_node."] pub fn aws_linked_list_push_back (list : * mut aws_linked_list , node : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Returns the element in the back of the list."] pub fn aws_linked_list_back (list : * const aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Returns the element in the back of the list and removes it"] pub fn aws_linked_list_pop_back (list : * mut aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Prepend new_node."] pub fn aws_linked_list_push_front (list : * mut aws_linked_list , node : * mut aws_linked_list_node) ; } extern "C" { # [doc = " Returns the element in the front of the list."] pub fn aws_linked_list_front (list : * const aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { # [doc = " Returns the element in the front of the list and removes it"] pub fn aws_linked_list_pop_front (list : * mut aws_linked_list) -> * mut aws_linked_list_node ; } extern "C" { pub fn aws_linked_list_swap_contents (a : * mut aws_linked_list , b : * mut aws_linked_list) ; } extern "C" { # [doc = " Remove all nodes from one list, and add them to the back of another.\n\n Example: if dst={1,2} and src={3,4}, they become dst={1,2,3,4} and src={}"] pub fn aws_linked_list_move_all_back (dst : * mut aws_linked_list , src : * mut aws_linked_list) ; } extern "C" { # [doc = " Remove all nodes from one list, and add them to the front of another.\n\n Example: if dst={2,1} and src={4,3}, they become dst={4,3,2,1} and src={}"] pub fn aws_linked_list_move_all_front (dst : * mut aws_linked_list , src : * mut aws_linked_list) ; } # [repr (C)] # [derive (Copy , Clone)] pub struct aws_io_handle { pub data : aws_io_handle__bindgen_ty_1 , pub additional_data : * mut :: libc :: c_void , } # [repr (C)] # [derive (Copy , Clone)] pub union aws_io_handle__bindgen_ty_1 { pub fd : :: libc :: c_int , pub handle : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_io_handle__bindgen_ty_1 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_io_handle__bindgen_ty_1 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_io_handle__bindgen_ty_1 > () , 8usize , concat ! ("Size of: " , stringify ! (aws_io_handle__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_io_handle__bindgen_ty_1 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_io_handle__bindgen_ty_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . fd) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_io_handle__bindgen_ty_1) , "::" , stringify ! (fd))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . handle) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_io_handle__bindgen_ty_1) , "::" , stringify ! (handle))) ; } impl Default for aws_io_handle__bindgen_ty_1 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [test] fn bindgen_test_layout_aws_io_handle () { const UNINIT : :: std :: mem :: MaybeUninit < aws_io_handle > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_io_handle > () , 16usize , concat ! ("Size of: " , stringify ! (aws_io_handle))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_io_handle > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_io_handle))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . data) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_io_handle) , "::" , stringify ! (data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . additional_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_io_handle) , "::" , stringify ! (additional_data))) ; } impl Default for aws_io_handle { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_io_message_type { AWS_IO_MESSAGE_APPLICATION_DATA = 0 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_channel { _unused : [u8 ; 0] , } pub type aws_channel_on_message_write_completed_fn = :: std :: option :: Option < unsafe extern "C" fn (channel : * mut aws_channel , message : * mut aws_io_message , err_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_io_message { # [doc = " Allocator used for the message and message data. If this is null, the message belongs to a pool or some other\n message manager."] pub allocator : * mut aws_allocator , # [doc = " Buffer containing the data for message"] pub message_data : aws_byte_buf , # [doc = " type of the message. This is used for framework control messages. Currently the only type is\n AWS_IO_MESSAGE_APPLICATION_DATA"] pub message_type : aws_io_message_type , # [doc = " Conveys information about the contents of message_data (e.g. cast the ptr to some type). If 0, it's just opaque\n data."] pub message_tag : :: libc :: c_int , # [doc = " In order to avoid excess allocations/copies, on a partial read or write, the copy mark is set to indicate how\n much of this message has already been processed or copied."] pub copy_mark : usize , # [doc = " The channel that the message is bound to."] pub owning_channel : * mut aws_channel , # [doc = " Invoked by the channel once the entire message has been written to the data sink."] pub on_completion : aws_channel_on_message_write_completed_fn , # [doc = " arbitrary user data for the on_completion callback"] pub user_data : * mut :: libc :: c_void , # [doc = " it's incredibly likely something is going to need to queue this,\n go ahead and make sure the list info is part of the original allocation."] pub queueing_handle : aws_linked_list_node , } # [test] fn bindgen_test_layout_aws_io_message () { const UNINIT : :: std :: mem :: MaybeUninit < aws_io_message > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_io_message > () , 96usize , concat ! ("Size of: " , stringify ! (aws_io_message))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_io_message > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_io_message))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . message_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (message_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . message_type) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (message_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . message_tag) as usize - ptr as usize } , 44usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (message_tag))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . copy_mark) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (copy_mark))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . owning_channel) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (owning_channel))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_completion) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (on_completion))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . queueing_handle) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_io_message) , "::" , stringify ! (queueing_handle))) ; } impl Default for aws_io_message { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_io_clock_fn = :: std :: option :: Option < unsafe extern "C" fn (timestamp : * mut u64) -> :: libc :: c_int > ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_io_errors { AWS_IO_CHANNEL_ERROR_ERROR_CANT_ACCEPT_INPUT = 1024 , AWS_IO_CHANNEL_UNKNOWN_MESSAGE_TYPE = 1025 , AWS_IO_CHANNEL_READ_WOULD_EXCEED_WINDOW = 1026 , AWS_IO_EVENT_LOOP_ALREADY_ASSIGNED = 1027 , AWS_IO_EVENT_LOOP_SHUTDOWN = 1028 , AWS_IO_TLS_ERROR_NEGOTIATION_FAILURE = 1029 , AWS_IO_TLS_ERROR_NOT_NEGOTIATED = 1030 , AWS_IO_TLS_ERROR_WRITE_FAILURE = 1031 , AWS_IO_TLS_ERROR_ALERT_RECEIVED = 1032 , AWS_IO_TLS_CTX_ERROR = 1033 , AWS_IO_TLS_VERSION_UNSUPPORTED = 1034 , AWS_IO_TLS_CIPHER_PREF_UNSUPPORTED = 1035 , AWS_IO_MISSING_ALPN_MESSAGE = 1036 , AWS_IO_UNHANDLED_ALPN_PROTOCOL_MESSAGE = 1037 , AWS_IO_FILE_VALIDATION_FAILURE = 1038 , AWS_ERROR_IO_EVENT_LOOP_THREAD_ONLY = 1039 , AWS_ERROR_IO_ALREADY_SUBSCRIBED = 1040 , AWS_ERROR_IO_NOT_SUBSCRIBED = 1041 , AWS_ERROR_IO_OPERATION_CANCELLED = 1042 , AWS_IO_READ_WOULD_BLOCK = 1043 , AWS_IO_BROKEN_PIPE = 1044 , AWS_IO_SOCKET_UNSUPPORTED_ADDRESS_FAMILY = 1045 , AWS_IO_SOCKET_INVALID_OPERATION_FOR_TYPE = 1046 , AWS_IO_SOCKET_CONNECTION_REFUSED = 1047 , AWS_IO_SOCKET_TIMEOUT = 1048 , AWS_IO_SOCKET_NO_ROUTE_TO_HOST = 1049 , AWS_IO_SOCKET_NETWORK_DOWN = 1050 , AWS_IO_SOCKET_CLOSED = 1051 , AWS_IO_SOCKET_NOT_CONNECTED = 1052 , AWS_IO_SOCKET_INVALID_OPTIONS = 1053 , AWS_IO_SOCKET_ADDRESS_IN_USE = 1054 , AWS_IO_SOCKET_INVALID_ADDRESS = 1055 , AWS_IO_SOCKET_ILLEGAL_OPERATION_FOR_STATE = 1056 , AWS_IO_SOCKET_CONNECT_ABORTED = 1057 , AWS_IO_DNS_QUERY_FAILED = 1058 , AWS_IO_DNS_INVALID_NAME = 1059 , AWS_IO_DNS_NO_ADDRESS_FOR_HOST = 1060 , AWS_IO_DNS_HOST_REMOVED_FROM_CACHE = 1061 , AWS_IO_STREAM_INVALID_SEEK_POSITION = 1062 , AWS_IO_STREAM_READ_FAILED = 1063 , DEPRECATED_AWS_IO_INVALID_FILE_HANDLE = 1064 , AWS_IO_SHARED_LIBRARY_LOAD_FAILURE = 1065 , AWS_IO_SHARED_LIBRARY_FIND_SYMBOL_FAILURE = 1066 , AWS_IO_TLS_NEGOTIATION_TIMEOUT = 1067 , AWS_IO_TLS_ALERT_NOT_GRACEFUL = 1068 , AWS_IO_MAX_RETRIES_EXCEEDED = 1069 , AWS_IO_RETRY_PERMISSION_DENIED = 1070 , AWS_IO_TLS_DIGEST_ALGORITHM_UNSUPPORTED = 1071 , AWS_IO_TLS_SIGNATURE_ALGORITHM_UNSUPPORTED = 1072 , AWS_ERROR_PKCS11_VERSION_UNSUPPORTED = 1073 , AWS_ERROR_PKCS11_TOKEN_NOT_FOUND = 1074 , AWS_ERROR_PKCS11_KEY_NOT_FOUND = 1075 , AWS_ERROR_PKCS11_KEY_TYPE_UNSUPPORTED = 1076 , AWS_ERROR_PKCS11_UNKNOWN_CRYPTOKI_RETURN_VALUE = 1077 , AWS_ERROR_PKCS11_CKR_CANCEL = 1078 , AWS_ERROR_PKCS11_CKR_HOST_MEMORY = 1079 , AWS_ERROR_PKCS11_CKR_SLOT_ID_INVALID = 1080 , AWS_ERROR_PKCS11_CKR_GENERAL_ERROR = 1081 , AWS_ERROR_PKCS11_CKR_FUNCTION_FAILED = 1082 , AWS_ERROR_PKCS11_CKR_ARGUMENTS_BAD = 1083 , AWS_ERROR_PKCS11_CKR_NO_EVENT = 1084 , AWS_ERROR_PKCS11_CKR_NEED_TO_CREATE_THREADS = 1085 , AWS_ERROR_PKCS11_CKR_CANT_LOCK = 1086 , AWS_ERROR_PKCS11_CKR_ATTRIBUTE_READ_ONLY = 1087 , AWS_ERROR_PKCS11_CKR_ATTRIBUTE_SENSITIVE = 1088 , AWS_ERROR_PKCS11_CKR_ATTRIBUTE_TYPE_INVALID = 1089 , AWS_ERROR_PKCS11_CKR_ATTRIBUTE_VALUE_INVALID = 1090 , AWS_ERROR_PKCS11_CKR_ACTION_PROHIBITED = 1091 , AWS_ERROR_PKCS11_CKR_DATA_INVALID = 1092 , AWS_ERROR_PKCS11_CKR_DATA_LEN_RANGE = 1093 , AWS_ERROR_PKCS11_CKR_DEVICE_ERROR = 1094 , AWS_ERROR_PKCS11_CKR_DEVICE_MEMORY = 1095 , AWS_ERROR_PKCS11_CKR_DEVICE_REMOVED = 1096 , AWS_ERROR_PKCS11_CKR_ENCRYPTED_DATA_INVALID = 1097 , AWS_ERROR_PKCS11_CKR_ENCRYPTED_DATA_LEN_RANGE = 1098 , AWS_ERROR_PKCS11_CKR_FUNCTION_CANCELED = 1099 , AWS_ERROR_PKCS11_CKR_FUNCTION_NOT_PARALLEL = 1100 , AWS_ERROR_PKCS11_CKR_FUNCTION_NOT_SUPPORTED = 1101 , AWS_ERROR_PKCS11_CKR_KEY_HANDLE_INVALID = 1102 , AWS_ERROR_PKCS11_CKR_KEY_SIZE_RANGE = 1103 , AWS_ERROR_PKCS11_CKR_KEY_TYPE_INCONSISTENT = 1104 , AWS_ERROR_PKCS11_CKR_KEY_NOT_NEEDED = 1105 , AWS_ERROR_PKCS11_CKR_KEY_CHANGED = 1106 , AWS_ERROR_PKCS11_CKR_KEY_NEEDED = 1107 , AWS_ERROR_PKCS11_CKR_KEY_INDIGESTIBLE = 1108 , AWS_ERROR_PKCS11_CKR_KEY_FUNCTION_NOT_PERMITTED = 1109 , AWS_ERROR_PKCS11_CKR_KEY_NOT_WRAPPABLE = 1110 , AWS_ERROR_PKCS11_CKR_KEY_UNEXTRACTABLE = 1111 , AWS_ERROR_PKCS11_CKR_MECHANISM_INVALID = 1112 , AWS_ERROR_PKCS11_CKR_MECHANISM_PARAM_INVALID = 1113 , AWS_ERROR_PKCS11_CKR_OBJECT_HANDLE_INVALID = 1114 , AWS_ERROR_PKCS11_CKR_OPERATION_ACTIVE = 1115 , AWS_ERROR_PKCS11_CKR_OPERATION_NOT_INITIALIZED = 1116 , AWS_ERROR_PKCS11_CKR_PIN_INCORRECT = 1117 , AWS_ERROR_PKCS11_CKR_PIN_INVALID = 1118 , AWS_ERROR_PKCS11_CKR_PIN_LEN_RANGE = 1119 , AWS_ERROR_PKCS11_CKR_PIN_EXPIRED = 1120 , AWS_ERROR_PKCS11_CKR_PIN_LOCKED = 1121 , AWS_ERROR_PKCS11_CKR_SESSION_CLOSED = 1122 , AWS_ERROR_PKCS11_CKR_SESSION_COUNT = 1123 , AWS_ERROR_PKCS11_CKR_SESSION_HANDLE_INVALID = 1124 , AWS_ERROR_PKCS11_CKR_SESSION_PARALLEL_NOT_SUPPORTED = 1125 , AWS_ERROR_PKCS11_CKR_SESSION_READ_ONLY = 1126 , AWS_ERROR_PKCS11_CKR_SESSION_EXISTS = 1127 , AWS_ERROR_PKCS11_CKR_SESSION_READ_ONLY_EXISTS = 1128 , AWS_ERROR_PKCS11_CKR_SESSION_READ_WRITE_SO_EXISTS = 1129 , AWS_ERROR_PKCS11_CKR_SIGNATURE_INVALID = 1130 , AWS_ERROR_PKCS11_CKR_SIGNATURE_LEN_RANGE = 1131 , AWS_ERROR_PKCS11_CKR_TEMPLATE_INCOMPLETE = 1132 , AWS_ERROR_PKCS11_CKR_TEMPLATE_INCONSISTENT = 1133 , AWS_ERROR_PKCS11_CKR_TOKEN_NOT_PRESENT = 1134 , AWS_ERROR_PKCS11_CKR_TOKEN_NOT_RECOGNIZED = 1135 , AWS_ERROR_PKCS11_CKR_TOKEN_WRITE_PROTECTED = 1136 , AWS_ERROR_PKCS11_CKR_UNWRAPPING_KEY_HANDLE_INVALID = 1137 , AWS_ERROR_PKCS11_CKR_UNWRAPPING_KEY_SIZE_RANGE = 1138 , AWS_ERROR_PKCS11_CKR_UNWRAPPING_KEY_TYPE_INCONSISTENT = 1139 , AWS_ERROR_PKCS11_CKR_USER_ALREADY_LOGGED_IN = 1140 , AWS_ERROR_PKCS11_CKR_USER_NOT_LOGGED_IN = 1141 , AWS_ERROR_PKCS11_CKR_USER_PIN_NOT_INITIALIZED = 1142 , AWS_ERROR_PKCS11_CKR_USER_TYPE_INVALID = 1143 , AWS_ERROR_PKCS11_CKR_USER_ANOTHER_ALREADY_LOGGED_IN = 1144 , AWS_ERROR_PKCS11_CKR_USER_TOO_MANY_TYPES = 1145 , AWS_ERROR_PKCS11_CKR_WRAPPED_KEY_INVALID = 1146 , AWS_ERROR_PKCS11_CKR_WRAPPED_KEY_LEN_RANGE = 1147 , AWS_ERROR_PKCS11_CKR_WRAPPING_KEY_HANDLE_INVALID = 1148 , AWS_ERROR_PKCS11_CKR_WRAPPING_KEY_SIZE_RANGE = 1149 , AWS_ERROR_PKCS11_CKR_WRAPPING_KEY_TYPE_INCONSISTENT = 1150 , AWS_ERROR_PKCS11_CKR_RANDOM_SEED_NOT_SUPPORTED = 1151 , AWS_ERROR_PKCS11_CKR_RANDOM_NO_RNG = 1152 , AWS_ERROR_PKCS11_CKR_DOMAIN_PARAMS_INVALID = 1153 , AWS_ERROR_PKCS11_CKR_CURVE_NOT_SUPPORTED = 1154 , AWS_ERROR_PKCS11_CKR_BUFFER_TOO_SMALL = 1155 , AWS_ERROR_PKCS11_CKR_SAVED_STATE_INVALID = 1156 , AWS_ERROR_PKCS11_CKR_INFORMATION_SENSITIVE = 1157 , AWS_ERROR_PKCS11_CKR_STATE_UNSAVEABLE = 1158 , AWS_ERROR_PKCS11_CKR_CRYPTOKI_NOT_INITIALIZED = 1159 , AWS_ERROR_PKCS11_CKR_CRYPTOKI_ALREADY_INITIALIZED = 1160 , AWS_ERROR_PKCS11_CKR_MUTEX_BAD = 1161 , AWS_ERROR_PKCS11_CKR_MUTEX_NOT_LOCKED = 1162 , AWS_ERROR_PKCS11_CKR_NEW_PIN_MODE = 1163 , AWS_ERROR_PKCS11_CKR_NEXT_OTP = 1164 , AWS_ERROR_PKCS11_CKR_EXCEEDED_MAX_ITERATIONS = 1165 , AWS_ERROR_PKCS11_CKR_FIPS_SELF_TEST_FAILED = 1166 , AWS_ERROR_PKCS11_CKR_LIBRARY_LOAD_FAILED = 1167 , AWS_ERROR_PKCS11_CKR_PIN_TOO_WEAK = 1168 , AWS_ERROR_PKCS11_CKR_PUBLIC_KEY_INVALID = 1169 , AWS_ERROR_PKCS11_CKR_FUNCTION_REJECTED = 1170 , AWS_ERROR_IO_PINNED_EVENT_LOOP_MISMATCH = 1171 , AWS_ERROR_PKCS11_ENCODING_ERROR = 1172 , AWS_IO_TLS_ERROR_DEFAULT_TRUST_STORE_NOT_FOUND = 1173 , AWS_IO_STREAM_SEEK_FAILED = 1174 , AWS_IO_STREAM_GET_LENGTH_FAILED = 1175 , AWS_IO_STREAM_SEEK_UNSUPPORTED = 1176 , AWS_IO_STREAM_GET_LENGTH_UNSUPPORTED = 1177 , AWS_IO_TLS_ERROR_READ_FAILURE = 1178 , AWS_IO_ERROR_END_RANGE = 2047 , AWS_IO_INVALID_FILE_HANDLE = 50 , } extern "C" { # [doc = " Initializes internal datastructures used by aws-c-io.\n Must be called before using any functionality in aws-c-io."] pub fn aws_io_library_init (allocator : * mut aws_allocator) ; } extern "C" { # [doc = " Shuts down the internal datastructures used by aws-c-io."] pub fn aws_io_library_clean_up () ; } extern "C" { pub fn aws_io_fatal_assert_library_initialized () ; } # [doc = " struct aws_atomic_var represents an atomic variable - a value which can hold an integer or pointer\n that can be manipulated atomically. struct aws_atomic_vars should normally only be manipulated\n with atomics methods defined in this header."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_atomic_var { pub value : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_atomic_var () { const UNINIT : :: std :: mem :: MaybeUninit < aws_atomic_var > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_atomic_var > () , 8usize , concat ! ("Size of: " , stringify ! (aws_atomic_var))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_atomic_var > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_atomic_var))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_atomic_var) , "::" , stringify ! (value))) ; } impl Default for aws_atomic_var { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_memory_order { # [doc = " No particular ordering constraints are guaranteed relative to other\n operations at all; we merely ensure that the operation itself is atomic."] aws_memory_order_relaxed = 0 , # [doc = " Specifies acquire ordering. No reads or writes on the current thread can be\n reordered to happen before this operation. This is typically paired with a release\n ordering; any writes that happened on the releasing operation will be visible\n after the paired acquire operation.\n\n Acquire ordering is only meaningful on load or load-store operations."] aws_memory_order_acquire = 2 , # [doc = " Specifies release order. No reads or writes can be reordered to come after this\n operation. Typically paired with an acquire operation.\n\n Release ordering is only meaningful on store or load-store operations."] aws_memory_order_release = 3 , # [doc = " Specifies acquire-release order; if this operation acts as a load, it acts as an\n acquire operation; if it acts as a store, it acts as a release operation; if it's\n a load-store, it does both."] aws_memory_order_acq_rel = 4 , # [doc = " Specifies acquire-release order; if this operation acts as a load, it acts as an\n acquire operation; if it acts as a store, it acts as a release operation; if it's\n a load-store, it does both."] aws_memory_order_seq_cst = 5 , } extern "C" { # [doc = " Initializes an atomic variable with an integer value. This operation should be done before any\n other operations on this atomic variable, and must be done before attempting any parallel operations.\n\n This operation does not imply a barrier. Ensure that you use an acquire-release barrier (or stronger)\n when communicating the fact that initialization is complete to the other thread. Launching the thread\n implies a sufficiently strong barrier."] pub fn aws_atomic_init_int (var : * mut aws_atomic_var , n : usize) ; } extern "C" { # [doc = " Initializes an atomic variable with a pointer value. This operation should be done before any\n other operations on this atomic variable, and must be done before attempting any parallel operations.\n\n This operation does not imply a barrier. Ensure that you use an acquire-release barrier (or stronger)\n when communicating the fact that initialization is complete to the other thread. Launching the thread\n implies a sufficiently strong barrier."] pub fn aws_atomic_init_ptr (var : * mut aws_atomic_var , p : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Reads an atomic var as an integer, using the specified ordering, and returns the result."] pub fn aws_atomic_load_int_explicit (var : * const aws_atomic_var , memory_order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Reads an atomic var as an integer, using sequentially consistent ordering, and returns the result."] pub fn aws_atomic_load_int (var : * const aws_atomic_var) -> usize ; } extern "C" { # [doc = " Reads an atomic var as a pointer, using the specified ordering, and returns the result."] pub fn aws_atomic_load_ptr_explicit (var : * const aws_atomic_var , memory_order : aws_memory_order) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Reads an atomic var as a pointer, using sequentially consistent ordering, and returns the result."] pub fn aws_atomic_load_ptr (var : * const aws_atomic_var) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Stores an integer into an atomic var, using the specified ordering."] pub fn aws_atomic_store_int_explicit (var : * mut aws_atomic_var , n : usize , memory_order : aws_memory_order) ; } extern "C" { # [doc = " Stores an integer into an atomic var, using sequentially consistent ordering."] pub fn aws_atomic_store_int (var : * mut aws_atomic_var , n : usize) ; } extern "C" { # [doc = " Stores a pointer into an atomic var, using the specified ordering."] pub fn aws_atomic_store_ptr_explicit (var : * mut aws_atomic_var , p : * mut :: libc :: c_void , memory_order : aws_memory_order) ; } extern "C" { # [doc = " Stores a pointer into an atomic var, using sequentially consistent ordering."] pub fn aws_atomic_store_ptr (var : * mut aws_atomic_var , p : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Exchanges an integer with the value in an atomic_var, using the specified ordering.\n Returns the value that was previously in the atomic_var."] pub fn aws_atomic_exchange_int_explicit (var : * mut aws_atomic_var , n : usize , memory_order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Exchanges an integer with the value in an atomic_var, using sequentially consistent ordering.\n Returns the value that was previously in the atomic_var."] pub fn aws_atomic_exchange_int (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Exchanges a pointer with the value in an atomic_var, using the specified ordering.\n Returns the value that was previously in the atomic_var."] pub fn aws_atomic_exchange_ptr_explicit (var : * mut aws_atomic_var , p : * mut :: libc :: c_void , memory_order : aws_memory_order) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Exchanges an integer with the value in an atomic_var, using sequentially consistent ordering.\n Returns the value that was previously in the atomic_var."] pub fn aws_atomic_exchange_ptr (var : * mut aws_atomic_var , p : * mut :: libc :: c_void) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Atomically compares *var to *expected; if they are equal, atomically sets *var = desired. Otherwise, *expected is set\n to the value in *var. On success, the memory ordering used was order_success; otherwise, it was order_failure.\n order_failure must be no stronger than order_success, and must not be release or acq_rel.\n Returns true if the compare was successful and the variable updated to desired."] pub fn aws_atomic_compare_exchange_int_explicit (var : * mut aws_atomic_var , expected : * mut usize , desired : usize , order_success : aws_memory_order , order_failure : aws_memory_order) -> bool ; } extern "C" { # [doc = " Atomically compares *var to *expected; if they are equal, atomically sets *var = desired. Otherwise, *expected is set\n to the value in *var. Uses sequentially consistent memory ordering, regardless of success or failure.\n Returns true if the compare was successful and the variable updated to desired."] pub fn aws_atomic_compare_exchange_int (var : * mut aws_atomic_var , expected : * mut usize , desired : usize) -> bool ; } extern "C" { # [doc = " Atomically compares *var to *expected; if they are equal, atomically sets *var = desired. Otherwise, *expected is set\n to the value in *var. On success, the memory ordering used was order_success; otherwise, it was order_failure.\n order_failure must be no stronger than order_success, and must not be release or acq_rel.\n Returns true if the compare was successful and the variable updated to desired."] pub fn aws_atomic_compare_exchange_ptr_explicit (var : * mut aws_atomic_var , expected : * mut * mut :: libc :: c_void , desired : * mut :: libc :: c_void , order_success : aws_memory_order , order_failure : aws_memory_order) -> bool ; } extern "C" { # [doc = " Atomically compares *var to *expected; if they are equal, atomically sets *var = desired. Otherwise, *expected is set\n to the value in *var. Uses sequentially consistent memory ordering, regardless of success or failure.\n Returns true if the compare was successful and the variable updated to desired."] pub fn aws_atomic_compare_exchange_ptr (var : * mut aws_atomic_var , expected : * mut * mut :: libc :: c_void , desired : * mut :: libc :: c_void) -> bool ; } extern "C" { # [doc = " Atomically adds n to *var, and returns the previous value of *var."] pub fn aws_atomic_fetch_add_explicit (var : * mut aws_atomic_var , n : usize , order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Atomically subtracts n from *var, and returns the previous value of *var."] pub fn aws_atomic_fetch_sub_explicit (var : * mut aws_atomic_var , n : usize , order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Atomically ORs n with *var, and returns the previous value of *var."] pub fn aws_atomic_fetch_or_explicit (var : * mut aws_atomic_var , n : usize , order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Atomically ANDs n with *var, and returns the previous value of *var."] pub fn aws_atomic_fetch_and_explicit (var : * mut aws_atomic_var , n : usize , order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Atomically XORs n with *var, and returns the previous value of *var."] pub fn aws_atomic_fetch_xor_explicit (var : * mut aws_atomic_var , n : usize , order : aws_memory_order) -> usize ; } extern "C" { # [doc = " Atomically adds n to *var, and returns the previous value of *var.\n Uses sequentially consistent ordering."] pub fn aws_atomic_fetch_add (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Atomically subtracts n from *var, and returns the previous value of *var.\n Uses sequentially consistent ordering."] pub fn aws_atomic_fetch_sub (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Atomically ands n into *var, and returns the previous value of *var.\n Uses sequentially consistent ordering."] pub fn aws_atomic_fetch_and (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Atomically ors n into *var, and returns the previous value of *var.\n Uses sequentially consistent ordering."] pub fn aws_atomic_fetch_or (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Atomically xors n into *var, and returns the previous value of *var.\n Uses sequentially consistent ordering."] pub fn aws_atomic_fetch_xor (var : * mut aws_atomic_var , n : usize) -> usize ; } extern "C" { # [doc = " Provides the same reordering guarantees as an atomic operation with the specified memory order, without\n needing to actually perform an atomic operation."] pub fn aws_atomic_thread_fence (order : aws_memory_order) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_string { pub allocator : * mut aws_allocator , pub len : usize , pub bytes : [u8 ; 1usize] , } # [test] fn bindgen_test_layout_aws_string () { const UNINIT : :: std :: mem :: MaybeUninit < aws_string > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_string > () , 24usize , concat ! ("Size of: " , stringify ! (aws_string))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_string > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_string))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_string) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . len) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_string) , "::" , stringify ! (len))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bytes) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_string) , "::" , stringify ! (bytes))) ; } impl Default for aws_string { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Returns true if bytes of string are the same, false otherwise."] pub fn aws_string_eq (a : * const aws_string , b : * const aws_string) -> bool ; } extern "C" { # [doc = " Returns true if bytes of string are equivalent, using a case-insensitive comparison."] pub fn aws_string_eq_ignore_case (a : * const aws_string , b : * const aws_string) -> bool ; } extern "C" { # [doc = " Returns true if bytes of string and cursor are the same, false otherwise."] pub fn aws_string_eq_byte_cursor (str_ : * const aws_string , cur : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Returns true if bytes of string and cursor are equivalent, using a case-insensitive comparison."] pub fn aws_string_eq_byte_cursor_ignore_case (str_ : * const aws_string , cur : * const aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Returns true if bytes of string and buffer are the same, false otherwise."] pub fn aws_string_eq_byte_buf (str_ : * const aws_string , buf : * const aws_byte_buf) -> bool ; } extern "C" { # [doc = " Returns true if bytes of string and buffer are equivalent, using a case-insensitive comparison."] pub fn aws_string_eq_byte_buf_ignore_case (str_ : * const aws_string , buf : * const aws_byte_buf) -> bool ; } extern "C" { pub fn aws_string_eq_c_str (str_ : * const aws_string , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Returns true if bytes of strings are equivalent, using a case-insensitive comparison."] pub fn aws_string_eq_c_str_ignore_case (str_ : * const aws_string , c_str : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Constructor functions which copy data from null-terminated C-string or array of bytes."] pub fn aws_string_new_from_c_str (allocator : * mut aws_allocator , c_str : * const :: libc :: c_char) -> * mut aws_string ; } extern "C" { # [doc = " Allocate a new string with the same contents as array."] pub fn aws_string_new_from_array (allocator : * mut aws_allocator , bytes : * const u8 , len : usize) -> * mut aws_string ; } extern "C" { # [doc = " Allocate a new string with the same contents as another string."] pub fn aws_string_new_from_string (allocator : * mut aws_allocator , str_ : * const aws_string) -> * mut aws_string ; } extern "C" { # [doc = " Allocate a new string with the same contents as cursor."] pub fn aws_string_new_from_cursor (allocator : * mut aws_allocator , cursor : * const aws_byte_cursor) -> * mut aws_string ; } extern "C" { # [doc = " Allocate a new string with the same contents as buf."] pub fn aws_string_new_from_buf (allocator : * mut aws_allocator , buf : * const aws_byte_buf) -> * mut aws_string ; } extern "C" { # [doc = " Deallocate string."] pub fn aws_string_destroy (str_ : * mut aws_string) ; } extern "C" { # [doc = " Zeroes out the data bytes of string and then deallocates the memory.\n Not safe to run on a string created with AWS_STATIC_STRING_FROM_LITERAL."] pub fn aws_string_destroy_secure (str_ : * mut aws_string) ; } extern "C" { # [doc = " Compares lexicographical ordering of two strings. This is a binary\n byte-by-byte comparison, treating bytes as unsigned integers. It is suitable\n for either textual or binary data and is unaware of unicode or any other byte\n encoding. If both strings are identical in the bytes of the shorter string,\n then the longer string is lexicographically after the shorter.\n\n Returns a positive number if string a > string b. (i.e., string a is\n lexicographically after string b.) Returns zero if string a = string b.\n Returns negative number if string a < string b."] pub fn aws_string_compare (a : * const aws_string , b : * const aws_string) -> :: libc :: c_int ; } extern "C" { # [doc = " A convenience function for sorting lists of (const struct aws_string *) elements. This can be used as a\n comparator for aws_array_list_sort. It is just a simple wrapper around aws_string_compare."] pub fn aws_array_list_comparator_string (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies all bytes from string to buf.\n\n On success, returns true and updates the buf pointer/length\n accordingly. If there is insufficient space in the buf, returns\n false, leaving the buf unchanged."] pub fn aws_byte_buf_write_from_whole_string (buf : * mut aws_byte_buf , src : * const aws_string) -> bool ; } extern "C" { # [doc = " Creates an aws_byte_cursor from an existing string."] pub fn aws_byte_cursor_from_string (src : * const aws_string) -> aws_byte_cursor ; } extern "C" { # [doc = " If the string was dynamically allocated, clones it. If the string was statically allocated (i.e. has no allocator),\n returns the original string."] pub fn aws_string_clone_or_reuse (allocator : * mut aws_allocator , str_ : * const aws_string) -> * mut aws_string ; } extern "C" { # [doc = " Computes the length of a c string in bytes assuming the character set is either ASCII or UTF-8. If no NULL character\n is found within max_read_len of str, AWS_ERROR_C_STRING_BUFFER_NOT_NULL_TERMINATED is raised. Otherwise, str_len\n will contain the string length minus the NULL character, and AWS_OP_SUCCESS will be returned."] pub fn aws_secure_strlen (str_ : * const :: libc :: c_char , max_read_len : usize , str_len : * mut usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Equivalent to str->bytes."] pub fn aws_string_bytes (str_ : * const aws_string) -> * const u8 ; } extern "C" { # [doc = " Equivalent to `(const char *)str->bytes`."] pub fn aws_string_c_str (str_ : * const aws_string) -> * const :: libc :: c_char ; } extern "C" { # [doc = " Evaluates the set of properties that define the shape of all valid aws_string structures.\n It is also a cheap check, in the sense it run in constant time (i.e., no loops or recursion)."] pub fn aws_string_is_valid (str_ : * const aws_string) -> bool ; } extern "C" { # [doc = " Best-effort checks aws_string invariants, when the str->len is unknown"] pub fn aws_c_string_is_valid (str_ : * const :: libc :: c_char) -> bool ; } extern "C" { # [doc = " Evaluates if a char is a white character."] pub fn aws_char_is_space (c : u8) -> bool ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_thread_detach_state { AWS_THREAD_NOT_CREATED = 1 , AWS_THREAD_JOINABLE = 2 , AWS_THREAD_JOIN_COMPLETED = 3 , AWS_THREAD_MANAGED = 4 , } # [repr (u32)] # [non_exhaustive] # [doc = " Specifies the join strategy used on an aws_thread, which in turn controls whether or not a thread participates\n in the managed thread system. The managed thread system provides logic to guarantee a join on all participating\n threads at the cost of laziness (the user cannot control when joins happen).\n\n Manual - thread does not participate in the managed thread system; any joins must be done by the user. This\n is the default. The user must call aws_thread_clean_up(), but only after any desired join operation has completed.\n Not doing so will cause the windows handle to leak.\n\n Managed - the managed thread system will automatically perform a join some time after the thread's run function\n has completed. It is an error to call aws_thread_join on a thread configured with the managed join strategy. The\n managed thread system will call aws_thread_clean_up() on the thread after the background join has completed.\n\n Additionally, an API exists, aws_thread_join_all_managed(), which blocks and returns when all outstanding threads\n with the managed strategy have fully joined. This API is useful for tests (rather than waiting for many individual\n signals) and program shutdown or DLL unload. This API is automatically invoked by the common library clean up\n function. If the common library clean up is called from a managed thread, this will cause deadlock.\n\n Lazy thread joining is done only when threads finish their run function or when the user calls\n aws_thread_join_all_managed(). This means it may be a long time between thread function completion and the join\n being applied, but the queue of unjoined threads is always one or fewer so there is no critical resource\n backlog.\n\n Currently, only event loop group async cleanup and host resolver threads participate in the managed thread system.\n Additionally, event loop threads will increment and decrement the pending join count (they are manually joined\n internally) in order to have an accurate view of internal thread usage and also to prevent failure to release\n an event loop group fully from allowing aws_thread_join_all_managed() from running to completion when its\n intent is such that it should block instead."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_thread_join_strategy { AWS_TJS_MANUAL = 0 , AWS_TJS_MANAGED = 1 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_thread_options { pub stack_size : usize , pub cpu_id : i32 , pub join_strategy : aws_thread_join_strategy , # [doc = " Thread name, for debugging purpose.\n The length should not exceed AWS_THREAD_NAME_RECOMMENDED_STRLEN(15)\n if you want it to display properly on all platforms."] pub name : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_thread_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_thread_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_thread_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_thread_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_thread_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_thread_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . stack_size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_thread_options) , "::" , stringify ! (stack_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cpu_id) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_thread_options) , "::" , stringify ! (cpu_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . join_strategy) as usize - ptr as usize } , 12usize , concat ! ("Offset of field: " , stringify ! (aws_thread_options) , "::" , stringify ! (join_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . name) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_thread_options) , "::" , stringify ! (name))) ; } impl Default for aws_thread_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_thread_once = pthread_once_t ; pub type aws_thread_id_t = pthread_t ; # [repr (C)] pub struct aws_thread { pub allocator : * mut aws_allocator , pub detach_state : aws_thread_detach_state , pub thread_id : aws_thread_id_t , } # [test] fn bindgen_test_layout_aws_thread () { const UNINIT : :: std :: mem :: MaybeUninit < aws_thread > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_thread > () , 24usize , concat ! ("Size of: " , stringify ! (aws_thread))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_thread > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_thread))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_thread) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . detach_state) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_thread) , "::" , stringify ! (detach_state))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . thread_id) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_thread) , "::" , stringify ! (thread_id))) ; } impl Default for aws_thread { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Returns an instance of system default thread options."] pub fn aws_default_thread_options () -> * const aws_thread_options ; } extern "C" { pub fn aws_thread_call_once (flag : * mut aws_thread_once , call_once : :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: libc :: c_void) > , user_data : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Initializes a new platform specific thread object struct (not the os-level\n thread itself)."] pub fn aws_thread_init (thread : * mut aws_thread , allocator : * mut aws_allocator) -> :: libc :: c_int ; } extern "C" { # [doc = " Creates an OS level thread and associates it with func. context will be passed to func when it is executed.\n options will be applied to the thread if they are applicable for the platform.\n\n After launch, you may join on the thread. A successfully launched thread must have clean_up called on it in order\n to avoid a handle leak. If you do not join before calling clean_up, the thread will become detached.\n\n Managed threads must not have join or clean_up called on them by external code."] pub fn aws_thread_launch (thread : * mut aws_thread , func : :: std :: option :: Option < unsafe extern "C" fn (arg : * mut :: libc :: c_void) > , arg : * mut :: libc :: c_void , options : * const aws_thread_options) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the id of thread"] pub fn aws_thread_get_id (thread : * mut aws_thread) -> aws_thread_id_t ; } extern "C" { # [doc = " Gets the detach state of the thread. For example, is it safe to call join on\n this thread? Has it been detached()?"] pub fn aws_thread_get_detach_state (thread : * mut aws_thread) -> aws_thread_detach_state ; } extern "C" { # [doc = " Joins the calling thread to a thread instance. Returns when thread is\n finished. Calling this from the associated OS thread will cause a deadlock."] pub fn aws_thread_join (thread : * mut aws_thread) -> :: libc :: c_int ; } extern "C" { # [doc = " Blocking call that waits for all managed threads to complete their join call. This can only be called\n from the main thread or a non-managed thread.\n\n This gets called automatically from library cleanup.\n\n By default the wait is unbounded, but that default can be overridden via aws_thread_set_managed_join_timeout_ns()"] pub fn aws_thread_join_all_managed () -> :: libc :: c_int ; } extern "C" { # [doc = " Overrides how long, in nanoseconds, that aws_thread_join_all_managed will wait for threads to complete.\n A value of zero will result in an unbounded wait."] pub fn aws_thread_set_managed_join_timeout_ns (timeout_in_ns : u64) ; } extern "C" { # [doc = " Cleans up the thread handle. Don't call this on a managed thread. If you wish to join the thread, you must join\n before calling this function."] pub fn aws_thread_clean_up (thread : * mut aws_thread) ; } extern "C" { # [doc = " Returns the thread id of the calling thread."] pub fn aws_thread_current_thread_id () -> aws_thread_id_t ; } extern "C" { # [doc = " Compare thread ids."] pub fn aws_thread_thread_id_equal (t1 : aws_thread_id_t , t2 : aws_thread_id_t) -> bool ; } extern "C" { # [doc = " Sleeps the current thread by nanos."] pub fn aws_thread_current_sleep (nanos : u64) ; } pub type aws_thread_atexit_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; extern "C" { # [doc = " Adds a callback to the chain to be called when the current thread joins.\n Callbacks are called from the current thread, in the reverse order they\n were added, after the thread function returns.\n If not called from within an aws_thread, has no effect."] pub fn aws_thread_current_at_exit (callback : aws_thread_atexit_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Increments the count of unjoined threads in the managed thread system. Used by managed threads and\n event loop threads. Additional usage requires the user to join corresponding threads themselves and\n correctly increment/decrement even in the face of launch/join errors.\n\n aws_thread_join_all_managed() will not return until this count has gone to zero."] pub fn aws_thread_increment_unjoined_count () ; } extern "C" { # [doc = " Decrements the count of unjoined threads in the managed thread system. Used by managed threads and\n event loop threads. Additional usage requires the user to join corresponding threads themselves and\n correctly increment/decrement even in the face of launch/join errors.\n\n aws_thread_join_all_managed() will not return until this count has gone to zero."] pub fn aws_thread_decrement_unjoined_count () ; } extern "C" { # [doc = " Gets name of the current thread.\n Caller is responsible for destroying returned string.\n If thread does not have a name, AWS_OP_SUCCESS is returned and out_name is\n set to NULL.\n If underlying OS call fails, AWS_ERROR_SYS_CALL_FAILURE will be raised\n If OS does not support getting thread name, AWS_ERROR_PLATFORM_NOT_SUPPORTED\n will be raised"] pub fn aws_thread_current_name (allocator : * mut aws_allocator , out_name : * mut * mut aws_string) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets name of the thread.\n Caller is responsible for destroying returned string.\n If thread does not have a name, AWS_OP_SUCCESS is returned and out_name is\n set to NULL.\n If underlying OS call fails, AWS_ERROR_SYS_CALL_FAILURE will be raised\n If OS does not support getting thread name, AWS_ERROR_PLATFORM_NOT_SUPPORTED\n will be raised"] pub fn aws_thread_name (allocator : * mut aws_allocator , thread_id : aws_thread_id_t , out_name : * mut * mut aws_string) -> :: libc :: c_int ; } pub mod aws_log_level { # [doc = " Controls what log calls pass through the logger and what log calls get filtered out.\n If a log level has a value of X, then all log calls using a level <= X will appear, while\n those using a value > X will not occur.\n\n You can filter both dynamically (by setting the log level on the logger object) or statically\n (by defining AWS_STATIC_LOG_LEVEL to be an appropriate integer module-wide). Statically filtered\n log calls will be completely compiled out but require a rebuild if you want to get more detail\n about what's happening."] pub type Type = :: libc :: c_uint ; pub const AWS_LL_NONE : Type = 0 ; pub const AWS_LL_FATAL : Type = 1 ; pub const AWS_LL_ERROR : Type = 2 ; pub const AWS_LL_WARN : Type = 3 ; pub const AWS_LL_INFO : Type = 4 ; pub const AWS_LL_DEBUG : Type = 5 ; pub const AWS_LL_TRACE : Type = 6 ; pub const AWS_LL_COUNT : Type = 7 ; } # [doc = " Log subject is a way of designating the topic of logging.\n\n The general idea is to support a finer-grained approach to log level control. The primary use case\n is for situations that require more detailed logging within a specific domain, where enabling that detail\n globally leads to an untenable flood of information.\n\n For example, enable TRACE logging for tls-related log statements (handshake binary payloads), but\n only WARN logging everywhere else (because http payloads would blow up the log files).\n\n Log subject is an enum similar to aws error: each library has its own value-space and someone is\n responsible for registering the value <-> string connections."] pub type aws_log_subject_t = u32 ; pub const AWS_LOG_SUBJECT_STRIDE_BITS : _bindgen_ty_20 = _bindgen_ty_20 :: AWS_LOG_SUBJECT_STRIDE_BITS ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_20 { AWS_LOG_SUBJECT_STRIDE_BITS = 10 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_subject_info { pub subject_id : aws_log_subject_t , pub subject_name : * const :: libc :: c_char , pub subject_description : * const :: libc :: c_char , } # [test] fn bindgen_test_layout_aws_log_subject_info () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_subject_info > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_subject_info > () , 24usize , concat ! ("Size of: " , stringify ! (aws_log_subject_info))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_subject_info > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_subject_info))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subject_id) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_subject_info) , "::" , stringify ! (subject_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subject_name) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_subject_info) , "::" , stringify ! (subject_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subject_description) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_log_subject_info) , "::" , stringify ! (subject_description))) ; } impl Default for aws_log_subject_info { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_subject_info_list { pub subject_list : * mut aws_log_subject_info , pub count : usize , } # [test] fn bindgen_test_layout_aws_log_subject_info_list () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_subject_info_list > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_subject_info_list > () , 16usize , concat ! ("Size of: " , stringify ! (aws_log_subject_info_list))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_subject_info_list > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_subject_info_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subject_list) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_subject_info_list) , "::" , stringify ! (subject_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . count) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_subject_info_list) , "::" , stringify ! (count))) ; } impl Default for aws_log_subject_info_list { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_common_log_subject { AWS_LS_COMMON_GENERAL = 0 , AWS_LS_COMMON_TASK_SCHEDULER = 1 , AWS_LS_COMMON_THREAD = 2 , AWS_LS_COMMON_MEMTRACE = 3 , AWS_LS_COMMON_XML_PARSER = 4 , AWS_LS_COMMON_IO = 5 , AWS_LS_COMMON_BUS = 6 , AWS_LS_COMMON_TEST = 7 , AWS_LS_COMMON_JSON_PARSER = 8 , AWS_LS_COMMON_LAST = 1023 , } # [doc = " We separate the log level function from the log call itself so that we can do the filter check in the macros (see\n below)\n\n By doing so, we make it so that the variadic format arguments are not even evaluated if the filter check does not\n succeed."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_logger_vtable { pub log : :: std :: option :: Option < unsafe extern "C" fn (logger : * mut aws_logger , log_level : aws_log_level :: Type , subject : aws_log_subject_t , format : * const :: libc :: c_char , ...) -> :: libc :: c_int > , pub get_log_level : :: std :: option :: Option < unsafe extern "C" fn (logger : * mut aws_logger , subject : aws_log_subject_t) -> aws_log_level :: Type > , pub clean_up : :: std :: option :: Option < unsafe extern "C" fn (logger : * mut aws_logger) > , pub set_log_level : :: std :: option :: Option < unsafe extern "C" fn (logger : * mut aws_logger , arg1 : aws_log_level :: Type) -> :: libc :: c_int > , } # [test] fn bindgen_test_layout_aws_logger_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_logger_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_logger_vtable > () , 32usize , concat ! ("Size of: " , stringify ! (aws_logger_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_logger_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_logger_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . log) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_logger_vtable) , "::" , stringify ! (log))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_log_level) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_logger_vtable) , "::" , stringify ! (get_log_level))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clean_up) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_logger_vtable) , "::" , stringify ! (clean_up))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . set_log_level) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_logger_vtable) , "::" , stringify ! (set_log_level))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_logger { pub vtable : * mut aws_logger_vtable , pub allocator : * mut aws_allocator , pub p_impl : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_logger () { const UNINIT : :: std :: mem :: MaybeUninit < aws_logger > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_logger > () , 24usize , concat ! ("Size of: " , stringify ! (aws_logger))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_logger > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_logger))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_logger) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_logger) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . p_impl) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_logger) , "::" , stringify ! (p_impl))) ; } impl Default for aws_logger { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_logger_pipeline { pub formatter : * mut aws_log_formatter , pub channel : * mut aws_log_channel , pub writer : * mut aws_log_writer , pub allocator : * mut aws_allocator , pub level : aws_atomic_var , } # [test] fn bindgen_test_layout_aws_logger_pipeline () { const UNINIT : :: std :: mem :: MaybeUninit < aws_logger_pipeline > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_logger_pipeline > () , 40usize , concat ! ("Size of: " , stringify ! (aws_logger_pipeline))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_logger_pipeline > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_logger_pipeline))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . formatter) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_logger_pipeline) , "::" , stringify ! (formatter))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . channel) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_logger_pipeline) , "::" , stringify ! (channel))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . writer) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_logger_pipeline) , "::" , stringify ! (writer))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_logger_pipeline) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . level) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_logger_pipeline) , "::" , stringify ! (level))) ; } impl Default for aws_logger_pipeline { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Options for aws_logger_init_standard().\n Set `filename` to open a file for logging and close it when the logger cleans up.\n Set `file` to use a file that is already open, such as `stderr` or `stdout`."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_logger_standard_options { pub level : aws_log_level :: Type , pub filename : * const :: libc :: c_char , pub file : * mut FILE , } # [test] fn bindgen_test_layout_aws_logger_standard_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_logger_standard_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_logger_standard_options > () , 24usize , concat ! ("Size of: " , stringify ! (aws_logger_standard_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_logger_standard_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_logger_standard_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . level) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_logger_standard_options) , "::" , stringify ! (level))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . filename) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_logger_standard_options) , "::" , stringify ! (filename))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . file) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_logger_standard_options) , "::" , stringify ! (file))) ; } impl Default for aws_logger_standard_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Sets the aws logger used globally across the process. Not thread-safe. Must only be called once."] pub fn aws_logger_set (logger : * mut aws_logger) ; } extern "C" { # [doc = " Gets the aws logger used globally across the process."] pub fn aws_logger_get () -> * mut aws_logger ; } extern "C" { # [doc = " Gets the aws logger used globally across the process if the logging level is at least the inputted level.\n\n @param subject log subject to perform the level check versus, not currently used\n @param level logging level to check against in order to return the logger\n @return the current logger if the current logging level is at or more detailed then the supplied logging level"] pub fn aws_logger_get_conditional (subject : aws_log_subject_t , level : aws_log_level :: Type) -> * mut aws_logger ; } extern "C" { # [doc = " Cleans up all resources used by the logger; simply invokes the clean_up v-function"] pub fn aws_logger_clean_up (logger : * mut aws_logger) ; } extern "C" { # [doc = " Sets the current logging level for the logger. Loggers are not require to support this.\n @param logger logger to set the log level for\n @param level new log level for the logger\n @return AWS_OP_SUCCESS if the level was successfully set, AWS_OP_ERR otherwise"] pub fn aws_logger_set_log_level (logger : * mut aws_logger , level : aws_log_level :: Type) -> :: libc :: c_int ; } extern "C" { # [doc = " Converts a log level to a c-string constant. Intended primarily to support building log lines that\n include the level in them, i.e.\n\n [ERROR] 10:34:54.642 01-31-19 - Json parse error...."] pub fn aws_log_level_to_string (log_level : aws_log_level :: Type , level_string : * mut * const :: libc :: c_char) -> :: libc :: c_int ; } extern "C" { # [doc = " Converts a c-string constant to a log level value. Uses case-insensitive comparison\n and simply iterates all possibilities until a match or nothing remains. If no match\n is found, AWS_OP_ERR is returned."] pub fn aws_string_to_log_level (level_string : * const :: libc :: c_char , log_level : * mut aws_log_level :: Type) -> :: libc :: c_int ; } extern "C" { # [doc = " Converts an aws_thread_id_t to a c-string. For portability, aws_thread_id_t\n must not be printed directly. Intended primarily to support building log\n lines that include the thread id in them. The parameter `buffer` must\n point-to a char buffer of length `bufsz == AWS_THREAD_ID_T_REPR_BUFSZ`. The\n thread id representation is returned in `buffer`."] pub fn aws_thread_id_t_to_string (thread_id : aws_thread_id_t , buffer : * mut :: libc :: c_char , bufsz : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Get subject name from log subject."] pub fn aws_log_subject_name (subject : aws_log_subject_t) -> * const :: libc :: c_char ; } extern "C" { # [doc = " Connects log subject strings with log subject integer values"] pub fn aws_register_log_subject_info_list (log_subject_list : * mut aws_log_subject_info_list) ; } extern "C" { # [doc = " Disconnects log subject strings with log subject integer values"] pub fn aws_unregister_log_subject_info_list (log_subject_list : * mut aws_log_subject_info_list) ; } extern "C" { pub fn aws_logger_init_standard (logger : * mut aws_logger , allocator : * mut aws_allocator , options : * mut aws_logger_standard_options) -> :: libc :: c_int ; } extern "C" { pub fn aws_logger_init_from_external (logger : * mut aws_logger , allocator : * mut aws_allocator , formatter : * mut aws_log_formatter , channel : * mut aws_log_channel , writer : * mut aws_log_writer , level : aws_log_level :: Type) -> :: libc :: c_int ; } extern "C" { pub static mut g_pipeline_logger_owned_vtable : aws_logger_vtable ; } extern "C" { pub fn aws_logger_init_noalloc (logger : * mut aws_logger , allocator : * mut aws_allocator , options : * mut aws_logger_standard_options) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_io_log_subject { AWS_LS_IO_GENERAL = 1024 , AWS_LS_IO_EVENT_LOOP = 1025 , AWS_LS_IO_SOCKET = 1026 , AWS_LS_IO_SOCKET_HANDLER = 1027 , AWS_LS_IO_TLS = 1028 , AWS_LS_IO_ALPN = 1029 , AWS_LS_IO_DNS = 1030 , AWS_LS_IO_PKI = 1031 , AWS_LS_IO_CHANNEL = 1032 , AWS_LS_IO_CHANNEL_BOOTSTRAP = 1033 , AWS_LS_IO_FILE_UTILS = 1034 , AWS_LS_IO_SHARED_LIBRARY = 1035 , AWS_LS_IO_EXPONENTIAL_BACKOFF_RETRY_STRATEGY = 1036 , AWS_LS_IO_STANDARD_RETRY_STRATEGY = 1037 , AWS_LS_IO_PKCS11 = 1038 , AWS_IO_LS_LAST = 2047 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_sdkutils_errors { AWS_ERROR_SDKUTILS_GENERAL = 15360 , AWS_ERROR_SDKUTILS_PARSE_FATAL = 15361 , AWS_ERROR_SDKUTILS_PARSE_RECOVERABLE = 15362 , AWS_ERROR_SDKUTILS_ENDPOINTS_UNSUPPORTED_RULESET = 15363 , AWS_ERROR_SDKUTILS_ENDPOINTS_PARSE_FAILED = 15364 , AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_INIT_FAILED = 15365 , AWS_ERROR_SDKUTILS_ENDPOINTS_RESOLVE_FAILED = 15366 , AWS_ERROR_SDKUTILS_ENDPOINTS_EMPTY_RULESET = 15367 , AWS_ERROR_SDKUTILS_ENDPOINTS_RULESET_EXHAUSTED = 15368 , AWS_ERROR_SDKUTILS_PARTITIONS_UNSUPPORTED = 15369 , AWS_ERROR_SDKUTILS_PARTITIONS_PARSE_FAILED = 15370 , AWS_ERROR_SDKUTILS_END_RANGE = 16383 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_sdkutils_log_subject { AWS_LS_SDKUTILS_GENERAL = 15360 , AWS_LS_SDKUTILS_PROFILE = 15361 , AWS_LS_SDKUTILS_ENDPOINTS_PARSING = 15362 , AWS_LS_SDKUTILS_ENDPOINTS_RESOLVE = 15363 , AWS_LS_SDKUTILS_ENDPOINTS_GENERAL = 15364 , AWS_LS_SDKUTILS_PARTITIONS_PARSING = 15365 , AWS_LS_SDKUTILS_LAST = 16383 , } extern "C" { pub fn aws_sdkutils_library_init (allocator : * mut aws_allocator) ; } extern "C" { pub fn aws_sdkutils_library_clean_up () ; } # [repr (u32)] # [non_exhaustive] # [doc = " Auth-specific error codes"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_auth_errors { AWS_AUTH_PROFILE_PARSE_RECOVERABLE_ERROR = 15362 , AWS_AUTH_PROFILE_PARSE_FATAL_ERROR = 15361 , AWS_AUTH_SIGNING_UNSUPPORTED_ALGORITHM = 6144 , AWS_AUTH_SIGNING_MISMATCHED_CONFIGURATION = 6145 , AWS_AUTH_SIGNING_NO_CREDENTIALS = 6146 , AWS_AUTH_SIGNING_ILLEGAL_REQUEST_QUERY_PARAM = 6147 , AWS_AUTH_SIGNING_ILLEGAL_REQUEST_HEADER = 6148 , AWS_AUTH_SIGNING_INVALID_CONFIGURATION = 6149 , AWS_AUTH_CREDENTIALS_PROVIDER_INVALID_ENVIRONMENT = 6150 , AWS_AUTH_CREDENTIALS_PROVIDER_INVALID_DELEGATE = 6151 , AWS_AUTH_CREDENTIALS_PROVIDER_PROFILE_SOURCE_FAILURE = 6152 , AWS_AUTH_CREDENTIALS_PROVIDER_IMDS_SOURCE_FAILURE = 6153 , AWS_AUTH_CREDENTIALS_PROVIDER_STS_SOURCE_FAILURE = 6154 , AWS_AUTH_CREDENTIALS_PROVIDER_HTTP_STATUS_FAILURE = 6155 , AWS_AUTH_PROVIDER_PARSER_UNEXPECTED_RESPONSE = 6156 , AWS_AUTH_CREDENTIALS_PROVIDER_ECS_SOURCE_FAILURE = 6157 , AWS_AUTH_CREDENTIALS_PROVIDER_X509_SOURCE_FAILURE = 6158 , AWS_AUTH_CREDENTIALS_PROVIDER_PROCESS_SOURCE_FAILURE = 6159 , AWS_AUTH_CREDENTIALS_PROVIDER_STS_WEB_IDENTITY_SOURCE_FAILURE = 6160 , AWS_AUTH_SIGNING_UNSUPPORTED_SIGNATURE_TYPE = 6161 , AWS_AUTH_SIGNING_MISSING_PREVIOUS_SIGNATURE = 6162 , AWS_AUTH_SIGNING_INVALID_CREDENTIALS = 6163 , AWS_AUTH_CANONICAL_REQUEST_MISMATCH = 6164 , AWS_AUTH_SIGV4A_SIGNATURE_VALIDATION_FAILURE = 6165 , AWS_AUTH_CREDENTIALS_PROVIDER_COGNITO_SOURCE_FAILURE = 6166 , AWS_AUTH_CREDENTIALS_PROVIDER_DELEGATE_FAILURE = 6167 , AWS_AUTH_SSO_TOKEN_PROVIDER_SOURCE_FAILURE = 6168 , AWS_AUTH_SSO_TOKEN_INVALID = 6169 , AWS_AUTH_SSO_TOKEN_EXPIRED = 6170 , AWS_AUTH_CREDENTIALS_PROVIDER_SSO_SOURCE_FAILURE = 6171 , AWS_AUTH_ERROR_END_RANGE = 7167 , } # [repr (u32)] # [non_exhaustive] # [doc = " Auth-specific logging subjects"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_auth_log_subject { AWS_LS_AUTH_GENERAL = 6144 , AWS_LS_AUTH_PROFILE = 6145 , AWS_LS_AUTH_CREDENTIALS_PROVIDER = 6146 , AWS_LS_AUTH_SIGNING = 6147 , AWS_LS_IMDS_CLIENT = 6148 , AWS_LS_AUTH_LAST = 7167 , } extern "C" { # [doc = " Initializes internal datastructures used by aws-c-auth.\n Must be called before using any functionality in aws-c-auth.\n\n @param allocator memory allocator to use for any module-level memory allocation"] pub fn aws_auth_library_init (allocator : * mut aws_allocator) ; } extern "C" { # [doc = " Clean up internal datastructures used by aws-c-auth.\n Must not be called until application is done using functionality in aws-c-auth."] pub fn aws_auth_library_clean_up () ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_auth_http_system_vtable { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_ecc_key_pair { _unused : [u8 ; 0] , } extern "C" { pub static aws_sts_assume_role_default_duration_secs : u16 ; } pub type aws_on_get_credentials_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (credentials : * mut aws_credentials , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_credentials_provider_get_credentials_fn = :: std :: option :: Option < unsafe extern "C" fn (provider : * mut aws_credentials_provider , callback : aws_on_get_credentials_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; pub type aws_credentials_provider_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (provider : * mut aws_credentials_provider) > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_credentials_provider_vtable { pub get_credentials : aws_credentials_provider_get_credentials_fn , pub destroy : aws_credentials_provider_destroy_fn , } # [test] fn bindgen_test_layout_aws_credentials_provider_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_credentials) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_vtable) , "::" , stringify ! (get_credentials))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_vtable) , "::" , stringify ! (destroy))) ; } pub type aws_credentials_provider_shutdown_completed_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_shutdown_options { pub shutdown_callback : aws_credentials_provider_shutdown_completed_fn , pub shutdown_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_credentials_provider_shutdown_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_shutdown_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_shutdown_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_shutdown_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_shutdown_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_shutdown_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_user_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_shutdown_options) , "::" , stringify ! (shutdown_user_data))) ; } impl Default for aws_credentials_provider_shutdown_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " A baseclass for credentials providers. A credentials provider is an object that has an asynchronous\n query function for retrieving AWS credentials.\n\n Ref-counted. Thread-safe."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider { pub vtable : * mut aws_credentials_provider_vtable , pub allocator : * mut aws_allocator , pub shutdown_options : aws_credentials_provider_shutdown_options , pub impl_ : * mut :: libc :: c_void , pub ref_count : aws_atomic_var , } # [test] fn bindgen_test_layout_aws_credentials_provider () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider > () , 48usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider) , "::" , stringify ! (ref_count))) ; } impl Default for aws_credentials_provider { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for a provider that returns a fixed set of credentials"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_static_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub access_key_id : aws_byte_cursor , pub secret_access_key : aws_byte_cursor , pub session_token : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_credentials_provider_static_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_static_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_static_options > () , 64usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_static_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_static_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_static_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_static_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . access_key_id) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_static_options) , "::" , stringify ! (access_key_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . secret_access_key) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_static_options) , "::" , stringify ! (secret_access_key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . session_token) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_static_options) , "::" , stringify ! (session_token))) ; } impl Default for aws_credentials_provider_static_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for a provider that returns credentials based on environment variable values"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_environment_options { pub shutdown_options : aws_credentials_provider_shutdown_options , } # [test] fn bindgen_test_layout_aws_credentials_provider_environment_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_environment_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_environment_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_environment_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_environment_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_environment_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_environment_options) , "::" , stringify ! (shutdown_options))) ; } impl Default for aws_credentials_provider_environment_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for a provider that sources credentials from the aws config and credentials files\n (by default ~/.aws/config and ~/.aws/credentials)"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_profile_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub profile_name_override : aws_byte_cursor , pub config_file_name_override : aws_byte_cursor , pub credentials_file_name_override : aws_byte_cursor , # [doc = " (Optional)\n Use a cached merged profile collection. A merge collection has both config file\n (~/.aws/config) and credentials file based profile collection (~/.aws/credentials) using\n `aws_profile_collection_new_from_merge`.\n If this option is provided, `config_file_name_override` and `credentials_file_name_override` will be ignored."] pub profile_collection_cached : * mut aws_profile_collection , pub bootstrap : * mut aws_client_bootstrap , pub tls_ctx : * mut aws_tls_ctx , pub function_table : * mut aws_auth_http_system_vtable , } # [test] fn bindgen_test_layout_aws_credentials_provider_profile_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_profile_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_profile_options > () , 96usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_profile_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_profile_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_profile_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_name_override) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (profile_name_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_file_name_override) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (config_file_name_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . credentials_file_name_override) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (credentials_file_name_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_collection_cached) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (profile_collection_cached))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_profile_options) , "::" , stringify ! (function_table))) ; } impl Default for aws_credentials_provider_profile_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for a provider that functions as a caching decorator. Credentials sourced through this\n provider will be cached within it until their expiration time. When the cached credentials expire, new\n credentials will be fetched when next queried."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_cached_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub source : * mut aws_credentials_provider , pub refresh_time_in_milliseconds : u64 , pub high_res_clock_fn : aws_io_clock_fn , pub system_clock_fn : aws_io_clock_fn , } # [test] fn bindgen_test_layout_aws_credentials_provider_cached_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_cached_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_cached_options > () , 48usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_cached_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_cached_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_cached_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cached_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . source) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cached_options) , "::" , stringify ! (source))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . refresh_time_in_milliseconds) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cached_options) , "::" , stringify ! (refresh_time_in_milliseconds))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . high_res_clock_fn) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cached_options) , "::" , stringify ! (high_res_clock_fn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . system_clock_fn) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cached_options) , "::" , stringify ! (system_clock_fn))) ; } impl Default for aws_credentials_provider_cached_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for a provider that queries, in order, a list of providers. This provider uses the\n first set of credentials successfully queried. Providers are queried one at a time; a provider is not queried\n until the preceding provider has failed to source credentials."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_chain_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub providers : * mut * mut aws_credentials_provider , pub provider_count : usize , } # [test] fn bindgen_test_layout_aws_credentials_provider_chain_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_chain_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_chain_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_chain_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_chain_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_chain_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . providers) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_options) , "::" , stringify ! (providers))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . provider_count) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_options) , "::" , stringify ! (provider_count))) ; } impl Default for aws_credentials_provider_chain_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_imds_protocol_version { # [doc = " Defaults to IMDS_PROTOCOL_V2. It can be set to either one and IMDS Client\n will figure out (by looking at response code) which protocol an instance\n is using. But a more clear setting will reduce unnecessary network request."] IMDS_PROTOCOL_V2 = 0 , # [doc = " Defaults to IMDS_PROTOCOL_V2. It can be set to either one and IMDS Client\n will figure out (by looking at response code) which protocol an instance\n is using. But a more clear setting will reduce unnecessary network request."] IMDS_PROTOCOL_V1 = 1 , } # [doc = " Configuration options for the provider that sources credentials from ec2 instance metadata"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_imds_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , pub imds_version : aws_imds_protocol_version , pub function_table : * mut aws_auth_http_system_vtable , } # [test] fn bindgen_test_layout_aws_credentials_provider_imds_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_imds_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_imds_options > () , 40usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_imds_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_imds_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_imds_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_imds_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_imds_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . imds_version) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_imds_options) , "::" , stringify ! (imds_version))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_imds_options) , "::" , stringify ! (function_table))) ; } impl Default for aws_credentials_provider_imds_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_ecs_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , pub host : aws_byte_cursor , pub path_and_query : aws_byte_cursor , pub auth_token : aws_byte_cursor , pub tls_ctx : * mut aws_tls_ctx , pub function_table : * mut aws_auth_http_system_vtable , pub port : u16 , } # [test] fn bindgen_test_layout_aws_credentials_provider_ecs_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_ecs_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_ecs_options > () , 96usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_ecs_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_ecs_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_ecs_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . path_and_query) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (path_and_query))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . auth_token) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (auth_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (function_table))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_ecs_options) , "::" , stringify ! (port))) ; } impl Default for aws_credentials_provider_ecs_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for the X509 credentials provider\n\n The x509 credentials provider sources temporary credentials from AWS IoT Core using TLS mutual authentication.\n See details: https://docs.aws.amazon.com/iot/latest/developerguide/authorizing-direct-aws.html\n An end to end demo with detailed steps can be found here:\n https://aws.amazon.com/blogs/security/how-to-eliminate-the-need-for-hardcoded-aws-credentials-in-devices-by-using-the-aws-iot-credentials-provider/"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_x509_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , pub tls_connection_options : * const aws_tls_connection_options , pub thing_name : aws_byte_cursor , pub role_alias : aws_byte_cursor , # [doc = " Per-account X509 credentials sourcing endpoint."] pub endpoint : aws_byte_cursor , # [doc = " (Optional) Http proxy configuration for the http request that fetches credentials"] pub proxy_options : * const aws_http_proxy_options , pub function_table : * mut aws_auth_http_system_vtable , } # [test] fn bindgen_test_layout_aws_credentials_provider_x509_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_x509_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_x509_options > () , 96usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_x509_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_x509_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_x509_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_connection_options) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (tls_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . thing_name) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (thing_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . role_alias) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (role_alias))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoint) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (endpoint))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_options) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_x509_options) , "::" , stringify ! (function_table))) ; } impl Default for aws_credentials_provider_x509_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for the STS web identity provider\n\n Sts with web identity credentials provider sources a set of temporary security credentials for users who have been\n authenticated in a mobile or web application with a web identity provider.\n Example providers include Amazon Cognito, Login with Amazon, Facebook, Google, or any OpenID Connect-compatible\n identity provider like Elastic Kubernetes Service\n https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html\n The required parameters used in the request (region, roleArn, sessionName, tokenFilePath) are automatically resolved\n by SDK from envrionment variables or config file.\n---------------------------------------------------------------------------------\n| Parameter | Environment Variable Name | Config File Property Name |\n----------------------------------------------------------------------------------\n| region | AWS_DEFAULT_REGION | region |\n| role_arn | AWS_ROLE_ARN | role_arn |\n| role_session_name | AWS_ROLE_SESSION_NAME | role_session_name |\n| token_file_path | AWS_WEB_IDENTITY_TOKEN_FILE | web_identity_token_file |\n|--------------------------------------------------------------------------------|"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_sts_web_identity_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , # [doc = " (Optional)\n Use a cached config profile collection. You can also pass a merged collection."] pub config_profile_collection_cached : * mut aws_profile_collection , pub tls_ctx : * mut aws_tls_ctx , pub function_table : * mut aws_auth_http_system_vtable , pub profile_name_override : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_credentials_provider_sts_web_identity_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_sts_web_identity_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_sts_web_identity_options > () , 64usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_sts_web_identity_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_sts_web_identity_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_sts_web_identity_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_profile_collection_cached) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (config_profile_collection_cached))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (function_table))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_name_override) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_web_identity_options) , "::" , stringify ! (profile_name_override))) ; } impl Default for aws_credentials_provider_sts_web_identity_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_sso_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub profile_name_override : aws_byte_cursor , pub config_file_name_override : aws_byte_cursor , # [doc = " (Optional)\n Use a cached config profile collection. You can also pass a merged collection.\n config_file_name_override will be ignored if this option is provided."] pub config_file_cached : * mut aws_profile_collection , pub bootstrap : * mut aws_client_bootstrap , pub tls_ctx : * mut aws_tls_ctx , pub function_table : * mut aws_auth_http_system_vtable , pub system_clock_fn : aws_io_clock_fn , } # [test] fn bindgen_test_layout_aws_credentials_provider_sso_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_sso_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_sso_options > () , 88usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_sso_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_sso_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_sso_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_name_override) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (profile_name_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_file_name_override) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (config_file_name_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_file_cached) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (config_file_cached))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (function_table))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . system_clock_fn) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sso_options) , "::" , stringify ! (system_clock_fn))) ; } impl Default for aws_credentials_provider_sso_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for the STS credentials provider"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_sts_options { pub bootstrap : * mut aws_client_bootstrap , pub tls_ctx : * mut aws_tls_ctx , pub creds_provider : * mut aws_credentials_provider , pub role_arn : aws_byte_cursor , pub session_name : aws_byte_cursor , pub duration_seconds : u16 , # [doc = " (Optional) Http proxy configuration for the AssumeRole http request that fetches credentials"] pub http_proxy_options : * const aws_http_proxy_options , pub shutdown_options : aws_credentials_provider_shutdown_options , pub function_table : * mut aws_auth_http_system_vtable , pub system_clock_fn : aws_io_clock_fn , } # [test] fn bindgen_test_layout_aws_credentials_provider_sts_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_sts_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_sts_options > () , 104usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_sts_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_sts_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_sts_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . creds_provider) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (creds_provider))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . role_arn) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (role_arn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . session_name) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (session_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . duration_seconds) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (duration_seconds))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http_proxy_options) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (http_proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (function_table))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . system_clock_fn) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_sts_options) , "::" , stringify ! (system_clock_fn))) ; } impl Default for aws_credentials_provider_sts_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for the process credentials provider\n\n The process credentials provider sources credentials from running a command or process.\n The command to run is sourced from a profile in the AWS config file, using the standard\n profile selection rules. The profile key the command is read from is \"credential_process.\"\n E.g.:\n [default]\n credential_process=/opt/amazon/bin/my-credential-fetcher --argsA=abc\n On successfully running the command, the output should be a json data with the following\n format:\n {\n\"Version\": 1,\n\"AccessKeyId\": \"accesskey\",\n\"SecretAccessKey\": \"secretAccessKey\"\n\"SessionToken\": \"....\",\n\"Expiration\": \"2019-05-29T00:21:43Z\"\n}\n Version here identifies the command output format version."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_process_options { pub shutdown_options : aws_credentials_provider_shutdown_options , # [doc = " In which profile name to look for credential_process,\n if not provided, we will try environment variable: AWS_PROFILE."] pub profile_to_use : aws_byte_cursor , # [doc = " (Optional)\n Use a cached config profile collection. You can also pass a merged collection."] pub config_profile_collection_cached : * mut aws_profile_collection , } # [test] fn bindgen_test_layout_aws_credentials_provider_process_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_process_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_process_options > () , 40usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_process_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_process_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_process_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_process_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_to_use) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_process_options) , "::" , stringify ! (profile_to_use))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_profile_collection_cached) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_process_options) , "::" , stringify ! (config_profile_collection_cached))) ; } impl Default for aws_credentials_provider_process_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options for the default credentials provider chain."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_chain_default_options { pub shutdown_options : aws_credentials_provider_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , pub tls_ctx : * mut aws_tls_ctx , # [doc = " (Optional)\n Use a cached merged profile collection. A merge collection has both config file\n (~/.aws/config) and credentials file based profile collection (~/.aws/credentials) using\n `aws_profile_collection_new_from_merge`.\n If this option is provided, `config_file_name_override` and `credentials_file_name_override` will be ignored."] pub profile_collection_cached : * mut aws_profile_collection , pub profile_name_override : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_credentials_provider_chain_default_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_chain_default_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_chain_default_options > () , 56usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_chain_default_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_chain_default_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_chain_default_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_default_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_default_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_default_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_collection_cached) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_default_options) , "::" , stringify ! (profile_collection_cached))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . profile_name_override) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_chain_default_options) , "::" , stringify ! (profile_name_override))) ; } impl Default for aws_credentials_provider_chain_default_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_credentials_provider_delegate_get_credentials_fn = :: std :: option :: Option < unsafe extern "C" fn (delegate_user_data : * mut :: libc :: c_void , callback : aws_on_get_credentials_callback_fn , callback_user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Configuration options for the delegate credentials provider."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_delegate_options { pub shutdown_options : aws_credentials_provider_shutdown_options , # [doc = " Delegated get_credentials() callback."] pub get_credentials : aws_credentials_provider_delegate_get_credentials_fn , # [doc = " User data for delegated callbacks."] pub delegate_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_credentials_provider_delegate_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_delegate_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_delegate_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_delegate_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_delegate_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_delegate_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_delegate_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_credentials) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_delegate_options) , "::" , stringify ! (get_credentials))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . delegate_user_data) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_delegate_options) , "::" , stringify ! (delegate_user_data))) ; } impl Default for aws_credentials_provider_delegate_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " A (string) pair defining an identity provider and a valid login token sourced from it."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_cognito_identity_provider_token_pair { # [doc = " Name of an identity provider"] pub identity_provider_name : aws_byte_cursor , # [doc = " Valid login token source from the identity provider"] pub identity_provider_token : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_cognito_identity_provider_token_pair () { const UNINIT : :: std :: mem :: MaybeUninit < aws_cognito_identity_provider_token_pair > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_cognito_identity_provider_token_pair > () , 32usize , concat ! ("Size of: " , stringify ! (aws_cognito_identity_provider_token_pair))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_cognito_identity_provider_token_pair > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_cognito_identity_provider_token_pair))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . identity_provider_name) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_cognito_identity_provider_token_pair) , "::" , stringify ! (identity_provider_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . identity_provider_token) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_cognito_identity_provider_token_pair) , "::" , stringify ! (identity_provider_token))) ; } impl Default for aws_cognito_identity_provider_token_pair { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options needed to create a Cognito-based Credentials Provider"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_credentials_provider_cognito_options { pub shutdown_options : aws_credentials_provider_shutdown_options , # [doc = " Cognito service regional endpoint to source credentials from."] pub endpoint : aws_byte_cursor , # [doc = " Cognito identity to fetch credentials relative to."] pub identity : aws_byte_cursor , # [doc = " Optional set of identity provider token pairs to allow for authenticated identity access."] pub logins : * mut aws_cognito_identity_provider_token_pair , pub login_count : usize , # [doc = " Optional ARN of the role to be assumed when multiple roles were received in the token from the identity provider."] pub custom_role_arn : * mut aws_byte_cursor , pub bootstrap : * mut aws_client_bootstrap , pub tls_ctx : * mut aws_tls_ctx , # [doc = " (Optional) Http proxy configuration for the http request that fetches credentials"] pub http_proxy_options : * const aws_http_proxy_options , pub function_table : * mut aws_auth_http_system_vtable , } # [test] fn bindgen_test_layout_aws_credentials_provider_cognito_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_credentials_provider_cognito_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_credentials_provider_cognito_options > () , 104usize , concat ! ("Size of: " , stringify ! (aws_credentials_provider_cognito_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_credentials_provider_cognito_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_credentials_provider_cognito_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoint) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (endpoint))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . identity) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (identity))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . logins) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (logins))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . login_count) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (login_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . custom_role_arn) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (custom_role_arn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_ctx) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (tls_ctx))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http_proxy_options) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (http_proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_credentials_provider_cognito_options) , "::" , stringify ! (function_table))) ; } impl Default for aws_credentials_provider_cognito_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Creates a new set of aws credentials\n\n @param allocator memory allocator to use\n @param access_key_id_cursor value for the aws access key id field\n @param secret_access_key_cursor value for the secret access key field\n @param session_token_cursor (optional) security token associated with the credentials\n @param expiration_timepoint_seconds timepoint, in seconds since epoch, that the credentials will no longer\n be valid past. For credentials that do not expire, use UINT64_MAX\n\n @return a valid credentials object, or NULL"] pub fn aws_credentials_new (allocator : * mut aws_allocator , access_key_id_cursor : aws_byte_cursor , secret_access_key_cursor : aws_byte_cursor , session_token_cursor : aws_byte_cursor , expiration_timepoint_seconds : u64) -> * mut aws_credentials ; } extern "C" { # [doc = " Creates a new set of aws anonymous credentials.\n Use Anonymous credentials, when you want to skip the signing process.\n\n @param allocator memory allocator to use\n\n @return a valid credentials object, or NULL"] pub fn aws_credentials_new_anonymous (allocator : * mut aws_allocator) -> * mut aws_credentials ; } extern "C" { # [doc = " Creates a new set of AWS credentials\n\n @param allocator memory allocator to use\n @param access_key_id value for the aws access key id field\n @param secret_access_key value for the secret access key field\n @param session_token (optional) security token associated with the credentials\n @param expiration_timepoint_seconds timepoint, in seconds since epoch, that the credentials will no longer\n be valid past. For credentials that do not expire, use UINT64_MAX\n\n @return a valid credentials object, or NULL"] pub fn aws_credentials_new_from_string (allocator : * mut aws_allocator , access_key_id : * const aws_string , secret_access_key : * const aws_string , session_token : * const aws_string , expiration_timepoint_seconds : u64) -> * mut aws_credentials ; } extern "C" { # [doc = " Creates a set of AWS credentials that includes an ECC key pair. These credentials do not have a value for\n the secret access key; the ecc key takes over that field's role in sigv4a signing.\n\n @param allocator memory allocator to use for all memory allocation\n @param access_key_id access key id for the credential set\n @param ecc_key ecc key to use during signing when using these credentials\n @param session_token (optional) session token associated with the credentials\n @param expiration_timepoint_in_seconds (optional) if session-based, time at which these credentials expire\n @return a new pair of AWS credentials, or NULL"] pub fn aws_credentials_new_ecc (allocator : * mut aws_allocator , access_key_id : aws_byte_cursor , ecc_key : * mut aws_ecc_key_pair , session_token : aws_byte_cursor , expiration_timepoint_in_seconds : u64) -> * mut aws_credentials ; } extern "C" { pub fn aws_credentials_new_ecc_from_aws_credentials (allocator : * mut aws_allocator , credentials : * const aws_credentials) -> * mut aws_credentials ; } extern "C" { # [doc = " Add a reference to some credentials\n\n @param credentials credentials to increment the ref count on"] pub fn aws_credentials_acquire (credentials : * const aws_credentials) ; } extern "C" { # [doc = " Remove a reference to some credentials\n\n @param credentials credentials to decrement the ref count on"] pub fn aws_credentials_release (credentials : * const aws_credentials) ; } extern "C" { # [doc = " Get the AWS access key id from a set of credentials\n\n @param credentials credentials to get the access key id from\n @return a byte cursor to the access key id"] pub fn aws_credentials_get_access_key_id (credentials : * const aws_credentials) -> aws_byte_cursor ; } extern "C" { # [doc = " Get the AWS secret access key from a set of credentials\n\n @param credentials credentials to get the secret access key from\n @return a byte cursor to the secret access key"] pub fn aws_credentials_get_secret_access_key (credentials : * const aws_credentials) -> aws_byte_cursor ; } extern "C" { # [doc = " Get the AWS session token from a set of credentials\n\n @param credentials credentials to get the session token from\n @return a byte cursor to the session token or an empty byte cursor if there is no session token"] pub fn aws_credentials_get_session_token (credentials : * const aws_credentials) -> aws_byte_cursor ; } extern "C" { # [doc = " Get the expiration timepoint (in seconds since epoch) associated with a set of credentials\n\n @param credentials credentials to get the expiration timepoint for\n @return the time, in seconds since epoch, the credentials will expire; UINT64_MAX for credentials\n without a specific expiration time"] pub fn aws_credentials_get_expiration_timepoint_seconds (credentials : * const aws_credentials) -> u64 ; } extern "C" { # [doc = " Get the elliptic curve key associated with this set of credentials\n @param credentials credentials to get the the elliptic curve key for\n @return the elliptic curve key associated with the credentials, or NULL if no key is associated with\n these credentials"] pub fn aws_credentials_get_ecc_key_pair (credentials : * const aws_credentials) -> * mut aws_ecc_key_pair ; } extern "C" { # [doc = " If credentials are anonymous, then the signing process is skipped.\n\n @param credentials credentials to check\n\n @return true if the credentials are anonymous; false otherwise."] pub fn aws_credentials_is_anonymous (credentials : * const aws_credentials) -> bool ; } extern "C" { # [doc = " Derives an ecc key pair (based on the nist P256 curve) from the access key id and secret access key components\n of a set of AWS credentials using an internal key derivation specification. Used to perform sigv4a signing in\n the hybrid mode based on AWS credentials.\n\n @param allocator memory allocator to use for all memory allocation\n @param credentials AWS credentials to derive the ECC key from using the AWS sigv4a key deriviation specification\n @return a new ecc key pair or NULL on failure"] pub fn aws_ecc_key_pair_new_ecdsa_p256_key_from_aws_credentials (allocator : * mut aws_allocator , credentials : * const aws_credentials) -> * mut aws_ecc_key_pair ; } extern "C" { # [doc = " Release a reference to a credentials provider\n\n @param provider provider to decrement the ref count on"] pub fn aws_credentials_provider_release (provider : * mut aws_credentials_provider) -> * mut aws_credentials_provider ; } extern "C" { pub fn aws_credentials_provider_acquire (provider : * mut aws_credentials_provider) -> * mut aws_credentials_provider ; } extern "C" { pub fn aws_credentials_provider_get_credentials (provider : * mut aws_credentials_provider , callback : aws_on_get_credentials_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Creates a simple provider that just returns a fixed set of credentials\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_static (allocator : * mut aws_allocator , options : * const aws_credentials_provider_static_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a simple anonymous credentials provider\n\n @param allocator memory allocator to use for all memory allocation\n @param shutdown_options an optional shutdown callback that gets\n invoked when the resources used by the provider are no longer in use.\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_anonymous (allocator : * mut aws_allocator , shutdown_options : * const aws_credentials_provider_shutdown_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that returns credentials sourced from the environment variables:\n\n AWS_ACCESS_KEY_ID\n AWS_SECRET_ACCESS_KEY\n AWS_SESSION_TOKEN\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_environment (allocator : * mut aws_allocator , options : * const aws_credentials_provider_environment_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that functions as a caching decorating of another provider.\n\n For example, the default chain is implemented as:\n\n CachedProvider -> ProviderChain(EnvironmentProvider -> ProfileProvider -> ECS/EC2IMD etc...)\n\n A reference is taken on the target provider\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_cached (allocator : * mut aws_allocator , options : * const aws_credentials_provider_cached_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from key-value profiles loaded from the aws credentials\n file (\"~/.aws/credentials\" by default) and the aws config file (\"~/.aws/config\" by\n default)\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_profile (allocator : * mut aws_allocator , options : * const aws_credentials_provider_profile_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that assumes an IAM role via. STS AssumeRole() API. This provider will fetch new credentials\n upon each call to aws_credentials_provider_get_credentials().\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_sts (allocator : * mut aws_allocator , options : * const aws_credentials_provider_sts_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from an ordered sequence of providers, with the overall result\n being from the first provider to return a valid set of credentials\n\n References are taken on all supplied providers\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_chain (allocator : * mut aws_allocator , options : * const aws_credentials_provider_chain_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from the ec2 instance metadata service\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_imds (allocator : * mut aws_allocator , options : * const aws_credentials_provider_imds_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from the ecs role credentials service\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_ecs (allocator : * mut aws_allocator , options : * const aws_credentials_provider_ecs_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from IoT Core\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_x509 (allocator : * mut aws_allocator , options : * const aws_credentials_provider_x509_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from STS using AssumeRoleWithWebIdentity\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_sts_web_identity (allocator : * mut aws_allocator , options : * const aws_credentials_provider_sts_web_identity_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from SSO using a SSOToken.\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_sso (allocator : * mut aws_allocator , options : * const aws_credentials_provider_sso_options) -> * mut aws_credentials_provider ; } extern "C" { pub fn aws_credentials_provider_new_process (allocator : * mut aws_allocator , options : * const aws_credentials_provider_process_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Create a credentials provider depends on provided vtable to fetch the credentials.\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_delegate (allocator : * mut aws_allocator , options : * const aws_credentials_provider_delegate_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a provider that sources credentials from the Cognito-Identity service via an\n invocation of the GetCredentialsForIdentity API call.\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_cognito (allocator : * mut aws_allocator , options : * const aws_credentials_provider_cognito_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates a cognito-based provider that has a caching layer wrapped around it\n\n @param allocator memory allocator to use for all memory allocation\n @param options cognito-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_cognito_caching (allocator : * mut aws_allocator , options : * const aws_credentials_provider_cognito_options) -> * mut aws_credentials_provider ; } extern "C" { # [doc = " Creates the default provider chain used by most AWS SDKs.\n\n Generally:\n\n (1) Environment\n (2) Profile\n (3) STS web identity\n (4) (conditional, off by default) ECS\n (5) (conditional, on by default) EC2 Instance Metadata\n\n Support for environmental control of the default provider chain is not yet\n implemented.\n\n @param allocator memory allocator to use for all memory allocation\n @param options provider-specific configuration options\n\n @return the newly-constructed credentials provider, or NULL if an error occurred."] pub fn aws_credentials_provider_new_chain_default (allocator : * mut aws_allocator , options : * const aws_credentials_provider_chain_default_options) -> * mut aws_credentials_provider ; } extern "C" { pub static mut g_aws_credentials_provider_http_function_table : * const aws_auth_http_system_vtable ; } pub const AWS_DATE_TIME_STR_MAX_LEN : _bindgen_ty_21 = _bindgen_ty_21 :: AWS_DATE_TIME_STR_MAX_LEN ; pub const AWS_DATE_TIME_STR_MAX_BASIC_LEN : _bindgen_ty_21 = _bindgen_ty_21 :: AWS_DATE_TIME_STR_MAX_BASIC_LEN ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_21 { AWS_DATE_TIME_STR_MAX_LEN = 100 , AWS_DATE_TIME_STR_MAX_BASIC_LEN = 20 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_date_format { AWS_DATE_FORMAT_RFC822 = 0 , AWS_DATE_FORMAT_ISO_8601 = 1 , AWS_DATE_FORMAT_ISO_8601_BASIC = 2 , AWS_DATE_FORMAT_AUTO_DETECT = 3 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_date_month { AWS_DATE_MONTH_JANUARY = 0 , AWS_DATE_MONTH_FEBRUARY = 1 , AWS_DATE_MONTH_MARCH = 2 , AWS_DATE_MONTH_APRIL = 3 , AWS_DATE_MONTH_MAY = 4 , AWS_DATE_MONTH_JUNE = 5 , AWS_DATE_MONTH_JULY = 6 , AWS_DATE_MONTH_AUGUST = 7 , AWS_DATE_MONTH_SEPTEMBER = 8 , AWS_DATE_MONTH_OCTOBER = 9 , AWS_DATE_MONTH_NOVEMBER = 10 , AWS_DATE_MONTH_DECEMBER = 11 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_date_day_of_week { AWS_DATE_DAY_OF_WEEK_SUNDAY = 0 , AWS_DATE_DAY_OF_WEEK_MONDAY = 1 , AWS_DATE_DAY_OF_WEEK_TUESDAY = 2 , AWS_DATE_DAY_OF_WEEK_WEDNESDAY = 3 , AWS_DATE_DAY_OF_WEEK_THURSDAY = 4 , AWS_DATE_DAY_OF_WEEK_FRIDAY = 5 , AWS_DATE_DAY_OF_WEEK_SATURDAY = 6 , } # [repr (C)] pub struct aws_date_time { pub timestamp : time_t , pub milliseconds : u16 , pub tz : [:: libc :: c_char ; 6usize] , pub gmt_time : tm , pub local_time : tm , pub utc_assumed : bool , } # [test] fn bindgen_test_layout_aws_date_time () { const UNINIT : :: std :: mem :: MaybeUninit < aws_date_time > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_date_time > () , 136usize , concat ! ("Size of: " , stringify ! (aws_date_time))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_date_time > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_date_time))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . timestamp) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (timestamp))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . milliseconds) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (milliseconds))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tz) as usize - ptr as usize } , 10usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (tz))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . gmt_time) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (gmt_time))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . local_time) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (local_time))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . utc_assumed) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_date_time) , "::" , stringify ! (utc_assumed))) ; } impl Default for aws_date_time { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Initializes dt to be the current system time."] pub fn aws_date_time_init_now (dt : * mut aws_date_time) ; } extern "C" { # [doc = " Initializes dt to be the time represented in milliseconds since unix epoch."] pub fn aws_date_time_init_epoch_millis (dt : * mut aws_date_time , ms_since_epoch : u64) ; } extern "C" { # [doc = " Initializes dt to be the time represented in seconds.millis since unix epoch."] pub fn aws_date_time_init_epoch_secs (dt : * mut aws_date_time , sec_ms : f64) ; } extern "C" { # [doc = " Initializes dt to be the time represented by date_str in format 'fmt'. Returns AWS_OP_SUCCESS if the\n string was successfully parsed, returns AWS_OP_ERR if parsing failed.\n\n Notes for AWS_DATE_FORMAT_RFC822:\n If no time zone information is provided, it is assumed to be local time (please don't do this).\n\n If the time zone is something other than something indicating Universal Time (e.g. Z, UT, UTC, or GMT) or an offset\n from UTC (e.g. +0100, -0700), parsing will fail.\n\n Really, it's just better if you always use Universal Time."] pub fn aws_date_time_init_from_str (dt : * mut aws_date_time , date_str : * const aws_byte_buf , fmt : aws_date_format) -> :: libc :: c_int ; } extern "C" { # [doc = " aws_date_time_init variant that takes a byte_cursor rather than a byte_buf"] pub fn aws_date_time_init_from_str_cursor (dt : * mut aws_date_time , date_str_cursor : * const aws_byte_cursor , fmt : aws_date_format) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the current time as a formatted date string in local time into output_buf. If buffer is too small, it will\n return AWS_OP_ERR. A good size suggestion is AWS_DATE_TIME_STR_MAX_LEN bytes. AWS_DATE_FORMAT_AUTO_DETECT is not\n allowed."] pub fn aws_date_time_to_local_time_str (dt : * const aws_date_time , fmt : aws_date_format , output_buf : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the current time as a formatted date string in utc time into output_buf. If buffer is too small, it will\n return AWS_OP_ERR. A good size suggestion is AWS_DATE_TIME_STR_MAX_LEN bytes. AWS_DATE_FORMAT_AUTO_DETECT is not\n allowed."] pub fn aws_date_time_to_utc_time_str (dt : * const aws_date_time , fmt : aws_date_format , output_buf : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the current time as a formatted short date string in local time into output_buf. If buffer is too small, it\n will return AWS_OP_ERR. A good size suggestion is AWS_DATE_TIME_STR_MAX_LEN bytes. AWS_DATE_FORMAT_AUTO_DETECT is not\n allowed."] pub fn aws_date_time_to_local_time_short_str (dt : * const aws_date_time , fmt : aws_date_format , output_buf : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the current time as a formatted short date string in utc time into output_buf. If buffer is too small, it will\n return AWS_OP_ERR. A good size suggestion is AWS_DATE_TIME_STR_MAX_LEN bytes. AWS_DATE_FORMAT_AUTO_DETECT is not\n allowed."] pub fn aws_date_time_to_utc_time_short_str (dt : * const aws_date_time , fmt : aws_date_format , output_buf : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { pub fn aws_date_time_as_epoch_secs (dt : * const aws_date_time) -> f64 ; } extern "C" { pub fn aws_date_time_as_nanos (dt : * const aws_date_time) -> u64 ; } extern "C" { pub fn aws_date_time_as_millis (dt : * const aws_date_time) -> u64 ; } extern "C" { pub fn aws_date_time_year (dt : * const aws_date_time , local_time : bool) -> u16 ; } extern "C" { pub fn aws_date_time_month (dt : * const aws_date_time , local_time : bool) -> aws_date_month ; } extern "C" { pub fn aws_date_time_month_day (dt : * const aws_date_time , local_time : bool) -> u8 ; } extern "C" { pub fn aws_date_time_day_of_week (dt : * const aws_date_time , local_time : bool) -> aws_date_day_of_week ; } extern "C" { pub fn aws_date_time_hour (dt : * const aws_date_time , local_time : bool) -> u8 ; } extern "C" { pub fn aws_date_time_minute (dt : * const aws_date_time , local_time : bool) -> u8 ; } extern "C" { pub fn aws_date_time_second (dt : * const aws_date_time , local_time : bool) -> u8 ; } extern "C" { pub fn aws_date_time_dst (dt : * const aws_date_time , local_time : bool) -> bool ; } extern "C" { # [doc = " returns the difference of a and b (a - b) in seconds."] pub fn aws_date_time_diff (a : * const aws_date_time , b : * const aws_date_time) -> time_t ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_errors { AWS_ERROR_HTTP_UNKNOWN = 2048 , AWS_ERROR_HTTP_HEADER_NOT_FOUND = 2049 , AWS_ERROR_HTTP_INVALID_HEADER_FIELD = 2050 , AWS_ERROR_HTTP_INVALID_HEADER_NAME = 2051 , AWS_ERROR_HTTP_INVALID_HEADER_VALUE = 2052 , AWS_ERROR_HTTP_INVALID_METHOD = 2053 , AWS_ERROR_HTTP_INVALID_PATH = 2054 , AWS_ERROR_HTTP_INVALID_STATUS_CODE = 2055 , AWS_ERROR_HTTP_MISSING_BODY_STREAM = 2056 , AWS_ERROR_HTTP_INVALID_BODY_STREAM = 2057 , AWS_ERROR_HTTP_CONNECTION_CLOSED = 2058 , AWS_ERROR_HTTP_SWITCHED_PROTOCOLS = 2059 , AWS_ERROR_HTTP_UNSUPPORTED_PROTOCOL = 2060 , AWS_ERROR_HTTP_REACTION_REQUIRED = 2061 , AWS_ERROR_HTTP_DATA_NOT_AVAILABLE = 2062 , AWS_ERROR_HTTP_OUTGOING_STREAM_LENGTH_INCORRECT = 2063 , AWS_ERROR_HTTP_CALLBACK_FAILURE = 2064 , AWS_ERROR_HTTP_WEBSOCKET_UPGRADE_FAILURE = 2065 , AWS_ERROR_HTTP_WEBSOCKET_CLOSE_FRAME_SENT = 2066 , AWS_ERROR_HTTP_WEBSOCKET_IS_MIDCHANNEL_HANDLER = 2067 , AWS_ERROR_HTTP_CONNECTION_MANAGER_INVALID_STATE_FOR_ACQUIRE = 2068 , AWS_ERROR_HTTP_CONNECTION_MANAGER_VENDED_CONNECTION_UNDERFLOW = 2069 , AWS_ERROR_HTTP_SERVER_CLOSED = 2070 , AWS_ERROR_HTTP_PROXY_CONNECT_FAILED = 2071 , AWS_ERROR_HTTP_CONNECTION_MANAGER_SHUTTING_DOWN = 2072 , AWS_ERROR_HTTP_CHANNEL_THROUGHPUT_FAILURE = 2073 , AWS_ERROR_HTTP_PROTOCOL_ERROR = 2074 , AWS_ERROR_HTTP_STREAM_IDS_EXHAUSTED = 2075 , AWS_ERROR_HTTP_GOAWAY_RECEIVED = 2076 , AWS_ERROR_HTTP_RST_STREAM_RECEIVED = 2077 , AWS_ERROR_HTTP_RST_STREAM_SENT = 2078 , AWS_ERROR_HTTP_STREAM_NOT_ACTIVATED = 2079 , AWS_ERROR_HTTP_STREAM_HAS_COMPLETED = 2080 , AWS_ERROR_HTTP_PROXY_STRATEGY_NTLM_CHALLENGE_TOKEN_MISSING = 2081 , AWS_ERROR_HTTP_PROXY_STRATEGY_TOKEN_RETRIEVAL_FAILURE = 2082 , AWS_ERROR_HTTP_PROXY_CONNECT_FAILED_RETRYABLE = 2083 , AWS_ERROR_HTTP_PROTOCOL_SWITCH_FAILURE = 2084 , AWS_ERROR_HTTP_MAX_CONCURRENT_STREAMS_EXCEEDED = 2085 , AWS_ERROR_HTTP_STREAM_MANAGER_SHUTTING_DOWN = 2086 , AWS_ERROR_HTTP_STREAM_MANAGER_CONNECTION_ACQUIRE_FAILURE = 2087 , AWS_ERROR_HTTP_STREAM_MANAGER_UNEXPECTED_HTTP_VERSION = 2088 , AWS_ERROR_HTTP_WEBSOCKET_PROTOCOL_ERROR = 2089 , AWS_ERROR_HTTP_MANUAL_WRITE_NOT_ENABLED = 2090 , AWS_ERROR_HTTP_MANUAL_WRITE_HAS_COMPLETED = 2091 , AWS_ERROR_HTTP_END_RANGE = 3071 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http2_error_code { AWS_HTTP2_ERR_NO_ERROR = 0 , AWS_HTTP2_ERR_PROTOCOL_ERROR = 1 , AWS_HTTP2_ERR_INTERNAL_ERROR = 2 , AWS_HTTP2_ERR_FLOW_CONTROL_ERROR = 3 , AWS_HTTP2_ERR_SETTINGS_TIMEOUT = 4 , AWS_HTTP2_ERR_STREAM_CLOSED = 5 , AWS_HTTP2_ERR_FRAME_SIZE_ERROR = 6 , AWS_HTTP2_ERR_REFUSED_STREAM = 7 , AWS_HTTP2_ERR_CANCEL = 8 , AWS_HTTP2_ERR_COMPRESSION_ERROR = 9 , AWS_HTTP2_ERR_CONNECT_ERROR = 10 , AWS_HTTP2_ERR_ENHANCE_YOUR_CALM = 11 , AWS_HTTP2_ERR_INADEQUATE_SECURITY = 12 , AWS_HTTP2_ERR_HTTP_1_1_REQUIRED = 13 , AWS_HTTP2_ERR_COUNT = 14 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_log_subject { AWS_LS_HTTP_GENERAL = 2048 , AWS_LS_HTTP_CONNECTION = 2049 , AWS_LS_HTTP_ENCODER = 2050 , AWS_LS_HTTP_DECODER = 2051 , AWS_LS_HTTP_SERVER = 2052 , AWS_LS_HTTP_STREAM = 2053 , AWS_LS_HTTP_CONNECTION_MANAGER = 2054 , AWS_LS_HTTP_STREAM_MANAGER = 2055 , AWS_LS_HTTP_WEBSOCKET = 2056 , AWS_LS_HTTP_WEBSOCKET_SETUP = 2057 , AWS_LS_HTTP_PROXY_NEGOTIATION = 2058 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_version { AWS_HTTP_VERSION_UNKNOWN = 0 , AWS_HTTP_VERSION_1_0 = 1 , AWS_HTTP_VERSION_1_1 = 2 , AWS_HTTP_VERSION_2 = 3 , AWS_HTTP_VERSION_COUNT = 4 , } extern "C" { # [doc = " Initializes internal datastructures used by aws-c-http.\n Must be called before using any functionality in aws-c-http."] pub fn aws_http_library_init (alloc : * mut aws_allocator) ; } extern "C" { # [doc = " Clean up internal datastructures used by aws-c-http.\n Must not be called until application is done using functionality in aws-c-http."] pub fn aws_http_library_clean_up () ; } extern "C" { # [doc = " Returns the description of common status codes.\n Ex: 404 -> \"Not Found\"\n An empty string is returned if the status code is not recognized."] pub fn aws_http_status_text (status_code : :: libc :: c_int) -> * const :: libc :: c_char ; } extern "C" { # [doc = " Shortcuts for common HTTP request methods"] pub static aws_http_method_get : aws_byte_cursor ; } extern "C" { pub static aws_http_method_head : aws_byte_cursor ; } extern "C" { pub static aws_http_method_post : aws_byte_cursor ; } extern "C" { pub static aws_http_method_put : aws_byte_cursor ; } extern "C" { pub static aws_http_method_delete : aws_byte_cursor ; } extern "C" { pub static aws_http_method_connect : aws_byte_cursor ; } extern "C" { pub static aws_http_method_options : aws_byte_cursor ; } extern "C" { pub static aws_http_header_method : aws_byte_cursor ; } extern "C" { pub static aws_http_header_scheme : aws_byte_cursor ; } extern "C" { pub static aws_http_header_authority : aws_byte_cursor ; } extern "C" { pub static aws_http_header_path : aws_byte_cursor ; } extern "C" { pub static aws_http_header_status : aws_byte_cursor ; } extern "C" { pub static aws_http_scheme_http : aws_byte_cursor ; } extern "C" { pub static aws_http_scheme_https : aws_byte_cursor ; } # [doc = " An HTTP connection.\n This type is used by both server-side and client-side connections.\n This type is also used by all supported versions of HTTP."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_connection { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_connection_manager { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_socket_options { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_tls_connection_options { _unused : [u8 ; 0] , } pub type aws_http_connection_manager_on_connection_setup_fn = :: std :: option :: Option < unsafe extern "C" fn (connection : * mut aws_http_connection , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_http_connection_manager_shutdown_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [doc = " Metrics for logging and debugging purpose."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http_manager_metrics { # [doc = " The number of additional concurrent requests that can be supported by the HTTP manager without needing to\n establish additional connections to the target server.\n\n For connection manager, it equals to connections that's idle.\n For stream manager, it equals to the number of streams that are possible to be made without creating new\n connection, although the implementation can create new connection without fully filling it."] pub available_concurrency : usize , pub pending_concurrency_acquires : usize , pub leased_concurrency : usize , } # [test] fn bindgen_test_layout_aws_http_manager_metrics () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_manager_metrics > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_manager_metrics > () , 24usize , concat ! ("Size of: " , stringify ! (aws_http_manager_metrics))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_manager_metrics > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_manager_metrics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . available_concurrency) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_manager_metrics) , "::" , stringify ! (available_concurrency))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . pending_concurrency_acquires) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_manager_metrics) , "::" , stringify ! (pending_concurrency_acquires))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . leased_concurrency) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_manager_metrics) , "::" , stringify ! (leased_concurrency))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_connection_manager_options { pub bootstrap : * mut aws_client_bootstrap , pub initial_window_size : usize , pub socket_options : * const aws_socket_options , # [doc = " Options to create secure (HTTPS) connections.\n For secure connections, set \"h2\" in the ALPN string for HTTP/2, otherwise HTTP/1.1 is used.\n\n Leave NULL to create cleartext (HTTP) connections.\n For cleartext connections, use `http2_prior_knowledge` (RFC-7540 3.4)\n to control whether that are treated as HTTP/1.1 or HTTP/2."] pub tls_connection_options : * const aws_tls_connection_options , # [doc = " Specify whether you have prior knowledge that cleartext (HTTP) connections are HTTP/2 (RFC-7540 3.4).\n If false, then cleartext connections are treated as HTTP/1.1.\n It is illegal to set this true when secure connections are being used.\n Note that upgrading from HTTP/1.1 to HTTP/2 is not supported (RFC-7540 3.2)."] pub http2_prior_knowledge : bool , pub monitoring_options : * const aws_http_connection_monitoring_options , pub host : aws_byte_cursor , pub port : u16 , # [doc = " Optional.\n HTTP/2 specific configuration. Check `struct aws_http2_connection_options` for details of each config"] pub initial_settings_array : * const aws_http2_setting , pub num_initial_settings : usize , pub max_closed_streams : usize , pub http2_conn_manual_window_management : bool , pub proxy_options : * const aws_http_proxy_options , pub proxy_ev_settings : * const proxy_env_var_settings , pub max_connections : usize , pub shutdown_complete_user_data : * mut :: libc :: c_void , pub shutdown_complete_callback : aws_http_connection_manager_shutdown_complete_fn , # [doc = " If set to true, the read back pressure mechanism will be enabled."] pub enable_read_back_pressure : bool , # [doc = " If set to a non-zero value, then connections that stay in the pool longer than the specified\n timeout will be closed automatically."] pub max_connection_idle_in_milliseconds : u64 , } # [test] fn bindgen_test_layout_aws_http_connection_manager_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_connection_manager_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_connection_manager_options > () , 160usize , concat ! ("Size of: " , stringify ! (aws_http_connection_manager_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_connection_manager_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_connection_manager_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_window_size) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (initial_window_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . socket_options) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (socket_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_connection_options) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (tls_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http2_prior_knowledge) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (http2_prior_knowledge))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . monitoring_options) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (monitoring_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_settings_array) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (initial_settings_array))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_initial_settings) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (num_initial_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_closed_streams) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (max_closed_streams))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http2_conn_manual_window_management) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (http2_conn_manual_window_management))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_options) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_settings) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (proxy_ev_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_connections) as usize - ptr as usize } , 120usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (max_connections))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_complete_user_data) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (shutdown_complete_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_complete_callback) as usize - ptr as usize } , 136usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (shutdown_complete_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_back_pressure) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (enable_read_back_pressure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_connection_idle_in_milliseconds) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_manager_options) , "::" , stringify ! (max_connection_idle_in_milliseconds))) ; } impl Default for aws_http_connection_manager_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_http_connection_manager_acquire (manager : * mut aws_http_connection_manager) ; } extern "C" { pub fn aws_http_connection_manager_release (manager : * mut aws_http_connection_manager) ; } extern "C" { pub fn aws_http_connection_manager_new (allocator : * mut aws_allocator , options : * const aws_http_connection_manager_options) -> * mut aws_http_connection_manager ; } extern "C" { pub fn aws_http_connection_manager_acquire_connection (manager : * mut aws_http_connection_manager , callback : aws_http_connection_manager_on_connection_setup_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_http_connection_manager_release_connection (manager : * mut aws_http_connection_manager , connection : * mut aws_http_connection) -> :: libc :: c_int ; } extern "C" { # [doc = " Fetch the current manager metrics from connection manager."] pub fn aws_http_connection_manager_fetch_metrics (manager : * const aws_http_connection_manager , out_metrics : * mut aws_http_manager_metrics) ; } # [doc = " Invoked upon the acquisition, or failure to acquire a retry token. This function will always be invoked if and only\n if aws_retry_strategy_acquire_retry_token() returns AWS_OP_SUCCESS. It will never be invoked synchronously from\n aws_retry_strategy_acquire_retry_token(). Token will always be NULL if error_code is non-zero, and vice-versa. If\n token is non-null, it will have a reference count of 1, and you must call aws_retry_token_release() on it later. See\n the comments for aws_retry_strategy_on_retry_ready_fn for more info."] pub type aws_retry_strategy_on_retry_token_acquired_fn = :: std :: option :: Option < unsafe extern "C" fn (retry_strategy : * mut aws_retry_strategy , error_code : :: libc :: c_int , token : * mut aws_retry_token , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked after a successful call to aws_retry_strategy_schedule_retry(). This function will always be invoked if and\n only if aws_retry_strategy_schedule_retry() returns AWS_OP_SUCCESS. It will never be invoked synchronously from\n aws_retry_strategy_schedule_retry(). After attempting the operation, either call aws_retry_strategy_schedule_retry()\n with an aws_retry_error_type or call aws_retry_token_record_success() and then release the token via.\n aws_retry_token_release()."] pub type aws_retry_strategy_on_retry_ready_fn = :: std :: option :: Option < unsafe extern "C" fn (token : * mut aws_retry_token , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Optional function to supply your own generate random implementation"] pub type aws_generate_random_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) -> u64 > ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_retry_error_type { # [doc = " This is a connection level error such as a socket timeout, socket connect error, tls negotiation timeout etc...\n Typically these should never be applied for non-idempotent request types since in this scenario, it's impossible\n to know whether the operation had a side effect on the server."] AWS_RETRY_ERROR_TYPE_TRANSIENT = 0 , # [doc = " This is an error where the server explicitly told the client to back off, such as a 429 or 503 Http error."] AWS_RETRY_ERROR_TYPE_THROTTLING = 1 , # [doc = " This is a server error that isn't explicitly throttling but is considered by the client\n to be something that should be retried."] AWS_RETRY_ERROR_TYPE_SERVER_ERROR = 2 , # [doc = " Doesn't count against any budgets. This could be something like a 401 challenge in Http."] AWS_RETRY_ERROR_TYPE_CLIENT_ERROR = 3 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_retry_strategy_vtable { pub destroy : :: std :: option :: Option < unsafe extern "C" fn (retry_strategy : * mut aws_retry_strategy) > , pub acquire_token : :: std :: option :: Option < unsafe extern "C" fn (retry_strategy : * mut aws_retry_strategy , partition_id : * const aws_byte_cursor , on_acquired : aws_retry_strategy_on_retry_token_acquired_fn , user_data : * mut :: libc :: c_void , timeout_ms : u64) -> :: libc :: c_int > , pub schedule_retry : :: std :: option :: Option < unsafe extern "C" fn (token : * mut aws_retry_token , error_type : aws_retry_error_type , retry_ready : aws_retry_strategy_on_retry_ready_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > , pub record_success : :: std :: option :: Option < unsafe extern "C" fn (token : * mut aws_retry_token) -> :: libc :: c_int > , pub release_token : :: std :: option :: Option < unsafe extern "C" fn (token : * mut aws_retry_token) > , } # [test] fn bindgen_test_layout_aws_retry_strategy_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_retry_strategy_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_retry_strategy_vtable > () , 40usize , concat ! ("Size of: " , stringify ! (aws_retry_strategy_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_retry_strategy_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_retry_strategy_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . acquire_token) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy_vtable) , "::" , stringify ! (acquire_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . schedule_retry) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy_vtable) , "::" , stringify ! (schedule_retry))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . record_success) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy_vtable) , "::" , stringify ! (record_success))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . release_token) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy_vtable) , "::" , stringify ! (release_token))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_retry_strategy { pub allocator : * mut aws_allocator , pub vtable : * mut aws_retry_strategy_vtable , pub ref_count : aws_atomic_var , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_retry_strategy () { const UNINIT : :: std :: mem :: MaybeUninit < aws_retry_strategy > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_retry_strategy > () , 32usize , concat ! ("Size of: " , stringify ! (aws_retry_strategy))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_retry_strategy > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_retry_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_retry_strategy) , "::" , stringify ! (impl_))) ; } impl Default for aws_retry_strategy { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_retry_token { pub allocator : * mut aws_allocator , pub retry_strategy : * mut aws_retry_strategy , pub ref_count : aws_atomic_var , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_retry_token () { const UNINIT : :: std :: mem :: MaybeUninit < aws_retry_token > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_retry_token > () , 32usize , concat ! ("Size of: " , stringify ! (aws_retry_token))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_retry_token > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_retry_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_retry_token) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . retry_strategy) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_retry_token) , "::" , stringify ! (retry_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_retry_token) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_retry_token) , "::" , stringify ! (impl_))) ; } impl Default for aws_retry_token { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [doc = " Jitter mode for exponential backoff.\n\n For a great writeup on these options see:\n https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_exponential_backoff_jitter_mode { AWS_EXPONENTIAL_BACKOFF_JITTER_DEFAULT = 0 , AWS_EXPONENTIAL_BACKOFF_JITTER_NONE = 1 , AWS_EXPONENTIAL_BACKOFF_JITTER_FULL = 2 , AWS_EXPONENTIAL_BACKOFF_JITTER_DECORRELATED = 3 , } # [doc = " Options for exponential backoff retry strategy. el_group must be set, any other option, if set to 0 will signify\n \"use defaults\""] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_exponential_backoff_retry_options { # [doc = " Event loop group to use for scheduling tasks."] pub el_group : * mut aws_event_loop_group , # [doc = " Max retries to allow. The default value is 10"] pub max_retries : usize , # [doc = " Scaling factor to add for the backoff. Default is 25ms"] pub backoff_scale_factor_ms : u32 , # [doc = " Max retry backoff in seconds. Default is 20 seconds"] pub max_backoff_secs : u32 , # [doc = " Jitter mode to use, see comments for aws_exponential_backoff_jitter_mode.\n Default is AWS_EXPONENTIAL_BACKOFF_JITTER_DEFAULT"] pub jitter_mode : aws_exponential_backoff_jitter_mode , # [doc = " Deprecated. Use generate_random_impl instead\n By default this will be set to use aws_device_random. If you want something else, set it here."] pub generate_random : :: std :: option :: Option < unsafe extern "C" fn () -> u64 > , pub generate_random_impl : aws_generate_random_fn , # [doc = " Optional user data for the generate random generate_random_impl."] pub generate_random_user_data : * mut :: libc :: c_void , # [doc = " Optional shutdown callback that gets invoked, with appropriate user data,\n when the resources used by the retry_strategy are no longer in use."] pub shutdown_options : * const aws_shutdown_callback_options , } # [test] fn bindgen_test_layout_aws_exponential_backoff_retry_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_exponential_backoff_retry_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_exponential_backoff_retry_options > () , 64usize , concat ! ("Size of: " , stringify ! (aws_exponential_backoff_retry_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_exponential_backoff_retry_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_exponential_backoff_retry_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . el_group) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (el_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_retries) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (max_retries))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . backoff_scale_factor_ms) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (backoff_scale_factor_ms))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_backoff_secs) as usize - ptr as usize } , 20usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (max_backoff_secs))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . jitter_mode) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (jitter_mode))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . generate_random) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (generate_random))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . generate_random_impl) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (generate_random_impl))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . generate_random_user_data) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (generate_random_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_exponential_backoff_retry_options) , "::" , stringify ! (shutdown_options))) ; } impl Default for aws_exponential_backoff_retry_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_standard_retry_options { pub backoff_retry_options : aws_exponential_backoff_retry_options , # [doc = " capacity for partitions. Defaults to 500"] pub initial_bucket_capacity : usize , } # [test] fn bindgen_test_layout_aws_standard_retry_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_standard_retry_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_standard_retry_options > () , 72usize , concat ! ("Size of: " , stringify ! (aws_standard_retry_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_standard_retry_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_standard_retry_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . backoff_retry_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_standard_retry_options) , "::" , stringify ! (backoff_retry_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_bucket_capacity) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_standard_retry_options) , "::" , stringify ! (initial_bucket_capacity))) ; } impl Default for aws_standard_retry_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Acquire a reference count on retry_strategy."] pub fn aws_retry_strategy_acquire (retry_strategy : * mut aws_retry_strategy) ; } extern "C" { # [doc = " Releases a reference count on retry_strategy."] pub fn aws_retry_strategy_release (retry_strategy : * mut aws_retry_strategy) ; } extern "C" { # [doc = " Attempts to acquire a retry token for use with retries. On success, on_acquired will be invoked when a token is\n available, or an error will be returned if the timeout expires. partition_id identifies operations that should be\n grouped together. This allows for more sophisticated strategies such as AIMD and circuit breaker patterns. Pass NULL\n to use the global partition."] pub fn aws_retry_strategy_acquire_retry_token (retry_strategy : * mut aws_retry_strategy , partition_id : * const aws_byte_cursor , on_acquired : aws_retry_strategy_on_retry_token_acquired_fn , user_data : * mut :: libc :: c_void , timeout_ms : u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Schedules a retry based on the backoff and token based strategies. retry_ready is invoked when the retry is either\n ready for execution or if it has been canceled due to application shutdown.\n\n This function can return an error to reject the retry attempt if, for example, a circuit breaker has opened. If this\n occurs users should fail their calls back to their callers.\n\n error_type is used for book keeping. See the comments above for aws_retry_error_type."] pub fn aws_retry_strategy_schedule_retry (token : * mut aws_retry_token , error_type : aws_retry_error_type , retry_ready : aws_retry_strategy_on_retry_ready_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Records a successful retry. This is used for making future decisions to open up token buckets, AIMD breakers etc...\n some strategies such as exponential backoff will ignore this, but you should always call it after a successful\n operation or your system will never recover during an outage."] pub fn aws_retry_token_record_success (token : * mut aws_retry_token) -> :: libc :: c_int ; } extern "C" { # [doc = " Increments reference count for token. This should be called any time you seat the token to a pointer you own."] pub fn aws_retry_token_acquire (token : * mut aws_retry_token) ; } extern "C" { # [doc = " Releases the reference count for token. This should always be invoked after either calling\n aws_retry_strategy_schedule_retry() and failing, or after calling aws_retry_token_record_success()."] pub fn aws_retry_token_release (token : * mut aws_retry_token) ; } extern "C" { # [doc = " Creates a retry strategy using exponential backoff. This strategy does not perform any bookkeeping on error types and\n success. There is no circuit breaker functionality in here. See the comments above for\n aws_exponential_backoff_retry_options."] pub fn aws_retry_strategy_new_exponential_backoff (allocator : * mut aws_allocator , config : * const aws_exponential_backoff_retry_options) -> * mut aws_retry_strategy ; } extern "C" { # [doc = " This is a retry implementation that cuts off traffic if it's\n detected that an endpoint partition is having availability\n problems. This is necessary to keep from making outages worse\n by scheduling work that's unlikely to succeed yet increases\n load on an already ailing system.\n\n We do this by creating a bucket for each partition. A partition\n is an arbitrary specifier. It can be anything: a region, a service,\n a combination of region and service, a literal dns name.... doesn't matter.\n\n Each bucket has a budget for maximum allowed retries. Different types of events\n carry different weights. Things that indicate an unhealthy partition such as\n transient errors (timeouts, unhealthy connection etc...) cost more.\n A retry for any other reason (service sending a 5xx response code) cost a bit less.\n When a retry is attempted this capacity is leased out to the retry. On success it is\n released back to the capacity pool. On failure, it remains leased.\n Operations that succeed without a retry slowly restore the capacity pool.\n\n If a partition runs out of capacity it is assumed unhealthy and retries will be blocked\n until capacity returns to the pool. To prevent a partition from staying unhealthy after\n an outage has recovered, new requests that succeed without a retry will increase the capacity\n slowly ( a new request gets a payback lease of 1, but the lease is never actually deducted from the capacity pool)."] pub fn aws_retry_strategy_new_standard (allocator : * mut aws_allocator , config : * const aws_standard_retry_options) -> * mut aws_retry_strategy ; } pub type aws_imds_client_shutdown_completed_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [doc = " Optional callback and user data to be invoked when an imds client has fully shut down"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_imds_client_shutdown_options { pub shutdown_callback : aws_imds_client_shutdown_completed_fn , pub shutdown_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_imds_client_shutdown_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_imds_client_shutdown_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_imds_client_shutdown_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_imds_client_shutdown_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_imds_client_shutdown_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_imds_client_shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_shutdown_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_user_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_shutdown_options) , "::" , stringify ! (shutdown_user_data))) ; } impl Default for aws_imds_client_shutdown_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Configuration options when creating an imds client"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_imds_client_options { pub shutdown_options : aws_imds_client_shutdown_options , pub bootstrap : * mut aws_client_bootstrap , pub retry_strategy : * mut aws_retry_strategy , pub imds_version : aws_imds_protocol_version , pub function_table : * mut aws_auth_http_system_vtable , } # [test] fn bindgen_test_layout_aws_imds_client_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_imds_client_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_imds_client_options > () , 48usize , concat ! ("Size of: " , stringify ! (aws_imds_client_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_imds_client_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_imds_client_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . retry_strategy) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_options) , "::" , stringify ! (retry_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . imds_version) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_options) , "::" , stringify ! (imds_version))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . function_table) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_imds_client_options) , "::" , stringify ! (function_table))) ; } impl Default for aws_imds_client_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_imds_client_on_get_resource_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (resource : * const aws_byte_buf , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instancedata-data-categories.html"] # [repr (C)] pub struct aws_imds_iam_profile { pub last_updated : aws_date_time , pub instance_profile_arn : aws_byte_cursor , pub instance_profile_id : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_imds_iam_profile () { const UNINIT : :: std :: mem :: MaybeUninit < aws_imds_iam_profile > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_imds_iam_profile > () , 168usize , concat ! ("Size of: " , stringify ! (aws_imds_iam_profile))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_imds_iam_profile > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_imds_iam_profile))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . last_updated) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_imds_iam_profile) , "::" , stringify ! (last_updated))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . instance_profile_arn) as usize - ptr as usize } , 136usize , concat ! ("Offset of field: " , stringify ! (aws_imds_iam_profile) , "::" , stringify ! (instance_profile_arn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . instance_profile_id) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_imds_iam_profile) , "::" , stringify ! (instance_profile_id))) ; } impl Default for aws_imds_iam_profile { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Block of per-instance EC2-specific data\n\n https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-identity-documents.html"] # [repr (C)] pub struct aws_imds_instance_info { pub marketplace_product_codes : aws_array_list , pub availability_zone : aws_byte_cursor , pub private_ip : aws_byte_cursor , pub version : aws_byte_cursor , pub instance_id : aws_byte_cursor , pub billing_products : aws_array_list , pub instance_type : aws_byte_cursor , pub account_id : aws_byte_cursor , pub image_id : aws_byte_cursor , pub pending_time : aws_date_time , pub architecture : aws_byte_cursor , pub kernel_id : aws_byte_cursor , pub ramdisk_id : aws_byte_cursor , pub region : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_imds_instance_info () { const UNINIT : :: std :: mem :: MaybeUninit < aws_imds_instance_info > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_imds_instance_info > () , 392usize , concat ! ("Size of: " , stringify ! (aws_imds_instance_info))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_imds_instance_info > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_imds_instance_info))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . marketplace_product_codes) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (marketplace_product_codes))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . availability_zone) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (availability_zone))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . private_ip) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (private_ip))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . version) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (version))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . instance_id) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (instance_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . billing_products) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (billing_products))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . instance_type) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (instance_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . account_id) as usize - ptr as usize } , 160usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (account_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . image_id) as usize - ptr as usize } , 176usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (image_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . pending_time) as usize - ptr as usize } , 192usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (pending_time))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . architecture) as usize - ptr as usize } , 328usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (architecture))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . kernel_id) as usize - ptr as usize } , 344usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (kernel_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ramdisk_id) as usize - ptr as usize } , 360usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (ramdisk_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . region) as usize - ptr as usize } , 376usize , concat ! ("Offset of field: " , stringify ! (aws_imds_instance_info) , "::" , stringify ! (region))) ; } impl Default for aws_imds_instance_info { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_imds_client_on_get_array_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (array : * const aws_array_list , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_imds_client_on_get_credentials_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (credentials : * const aws_credentials , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_imds_client_on_get_iam_profile_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (iam_profile_info : * const aws_imds_iam_profile , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_imds_client_on_get_instance_info_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (instance_info : * const aws_imds_instance_info , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " AWS EC2 Metadata Client is used to retrieve AWS EC2 Instance Metadata info."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_imds_client { _unused : [u8 ; 0] , } extern "C" { # [doc = " Creates a new imds client\n\n @param allocator memory allocator to use for creation and queries\n @param options configuration options for the imds client\n\n @return a newly-constructed imds client, or NULL on failure"] pub fn aws_imds_client_new (allocator : * mut aws_allocator , options : * const aws_imds_client_options) -> * mut aws_imds_client ; } extern "C" { # [doc = " Increments the ref count on the client\n\n @param client imds client to acquire a reference to"] pub fn aws_imds_client_acquire (client : * mut aws_imds_client) ; } extern "C" { # [doc = " Decrements the ref count on the client\n\n @param client imds client to release a reference to"] pub fn aws_imds_client_release (client : * mut aws_imds_client) ; } extern "C" { # [doc = " Queries a generic resource (string) from the ec2 instance metadata document\n\n @param client imds client to use for the query\n @param resource_path path of the resource to query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_resource_async (client : * mut aws_imds_client , resource_path : aws_byte_cursor , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the ami id of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_ami_id (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the ami launch index of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_ami_launch_index (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the ami manifest path of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_ami_manifest_path (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the list of ancestor ami ids of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_ancestor_ami_ids (client : * mut aws_imds_client , callback : aws_imds_client_on_get_array_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the instance-action of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_instance_action (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the instance id of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_instance_id (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the instance type of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_instance_type (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the mac address of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_mac_address (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the private ip address of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_private_ip_address (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the availability zone of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_availability_zone (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the product codes of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_product_codes (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the public key of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_public_key (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the ramdisk id of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_ramdisk_id (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the reservation id of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_reservation_id (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the list of the security groups of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_security_groups (client : * mut aws_imds_client , callback : aws_imds_client_on_get_array_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the list of block device mappings of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_block_device_mapping (client : * mut aws_imds_client , callback : aws_imds_client_on_get_array_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the attached iam role of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_attached_iam_role (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets temporary credentials based on the attached iam role of the ec2 instance\n\n @param client imds client to use for the query\n @param iam_role_name iam role name to get temporary credentials through\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_credentials (client : * mut aws_imds_client , iam_role_name : aws_byte_cursor , callback : aws_imds_client_on_get_credentials_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the iam profile information of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_iam_profile (client : * mut aws_imds_client , callback : aws_imds_client_on_get_iam_profile_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the user data of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_user_data (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the signature of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_instance_signature (client : * mut aws_imds_client , callback : aws_imds_client_on_get_resource_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Gets the instance information data block of the ec2 instance from the instance metadata document\n\n @param client imds client to use for the query\n @param callback callback function to invoke on query success or failure\n @param user_data opaque data to invoke the completion callback with\n @return AWS_OP_SUCCESS if the query was successfully started, AWS_OP_ERR otherwise"] pub fn aws_imds_client_get_instance_info (client : * mut aws_imds_client , callback : aws_imds_client_on_get_instance_info_callback_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " The entry point function to perform a CRC32 (Ethernet, gzip) computation.\n Selects a suitable implementation based on hardware capabilities.\n Pass 0 in the previousCrc32 parameter as an initial value unless continuing\n to update a running crc in a subsequent call."] pub fn aws_checksums_crc32 (input : * const u8 , length : :: libc :: c_int , previousCrc32 : u32) -> u32 ; } extern "C" { # [doc = " The entry point function to perform a Castagnoli CRC32c (iSCSI) computation.\n Selects a suitable implementation based on hardware capabilities.\n Pass 0 in the previousCrc32 parameter as an initial value unless continuing\n to update a running crc in a subsequent call."] pub fn aws_checksums_crc32c (input : * const u8 , length : :: libc :: c_int , previousCrc32 : u32) -> u32 ; } pub type aws_log_channel_send_fn = :: std :: option :: Option < unsafe extern "C" fn (channel : * mut aws_log_channel , output : * mut aws_string) -> :: libc :: c_int > ; pub type aws_log_channel_clean_up_fn = :: std :: option :: Option < unsafe extern "C" fn (channel : * mut aws_log_channel) > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_log_channel_vtable { pub send : aws_log_channel_send_fn , pub clean_up : aws_log_channel_clean_up_fn , } # [test] fn bindgen_test_layout_aws_log_channel_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_channel_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_channel_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_log_channel_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_channel_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_channel_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . send) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel_vtable) , "::" , stringify ! (send))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clean_up) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel_vtable) , "::" , stringify ! (clean_up))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_channel { pub vtable : * mut aws_log_channel_vtable , pub allocator : * mut aws_allocator , pub writer : * mut aws_log_writer , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_log_channel () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_channel > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_channel > () , 32usize , concat ! ("Size of: " , stringify ! (aws_log_channel))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_channel > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_channel))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . writer) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel) , "::" , stringify ! (writer))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_log_channel) , "::" , stringify ! (impl_))) ; } impl Default for aws_log_channel { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_log_channel_init_foreground (channel : * mut aws_log_channel , allocator : * mut aws_allocator , writer : * mut aws_log_writer) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_channel_init_background (channel : * mut aws_log_channel , allocator : * mut aws_allocator , writer : * mut aws_log_writer) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_channel_clean_up (channel : * mut aws_log_channel) ; } pub type aws_log_formatter_format_fn = :: std :: option :: Option < unsafe extern "C" fn (formatter : * mut aws_log_formatter , formatted_output : * mut * mut aws_string , level : aws_log_level :: Type , subject : aws_log_subject_t , format : * const :: libc :: c_char , args : * mut __va_list_tag) -> :: libc :: c_int > ; pub type aws_log_formatter_clean_up_fn = :: std :: option :: Option < unsafe extern "C" fn (logger : * mut aws_log_formatter) > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_log_formatter_vtable { pub format : aws_log_formatter_format_fn , pub clean_up : aws_log_formatter_clean_up_fn , } # [test] fn bindgen_test_layout_aws_log_formatter_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_formatter_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_formatter_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_log_formatter_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_formatter_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_formatter_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . format) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter_vtable) , "::" , stringify ! (format))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clean_up) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter_vtable) , "::" , stringify ! (clean_up))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_formatter { pub vtable : * mut aws_log_formatter_vtable , pub allocator : * mut aws_allocator , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_log_formatter () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_formatter > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_formatter > () , 24usize , concat ! ("Size of: " , stringify ! (aws_log_formatter))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_formatter > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_formatter))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter) , "::" , stringify ! (impl_))) ; } impl Default for aws_log_formatter { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_formatter_standard_options { pub date_format : aws_date_format , } # [test] fn bindgen_test_layout_aws_log_formatter_standard_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_formatter_standard_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_formatter_standard_options > () , 4usize , concat ! ("Size of: " , stringify ! (aws_log_formatter_standard_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_formatter_standard_options > () , 4usize , concat ! ("Alignment of " , stringify ! (aws_log_formatter_standard_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . date_format) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_formatter_standard_options) , "::" , stringify ! (date_format))) ; } impl Default for aws_log_formatter_standard_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_logging_standard_formatting_data { pub log_line_buffer : * mut :: libc :: c_char , pub total_length : usize , pub level : aws_log_level :: Type , pub subject_name : * const :: libc :: c_char , pub format : * const :: libc :: c_char , pub date_format : aws_date_format , pub allocator : * mut aws_allocator , pub amount_written : usize , } # [test] fn bindgen_test_layout_aws_logging_standard_formatting_data () { const UNINIT : :: std :: mem :: MaybeUninit < aws_logging_standard_formatting_data > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_logging_standard_formatting_data > () , 64usize , concat ! ("Size of: " , stringify ! (aws_logging_standard_formatting_data))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_logging_standard_formatting_data > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_logging_standard_formatting_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . log_line_buffer) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (log_line_buffer))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . total_length) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (total_length))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . level) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (level))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subject_name) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (subject_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . format) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (format))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . date_format) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (date_format))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . amount_written) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_logging_standard_formatting_data) , "::" , stringify ! (amount_written))) ; } impl Default for aws_logging_standard_formatting_data { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_log_formatter_init_default (formatter : * mut aws_log_formatter , allocator : * mut aws_allocator , options : * mut aws_log_formatter_standard_options) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_formatter_clean_up (formatter : * mut aws_log_formatter) ; } extern "C" { pub fn aws_format_standard_log_line (formatting_data : * mut aws_logging_standard_formatting_data , args : * mut __va_list_tag) -> :: libc :: c_int ; } pub type aws_log_writer_write_fn = :: std :: option :: Option < unsafe extern "C" fn (writer : * mut aws_log_writer , output : * const aws_string) -> :: libc :: c_int > ; pub type aws_log_writer_clean_up_fn = :: std :: option :: Option < unsafe extern "C" fn (writer : * mut aws_log_writer) > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_log_writer_vtable { pub write : aws_log_writer_write_fn , pub clean_up : aws_log_writer_clean_up_fn , } # [test] fn bindgen_test_layout_aws_log_writer_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_writer_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_writer_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_log_writer_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_writer_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_writer_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . write) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer_vtable) , "::" , stringify ! (write))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clean_up) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer_vtable) , "::" , stringify ! (clean_up))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_writer { pub vtable : * mut aws_log_writer_vtable , pub allocator : * mut aws_allocator , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_log_writer () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_writer > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_writer > () , 24usize , concat ! ("Size of: " , stringify ! (aws_log_writer))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_writer > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_writer))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer) , "::" , stringify ! (impl_))) ; } impl Default for aws_log_writer { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_log_writer_file_options { pub filename : * const :: libc :: c_char , pub file : * mut FILE , } # [test] fn bindgen_test_layout_aws_log_writer_file_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_log_writer_file_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_log_writer_file_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_log_writer_file_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_log_writer_file_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_log_writer_file_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . filename) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer_file_options) , "::" , stringify ! (filename))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . file) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_log_writer_file_options) , "::" , stringify ! (file))) ; } impl Default for aws_log_writer_file_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_log_writer_init_stdout (writer : * mut aws_log_writer , allocator : * mut aws_allocator) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_writer_init_stderr (writer : * mut aws_log_writer , allocator : * mut aws_allocator) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_writer_init_file (writer : * mut aws_log_writer , allocator : * mut aws_allocator , options : * mut aws_log_writer_file_options) -> :: libc :: c_int ; } extern "C" { pub fn aws_log_writer_clean_up (writer : * mut aws_log_writer) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_socket_endpoint { _unused : [u8 ; 0] , } # [doc = " Invoked when connect completes.\n\n If unsuccessful, error_code will be set, connection will be NULL,\n and the on_shutdown callback will never be invoked.\n\n If successful, error_code will be 0 and connection will be valid.\n The user is now responsible for the connection and must\n call aws_http_connection_release() when they are done with it.\n\n The connection uses one event-loop thread to do all its work.\n The thread invoking this callback will be the same thread that invokes all\n future callbacks for this connection and its streams."] pub type aws_http_on_client_connection_setup_fn = :: std :: option :: Option < unsafe extern "C" fn (connection : * mut aws_http_connection , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when the connection has finished shutting down.\n Never invoked if on_setup failed.\n This is always invoked on connection's event-loop thread.\n Note that the connection is not completely done until on_shutdown has been invoked\n AND aws_http_connection_release() has been called."] pub type aws_http_on_client_connection_shutdown_fn = :: std :: option :: Option < unsafe extern "C" fn (connection : * mut aws_http_connection , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when the HTTP/2 settings change is complete.\n If connection setup successfully this will always be invoked whether settings change successfully or unsuccessfully.\n If error_code is AWS_ERROR_SUCCESS (0), then the peer has acknowledged the settings and the change has been applied.\n If error_code is non-zero, then a connection error occurred before the settings could be fully acknowledged and\n applied. This is always invoked on the connection's event-loop thread."] pub type aws_http2_on_change_settings_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (http2_connection : * mut aws_http_connection , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when the HTTP/2 PING completes, whether peer has acknowledged it or not.\n If error_code is AWS_ERROR_SUCCESS (0), then the peer has acknowledged the PING and round_trip_time_ns will be the\n round trip time in nano seconds for the connection.\n If error_code is non-zero, then a connection error occurred before the PING get acknowledgment and round_trip_time_ns\n will be useless in this case."] pub type aws_http2_on_ping_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (http2_connection : * mut aws_http_connection , round_trip_time_ns : u64 , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when an HTTP/2 GOAWAY frame is received from peer.\n Implies that the peer has initiated shutdown, or encountered a serious error.\n Once a GOAWAY is received, no further streams may be created on this connection.\n\n @param http2_connection This HTTP/2 connection.\n @param last_stream_id ID of the last locally-initiated stream that peer will\n process. Any locally-initiated streams with a higher ID are ignored by\n peer, and are safe to retry on another connection.\n @param http2_error_code The HTTP/2 error code (RFC-7540 section 7) sent by peer.\n `enum aws_http2_error_code` lists official codes.\n @param debug_data The debug data sent by peer. It can be empty. (NOTE: this data is only valid for the lifetime of\n the callback. Make a deep copy if you wish to keep it longer.)\n @param user_data User-data passed to the callback."] pub type aws_http2_on_goaway_received_fn = :: std :: option :: Option < unsafe extern "C" fn (http2_connection : * mut aws_http_connection , last_stream_id : u32 , http2_error_code : u32 , debug_data : aws_byte_cursor , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when new HTTP/2 settings from peer have been applied.\n Settings_array is the array of aws_http2_settings that contains all the settings we just changed in the order we\n applied (the order settings arrived). Num_settings is the number of elements in that array."] pub type aws_http2_on_remote_settings_change_fn = :: std :: option :: Option < unsafe extern "C" fn (http2_connection : * mut aws_http_connection , settings_array : * const aws_http2_setting , num_settings : usize , user_data : * mut :: libc :: c_void) > ; # [doc = " Callback invoked on each statistics sample.\n\n connection_nonce is unique to each connection for disambiguation of each callback per connection."] pub type aws_http_statistics_observer_fn = :: std :: option :: Option < unsafe extern "C" fn (connection_nonce : usize , stats_list : * const aws_array_list , user_data : * mut :: libc :: c_void) > ; # [doc = " Configuration options for connection monitoring"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_connection_monitoring_options { # [doc = " minimum required throughput of the connection. Throughput is only measured against the interval of time where\n there is actual io to perform. Read and write throughput are measured and checked independently of one another."] pub minimum_throughput_bytes_per_second : u64 , pub allowable_throughput_failure_interval_seconds : u32 , # [doc = " invoked on each statistics publish by the underlying IO channel. Install this callback to receive the statistics\n for observation. This field is optional."] pub statistics_observer_fn : aws_http_statistics_observer_fn , # [doc = " user_data to be passed to statistics_observer_fn."] pub statistics_observer_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_http_connection_monitoring_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_connection_monitoring_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_connection_monitoring_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_http_connection_monitoring_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_connection_monitoring_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_connection_monitoring_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . minimum_throughput_bytes_per_second) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_monitoring_options) , "::" , stringify ! (minimum_throughput_bytes_per_second))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allowable_throughput_failure_interval_seconds) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_monitoring_options) , "::" , stringify ! (allowable_throughput_failure_interval_seconds))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . statistics_observer_fn) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_monitoring_options) , "::" , stringify ! (statistics_observer_fn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . statistics_observer_user_data) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_connection_monitoring_options) , "::" , stringify ! (statistics_observer_user_data))) ; } impl Default for aws_http_connection_monitoring_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Options specific to HTTP/1.x connections."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http1_connection_options { # [doc = " Optional\n Capacity in bytes of the HTTP/1 connection's read buffer.\n The buffer grows if the flow-control window of the incoming HTTP-stream\n reaches zero. If the buffer reaches capacity, no further socket data is\n read until the HTTP-stream's window opens again, allowing data to resume flowing.\n\n Ignored if `manual_window_management` is false.\n If zero is specified (the default) then a default capacity is chosen.\n A capacity that is too small may hinder throughput.\n A capacity that is too big may waste memory without helping throughput."] pub read_buffer_capacity : usize , } # [test] fn bindgen_test_layout_aws_http1_connection_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http1_connection_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http1_connection_options > () , 8usize , concat ! ("Size of: " , stringify ! (aws_http1_connection_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http1_connection_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http1_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . read_buffer_capacity) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http1_connection_options) , "::" , stringify ! (read_buffer_capacity))) ; } # [doc = " Options specific to HTTP/2 connections."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http2_connection_options { # [doc = " Optional\n The data of settings to change for initial settings.\n Note: each setting has its boundary. If settings_array is not set, num_settings has to be 0 to send an empty\n SETTINGS frame."] pub initial_settings_array : * mut aws_http2_setting , # [doc = " Required\n The num of settings to change (Length of the initial_settings_array)."] pub num_initial_settings : usize , # [doc = " Optional.\n Invoked when the HTTP/2 initial settings change is complete.\n If failed to setup the connection, this will not be invoked.\n Otherwise, this will be invoked, whether settings change successfully or unsuccessfully.\n See `aws_http2_on_change_settings_complete_fn`."] pub on_initial_settings_completed : aws_http2_on_change_settings_complete_fn , # [doc = " Optional\n The max number of recently-closed streams to remember.\n Set it to zero to use the default setting, AWS_HTTP2_DEFAULT_MAX_CLOSED_STREAMS\n\n If the connection receives a frame for a closed stream,\n the frame will be ignored or cause a connection error,\n depending on the frame type and how the stream was closed.\n Remembering more streams reduces the chances that a late frame causes\n a connection error, but costs some memory."] pub max_closed_streams : usize , # [doc = " Optional.\n Invoked when a valid GOAWAY frame received.\n See `aws_http2_on_goaway_received_fn`."] pub on_goaway_received : aws_http2_on_goaway_received_fn , # [doc = " Optional.\n Invoked when new settings from peer have been applied.\n See `aws_http2_on_remote_settings_change_fn`."] pub on_remote_settings_change : aws_http2_on_remote_settings_change_fn , # [doc = " Optional.\n Set to true to manually manage the flow-control window of whole HTTP/2 connection.\n\n If false, the connection will maintain its flow-control windows such that\n no back-pressure is applied and data arrives as fast as possible.\n\n If true, the flow-control window of the whole connection will shrink as body data\n is received (headers, padding, and other metadata do not affect the window) for every streams\n created on this connection.\n The initial connection flow-control window is 65,535.\n Once the connection's flow-control window reaches to 0, all the streams on the connection stop receiving any\n further data.\n The user must call aws_http2_connection_update_window() to increment the connection's\n window and keep data flowing.\n Note: the padding of data frame counts to the flow-control window.\n But, the client will always automatically update the window for padding even for manual window update."] pub conn_manual_window_management : bool , } # [test] fn bindgen_test_layout_aws_http2_connection_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http2_connection_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http2_connection_options > () , 56usize , concat ! ("Size of: " , stringify ! (aws_http2_connection_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http2_connection_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http2_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_settings_array) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (initial_settings_array))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_initial_settings) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (num_initial_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_initial_settings_completed) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (on_initial_settings_completed))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_closed_streams) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (max_closed_streams))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_goaway_received) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (on_goaway_received))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_remote_settings_change) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (on_remote_settings_change))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . conn_manual_window_management) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http2_connection_options) , "::" , stringify ! (conn_manual_window_management))) ; } impl Default for aws_http2_connection_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Options for creating an HTTP client connection.\n Initialize with AWS_HTTP_CLIENT_CONNECTION_OPTIONS_INIT to set default values."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_client_connection_options { # [doc = " The sizeof() this struct, used for versioning.\n Set by AWS_HTTP_CLIENT_CONNECTION_OPTIONS_INIT."] pub self_size : usize , # [doc = " Required.\n Must outlive the connection."] pub allocator : * mut aws_allocator , # [doc = " Required.\n The connection keeps the bootstrap alive via ref-counting."] pub bootstrap : * mut aws_client_bootstrap , # [doc = " Required.\n aws_http_client_connect() makes a copy."] pub host_name : aws_byte_cursor , # [doc = " Required."] pub port : u16 , # [doc = " Required.\n aws_http_client_connect() makes a copy."] pub socket_options : * const aws_socket_options , # [doc = " Optional.\n aws_http_client_connect() deep-copies all contents,\n and keeps `aws_tls_ctx` alive via ref-counting."] pub tls_options : * const aws_tls_connection_options , # [doc = " Optional\n Configuration options related to http proxy usage.\n Relevant fields are copied internally."] pub proxy_options : * const aws_http_proxy_options , pub proxy_ev_settings : * const proxy_env_var_settings , # [doc = " Optional\n Configuration options related to connection health monitoring"] pub monitoring_options : * const aws_http_connection_monitoring_options , # [doc = " Set to true to manually manage the flow-control window of each stream.\n\n If false, the connection will maintain its flow-control windows such that\n no back-pressure is applied and data arrives as fast as possible.\n\n If true, the flow-control window of each stream will shrink as body data\n is received (headers, padding, and other metadata do not affect the window).\n `initial_window_size` determines the starting size of each stream's window for HTTP/1 stream, while HTTP/2 stream\n will use the settings AWS_HTTP2_SETTINGS_INITIAL_WINDOW_SIZE to inform the other side about read back pressure\n\n If a stream's flow-control window reaches 0, no further data will be received. The user must call\n aws_http_stream_update_window() to increment the stream's window and keep data flowing.\n\n If a HTTP/2 connection created, it will ONLY control the stream window\n management. Connection window management is controlled by\n conn_manual_window_management. Note: the padding of data frame counts to the flow-control window.\n But, the client will always automatically update the window for padding even for manual window update."] pub manual_window_management : bool , # [doc = " The starting size of each HTTP stream's flow-control window for HTTP/1 connection.\n Required if `manual_window_management` is true,\n ignored if `manual_window_management` is false.\n\n Always ignored when HTTP/2 connection created. The initial window size is controlled by the settings,\n `AWS_HTTP2_SETTINGS_INITIAL_WINDOW_SIZE`"] pub initial_window_size : usize , # [doc = " User data for callbacks\n Optional."] pub user_data : * mut :: libc :: c_void , # [doc = " Invoked when connect completes.\n Required.\n See `aws_http_on_client_connection_setup_fn`."] pub on_setup : aws_http_on_client_connection_setup_fn , # [doc = " Invoked when the connection has finished shutting down.\n Never invoked if setup failed.\n Optional.\n See `aws_http_on_client_connection_shutdown_fn`."] pub on_shutdown : aws_http_on_client_connection_shutdown_fn , # [doc = " Optional.\n When true, use prior knowledge to set up an HTTP/2 connection on a cleartext\n connection.\n When TLS is set and this is true, the connection will failed to be established,\n as prior knowledge only works for cleartext TLS.\n Refer to RFC7540 3.4"] pub prior_knowledge_http2 : bool , # [doc = " Optional.\n Pointer to the hash map containing the ALPN string to protocol to use.\n Hash from `struct aws_string *` to `enum aws_http_version`.\n If not set, only the predefined string `h2` and `http/1.1` will be recognized. Other negotiated ALPN string will\n result in a HTTP1/1 connection\n Note: Connection will keep a deep copy of the table and the strings."] pub alpn_string_map : * mut aws_hash_table , # [doc = " Options specific to HTTP/1.x connections.\n Optional.\n Ignored if connection is not HTTP/1.x.\n If connection is HTTP/1.x and options were not specified, default values are used."] pub http1_options : * const aws_http1_connection_options , # [doc = " Options specific to HTTP/2 connections.\n Optional.\n Ignored if connection is not HTTP/2.\n If connection is HTTP/2 and options were not specified, default values are used."] pub http2_options : * const aws_http2_connection_options , # [doc = " Optional.\n Requests the channel/connection be bound to a specific event loop rather than chosen sequentially from the\n event loop group associated with the client bootstrap."] pub requested_event_loop : * mut aws_event_loop , # [doc = " Optional\n Host resolution override that allows the user to override DNS behavior for this particular connection."] pub host_resolution_config : * const aws_host_resolution_config , } # [test] fn bindgen_test_layout_aws_http_client_connection_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_client_connection_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_client_connection_options > () , 176usize , concat ! ("Size of: " , stringify ! (aws_http_client_connection_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_client_connection_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_client_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . self_size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (self_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . socket_options) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (socket_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_options) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (tls_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_options) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_settings) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (proxy_ev_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . monitoring_options) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (monitoring_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . manual_window_management) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (manual_window_management))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_window_size) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (initial_window_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_setup) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (on_setup))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_shutdown) as usize - ptr as usize } , 120usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (on_shutdown))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . prior_knowledge_http2) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (prior_knowledge_http2))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alpn_string_map) as usize - ptr as usize } , 136usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (alpn_string_map))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http1_options) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (http1_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http2_options) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (http2_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . requested_event_loop) as usize - ptr as usize } , 160usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (requested_event_loop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolution_config) as usize - ptr as usize } , 168usize , concat ! ("Offset of field: " , stringify ! (aws_http_client_connection_options) , "::" , stringify ! (host_resolution_config))) ; } impl Default for aws_http_client_connection_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } impl aws_http2_settings_id { pub const AWS_HTTP2_SETTINGS_HEADER_TABLE_SIZE : aws_http2_settings_id = aws_http2_settings_id :: AWS_HTTP2_SETTINGS_BEGIN_RANGE ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http2_settings_id { AWS_HTTP2_SETTINGS_BEGIN_RANGE = 1 , AWS_HTTP2_SETTINGS_ENABLE_PUSH = 2 , AWS_HTTP2_SETTINGS_MAX_CONCURRENT_STREAMS = 3 , AWS_HTTP2_SETTINGS_INITIAL_WINDOW_SIZE = 4 , AWS_HTTP2_SETTINGS_MAX_FRAME_SIZE = 5 , AWS_HTTP2_SETTINGS_MAX_HEADER_LIST_SIZE = 6 , AWS_HTTP2_SETTINGS_END_RANGE = 7 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http2_setting { pub id : aws_http2_settings_id , pub value : u32 , } # [test] fn bindgen_test_layout_aws_http2_setting () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http2_setting > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http2_setting > () , 8usize , concat ! ("Size of: " , stringify ! (aws_http2_setting))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http2_setting > () , 4usize , concat ! ("Alignment of " , stringify ! (aws_http2_setting))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . id) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http2_setting) , "::" , stringify ! (id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (aws_http2_setting) , "::" , stringify ! (value))) ; } impl Default for aws_http2_setting { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Asynchronously establish a client connection.\n The on_setup callback is invoked when the operation has created a connection or failed."] pub fn aws_http_client_connect (options : * const aws_http_client_connection_options) -> :: libc :: c_int ; } extern "C" { # [doc = " Users must release the connection when they are done with it.\n The connection's memory cannot be reclaimed until this is done.\n If the connection was not already shutting down, it will be shut down.\n\n Users should always wait for the on_shutdown() callback to be called before releasing any data passed to the\n http_connection (Eg aws_tls_connection_options, aws_socket_options) otherwise there will be race conditions between\n http_connection shutdown tasks and memory release tasks, causing Segfaults."] pub fn aws_http_connection_release (connection : * mut aws_http_connection) ; } extern "C" { # [doc = " Begin shutdown sequence of the connection if it hasn't already started. This will schedule shutdown tasks on the\n EventLoop that may send HTTP/TLS/TCP shutdown messages to peers if necessary, and will eventually cause internal\n connection memory to stop being accessed and on_shutdown() callback to be called.\n\n It's safe to call this function regardless of the connection state as long as you hold a reference to the connection."] pub fn aws_http_connection_close (connection : * mut aws_http_connection) ; } extern "C" { # [doc = " Stop accepting new requests for the connection. It will NOT start the shutdown process for the connection. The\n requests that are already open can still wait to be completed, but new requests will fail to be created,"] pub fn aws_http_connection_stop_new_requests (connection : * mut aws_http_connection) ; } extern "C" { # [doc = " Returns true unless the connection is closed or closing."] pub fn aws_http_connection_is_open (connection : * const aws_http_connection) -> bool ; } extern "C" { # [doc = " Return whether the connection can make a new requests.\n If false, then a new connection must be established to make further requests."] pub fn aws_http_connection_new_requests_allowed (connection : * const aws_http_connection) -> bool ; } extern "C" { # [doc = " Returns true if this is a client connection."] pub fn aws_http_connection_is_client (connection : * const aws_http_connection) -> bool ; } extern "C" { pub fn aws_http_connection_get_version (connection : * const aws_http_connection) -> aws_http_version ; } extern "C" { # [doc = " Returns the channel hosting the HTTP connection.\n Do not expose this function to language bindings."] pub fn aws_http_connection_get_channel (connection : * mut aws_http_connection) -> * mut aws_channel ; } extern "C" { # [doc = " Returns the remote endpoint of the HTTP connection."] pub fn aws_http_connection_get_remote_endpoint (connection : * const aws_http_connection) -> * const aws_socket_endpoint ; } extern "C" { # [doc = " Initialize an map copied from the *src map, which maps `struct aws_string *` to `enum aws_http_version`."] pub fn aws_http_alpn_map_init_copy (allocator : * mut aws_allocator , dest : * mut aws_hash_table , src : * mut aws_hash_table) -> :: libc :: c_int ; } extern "C" { # [doc = " Initialize an empty hash-table that maps `struct aws_string *` to `enum aws_http_version`.\n This map can used in aws_http_client_connections_options.alpn_string_map."] pub fn aws_http_alpn_map_init (allocator : * mut aws_allocator , map : * mut aws_hash_table) -> :: libc :: c_int ; } extern "C" { # [doc = " Checks http proxy options for correctness"] pub fn aws_http_options_validate_proxy_configuration (options : * const aws_http_client_connection_options) -> :: libc :: c_int ; } extern "C" { # [doc = " Send a SETTINGS frame (HTTP/2 only).\n SETTINGS will be applied locally when SETTINGS ACK is received from peer.\n\n @param http2_connection HTTP/2 connection.\n @param settings_array The array of settings to change. Note: each setting has its boundary.\n @param num_settings The num of settings to change in settings_array.\n @param on_completed Optional callback, see `aws_http2_on_change_settings_complete_fn`.\n @param user_data User-data pass to on_completed callback."] pub fn aws_http2_connection_change_settings (http2_connection : * mut aws_http_connection , settings_array : * const aws_http2_setting , num_settings : usize , on_completed : aws_http2_on_change_settings_complete_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Send a PING frame (HTTP/2 only).\n Round-trip-time is calculated when PING ACK is received from peer.\n\n @param http2_connection HTTP/2 connection.\n @param optional_opaque_data Optional payload for PING frame.\n Must be NULL, or exactly 8 bytes (AWS_HTTP2_PING_DATA_SIZE).\n If NULL, the 8 byte payload will be all zeroes.\n @param on_completed Optional callback, invoked when PING ACK is received from peer,\n or when a connection error prevents the PING ACK from being received.\n Callback always fires on the connection's event-loop thread.\n @param user_data User-data pass to on_completed callback."] pub fn aws_http2_connection_ping (http2_connection : * mut aws_http_connection , optional_opaque_data : * const aws_byte_cursor , on_completed : aws_http2_on_ping_complete_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the local settings we are using to affect the decoding.\n\n @param http2_connection HTTP/2 connection.\n @param out_settings fixed size array of aws_http2_setting gets set to the local settings"] pub fn aws_http2_connection_get_local_settings (http2_connection : * const aws_http_connection , out_settings : * mut aws_http2_setting) ; } extern "C" { # [doc = " Get the settings received from remote peer, which we are using to restricts the message to send.\n\n @param http2_connection HTTP/2 connection.\n @param out_settings fixed size array of aws_http2_setting gets set to the remote settings"] pub fn aws_http2_connection_get_remote_settings (http2_connection : * const aws_http_connection , out_settings : * mut aws_http2_setting) ; } extern "C" { # [doc = " Send a custom GOAWAY frame (HTTP/2 only).\n\n Note that the connection automatically attempts to send a GOAWAY during\n shutdown (unless a GOAWAY with a valid Last-Stream-ID has already been sent).\n\n This call can be used to gracefully warn the peer of an impending shutdown\n (http2_error=0, allow_more_streams=true), or to customize the final GOAWAY\n frame that is sent by this connection.\n\n The other end may not receive the goaway, if the connection already closed.\n\n @param http2_connection HTTP/2 connection.\n @param http2_error The HTTP/2 error code (RFC-7540 section 7) to send.\n `enum aws_http2_error_code` lists official codes.\n @param allow_more_streams If true, new peer-initiated streams will continue\n to be acknowledged and the GOAWAY's Last-Stream-ID will be set to a max value.\n If false, new peer-initiated streams will be ignored and the GOAWAY's\n Last-Stream-ID will be set to the latest acknowledged stream.\n @param optional_debug_data Optional debug data to send. Size must not exceed 16KB."] pub fn aws_http2_connection_send_goaway (http2_connection : * mut aws_http_connection , http2_error : u32 , allow_more_streams : bool , optional_debug_data : * const aws_byte_cursor) ; } extern "C" { # [doc = " Get data about the latest GOAWAY frame sent to peer (HTTP/2 only).\n If no GOAWAY has been sent, AWS_ERROR_HTTP_DATA_NOT_AVAILABLE will be raised.\n Note that GOAWAY frames are typically sent automatically by the connection\n during shutdown.\n\n @param http2_connection HTTP/2 connection.\n @param out_http2_error Gets set to HTTP/2 error code sent in most recent GOAWAY.\n @param out_last_stream_id Gets set to Last-Stream-ID sent in most recent GOAWAY."] pub fn aws_http2_connection_get_sent_goaway (http2_connection : * mut aws_http_connection , out_http2_error : * mut u32 , out_last_stream_id : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Get data about the latest GOAWAY frame received from peer (HTTP/2 only).\n If no GOAWAY has been received, or the GOAWAY payload is still in transmitting,\n AWS_ERROR_HTTP_DATA_NOT_AVAILABLE will be raised.\n\n @param http2_connection HTTP/2 connection.\n @param out_http2_error Gets set to HTTP/2 error code received in most recent GOAWAY.\n @param out_last_stream_id Gets set to Last-Stream-ID received in most recent GOAWAY."] pub fn aws_http2_connection_get_received_goaway (http2_connection : * mut aws_http_connection , out_http2_error : * mut u32 , out_last_stream_id : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Increment the connection's flow-control window to keep data flowing (HTTP/2 only).\n\n If the connection was created with `conn_manual_window_management` set true,\n the flow-control window of the connection will shrink as body data is received for all the streams created on it.\n (headers, padding, and other metadata do not affect the window).\n The initial connection flow-control window is 65,535.\n Once the connection's flow-control window reaches to 0, all the streams on the connection stop receiving any further\n data.\n\n If `conn_manual_window_management` is false, this call will have no effect.\n The connection maintains its flow-control windows such that\n no back-pressure is applied and data arrives as fast as possible.\n\n If you are not connected, this call will have no effect.\n\n Crashes when the connection is not http2 connection.\n The limit of the Maximum Size is 2**31 - 1. If the increment size cause the connection flow window exceeds the\n Maximum size, this call will result in the connection lost.\n\n @param http2_connection HTTP/2 connection.\n @param increment_size The size to increment for the connection's flow control window"] pub fn aws_http2_connection_update_window (http2_connection : * mut aws_http_connection , increment_size : u32) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_future_impl { _unused : [u8 ; 0] , } `# [doc = " Completion callback for aws_future"]` pub type aws_future_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; pub type aws_future_impl_result_clean_up_fn = :: std :: option :: Option < unsafe extern "C" fn (result_addr : * mut :: libc :: c_void) > ; pub type aws_future_impl_result_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (result : * mut :: libc :: c_void) > ; pub type aws_future_impl_result_release_fn = :: std :: option :: Option < unsafe extern "C" fn (result : * mut :: libc :: c_void) -> * mut :: libc :: c_void > ; extern "C" { pub fn aws_future_impl_new_by_value (alloc : * mut aws_allocator , sizeof_result : usize) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_new_by_value_with_clean_up (alloc : * mut aws_allocator , sizeof_result : usize , result_clean_up : aws_future_impl_result_clean_up_fn) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_new_pointer (alloc : * mut aws_allocator) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_new_pointer_with_destroy (alloc : * mut aws_allocator , result_destroy : aws_future_impl_result_destroy_fn) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_new_pointer_with_release (alloc : * mut aws_allocator , result_release : aws_future_impl_result_release_fn) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_release (promise : * mut aws_future_impl) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_acquire (promise : * mut aws_future_impl) -> * mut aws_future_impl ; } extern "C" { pub fn aws_future_impl_set_error (promise : * mut aws_future_impl , error_code : :: libc :: c_int) ; } extern "C" { pub fn aws_future_impl_set_result_by_move (promise : * mut aws_future_impl , src_address : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_impl_is_done (future : * const aws_future_impl) -> bool ; } extern "C" { pub fn aws_future_impl_register_callback (future : * mut aws_future_impl , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_impl_register_callback_if_not_done (future : * mut aws_future_impl , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) -> bool ; } extern "C" { pub fn aws_future_impl_register_event_loop_callback (future : * mut aws_future_impl , event_loop : * mut aws_event_loop , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_impl_register_channel_callback (future : * mut aws_future_impl , channel : * mut aws_channel , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_impl_wait (future : * const aws_future_impl , timeout_ns : u64) -> bool ; } extern "C" { pub fn aws_future_impl_get_error (future : * const aws_future_impl) -> :: libc :: c_int ; } extern "C" { pub fn aws_future_impl_get_result_address (future : * const aws_future_impl) -> * mut :: libc :: c_void ; } extern "C" { pub fn aws_future_impl_get_result_by_move (future : * mut aws_future_impl , dst_address : * mut :: libc :: c_void) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_future_size { _unused : [u8 ; 0] , } extern "C" { pub fn aws_future_size_new (alloc : * mut aws_allocator) -> * mut aws_future_size ; } extern "C" { pub fn aws_future_size_set_result (future : * mut aws_future_size , result : usize) ; } extern "C" { pub fn aws_future_size_get_result (future : * const aws_future_size) -> usize ; } extern "C" { pub fn aws_future_size_acquire (future : * mut aws_future_size) -> * mut aws_future_size ; } extern "C" { pub fn aws_future_size_release (future : * mut aws_future_size) -> * mut aws_future_size ; } extern "C" { pub fn aws_future_size_set_error (future : * mut aws_future_size , error_code : :: libc :: c_int) ; } extern "C" { pub fn aws_future_size_is_done (future : * const aws_future_size) -> bool ; } extern "C" { pub fn aws_future_size_get_error (future : * const aws_future_size) -> :: libc :: c_int ; } extern "C" { pub fn aws_future_size_register_callback (future : * mut aws_future_size , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_size_register_callback_if_not_done (future : * mut aws_future_size , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) -> bool ; } extern "C" { pub fn aws_future_size_register_event_loop_callback (future : * mut aws_future_size , event_loop : * mut aws_event_loop , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_size_register_channel_callback (future : * mut aws_future_size , channel : * mut aws_channel , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_size_wait (future : * mut aws_future_size , timeout_ns : u64) -> bool ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_future_bool { _unused : [u8 ; 0] , } extern "C" { pub fn aws_future_bool_new (alloc : * mut aws_allocator) -> * mut aws_future_bool ; } extern "C" { pub fn aws_future_bool_set_result (future : * mut aws_future_bool , result : bool) ; } extern "C" { pub fn aws_future_bool_get_result (future : * const aws_future_bool) -> bool ; } extern "C" { pub fn aws_future_bool_acquire (future : * mut aws_future_bool) -> * mut aws_future_bool ; } extern "C" { pub fn aws_future_bool_release (future : * mut aws_future_bool) -> * mut aws_future_bool ; } extern "C" { pub fn aws_future_bool_set_error (future : * mut aws_future_bool , error_code : :: libc :: c_int) ; } extern "C" { pub fn aws_future_bool_is_done (future : * const aws_future_bool) -> bool ; } extern "C" { pub fn aws_future_bool_get_error (future : * const aws_future_bool) -> :: libc :: c_int ; } extern "C" { pub fn aws_future_bool_register_callback (future : * mut aws_future_bool , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_bool_register_callback_if_not_done (future : * mut aws_future_bool , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) -> bool ; } extern "C" { pub fn aws_future_bool_register_event_loop_callback (future : * mut aws_future_bool , event_loop : * mut aws_event_loop , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_bool_register_channel_callback (future : * mut aws_future_bool , channel : * mut aws_channel , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_bool_wait (future : * mut aws_future_bool , timeout_ns : u64) -> bool ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_future_void { _unused : [u8 ; 0] , } extern "C" { # [doc = " aws_future"] pub fn aws_future_void_new (alloc : * mut aws_allocator) -> * mut aws_future_void ; } extern "C" { pub fn aws_future_void_set_result (future : * mut aws_future_void) ; } extern "C" { pub fn aws_future_void_acquire (future : * mut aws_future_void) -> * mut aws_future_void ; } extern "C" { pub fn aws_future_void_release (future : * mut aws_future_void) -> * mut aws_future_void ; } extern "C" { pub fn aws_future_void_set_error (future : * mut aws_future_void , error_code : :: libc :: c_int) ; } extern "C" { pub fn aws_future_void_is_done (future : * const aws_future_void) -> bool ; } extern "C" { pub fn aws_future_void_get_error (future : * const aws_future_void) -> :: libc :: c_int ; } extern "C" { pub fn aws_future_void_register_callback (future : * mut aws_future_void , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_void_register_callback_if_not_done (future : * mut aws_future_void , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) -> bool ; } extern "C" { pub fn aws_future_void_register_event_loop_callback (future : * mut aws_future_void , event_loop : * mut aws_event_loop , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_void_register_channel_callback (future : * mut aws_future_void , channel : * mut aws_channel , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_void_wait (future : * mut aws_future_void , timeout_ns : u64) -> bool ; } # [doc = " A stream exists for the duration of a request/response exchange.\n A client creates a stream to send a request and receive a response.\n A server creates a stream to receive a request and send a response.\n In http/2, a push-promise stream can be sent by a server and received by a client."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_stream { _unused : [u8 ; 0] , } # [repr (u32)] # [non_exhaustive] # [doc = " Controls whether a header's strings may be compressed by encoding the index of\n strings in a cache, rather than encoding the literal string.\n\n This setting has no effect on HTTP/1.x connections.\n On HTTP/2 connections this controls HPACK behavior.\n See RFC-7541 Section 7.1 for security considerations."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_header_compression { # [doc = " Compress header by encoding the cached index of its strings,\n or by updating the cache to contain these strings for future reference.\n Best for headers that are sent repeatedly.\n This is the default setting."] AWS_HTTP_HEADER_COMPRESSION_USE_CACHE = 0 , # [doc = " Encode header strings literally.\n If an intermediary re-broadcasts the headers, it is permitted to use cache.\n Best for unique headers that are unlikely to repeat."] AWS_HTTP_HEADER_COMPRESSION_NO_CACHE = 1 , # [doc = " Encode header strings literally and forbid all intermediaries from using\n cache when re-broadcasting.\n Best for header fields that are highly valuable or sensitive to recovery."] AWS_HTTP_HEADER_COMPRESSION_NO_FORWARD_CACHE = 2 , } # [doc = " A lightweight HTTP header struct.\n Note that the underlying strings are not owned by the byte cursors."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_header { pub name : aws_byte_cursor , pub value : aws_byte_cursor , pub compression : aws_http_header_compression , } # [test] fn bindgen_test_layout_aws_http_header () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_header > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_header > () , 40usize , concat ! ("Size of: " , stringify ! (aws_http_header))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_header > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_header))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . name) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_header) , "::" , stringify ! (name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_header) , "::" , stringify ! (value))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . compression) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_header) , "::" , stringify ! (compression))) ; } impl Default for aws_http_header { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " A transformable block of HTTP headers.\n Provides a nice API for getting/setting header names and values.\n\n All strings are copied and stored within this datastructure.\n The index of a given header may change any time headers are modified.\n When iterating headers, the following ordering rules apply:\n\n - Headers with the same name will always be in the same order, relative to one another.\n If \"A: one\" is added before \"A: two\", then \"A: one\" will always precede \"A: two\".\n\n - Headers with different names could be in any order, relative to one another.\n If \"A: one\" is seen before \"B: bee\" in one iteration, you might see \"B: bee\" before \"A: one\" on the next."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_headers { _unused : [u8 ; 0] , } # [repr (u32)] # [non_exhaustive] # [doc = " Header block type.\n INFORMATIONAL: Header block for 1xx informational (interim) responses.\n MAIN: Main header block sent with request or response.\n TRAILING: Headers sent after the body of a request or response."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_header_block { AWS_HTTP_HEADER_BLOCK_MAIN = 0 , AWS_HTTP_HEADER_BLOCK_INFORMATIONAL = 1 , AWS_HTTP_HEADER_BLOCK_TRAILING = 2 , } # [doc = " The definition for an outgoing HTTP request or response.\n The message may be transformed (ex: signing the request) before its data is eventually sent.\n\n The message keeps internal copies of its trivial strings (method, path, headers)\n but does NOT take ownership of its body stream.\n\n A language binding would likely present this as an HttpMessage base class with\n HttpRequest and HttpResponse subclasses."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_message { _unused : [u8 ; 0] , } # [doc = " Function to invoke when a message transformation completes.\n This function MUST be invoked or the application will soft-lock.\n `message` and `complete_ctx` must be the same pointers provided to the `aws_http_message_transform_fn`.\n `error_code` should should be AWS_ERROR_SUCCESS if transformation was successful,\n otherwise pass a different AWS_ERROR_X value."] pub type aws_http_message_transform_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (message : * mut aws_http_message , error_code : :: libc :: c_int , complete_ctx : * mut :: libc :: c_void) > ; # [doc = " A function that may modify a request or response before it is sent.\n The transformation may be asynchronous or immediate.\n The user MUST invoke the `complete_fn` when transformation is complete or the application will soft-lock.\n When invoking the `complete_fn`, pass along the `message` and `complete_ctx` provided here and an error code.\n The error code should be AWS_ERROR_SUCCESS if transformation was successful,\n otherwise pass a different AWS_ERROR_X value."] pub type aws_http_message_transform_fn = :: std :: option :: Option < unsafe extern "C" fn (message : * mut aws_http_message , user_data : * mut :: libc :: c_void , complete_fn : aws_http_message_transform_complete_fn , complete_ctx : * mut :: libc :: c_void) > ; # [doc = " Invoked repeatedly times as headers are received.\n At this point, aws_http_stream_get_incoming_response_status() can be called for the client.\n And aws_http_stream_get_incoming_request_method() and aws_http_stream_get_incoming_request_uri() can be called for\n the server.\n This is always invoked on the HTTP connection's event-loop thread.\n\n Return AWS_OP_SUCCESS to continue processing the stream.\n Return AWS_OP_ERR to indicate failure and cancel the stream."] pub type aws_http_on_incoming_headers_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , header_block : aws_http_header_block , header_array : * const aws_http_header , num_headers : usize , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Invoked when the incoming header block of this type(informational/main/trailing) has been completely read.\n This is always invoked on the HTTP connection's event-loop thread.\n\n Return AWS_OP_SUCCESS to continue processing the stream.\n Return AWS_OP_ERR to indicate failure and cancel the stream."] pub type aws_http_on_incoming_header_block_done_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , header_block : aws_http_header_block , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Called repeatedly as body data is received.\n The data must be copied immediately if you wish to preserve it.\n This is always invoked on the HTTP connection's event-loop thread.\n\n Note that, if the connection is using manual_window_management then the window\n size has shrunk by the amount of body data received. If the window size\n reaches 0 no further data will be received. Increment the window size with\n aws_http_stream_update_window().\n\n Return AWS_OP_SUCCESS to continue processing the stream.\n Return AWS_OP_ERR to indicate failure and cancel the stream."] pub type aws_http_on_incoming_body_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , data : * const aws_byte_cursor , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Invoked when request has been completely read.\n This is always invoked on the HTTP connection's event-loop thread.\n\n Return AWS_OP_SUCCESS to continue processing the stream.\n Return AWS_OP_ERR to indicate failure and cancel the stream."] pub type aws_http_on_incoming_request_done_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Invoked when request/response stream is completely destroyed.\n This may be invoked synchronously when aws_http_stream_release() is called.\n This is invoked even if the stream is never activated."] pub type aws_http_on_stream_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when request/response stream destroy completely.\n This can be invoked within the same thead who release the refcount on http stream."] pub type aws_http_on_stream_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [doc = " Tracing metrics for aws_http_stream.\n Data maybe not be available if the data of stream was never sent/received before it completes."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http_stream_metrics { pub send_start_timestamp_ns : i64 , pub send_end_timestamp_ns : i64 , pub sending_duration_ns : i64 , pub receive_start_timestamp_ns : i64 , pub receive_end_timestamp_ns : i64 , pub receiving_duration_ns : i64 , pub stream_id : u32 , } # [test] fn bindgen_test_layout_aws_http_stream_metrics () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_stream_metrics > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_stream_metrics > () , 56usize , concat ! ("Size of: " , stringify ! (aws_http_stream_metrics))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_stream_metrics > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_stream_metrics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . send_start_timestamp_ns) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (send_start_timestamp_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . send_end_timestamp_ns) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (send_end_timestamp_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . sending_duration_ns) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (sending_duration_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . receive_start_timestamp_ns) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (receive_start_timestamp_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . receive_end_timestamp_ns) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (receive_end_timestamp_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . receiving_duration_ns) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (receiving_duration_ns))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . stream_id) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_stream_metrics) , "::" , stringify ! (stream_id))) ; } # [doc = " Invoked right before request/response stream is complete to report the tracing metrics for aws_http_stream.\n This may be invoked synchronously when aws_http_stream_release() is called.\n This is invoked even if the stream is never activated.\n See `aws_http_stream_metrics` for details."] pub type aws_http_on_stream_metrics_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , metrics : * const aws_http_stream_metrics , user_data : * mut :: libc :: c_void) > ; # [doc = " Options for creating a stream which sends a request from the client and receives a response from the server."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_make_request_options { # [doc = " The sizeof() this struct, used for versioning.\n Required."] pub self_size : usize , # [doc = " Definition for outgoing request.\n Required.\n The request will be kept alive via refcounting until the request completes."] pub request : * mut aws_http_message , pub user_data : * mut :: libc :: c_void , # [doc = " Invoked repeatedly times as headers are received.\n Optional.\n See `aws_http_on_incoming_headers_fn`."] pub on_response_headers : aws_http_on_incoming_headers_fn , # [doc = " Invoked when response header block has been completely read.\n Optional.\n See `aws_http_on_incoming_header_block_done_fn`."] pub on_response_header_block_done : aws_http_on_incoming_header_block_done_fn , # [doc = " Invoked repeatedly as body data is received.\n Optional.\n See `aws_http_on_incoming_body_fn`."] pub on_response_body : aws_http_on_incoming_body_fn , # [doc = " Invoked right before stream is complete, whether successful or unsuccessful\n Optional.\n See `aws_http_on_stream_metrics_fn`"] pub on_metrics : aws_http_on_stream_metrics_fn , # [doc = " Invoked when request/response stream is complete, whether successful or unsuccessful\n Optional.\n See `aws_http_on_stream_complete_fn`."] pub on_complete : aws_http_on_stream_complete_fn , pub on_destroy : aws_http_on_stream_destroy_fn , # [doc = " When using HTTP/2, request body data will be provided over time. The stream will only be polled for writing\n when data has been supplied via `aws_http2_stream_write_data`"] pub http2_use_manual_data_writes : bool , } # [test] fn bindgen_test_layout_aws_http_make_request_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_make_request_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_make_request_options > () , 80usize , concat ! ("Size of: " , stringify ! (aws_http_make_request_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_make_request_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_make_request_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . self_size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (self_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . request) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (request))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_response_headers) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_response_headers))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_response_header_block_done) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_response_header_block_done))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_response_body) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_response_body))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_metrics) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_metrics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_complete) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_destroy) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (on_destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http2_use_manual_data_writes) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_http_make_request_options) , "::" , stringify ! (http2_use_manual_data_writes))) ; } impl Default for aws_http_make_request_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_request_handler_options { pub self_size : usize , # [doc = " Required."] pub server_connection : * mut aws_http_connection , # [doc = " user_data passed to callbacks.\n Optional."] pub user_data : * mut :: libc :: c_void , # [doc = " Invoked repeatedly times as headers are received.\n Optional.\n See `aws_http_on_incoming_headers_fn`."] pub on_request_headers : aws_http_on_incoming_headers_fn , # [doc = " Invoked when the request header block has been completely read.\n Optional.\n See `aws_http_on_incoming_header_block_done_fn`."] pub on_request_header_block_done : aws_http_on_incoming_header_block_done_fn , # [doc = " Invoked as body data is received.\n Optional.\n See `aws_http_on_incoming_body_fn`."] pub on_request_body : aws_http_on_incoming_body_fn , # [doc = " Invoked when request has been completely read.\n Optional.\n See `aws_http_on_incoming_request_done_fn`."] pub on_request_done : aws_http_on_incoming_request_done_fn , # [doc = " Invoked when request/response stream is complete, whether successful or unsuccessful\n Optional.\n See `aws_http_on_stream_complete_fn`."] pub on_complete : aws_http_on_stream_complete_fn , pub on_destroy : aws_http_on_stream_destroy_fn , } # [test] fn bindgen_test_layout_aws_http_request_handler_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_request_handler_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_request_handler_options > () , 72usize , concat ! ("Size of: " , stringify ! (aws_http_request_handler_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_request_handler_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_request_handler_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . self_size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (self_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . server_connection) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (server_connection))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_request_headers) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_request_headers))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_request_header_block_done) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_request_header_block_done))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_request_body) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_request_body))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_request_done) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_request_done))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_complete) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_destroy) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_http_request_handler_options) , "::" , stringify ! (on_destroy))) ; } impl Default for aws_http_request_handler_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Invoked when the data stream of an outgoing HTTP write operation is no longer in use.\n This is always invoked on the HTTP connection's event-loop thread.\n\n @param stream HTTP-stream this write operation was submitted to.\n @param error_code If error_code is AWS_ERROR_SUCCESS (0), the data was successfully sent.\n Any other error_code indicates that the HTTP-stream is in the process of terminating.\n If the error_code is AWS_ERROR_HTTP_STREAM_HAS_COMPLETED,\n the stream's termination has nothing to do with this write operation.\n Any other non-zero error code indicates a problem with this particular write\n operation's data.\n @param user_data User data for this write operation."] pub type aws_http_stream_write_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_http_stream , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked when the data of an outgoing HTTP/1.1 chunk is no longer in use.\n This is always invoked on the HTTP connection's event-loop thread.\n\n @param stream HTTP-stream this chunk was submitted to.\n @param error_code If error_code is AWS_ERROR_SUCCESS (0), the data was successfully sent.\n Any other error_code indicates that the HTTP-stream is in the process of terminating.\n If the error_code is AWS_ERROR_HTTP_STREAM_HAS_COMPLETED,\n the stream's termination has nothing to do with this chunk.\n Any other non-zero error code indicates a problem with this particular chunk's data.\n @param user_data User data for this chunk."] pub type aws_http1_stream_write_chunk_complete_fn = aws_http_stream_write_complete_fn ; # [doc = " HTTP/1.1 chunk extension for chunked encoding.\n Note that the underlying strings are not owned by the byte cursors."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http1_chunk_extension { pub key : aws_byte_cursor , pub value : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_http1_chunk_extension () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http1_chunk_extension > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http1_chunk_extension > () , 32usize , concat ! ("Size of: " , stringify ! (aws_http1_chunk_extension))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http1_chunk_extension > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http1_chunk_extension))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . key) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_extension) , "::" , stringify ! (key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_extension) , "::" , stringify ! (value))) ; } impl Default for aws_http1_chunk_extension { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Encoding options for an HTTP/1.1 chunked transfer encoding chunk."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http1_chunk_options { pub chunk_data : * mut aws_input_stream , pub chunk_data_size : u64 , # [doc = " A pointer to an array of chunked extensions.\n The num_extensions must match the length of the array.\n This data is deep-copied by aws_http1_stream_write_chunk(),\n it does not need to remain valid until on_complete is invoked."] pub extensions : * mut aws_http1_chunk_extension , # [doc = " The number of elements defined in the extensions array."] pub num_extensions : usize , # [doc = " Invoked when the chunk data is no longer in use, whether or not it was successfully sent.\n Optional.\n See `aws_http1_stream_write_chunk_complete_fn`."] pub on_complete : aws_http1_stream_write_chunk_complete_fn , # [doc = " User provided data passed to the on_complete callback on its invocation."] pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_http1_chunk_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http1_chunk_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http1_chunk_options > () , 48usize , concat ! ("Size of: " , stringify ! (aws_http1_chunk_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http1_chunk_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http1_chunk_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . chunk_data) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (chunk_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . chunk_data_size) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (chunk_data_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . extensions) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (extensions))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_extensions) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (num_extensions))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_complete) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (on_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http1_chunk_options) , "::" , stringify ! (user_data))) ; } impl Default for aws_http1_chunk_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Invoked when the data of an outgoing HTTP2 data frame is no longer in use.\n This is always invoked on the HTTP connection's event-loop thread.\n\n @param stream HTTP2-stream this write was submitted to.\n @param error_code If error_code is AWS_ERROR_SUCCESS (0), the data was successfully sent.\n Any other error_code indicates that the HTTP-stream is in the process of terminating.\n If the error_code is AWS_ERROR_HTTP_STREAM_HAS_COMPLETED,\n the stream's termination has nothing to do with this write.\n Any other non-zero error code indicates a problem with this particular write's data.\n @param user_data User data for this write."] pub type aws_http2_stream_write_data_complete_fn = aws_http_stream_write_complete_fn ; # [doc = " Encoding options for manual H2 data frame writes"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http2_stream_write_data_options { # [doc = " The data to be sent.\n Optional.\n If not set, input stream with length 0 will be used."] pub data : * mut aws_input_stream , # [doc = " Set true when it's the last chunk to be sent.\n After a write with end_stream, no more data write will be accepted."] pub end_stream : bool , # [doc = " Invoked when the data stream is no longer in use, whether or not it was successfully sent.\n Optional.\n See `aws_http2_stream_write_data_complete_fn`."] pub on_complete : aws_http2_stream_write_data_complete_fn , # [doc = " User provided data passed to the on_complete callback on its invocation."] pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_http2_stream_write_data_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http2_stream_write_data_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http2_stream_write_data_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_http2_stream_write_data_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http2_stream_write_data_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http2_stream_write_data_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . data) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http2_stream_write_data_options) , "::" , stringify ! (data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . end_stream) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http2_stream_write_data_options) , "::" , stringify ! (end_stream))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_complete) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http2_stream_write_data_options) , "::" , stringify ! (on_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http2_stream_write_data_options) , "::" , stringify ! (user_data))) ; } impl Default for aws_http2_stream_write_data_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Return whether both names are equivalent.\n This is a case-insensitive string comparison.\n\n Example Matches:\n \"Content-Length\" == \"content-length\" // upper or lower case ok\n\n Example Mismatches:\n \"Content-Length\" != \" Content-Length\" // leading whitespace bad"] pub fn aws_http_header_name_eq (name_a : aws_byte_cursor , name_b : aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Create a new headers object.\n The caller has a hold on the object and must call aws_http_headers_release() when they are done with it."] pub fn aws_http_headers_new (allocator : * mut aws_allocator) -> * mut aws_http_headers ; } extern "C" { # [doc = " Acquire a hold on the object, preventing it from being deleted until\n aws_http_headers_release() is called by all those with a hold on it."] pub fn aws_http_headers_acquire (headers : * mut aws_http_headers) ; } extern "C" { # [doc = " Release a hold on the object.\n The object is deleted when all holds on it are released."] pub fn aws_http_headers_release (headers : * mut aws_http_headers) ; } extern "C" { # [doc = " Add a header.\n The underlying strings are copied."] pub fn aws_http_headers_add_header (headers : * mut aws_http_headers , header : * const aws_http_header) -> :: libc :: c_int ; } extern "C" { # [doc = " Add a header.\n The underlying strings are copied."] pub fn aws_http_headers_add (headers : * mut aws_http_headers , name : aws_byte_cursor , value : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Add an array of headers.\n The underlying strings are copied."] pub fn aws_http_headers_add_array (headers : * mut aws_http_headers , array : * const aws_http_header , count : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Set a header value.\n The header is added if necessary and any existing values for this name are removed.\n The underlying strings are copied."] pub fn aws_http_headers_set (headers : * mut aws_http_headers , name : aws_byte_cursor , value : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the total number of headers."] pub fn aws_http_headers_count (headers : * const aws_http_headers) -> usize ; } extern "C" { # [doc = " Get the header at the specified index.\n The index of a given header may change any time headers are modified.\n When iterating headers, the following ordering rules apply:\n\n - Headers with the same name will always be in the same order, relative to one another.\n If \"A: one\" is added before \"A: two\", then \"A: one\" will always precede \"A: two\".\n\n - Headers with different names could be in any order, relative to one another.\n If \"A: one\" is seen before \"B: bee\" in one iteration, you might see \"B: bee\" before \"A: one\" on the next.\n\n AWS_ERROR_INVALID_INDEX is raised if the index is invalid."] pub fn aws_http_headers_get_index (headers : * const aws_http_headers , index : usize , out_header : * mut aws_http_header) -> :: libc :: c_int ; } extern "C" { # [doc = " Get all values with this name, combined into one new aws_string that you are responsible for destroying.\n If there are multiple headers with this name, their values are appended with comma-separators.\n If there are no headers with this name, NULL is returned and AWS_ERROR_HTTP_HEADER_NOT_FOUND is raised."] pub fn aws_http_headers_get_all (headers : * const aws_http_headers , name : aws_byte_cursor) -> * mut aws_string ; } extern "C" { # [doc = " Get the first value for this name, ignoring any additional values.\n AWS_ERROR_HTTP_HEADER_NOT_FOUND is raised if the name is not found."] pub fn aws_http_headers_get (headers : * const aws_http_headers , name : aws_byte_cursor , out_value : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Test if header name exists or not in headers"] pub fn aws_http_headers_has (headers : * const aws_http_headers , name : aws_byte_cursor) -> bool ; } extern "C" { # [doc = " Remove all headers with this name.\n AWS_ERROR_HTTP_HEADER_NOT_FOUND is raised if no headers with this name are found."] pub fn aws_http_headers_erase (headers : * mut aws_http_headers , name : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Remove the first header found with this name and value.\n AWS_ERROR_HTTP_HEADER_NOT_FOUND is raised if no such header is found."] pub fn aws_http_headers_erase_value (headers : * mut aws_http_headers , name : aws_byte_cursor , value : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Remove the header at the specified index.\n\n AWS_ERROR_INVALID_INDEX is raised if the index is invalid."] pub fn aws_http_headers_erase_index (headers : * mut aws_http_headers , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Clear all headers."] pub fn aws_http_headers_clear (headers : * mut aws_http_headers) ; } extern "C" { # [doc = " Get the `:method` value (HTTP/2 headers only)."] pub fn aws_http2_headers_get_request_method (h2_headers : * const aws_http_headers , out_method : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set `:method` (HTTP/2 headers only).\n The headers makes its own copy of the underlying string."] pub fn aws_http2_headers_set_request_method (h2_headers : * mut aws_http_headers , method : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_http2_headers_get_request_scheme (h2_headers : * const aws_http_headers , out_scheme : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set `:scheme` (request pseudo headers only).\n The pseudo headers makes its own copy of the underlying string."] pub fn aws_http2_headers_set_request_scheme (h2_headers : * mut aws_http_headers , scheme : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_http2_headers_get_request_authority (h2_headers : * const aws_http_headers , out_authority : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set `:authority` (request pseudo headers only).\n The pseudo headers makes its own copy of the underlying string."] pub fn aws_http2_headers_set_request_authority (h2_headers : * mut aws_http_headers , authority : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_http2_headers_get_request_path (h2_headers : * const aws_http_headers , out_path : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set `:path` (request pseudo headers only).\n The pseudo headers makes its own copy of the underlying string."] pub fn aws_http2_headers_set_request_path (h2_headers : * mut aws_http_headers , path : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Get `:status` (response pseudo headers only).\n If no status is set, AWS_ERROR_HTTP_DATA_NOT_AVAILABLE is raised."] pub fn aws_http2_headers_get_response_status (h2_headers : * const aws_http_headers , out_status_code : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Set `:status` (response pseudo headers only)."] pub fn aws_http2_headers_set_response_status (h2_headers : * mut aws_http_headers , status_code : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Create a new HTTP/1.1 request message.\n The message is blank, all properties (method, path, etc) must be set individually.\n If HTTP/1.1 message used in HTTP/2 connection, the transformation will be automatically applied.\n A HTTP/2 message will created and sent based on the HTTP/1.1 message.\n\n The caller has a hold on the object and must call aws_http_message_release() when they are done with it."] pub fn aws_http_message_new_request (allocator : * mut aws_allocator) -> * mut aws_http_message ; } extern "C" { # [doc = " Like aws_http_message_new_request(), but uses existing aws_http_headers instead of creating a new one.\n Acquires a hold on the headers, and releases it when the request is destroyed."] pub fn aws_http_message_new_request_with_headers (allocator : * mut aws_allocator , existing_headers : * mut aws_http_headers) -> * mut aws_http_message ; } extern "C" { # [doc = " Create a new HTTP/1.1 response message.\n The message is blank, all properties (status, headers, etc) must be set individually.\n\n The caller has a hold on the object and must call aws_http_message_release() when they are done with it."] pub fn aws_http_message_new_response (allocator : * mut aws_allocator) -> * mut aws_http_message ; } extern "C" { # [doc = " Create a new HTTP/2 request message.\n pseudo headers need to be set from aws_http2_headers_set_request_* to the headers of the aws_http_message.\n Will be errored out if used in HTTP/1.1 connection.\n\n The caller has a hold on the object and must call aws_http_message_release() when they are done with it."] pub fn aws_http2_message_new_request (allocator : * mut aws_allocator) -> * mut aws_http_message ; } extern "C" { # [doc = " Create a new HTTP/2 response message.\n pseudo headers need to be set from aws_http2_headers_set_response_status to the headers of the aws_http_message.\n Will be errored out if used in HTTP/1.1 connection.\n\n The caller has a hold on the object and must call aws_http_message_release() when they are done with it."] pub fn aws_http2_message_new_response (allocator : * mut aws_allocator) -> * mut aws_http_message ; } extern "C" { # [doc = " Create an HTTP/2 message from HTTP/1.1 message.\n pseudo headers will be created from the context and added to the headers of new message.\n Normal headers will be copied to the headers of new message.\n Note:\n - if `host` exist, it will be removed and `:authority` will be added using the information.\n - `:scheme` always defaults to \"https\". To use a different scheme create the HTTP/2 message directly"] pub fn aws_http2_message_new_from_http1 (alloc : * mut aws_allocator , http1_msg : * const aws_http_message) -> * mut aws_http_message ; } extern "C" { # [doc = " Acquire a hold on the object, preventing it from being deleted until\n aws_http_message_release() is called by all those with a hold on it.\n\n This function returns the passed in message (possibly NULL) so that acquire-and-assign can be done with a single\n statement."] pub fn aws_http_message_acquire (message : * mut aws_http_message) -> * mut aws_http_message ; } extern "C" { # [doc = " Release a hold on the object.\n The object is deleted when all holds on it are released.\n\n This function always returns NULL so that release-and-assign-NULL can be done with a single statement."] pub fn aws_http_message_release (message : * mut aws_http_message) -> * mut aws_http_message ; } extern "C" { # [doc = " Deprecated. This is equivalent to aws_http_message_release()."] pub fn aws_http_message_destroy (message : * mut aws_http_message) ; } extern "C" { pub fn aws_http_message_is_request (message : * const aws_http_message) -> bool ; } extern "C" { pub fn aws_http_message_is_response (message : * const aws_http_message) -> bool ; } extern "C" { # [doc = " Get the protocol version of the http message."] pub fn aws_http_message_get_protocol_version (message : * const aws_http_message) -> aws_http_version ; } extern "C" { # [doc = " Get the method (request messages only)."] pub fn aws_http_message_get_request_method (request_message : * const aws_http_message , out_method : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set the method (request messages only).\n The request makes its own copy of the underlying string."] pub fn aws_http_message_set_request_method (request_message : * mut aws_http_message , method : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_http_message_get_request_path (request_message : * const aws_http_message , out_path : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Set the path-and-query value (request messages only).\n The request makes its own copy of the underlying string."] pub fn aws_http_message_set_request_path (request_message : * mut aws_http_message , path : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the status code (response messages only).\n If no status is set, AWS_ERROR_HTTP_DATA_NOT_AVAILABLE is raised."] pub fn aws_http_message_get_response_status (response_message : * const aws_http_message , out_status_code : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Set the status code (response messages only)."] pub fn aws_http_message_set_response_status (response_message : * mut aws_http_message , status_code : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the body stream.\n Returns NULL if no body stream is set."] pub fn aws_http_message_get_body_stream (message : * const aws_http_message) -> * mut aws_input_stream ; } extern "C" { # [doc = " Set the body stream.\n NULL is an acceptable value for messages with no body.\n Note: The message does NOT take ownership of the body stream.\n The stream must not be destroyed until the message is complete."] pub fn aws_http_message_set_body_stream (message : * mut aws_http_message , body_stream : * mut aws_input_stream) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_future_http_message { _unused : [u8 ; 0] , } extern "C" { pub fn aws_future_http_message_new (alloc : * mut aws_allocator) -> * mut aws_future_http_message ; } extern "C" { pub fn aws_future_http_message_set_result_by_move (future : * mut aws_future_http_message , pointer_address : * mut * mut aws_http_message) ; } extern "C" { pub fn aws_future_http_message_get_result_by_move (future : * mut aws_future_http_message) -> * mut aws_http_message ; } extern "C" { pub fn aws_future_http_message_peek_result (future : * const aws_future_http_message) -> * mut aws_http_message ; } extern "C" { pub fn aws_future_http_message_acquire (future : * mut aws_future_http_message) -> * mut aws_future_http_message ; } extern "C" { pub fn aws_future_http_message_release (future : * mut aws_future_http_message) -> * mut aws_future_http_message ; } extern "C" { pub fn aws_future_http_message_set_error (future : * mut aws_future_http_message , error_code : :: libc :: c_int) ; } extern "C" { pub fn aws_future_http_message_is_done (future : * const aws_future_http_message) -> bool ; } extern "C" { pub fn aws_future_http_message_get_error (future : * const aws_future_http_message) -> :: libc :: c_int ; } extern "C" { pub fn aws_future_http_message_register_callback (future : * mut aws_future_http_message , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_http_message_register_callback_if_not_done (future : * mut aws_future_http_message , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) -> bool ; } extern "C" { pub fn aws_future_http_message_register_event_loop_callback (future : * mut aws_future_http_message , event_loop : * mut aws_event_loop , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_http_message_register_channel_callback (future : * mut aws_future_http_message , channel : * mut aws_channel , on_done : aws_future_callback_fn , user_data : * mut :: libc :: c_void) ; } extern "C" { pub fn aws_future_http_message_wait (future : * mut aws_future_http_message , timeout_ns : u64) -> bool ; } extern "C" { # [doc = " Submit a chunk of data to be sent on an HTTP/1.1 stream.\n The stream must have specified \"chunked\" in a \"transfer-encoding\" header.\n For client streams, activate() must be called before any chunks are submitted.\n For server streams, the response must be submitted before any chunks.\n A final chunk with size 0 must be submitted to successfully complete the HTTP-stream.\n\n Returns AWS_OP_SUCCESS if the chunk has been submitted. The chunk's completion\n callback will be invoked when the HTTP-stream is done with the chunk data,\n whether or not it was successfully sent (see `aws_http1_stream_write_chunk_complete_fn`).\n The chunk data must remain valid until the completion callback is invoked.\n\n Returns AWS_OP_ERR and raises an error if the chunk could not be submitted.\n In this case, the chunk's completion callback will never be invoked.\n Note that it is always possible for the HTTP-stream to terminate unexpectedly\n prior to this call being made, in which case the error raised is\n AWS_ERROR_HTTP_STREAM_HAS_COMPLETED."] pub fn aws_http1_stream_write_chunk (http1_stream : * mut aws_http_stream , options : * const aws_http1_chunk_options) -> :: libc :: c_int ; } extern "C" { # [doc = " The stream must have specified `http2_use_manual_data_writes` during request creation.\n For client streams, activate() must be called before any frames are submitted.\n For server streams, the response headers must be submitted before any frames.\n A write with options that has end_stream set to be true will end the stream and prevent any further write.\n\n @return AWS_OP_SUCCESS if the write was queued\n AWS_OP_ERROR indicating the attempt raised an error code.\n AWS_ERROR_INVALID_STATE will be raised for invalid usage.\n AWS_ERROR_HTTP_STREAM_HAS_COMPLETED will be raised if the stream ended for reasons behind the scenes.\n\n Typical usage will be something like:\n options.http2_use_manual_data_writes = true;\n stream = aws_http_connection_make_request(connection, &options);\n aws_http_stream_activate(stream);\n ...\n struct aws_http2_stream_write_data_options write;\n aws_http2_stream_write_data(stream, &write);\n ...\n struct aws_http2_stream_write_data_options last_write;\n last_write.end_stream = true;\n aws_http2_stream_write_data(stream, &write);\n ...\n aws_http_stream_release(stream);"] pub fn aws_http2_stream_write_data (http2_stream : * mut aws_http_stream , options : * const aws_http2_stream_write_data_options) -> :: libc :: c_int ; } extern "C" { # [doc = " Add a list of headers to be added as trailing headers sent after the last chunk is sent.\n a \"Trailer\" header field which indicates the fields present in the trailer.\n\n Certain headers are forbidden in the trailer (e.g., Transfer-Encoding, Content-Length, Host). See RFC-7541\n Section 4.1.2 for more details.\n\n For client streams, activate() must be called before any chunks are submitted.\n\n For server streams, the response must be submitted before the trailer can be added\n\n aws_http1_stream_add_chunked_trailer must be called before the final size 0 chunk, and at the moment can only\n be called once, though this could change if need be.\n\n Returns AWS_OP_SUCCESS if the chunk has been submitted."] pub fn aws_http1_stream_add_chunked_trailer (http1_stream : * mut aws_http_stream , trailing_headers : * const aws_http_headers) -> :: libc :: c_int ; } extern "C" { # [doc = " This datastructure has more functions for inspecting and modifying headers than\n are available on the aws_http_message datastructure."] pub fn aws_http_message_get_headers (message : * const aws_http_message) -> * mut aws_http_headers ; } extern "C" { # [doc = " Get the message's const aws_http_headers."] pub fn aws_http_message_get_const_headers (message : * const aws_http_message) -> * const aws_http_headers ; } extern "C" { # [doc = " Get the number of headers."] pub fn aws_http_message_get_header_count (message : * const aws_http_message) -> usize ; } extern "C" { # [doc = " Get the header at the specified index.\n This function cannot fail if a valid index is provided.\n Otherwise, AWS_ERROR_INVALID_INDEX will be raised.\n\n The underlying strings are stored within the message."] pub fn aws_http_message_get_header (message : * const aws_http_message , out_header : * mut aws_http_header , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Add a header to the end of the array.\n The message makes its own copy of the underlying strings."] pub fn aws_http_message_add_header (message : * mut aws_http_message , header : aws_http_header) -> :: libc :: c_int ; } extern "C" { # [doc = " Add an array of headers to the end of the header array.\n The message makes its own copy of the underlying strings.\n\n This is a helper function useful when it's easier to define headers as a stack array, rather than calling add_header\n repeatedly."] pub fn aws_http_message_add_header_array (message : * mut aws_http_message , headers : * const aws_http_header , num_headers : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Remove the header at the specified index.\n Headers after this index are all shifted back one position.\n\n This function cannot fail if a valid index is provided.\n Otherwise, AWS_ERROR_INVALID_INDEX will be raised."] pub fn aws_http_message_erase_header (message : * mut aws_http_message , index : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Create a stream, with a client connection sending a request.\n The request does not start sending automatically once the stream is created. You must call\n aws_http_stream_activate to begin execution of the request.\n\n The `options` are copied during this call.\n\n Tip for language bindings: Do not bind the `options` struct. Use something more natural for your language,\n such as Builder Pattern in Java, or Python's ability to take many optional arguments by name.\n\n Note: The header of the request will be sent as it is when the message to send protocol matches the protocol of the\n connection.\n - No `user-agent` will be added.\n - No security check will be enforced. eg: `referer` header privacy should be enforced by the user-agent who adds the\n header\n - When HTTP/1 message sent on HTTP/2 connection, `aws_http2_message_new_from_http1` will be applied under the hood.\n - When HTTP/2 message sent on HTTP/1 connection, no change will be made."] pub fn aws_http_connection_make_request (client_connection : * mut aws_http_connection , options : * const aws_http_make_request_options) -> * mut aws_http_stream ; } extern "C" { # [doc = " Create a stream, with a server connection receiving and responding to a request.\n This function can only be called from the `aws_http_on_incoming_request_fn` callback.\n aws_http_stream_send_response() should be used to send a response."] pub fn aws_http_stream_new_server_request_handler (options : * const aws_http_request_handler_options) -> * mut aws_http_stream ; } extern "C" { # [doc = " Acquire refcount on the stream to prevent it from being cleaned up until it is released."] pub fn aws_http_stream_acquire (stream : * mut aws_http_stream) -> * mut aws_http_stream ; } extern "C" { # [doc = " Users must release the stream when they are done with it, or its memory will never be cleaned up.\n This will not cancel the stream, its callbacks will still fire if the stream is still in progress.\n\n Tips for language bindings:\n - Invoke this from the wrapper class's finalizer/destructor.\n - Do not let the wrapper class be destroyed until on_complete() has fired."] pub fn aws_http_stream_release (stream : * mut aws_http_stream) ; } extern "C" { # [doc = " Only used for client initiated streams (immediately following a call to aws_http_connection_make_request).\n\n Activates the request's outgoing stream processing."] pub fn aws_http_stream_activate (stream : * mut aws_http_stream) -> :: libc :: c_int ; } extern "C" { pub fn aws_http_stream_get_connection (stream : * const aws_http_stream) -> * mut aws_http_connection ; } extern "C" { pub fn aws_http_stream_get_incoming_response_status (stream : * const aws_http_stream , out_status : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { pub fn aws_http_stream_get_incoming_request_method (stream : * const aws_http_stream , out_method : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_http_stream_get_incoming_request_uri (stream : * const aws_http_stream , out_uri : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Send response (only callable from \"request handler\" streams)\n The response object must stay alive at least until the stream's on_complete is called."] pub fn aws_http_stream_send_response (stream : * mut aws_http_stream , response : * mut aws_http_message) -> :: libc :: c_int ; } extern "C" { # [doc = " Increment the stream's flow-control window to keep data flowing.\n\n If the connection was created with `manual_window_management` set true,\n the flow-control window of each stream will shrink as body data is received\n (headers, padding, and other metadata do not affect the window).\n The connection's `initial_window_size` determines the starting size of each stream's window.\n If a stream's flow-control window reaches 0, no further data will be received.\n\n If `manual_window_management` is false, this call will have no effect.\n The connection maintains its flow-control windows such that\n no back-pressure is applied and data arrives as fast as possible."] pub fn aws_http_stream_update_window (stream : * mut aws_http_stream , increment_size : usize) ; } extern "C" { # [doc = " Gets the HTTP/2 id associated with a stream. Even h1 streams have an id (using the same allocation procedure\n as http/2) for easier tracking purposes. For client streams, this will only be non-zero after a successful call\n to aws_http_stream_activate()"] pub fn aws_http_stream_get_id (stream : * const aws_http_stream) -> u32 ; } extern "C" { # [doc = " Reset the HTTP/2 stream (HTTP/2 only).\n Note that if the stream closes before this async call is fully processed, the RST_STREAM frame will not be sent.\n\n @param http2_stream HTTP/2 stream.\n @param http2_error aws_http2_error_code. Reason to reset the stream."] pub fn aws_http2_stream_reset (http2_stream : * mut aws_http_stream , http2_error : u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the error code received in rst_stream.\n Only valid if the stream has completed, and an RST_STREAM frame has received.\n\n @param http2_stream HTTP/2 stream.\n @param out_http2_error Gets to set to HTTP/2 error code received in rst_stream."] pub fn aws_http2_stream_get_received_reset_error_code (http2_stream : * mut aws_http_stream , out_http2_error : * mut u32) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the HTTP/2 error code sent in the RST_STREAM frame (HTTP/2 only).\n Only valid if the stream has completed, and has sent an RST_STREAM frame.\n\n @param http2_stream HTTP/2 stream.\n @param out_http2_error Gets to set to HTTP/2 error code sent in rst_stream."] pub fn aws_http2_stream_get_sent_reset_error_code (http2_stream : * mut aws_http_stream , out_http2_error : * mut u32) -> :: libc :: c_int ; } pub type aws_simple_completion_callback = :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_ref_count { pub ref_count : aws_atomic_var , pub object : * mut :: libc :: c_void , pub on_zero_fn : aws_simple_completion_callback , } # [test] fn bindgen_test_layout_aws_ref_count () { const UNINIT : :: std :: mem :: MaybeUninit < aws_ref_count > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_ref_count > () , 24usize , concat ! ("Size of: " , stringify ! (aws_ref_count))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_ref_count > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_ref_count) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . object) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_ref_count) , "::" , stringify ! (object))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_zero_fn) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_ref_count) , "::" , stringify ! (on_zero_fn))) ; } impl Default for aws_ref_count { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_shutdown_callback_options { pub shutdown_callback_fn : aws_simple_completion_callback , pub shutdown_callback_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_shutdown_callback_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_shutdown_callback_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_shutdown_callback_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_shutdown_callback_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_shutdown_callback_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_shutdown_callback_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback_fn) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_shutdown_callback_options) , "::" , stringify ! (shutdown_callback_fn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback_user_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_shutdown_callback_options) , "::" , stringify ! (shutdown_callback_user_data))) ; } impl Default for aws_shutdown_callback_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Initializes a ref-counter structure. After initialization, the ref count will be 1.\n\n @param ref_count ref-counter to initialize\n @param object object being ref counted\n @param on_zero_fn function to invoke when the ref count reaches zero"] pub fn aws_ref_count_init (ref_count : * mut aws_ref_count , object : * mut :: libc :: c_void , on_zero_fn : aws_simple_completion_callback) ; } extern "C" { # [doc = " Increments a ref-counter's ref count\n\n @param ref_count ref-counter to increment the count for\n @return the object being ref-counted"] pub fn aws_ref_count_acquire (ref_count : * mut aws_ref_count) -> * mut :: libc :: c_void ; } extern "C" { # [doc = " Decrements a ref-counter's ref count. Invokes the on_zero callback if the ref count drops to zero\n @param ref_count ref-counter to decrement the count for\n @return the value of the decremented ref count"] pub fn aws_ref_count_release (ref_count : * mut aws_ref_count) -> usize ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_async_input_stream { pub vtable : * const aws_async_input_stream_vtable , pub alloc : * mut aws_allocator , pub ref_count : aws_ref_count , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_async_input_stream () { const UNINIT : :: std :: mem :: MaybeUninit < aws_async_input_stream > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_async_input_stream > () , 48usize , concat ! ("Size of: " , stringify ! (aws_async_input_stream))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_async_input_stream > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_async_input_stream))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream) , "::" , stringify ! (impl_))) ; } impl Default for aws_async_input_stream { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_async_input_stream_vtable { # [doc = " Destroy the stream, its refcount has reached 0."] pub destroy : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_async_input_stream) > , # [doc = " Read once into the buffer.\n Complete the read when at least 1 byte is read, the buffer is full, or EOF is reached.\n Do not resize the buffer (do not use \"aws_byte_buf_xyz_dynamic()\" functions)\n Do not assume that buffer len starts at 0.\n You may assume that read() won't be called again until the current one completes.\n You may assume that the buffer has some space available.\n Return a future, which will contain an error code if something went wrong,\n or a result bool indicating whether EOF has been reached."] pub read : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_async_input_stream , dest : * mut aws_byte_buf) -> * mut aws_future_bool > , } # [test] fn bindgen_test_layout_aws_async_input_stream_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_async_input_stream_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_async_input_stream_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_async_input_stream_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_async_input_stream_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_async_input_stream_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . read) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_async_input_stream_vtable) , "::" , stringify ! (read))) ; } extern "C" { # [doc = " Initialize aws_async_input_stream \"base class\""] pub fn aws_async_input_stream_init_base (stream : * mut aws_async_input_stream , alloc : * mut aws_allocator , vtable : * const aws_async_input_stream_vtable , impl_ : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Increment reference count.\n You may pass in NULL (has no effect).\n Returns whatever pointer was passed in."] pub fn aws_async_input_stream_acquire (stream : * mut aws_async_input_stream) -> * mut aws_async_input_stream ; } extern "C" { # [doc = " Decrement reference count.\n You may pass in NULL (has no effect).\n Always returns NULL."] pub fn aws_async_input_stream_release (stream : * mut aws_async_input_stream) -> * mut aws_async_input_stream ; } extern "C" { # [doc = " Read once from the async stream into the buffer.\n The read completes when at least 1 byte is read, the buffer is full, or EOF is reached.\n Depending on implementation, the read could complete at any time.\n It may complete synchronously. It may complete on another thread.\n Returns a future, which will contain an error code if something went wrong,\n or a result bool indicating whether EOF has been reached.\n\n WARNING: The buffer must have space available.\n WARNING: Do not read again until the previous read is complete."] pub fn aws_async_input_stream_read (stream : * mut aws_async_input_stream , dest : * mut aws_byte_buf) -> * mut aws_future_bool ; } extern "C" { # [doc = " Read repeatedly from the async stream until the buffer is full, or EOF is reached.\n Depending on implementation, this could complete at any time.\n It may complete synchronously. It may complete on another thread.\n Returns a future, which will contain an error code if something went wrong,\n or a result bool indicating whether EOF has been reached.\n\n WARNING: The buffer must have space available.\n WARNING: Do not read again until the previous read is complete."] pub fn aws_async_input_stream_read_to_fill (stream : * mut aws_async_input_stream , dest : * mut aws_byte_buf) -> * mut aws_future_bool ; } pub type aws_crt_statistics_category_t = u32 ; pub const AWS_CRT_STATISTICS_CATEGORY_STRIDE_BITS : _bindgen_ty_22 = _bindgen_ty_22 :: AWS_CRT_STATISTICS_CATEGORY_STRIDE_BITS ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_22 { AWS_CRT_STATISTICS_CATEGORY_STRIDE_BITS = 8 , } # [repr (u32)] # [non_exhaustive] # [doc = " The common-specific range of the aws_crt_statistics_category cross-library enum.\n\n This enum functions as an RTTI value that lets statistics handler's interpret (via cast) a\n specific statistics structure if the RTTI value is understood.\n\n Common doesn't have any statistics structures presently, so its range is essentially empty.\n"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_crt_common_statistics_category { AWSCRT_STAT_CAT_INVALID = 0 , } # [doc = " Pattern-struct that functions as a base \"class\" for all statistics structures. To conform\n to the pattern, a statistics structure must have its first member be the category. In that\n case it becomes \"safe\" to cast from aws_crt_statistics_base to the specific statistics structure\n based on the category value."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_crt_statistics_base { pub category : aws_crt_statistics_category_t , } # [test] fn bindgen_test_layout_aws_crt_statistics_base () { const UNINIT : :: std :: mem :: MaybeUninit < aws_crt_statistics_base > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_crt_statistics_base > () , 4usize , concat ! ("Size of: " , stringify ! (aws_crt_statistics_base))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_crt_statistics_base > () , 4usize , concat ! ("Alignment of " , stringify ! (aws_crt_statistics_base))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . category) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_base) , "::" , stringify ! (category))) ; } # [doc = " The start and end time, in milliseconds-since-epoch, that a set of statistics was gathered over."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_crt_statistics_sample_interval { pub begin_time_ms : u64 , pub end_time_ms : u64 , } # [test] fn bindgen_test_layout_aws_crt_statistics_sample_interval () { const UNINIT : :: std :: mem :: MaybeUninit < aws_crt_statistics_sample_interval > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_crt_statistics_sample_interval > () , 16usize , concat ! ("Size of: " , stringify ! (aws_crt_statistics_sample_interval))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_crt_statistics_sample_interval > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_crt_statistics_sample_interval))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . begin_time_ms) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_sample_interval) , "::" , stringify ! (begin_time_ms))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . end_time_ms) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_sample_interval) , "::" , stringify ! (end_time_ms))) ; } pub type aws_crt_statistics_handler_process_statistics_fn = :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_crt_statistics_handler , interval : * mut aws_crt_statistics_sample_interval , stats : * mut aws_array_list , context : * mut :: libc :: c_void) > ; pub type aws_crt_statistics_handler_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_crt_statistics_handler) > ; pub type aws_crt_statistics_handler_get_report_interval_ms_fn = :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut aws_crt_statistics_handler) -> u64 > ; # [doc = " Vtable for functions that all statistics handlers must implement"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_crt_statistics_handler_vtable { pub process_statistics : aws_crt_statistics_handler_process_statistics_fn , pub destroy : aws_crt_statistics_handler_destroy_fn , pub get_report_interval_ms : aws_crt_statistics_handler_get_report_interval_ms_fn , } # [test] fn bindgen_test_layout_aws_crt_statistics_handler_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_crt_statistics_handler_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_crt_statistics_handler_vtable > () , 24usize , concat ! ("Size of: " , stringify ! (aws_crt_statistics_handler_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_crt_statistics_handler_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_crt_statistics_handler_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_statistics) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler_vtable) , "::" , stringify ! (process_statistics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_report_interval_ms) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler_vtable) , "::" , stringify ! (get_report_interval_ms))) ; } # [doc = " Base structure for all statistics handler implementations.\n\n A statistics handler is an object that listens to a stream of polymorphic (via the category RTTI enum) statistics\n structures emitted from some arbitrary source. In the initial implementation, statistics handlers are primarily\n attached to channels, where they monitor IO throughput and state data (from channel handlers) to determine a\n connection's health.\n\n Statistics handlers are a generalization of the timeout and bandwidth filters that are often associated with\n SDK network connections. Configurable, default implementations are defined at the protocol level (http, etc...)\n where they can be attached at connection (channel) creation time."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_crt_statistics_handler { pub vtable : * mut aws_crt_statistics_handler_vtable , pub allocator : * mut aws_allocator , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_crt_statistics_handler () { const UNINIT : :: std :: mem :: MaybeUninit < aws_crt_statistics_handler > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_crt_statistics_handler > () , 24usize , concat ! ("Size of: " , stringify ! (aws_crt_statistics_handler))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_crt_statistics_handler > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_crt_statistics_handler))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_crt_statistics_handler) , "::" , stringify ! (impl_))) ; } impl Default for aws_crt_statistics_handler { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Submits a list of statistics objects to a statistics handler for processing\n\n handler - the statistics handler that will process the statistics objects\n interval - time period over which the statistics were gathered\n stats - list of pointers to structures that can be case to aws_crt_statistics_base (i.e. have category as a first\n member)\n context - (optional) additional context specific to where the statistics handler has been attached"] pub fn aws_crt_statistics_handler_process_statistics (handler : * mut aws_crt_statistics_handler , interval : * mut aws_crt_statistics_sample_interval , stats : * mut aws_array_list , context : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Queries the frequency (via an interval in milliseconds) which a statistics handler would like to be informed\n of statistics."] pub fn aws_crt_statistics_handler_get_report_interval_ms (handler : * mut aws_crt_statistics_handler) -> u64 ; } extern "C" { # [doc = " completely destroys a statistics handler. The handler's cleanup function must clean up the impl portion completely\n (including its allocation, if done separately)."] pub fn aws_crt_statistics_handler_destroy (handler : * mut aws_crt_statistics_handler) ; } pub type aws_priority_queue_compare_fn = :: std :: option :: Option < unsafe extern "C" fn (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> :: libc :: c_int > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_priority_queue { # [doc = " predicate that determines the priority of the elements in the queue."] pub pred : aws_priority_queue_compare_fn , # [doc = " The underlying container storing the queue elements."] pub container : aws_array_list , # [doc = " An array of pointers to backpointer elements. This array is initialized when\n the first call to aws_priority_queue_push_bp is made, and is subsequently maintained\n through any heap node manipulations.\n\n Each element is a struct aws_priority_queue_node *, pointing to a backpointer field\n owned by the calling code, or a NULL. The backpointer field is continually updated\n with information needed to locate and remove a specific node later on."] pub backpointers : aws_array_list , } # [test] fn bindgen_test_layout_aws_priority_queue () { const UNINIT : :: std :: mem :: MaybeUninit < aws_priority_queue > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_priority_queue > () , 88usize , concat ! ("Size of: " , stringify ! (aws_priority_queue))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_priority_queue > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_priority_queue))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . pred) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_priority_queue) , "::" , stringify ! (pred))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . container) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_priority_queue) , "::" , stringify ! (container))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . backpointers) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_priority_queue) , "::" , stringify ! (backpointers))) ; } impl Default for aws_priority_queue { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_priority_queue_node { # [doc = " The current index of the node in question, or SIZE_MAX if the node has been removed."] pub current_index : usize , } # [test] fn bindgen_test_layout_aws_priority_queue_node () { const UNINIT : :: std :: mem :: MaybeUninit < aws_priority_queue_node > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_priority_queue_node > () , 8usize , concat ! ("Size of: " , stringify ! (aws_priority_queue_node))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_priority_queue_node > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_priority_queue_node))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . current_index) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_priority_queue_node) , "::" , stringify ! (current_index))) ; } extern "C" { # [doc = " Initializes a priority queue struct for use. This mode will grow memory automatically (exponential model)\n Default size is the inital size of the queue\n item_size is the size of each element in bytes. Mixing items types is not supported by this API.\n pred is the function that will be used to determine priority."] pub fn aws_priority_queue_init_dynamic (queue : * mut aws_priority_queue , alloc : * mut aws_allocator , default_size : usize , item_size : usize , pred : aws_priority_queue_compare_fn) -> :: libc :: c_int ; } extern "C" { # [doc = " Initializes a priority queue struct for use. This mode will not allocate any additional memory. When the heap fills\n new enqueue operations will fail with AWS_ERROR_PRIORITY_QUEUE_FULL.\n\n Heaps initialized using this call do not support the aws_priority_queue_push_ref call with a non-NULL backpointer\n parameter.\n\n heap is the raw memory allocated for this priority_queue\n item_count is the maximum number of elements the raw heap can contain\n item_size is the size of each element in bytes. Mixing items types is not supported by this API.\n pred is the function that will be used to determine priority."] pub fn aws_priority_queue_init_static (queue : * mut aws_priority_queue , heap : * mut :: libc :: c_void , item_count : usize , item_size : usize , pred : aws_priority_queue_compare_fn) ; } extern "C" { # [doc = " Checks that the backpointer at a specific index of the queue is\n NULL or points to a correctly allocated aws_priority_queue_node."] pub fn aws_priority_queue_backpointer_index_valid (queue : * const aws_priority_queue , index : usize) -> bool ; } extern "C" { # [doc = " Checks that the backpointers of the priority queue are either NULL\n or correctly allocated to point at aws_priority_queue_nodes. This\n check is O(n), as it accesses every backpointer in a loop, and thus\n shouldn't be used carelessly."] pub fn aws_priority_queue_backpointers_valid_deep (queue : * const aws_priority_queue) -> bool ; } extern "C" { # [doc = " Checks that the backpointers of the priority queue satisfy validity\n constraints."] pub fn aws_priority_queue_backpointers_valid (queue : * const aws_priority_queue) -> bool ; } extern "C" { # [doc = " Set of properties of a valid aws_priority_queue."] pub fn aws_priority_queue_is_valid (queue : * const aws_priority_queue) -> bool ; } extern "C" { # [doc = " Cleans up any internally allocated memory and resets the struct for reuse or deletion."] pub fn aws_priority_queue_clean_up (queue : * mut aws_priority_queue) ; } extern "C" { # [doc = " Copies item into the queue and places it in the proper priority order. Complexity: O(log(n))."] pub fn aws_priority_queue_push (queue : * mut aws_priority_queue , item : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies item into the queue and places it in the proper priority order. Complexity: O(log(n)).\n\n If the backpointer parameter is non-null, the heap will continually update the pointed-to field\n with information needed to remove the node later on. *backpointer must remain valid until the node\n is removed from the heap, and may be updated on any mutating operation on the priority queue.\n\n If the node is removed, the backpointer will be set to a sentinel value that indicates that the\n node has already been removed. It is safe (and a no-op) to call aws_priority_queue_remove with\n such a sentinel value."] pub fn aws_priority_queue_push_ref (queue : * mut aws_priority_queue , item : * mut :: libc :: c_void , backpointer : * mut aws_priority_queue_node) -> :: libc :: c_int ; } extern "C" { # [doc = " Copies the element of the highest priority, and removes it from the queue.. Complexity: O(log(n)).\n If queue is empty, AWS_ERROR_PRIORITY_QUEUE_EMPTY will be raised."] pub fn aws_priority_queue_pop (queue : * mut aws_priority_queue , item : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes a specific node from the priority queue. Complexity: O(log(n))\n After removing a node (using either _remove or _pop), the backpointer set at push_ref time is set\n to a sentinel value. If this sentinel value is passed to aws_priority_queue_remove,\n AWS_ERROR_PRIORITY_QUEUE_BAD_NODE will be raised. Note, however, that passing uninitialized\n aws_priority_queue_nodes, or ones from different priority queues, results in undefined behavior."] pub fn aws_priority_queue_remove (queue : * mut aws_priority_queue , item : * mut :: libc :: c_void , node : * const aws_priority_queue_node) -> :: libc :: c_int ; } extern "C" { # [doc = " Obtains a pointer to the element of the highest priority. Complexity: constant time.\n If queue is empty, AWS_ERROR_PRIORITY_QUEUE_EMPTY will be raised."] pub fn aws_priority_queue_top (queue : * const aws_priority_queue , item : * mut * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Current number of elements in the queue"] pub fn aws_priority_queue_size (queue : * const aws_priority_queue) -> usize ; } extern "C" { # [doc = " Current allocated capacity for the queue, in dynamic mode this grows over time, in static mode, this will never\n change."] pub fn aws_priority_queue_capacity (queue : * const aws_priority_queue) -> usize ; } impl aws_task_status { pub const AWS_TASK_STATUS_RUN_READY : aws_task_status = aws_task_status (0) ; } impl aws_task_status { pub const AWS_TASK_STATUS_CANCELED : aws_task_status = aws_task_status (1) ; } # [repr (transparent)] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub struct aws_task_status (pub :: libc :: c_uint) ; # [doc = " A scheduled function."] pub type aws_task_fn = :: std :: option :: Option < unsafe extern "C" fn (task : * mut aws_task , arg : * mut :: libc :: c_void , arg1 : aws_task_status) > ; # [repr (C)] # [derive (Copy , Clone)] pub struct aws_task { pub fn_ : aws_task_fn , pub arg : * mut :: libc :: c_void , pub timestamp : u64 , pub node : aws_linked_list_node , pub priority_queue_node : aws_priority_queue_node , pub type_tag : * const :: libc :: c_char , pub abi_extension : aws_task__bindgen_ty_1 , } # [repr (C)] # [derive (Copy , Clone)] pub union aws_task__bindgen_ty_1 { pub scheduled : bool , pub reserved : usize , } # [test] fn bindgen_test_layout_aws_task__bindgen_ty_1 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_task__bindgen_ty_1 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_task__bindgen_ty_1 > () , 8usize , concat ! ("Size of: " , stringify ! (aws_task__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_task__bindgen_ty_1 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_task__bindgen_ty_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . scheduled) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_task__bindgen_ty_1) , "::" , stringify ! (scheduled))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . reserved) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_task__bindgen_ty_1) , "::" , stringify ! (reserved))) ; } impl Default for aws_task__bindgen_ty_1 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [test] fn bindgen_test_layout_aws_task () { const UNINIT : :: std :: mem :: MaybeUninit < aws_task > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_task > () , 64usize , concat ! ("Size of: " , stringify ! (aws_task))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_task > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_task))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . fn_) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (fn_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . arg) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (arg))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . timestamp) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (timestamp))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . node) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (node))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . priority_queue_node) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (priority_queue_node))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . type_tag) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (type_tag))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . abi_extension) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_task) , "::" , stringify ! (abi_extension))) ; } impl Default for aws_task { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_task_scheduler { pub alloc : * mut aws_allocator , pub timed_queue : aws_priority_queue , pub timed_list : aws_linked_list , pub asap_list : aws_linked_list , } # [test] fn bindgen_test_layout_aws_task_scheduler () { const UNINIT : :: std :: mem :: MaybeUninit < aws_task_scheduler > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_task_scheduler > () , 160usize , concat ! ("Size of: " , stringify ! (aws_task_scheduler))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_task_scheduler > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_task_scheduler))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_task_scheduler) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . timed_queue) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_task_scheduler) , "::" , stringify ! (timed_queue))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . timed_list) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_task_scheduler) , "::" , stringify ! (timed_list))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . asap_list) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_task_scheduler) , "::" , stringify ! (asap_list))) ; } impl Default for aws_task_scheduler { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Init an aws_task"] pub fn aws_task_init (task : * mut aws_task , fn_ : aws_task_fn , arg : * mut :: libc :: c_void , type_tag : * const :: libc :: c_char) ; } extern "C" { pub fn aws_task_run (task : * mut aws_task , status : aws_task_status) ; } extern "C" { # [doc = " Initializes a task scheduler instance."] pub fn aws_task_scheduler_init (scheduler : * mut aws_task_scheduler , alloc : * mut aws_allocator) -> :: libc :: c_int ; } extern "C" { # [doc = " Empties and executes all queued tasks, passing the AWS_TASK_STATUS_CANCELED status to the task function.\n Cleans up any memory allocated, and prepares the instance for reuse or deletion."] pub fn aws_task_scheduler_clean_up (scheduler : * mut aws_task_scheduler) ; } extern "C" { pub fn aws_task_scheduler_is_valid (scheduler : * const aws_task_scheduler) -> bool ; } extern "C" { # [doc = " Returns whether the scheduler has any scheduled tasks.\n next_task_time (optional) will be set to time of the next task, note that 0 will be set if tasks were\n added via aws_task_scheduler_schedule_now() and UINT64_MAX will be set if no tasks are scheduled at all."] pub fn aws_task_scheduler_has_tasks (scheduler : * const aws_task_scheduler , next_task_time : * mut u64) -> bool ; } extern "C" { # [doc = " Schedules a task to run immediately.\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_task_scheduler_schedule_now (scheduler : * mut aws_task_scheduler , task : * mut aws_task) ; } extern "C" { # [doc = " Schedules a task to run at time_to_run.\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_task_scheduler_schedule_future (scheduler : * mut aws_task_scheduler , task : * mut aws_task , time_to_run : u64) ; } extern "C" { # [doc = " Removes task from the scheduler and invokes the task with the AWS_TASK_STATUS_CANCELED status."] pub fn aws_task_scheduler_cancel_task (scheduler : * mut aws_task_scheduler , task : * mut aws_task) ; } extern "C" { # [doc = " Sequentially execute all tasks scheduled to run at, or before current_time.\n AWS_TASK_STATUS_RUN_READY will be passed to the task function as the task status.\n\n If a task schedules another task, the new task will not be executed until the next call to this function."] pub fn aws_task_scheduler_run_all (scheduler : * mut aws_task_scheduler , current_time : u64) ; } extern "C" { # [doc = " Convert a status value to a c-string suitable for logging"] pub fn aws_task_status_to_c_str (status : aws_task_status) -> * const :: libc :: c_char ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_channel_direction { AWS_CHANNEL_DIR_READ = 0 , AWS_CHANNEL_DIR_WRITE = 1 , } pub type aws_channel_on_setup_completed_fn = :: std :: option :: Option < unsafe extern "C" fn (channel : * mut aws_channel , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; pub type aws_channel_on_shutdown_completed_fn = :: std :: option :: Option < unsafe extern "C" fn (channel : * mut aws_channel , error_code : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_channel_slot { pub alloc : * mut aws_allocator , pub channel : * mut aws_channel , pub adj_left : * mut aws_channel_slot , pub adj_right : * mut aws_channel_slot , pub handler : * mut aws_channel_handler , pub window_size : usize , pub upstream_message_overhead : usize , pub current_window_update_batch_size : usize , } # [test] fn bindgen_test_layout_aws_channel_slot () { const UNINIT : :: std :: mem :: MaybeUninit < aws_channel_slot > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_channel_slot > () , 64usize , concat ! ("Size of: " , stringify ! (aws_channel_slot))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_channel_slot > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_channel_slot))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . channel) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (channel))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . adj_left) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (adj_left))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . adj_right) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (adj_right))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . handler) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (handler))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . window_size) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (window_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . upstream_message_overhead) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (upstream_message_overhead))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . current_window_update_batch_size) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_channel_slot) , "::" , stringify ! (current_window_update_batch_size))) ; } impl Default for aws_channel_slot { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_channel_task_fn = :: std :: option :: Option < unsafe extern "C" fn (channel_task : * mut aws_channel_task , arg : * mut :: libc :: c_void , status : aws_task_status) > ; # [repr (C)] # [derive (Copy , Clone)] pub struct aws_channel_task { pub wrapper_task : aws_task , pub task_fn : aws_channel_task_fn , pub arg : * mut :: libc :: c_void , pub type_tag : * const :: libc :: c_char , pub node : aws_linked_list_node , } # [test] fn bindgen_test_layout_aws_channel_task () { const UNINIT : :: std :: mem :: MaybeUninit < aws_channel_task > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_channel_task > () , 104usize , concat ! ("Size of: " , stringify ! (aws_channel_task))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_channel_task > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_channel_task))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . wrapper_task) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_channel_task) , "::" , stringify ! (wrapper_task))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . task_fn) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_channel_task) , "::" , stringify ! (task_fn))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . arg) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_channel_task) , "::" , stringify ! (arg))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . type_tag) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_channel_task) , "::" , stringify ! (type_tag))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . node) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_channel_task) , "::" , stringify ! (node))) ; } impl Default for aws_channel_task { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_channel_handler_vtable { # [doc = " Called by the channel when a message is available for processing in the read direction. It is your\n responsibility to call aws_mem_release(message->allocator, message); on message when you are finished with it.\n\n Also keep in mind that your slot's internal window has been decremented. You'll want to call\n aws_channel_slot_increment_read_window() at some point in the future if you want to keep receiving data."] pub process_read_message : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , message : * mut aws_io_message) -> :: libc :: c_int > , # [doc = " Called by the channel when a message is available for processing in the write direction. It is your\n responsibility to call aws_mem_release(message->allocator, message); on message when you are finished with it."] pub process_write_message : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , message : * mut aws_io_message) -> :: libc :: c_int > , # [doc = " Called by the channel when a downstream handler has issued a window increment. You'll want to update your\n internal state and likely propagate a window increment message of your own by calling\n 'aws_channel_slot_increment_read_window()'"] pub increment_read_window : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , size : usize) -> :: libc :: c_int > , # [doc = " The channel calls shutdown on all handlers twice, once to shut down reading, and once to shut down writing.\n Shutdown always begins with the left-most handler, and proceeds to the right with dir set to\n AWS_CHANNEL_DIR_READ. Then shutdown is called on handlers from right to left with dir set to\n AWS_CHANNEL_DIR_WRITE.\n\n The shutdown process does not need to complete immediately and may rely on scheduled tasks.\n The handler must call aws_channel_slot_on_handler_shutdown_complete() when it is finished,\n which propagates shutdown to the next handler. If 'free_scarce_resources_immediately' is true,\n then resources vulnerable to denial-of-service attacks (such as sockets and file handles)\n must be closed immediately before the shutdown() call returns."] pub shutdown : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , dir : aws_channel_direction , error_code : :: libc :: c_int , free_scarce_resources_immediately : bool) -> :: libc :: c_int > , # [doc = " Called by the channel when the handler is added to a slot, to get the initial window size."] pub initial_window_size : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler) -> usize > , # [doc = " Called by the channel anytime a handler is added or removed, provides a hint for downstream\n handlers to avoid message fragmentation due to message overhead."] pub message_overhead : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler) -> usize > , # [doc = " Clean up any resources and deallocate yourself. The shutdown process will already be completed before this\n function is called."] pub destroy : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler) > , # [doc = " Directs the channel handler to reset all of the internal statistics it tracks about itself."] pub reset_statistics : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler) > , # [doc = " Adds a pointer to the handler's internal statistics (if they exist) to a list of statistics structures\n associated with the channel's handler chain."] pub gather_statistics : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler , stats_list : * mut aws_array_list) > , pub trigger_read : :: std :: option :: Option < unsafe extern "C" fn (handler : * mut aws_channel_handler) > , } # [test] fn bindgen_test_layout_aws_channel_handler_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_channel_handler_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_channel_handler_vtable > () , 80usize , concat ! ("Size of: " , stringify ! (aws_channel_handler_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_channel_handler_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_channel_handler_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_read_message) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (process_read_message))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_write_message) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (process_write_message))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . increment_read_window) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (increment_read_window))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (shutdown))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_window_size) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (initial_window_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . message_overhead) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (message_overhead))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . reset_statistics) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (reset_statistics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . gather_statistics) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (gather_statistics))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . trigger_read) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler_vtable) , "::" , stringify ! (trigger_read))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_channel_handler { pub vtable : * mut aws_channel_handler_vtable , pub alloc : * mut aws_allocator , pub slot : * mut aws_channel_slot , pub impl_ : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_channel_handler () { const UNINIT : :: std :: mem :: MaybeUninit < aws_channel_handler > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_channel_handler > () , 32usize , concat ! ("Size of: " , stringify ! (aws_channel_handler))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_channel_handler > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_channel_handler))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . slot) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler) , "::" , stringify ! (slot))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_channel_handler) , "::" , stringify ! (impl_))) ; } impl Default for aws_channel_handler { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Args for creating a new channel.\n event_loop to use for IO and tasks. on_setup_completed will be invoked when\n the setup process is finished It will be executed in the event loop's thread.\n on_shutdown_completed will be executed upon channel shutdown.\n\n enable_read_back_pressure toggles whether or not back pressure will be applied in the channel.\n Leave this option off unless you're using something like reactive-streams, since it is a slight throughput\n penalty.\n\n Unless otherwise\n specified all functions for channels and channel slots must be executed within that channel's event-loop's thread."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_channel_options { pub event_loop : * mut aws_event_loop , pub on_setup_completed : aws_channel_on_setup_completed_fn , pub on_shutdown_completed : aws_channel_on_shutdown_completed_fn , pub setup_user_data : * mut :: libc :: c_void , pub shutdown_user_data : * mut :: libc :: c_void , pub enable_read_back_pressure : bool , } # [test] fn bindgen_test_layout_aws_channel_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_channel_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_channel_options > () , 48usize , concat ! ("Size of: " , stringify ! (aws_channel_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_channel_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_channel_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . event_loop) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (event_loop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_setup_completed) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (on_setup_completed))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_shutdown_completed) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (on_shutdown_completed))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . setup_user_data) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (setup_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_user_data) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (shutdown_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_back_pressure) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_channel_options) , "::" , stringify ! (enable_read_back_pressure))) ; } impl Default for aws_channel_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub static mut g_aws_channel_max_fragment_size : usize ; } extern "C" { # [doc = " Initializes channel_task for use."] pub fn aws_channel_task_init (channel_task : * mut aws_channel_task , task_fn : aws_channel_task_fn , arg : * mut :: libc :: c_void , type_tag : * const :: libc :: c_char) ; } extern "C" { # [doc = " Allocates new channel, Unless otherwise specified all functions for channels and channel slots must be executed\n within that channel's event-loop's thread. channel_options are copied."] pub fn aws_channel_new (allocator : * mut aws_allocator , creation_args : * const aws_channel_options) -> * mut aws_channel ; } extern "C" { # [doc = " Mark the channel, along with all slots and handlers, for destruction.\n Must be called after shutdown has completed.\n Can be called from any thread assuming 'aws_channel_shutdown()' has completed.\n Note that memory will not be freed until all users which acquired holds on the channel via\n aws_channel_acquire_hold(), release them via aws_channel_release_hold()."] pub fn aws_channel_destroy (channel : * mut aws_channel) ; } extern "C" { # [doc = " Initiates shutdown of the channel. Shutdown will begin with the left-most slot. Each handler will invoke\n 'aws_channel_slot_on_handler_shutdown_complete' once they've finished their shutdown process for the read direction.\n Once the right-most slot has shutdown in the read direction, the process will start shutting down starting on the\n right-most slot. Once the left-most slot has shutdown in the write direction, 'callbacks->shutdown_completed' will be\n invoked in the event loop's thread.\n\n This function can be called from any thread."] pub fn aws_channel_shutdown (channel : * mut aws_channel , error_code : :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Prevent a channel's memory from being freed.\n Any number of users may acquire a hold to prevent a channel and its handlers from being unexpectedly freed.\n Any user which acquires a hold must release it via aws_channel_release_hold().\n Memory will be freed once all holds are released and aws_channel_destroy() has been called."] pub fn aws_channel_acquire_hold (channel : * mut aws_channel) ; } extern "C" { # [doc = " Release a hold on the channel's memory, allowing it to be freed.\n This may be called before or after aws_channel_destroy()."] pub fn aws_channel_release_hold (channel : * mut aws_channel) ; } extern "C" { # [doc = " Allocates and initializes a new slot for use with the channel. If this is the first slot in the channel, it will\n automatically be added to the channel as the first slot. For all subsequent calls on a given channel, the slot will\n need to be added to the channel via. the aws_channel_slot_insert_right(), aws_channel_slot_insert_end(), and\n aws_channel_slot_insert_left() APIs."] pub fn aws_channel_slot_new (channel : * mut aws_channel) -> * mut aws_channel_slot ; } extern "C" { # [doc = " Fetches the event loop the channel is a part of."] pub fn aws_channel_get_event_loop (channel : * mut aws_channel) -> * mut aws_event_loop ; } extern "C" { # [doc = " Fetches the current timestamp from the event-loop's clock, in nanoseconds."] pub fn aws_channel_current_clock_time (channel : * mut aws_channel , time_nanos : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Retrieves an object by key from the event loop's local storage."] pub fn aws_channel_fetch_local_object (channel : * mut aws_channel , key : * const :: libc :: c_void , obj : * mut aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Stores an object by key in the event loop's local storage."] pub fn aws_channel_put_local_object (channel : * mut aws_channel , key : * const :: libc :: c_void , obj : * const aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes an object by key from the event loop's local storage."] pub fn aws_channel_remove_local_object (channel : * mut aws_channel , key : * const :: libc :: c_void , removed_obj : * mut aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Acquires a message from the event loop's message pool. size_hint is merely a hint, it may be smaller than you\n requested and you are responsible for checking the bounds of it. If the returned message is not large enough, you\n must send multiple messages."] pub fn aws_channel_acquire_message_from_pool (channel : * mut aws_channel , message_type : aws_io_message_type , size_hint : usize) -> * mut aws_io_message ; } extern "C" { # [doc = " Schedules a task to run on the event loop as soon as possible.\n This is the ideal way to move a task into the correct thread. It's also handy for context switches.\n This function is safe to call from any thread.\n\n If called from the channel's event loop, the task will get directly added to the run-now list.\n If called from outside the channel's event loop, the task will go into a cross-thread task queue.\n\n If tasks must be serialized relative to some source synchronization, you may not want to use this API\n because tasks submitted from the event loop thread can \"jump ahead\" of tasks submitted from external threads\n due to this optimization. If this is a problem, you can either refactor your submission logic or use\n the aws_channel_schedule_task_now_serialized variant which does not perform this optimization.\n\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_channel_schedule_task_now (channel : * mut aws_channel , task : * mut aws_channel_task) ; } extern "C" { # [doc = " Schedules a task to run on the event loop as soon as possible.\n\n This variant always uses the cross thread queue rather than conditionally skipping it when already in\n the destination event loop. While not \"optimal\", this allows us to serialize task execution no matter where\n the task was submitted from: if you are submitting tasks from a critical section, the serialized order that you\n submit is guaranteed to be the order that they execute on the event loop.\n\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_channel_schedule_task_now_serialized (channel : * mut aws_channel , task : * mut aws_channel_task) ; } extern "C" { # [doc = " Schedules a task to run on the event loop at the specified time.\n This is the ideal way to move a task into the correct thread. It's also handy for context switches.\n Use aws_channel_current_clock_time() to get the current time in nanoseconds.\n This function is safe to call from any thread.\n\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_channel_schedule_task_future (channel : * mut aws_channel , task : * mut aws_channel_task , run_at_nanos : u64) ; } extern "C" { # [doc = " Instrument a channel with a statistics handler. While instrumented with a statistics handler, the channel\n will periodically report per-channel-handler-specific statistics about handler performance and state.\n\n Assigning a statistics handler to a channel is a transfer of ownership -- the channel will clean up\n the handler appropriately. Statistics handlers may be changed dynamically (for example, the upgrade\n from a vanilla http channel to a websocket channel), but this function may only be called from the\n event loop thread that the channel is a part of.\n\n The first possible hook to set a statistics handler is the channel's creation callback."] pub fn aws_channel_set_statistics_handler (channel : * mut aws_channel , handler : * mut aws_crt_statistics_handler) -> :: libc :: c_int ; } extern "C" { # [doc = " Returns true if the caller is on the event loop's thread. If false, you likely need to use\n aws_channel_schedule_task(). This function is safe to call from any thread."] pub fn aws_channel_thread_is_callers_thread (channel : * mut aws_channel) -> bool ; } extern "C" { # [doc = " Sets the handler for a slot, the slot will also call get_current_window_size() and propagate a window update\n upstream."] pub fn aws_channel_slot_set_handler (slot : * mut aws_channel_slot , handler : * mut aws_channel_handler) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes slot from the channel and deallocates the slot and its handler."] pub fn aws_channel_slot_remove (slot : * mut aws_channel_slot) -> :: libc :: c_int ; } extern "C" { # [doc = " Replaces remove with new_slot. Deallocates remove and its handler."] pub fn aws_channel_slot_replace (remove : * mut aws_channel_slot , new_slot : * mut aws_channel_slot) -> :: libc :: c_int ; } extern "C" { # [doc = " inserts 'to_add' to the position immediately to the right of slot. Note that the first call to\n aws_channel_slot_new() adds it to the channel implicitly."] pub fn aws_channel_slot_insert_right (slot : * mut aws_channel_slot , to_add : * mut aws_channel_slot) -> :: libc :: c_int ; } extern "C" { # [doc = " Inserts to 'to_add' the end of the channel. Note that the first call to\n aws_channel_slot_new() adds it to the channel implicitly."] pub fn aws_channel_slot_insert_end (channel : * mut aws_channel , to_add : * mut aws_channel_slot) -> :: libc :: c_int ; } extern "C" { # [doc = " inserts 'to_add' to the position immediately to the left of slot. Note that the first call to\n aws_channel_slot_new() adds it to the channel implicitly."] pub fn aws_channel_slot_insert_left (slot : * mut aws_channel_slot , to_add : * mut aws_channel_slot) -> :: libc :: c_int ; } extern "C" { # [doc = " Sends a message to the adjacent slot in the channel based on dir. Also does window size checking.\n\n NOTE: if this function returns an error code, it is the caller's responsibility to release message\n back to the pool. If this function returns AWS_OP_SUCCESS, the recipient of the message has taken\n ownership of the message. So, for example, don't release a message to the pool and then return an error.\n If you encounter an error condition in this case, shutdown the channel with the appropriate error code."] pub fn aws_channel_slot_send_message (slot : * mut aws_channel_slot , message : * mut aws_io_message , dir : aws_channel_direction) -> :: libc :: c_int ; } extern "C" { # [doc = " Convenience function that invokes aws_channel_acquire_message_from_pool(),\n asking for the largest reasonable DATA message that can be sent in the write direction,\n with upstream overhead accounted for."] pub fn aws_channel_slot_acquire_max_message_for_write (slot : * mut aws_channel_slot) -> * mut aws_io_message ; } extern "C" { # [doc = " Issues a window update notification upstream (to the left.)"] pub fn aws_channel_slot_increment_read_window (slot : * mut aws_channel_slot , window : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " Called by handlers once they have finished their shutdown in the 'dir' direction. Propagates the shutdown process\n to the next handler in the channel."] pub fn aws_channel_slot_on_handler_shutdown_complete (slot : * mut aws_channel_slot , dir : aws_channel_direction , err_code : :: libc :: c_int , free_scarce_resources_immediately : bool) -> :: libc :: c_int ; } extern "C" { # [doc = " Initiates shutdown on slot. callbacks->on_shutdown_completed will be called\n once the shutdown process is completed."] pub fn aws_channel_slot_shutdown (slot : * mut aws_channel_slot , dir : aws_channel_direction , err_code : :: libc :: c_int , free_scarce_resources_immediately : bool) -> :: libc :: c_int ; } extern "C" { # [doc = " Fetches the downstream read window. This gives you the information necessary to honor the read window. If you call\n send_message() and it exceeds this window, the message will be rejected."] pub fn aws_channel_slot_downstream_read_window (slot : * mut aws_channel_slot) -> usize ; } extern "C" { # [doc = " Fetches the current overhead of upstream handlers. This provides a hint to avoid fragmentation if you care."] pub fn aws_channel_slot_upstream_message_overhead (slot : * mut aws_channel_slot) -> usize ; } extern "C" { # [doc = " Calls destroy on handler's vtable"] pub fn aws_channel_handler_destroy (handler : * mut aws_channel_handler) ; } extern "C" { # [doc = " Calls process_read_message on handler's vtable"] pub fn aws_channel_handler_process_read_message (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , message : * mut aws_io_message) -> :: libc :: c_int ; } extern "C" { # [doc = " Calls process_write_message on handler's vtable."] pub fn aws_channel_handler_process_write_message (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , message : * mut aws_io_message) -> :: libc :: c_int ; } extern "C" { # [doc = " Calls on_window_update on handler's vtable."] pub fn aws_channel_handler_increment_read_window (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , size : usize) -> :: libc :: c_int ; } extern "C" { # [doc = " calls shutdown_direction on handler's vtable."] pub fn aws_channel_handler_shutdown (handler : * mut aws_channel_handler , slot : * mut aws_channel_slot , dir : aws_channel_direction , error_code : :: libc :: c_int , free_scarce_resources_immediately : bool) -> :: libc :: c_int ; } extern "C" { # [doc = " Calls initial_window_size on handler's vtable."] pub fn aws_channel_handler_initial_window_size (handler : * mut aws_channel_handler) -> usize ; } extern "C" { pub fn aws_channel_get_first_slot (channel : * mut aws_channel) -> * mut aws_channel_slot ; } extern "C" { # [doc = " A way for external processes to force a read by the data-source channel handler. Necessary in certain cases, like\n when a server channel finishes setting up its initial handlers, a read may have already been triggered on the\n socket (the client's CLIENT_HELLO tls payload, for example) and absent further data/notifications, this data\n would never get processed."] pub fn aws_channel_trigger_read (channel : * mut aws_channel) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_address_record_type { AWS_ADDRESS_RECORD_TYPE_A = 0 , AWS_ADDRESS_RECORD_TYPE_AAAA = 1 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_get_host_address_flags { AWS_GET_HOST_ADDRESS_COUNT_RECORD_TYPE_A = 1 , AWS_GET_HOST_ADDRESS_COUNT_RECORD_TYPE_AAAA = 2 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_address { pub allocator : * mut aws_allocator , pub host : * const aws_string , pub address : * const aws_string , pub record_type : aws_address_record_type , pub expiry : u64 , pub use_count : usize , pub connection_failure_count : usize , pub weight : u8 , } # [test] fn bindgen_test_layout_aws_host_address () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_address > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_address > () , 64usize , concat ! ("Size of: " , stringify ! (aws_host_address))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_address > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_address))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . address) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (address))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . record_type) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (record_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . expiry) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (expiry))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . use_count) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (use_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connection_failure_count) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (connection_failure_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . weight) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_host_address) , "::" , stringify ! (weight))) ; } impl Default for aws_host_address { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Invoked once an address has been resolved for host. The type in host_addresses is struct aws_host_address (by-value).\n The caller does not own this memory and you must copy the host address before returning from this function if you\n plan to use it later. For convenience, we've provided the aws_host_address_copy() and aws_host_address_clean_up()\n functions."] pub type aws_on_host_resolved_result_fn = :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , host_name : * const aws_string , err_code : :: libc :: c_int , host_addresses : * const aws_array_list , user_data : * mut :: libc :: c_void) > ; # [doc = " Function signature for configuring your own resolver (the default just uses getaddrinfo()). The type in\n output_addresses is struct aws_host_address (by-value). We assume this function blocks, hence this absurdly\n complicated design."] pub type aws_resolve_host_implementation_fn = :: std :: option :: Option < unsafe extern "C" fn (allocator : * mut aws_allocator , host_name : * const aws_string , output_addresses : * mut aws_array_list , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_resolution_config { pub impl_ : aws_resolve_host_implementation_fn , pub max_ttl : usize , pub impl_data : * mut :: libc :: c_void , pub resolve_frequency_ns : u64 , } # [test] fn bindgen_test_layout_aws_host_resolution_config () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_resolution_config > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_resolution_config > () , 32usize , concat ! ("Size of: " , stringify ! (aws_host_resolution_config))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_resolution_config > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_resolution_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolution_config) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_ttl) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolution_config) , "::" , stringify ! (max_ttl))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_data) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolution_config) , "::" , stringify ! (impl_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . resolve_frequency_ns) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolution_config) , "::" , stringify ! (resolve_frequency_ns))) ; } impl Default for aws_host_resolution_config { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_listener { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_listener_options { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_resolver_purge_host_options { pub host : * const aws_string , pub on_host_purge_complete_callback : aws_simple_completion_callback , pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_host_resolver_purge_host_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_resolver_purge_host_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_resolver_purge_host_options > () , 24usize , concat ! ("Size of: " , stringify ! (aws_host_resolver_purge_host_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_resolver_purge_host_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_resolver_purge_host_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_purge_host_options) , "::" , stringify ! (host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_host_purge_complete_callback) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_purge_host_options) , "::" , stringify ! (on_host_purge_complete_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_purge_host_options) , "::" , stringify ! (user_data))) ; } impl Default for aws_host_resolver_purge_host_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " should you absolutely disdain the default implementation, feel free to implement your own."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_host_resolver_vtable { # [doc = " clean up everything you allocated, but not resolver itself."] pub destroy : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver) > , # [doc = " resolve the host by host_name, the user owns host_name, so it needs to be copied if you persist it,\n invoke res with the result. This function should never block."] pub resolve_host : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , host_name : * const aws_string , res : aws_on_host_resolved_result_fn , config : * const aws_host_resolution_config , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > , # [doc = " gives your implementation a hint that an address has some failed connections occuring. Do whatever you want (or\n nothing) about it."] pub record_connection_failure : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , address : * const aws_host_address) -> :: libc :: c_int > , # [doc = " @Deprecated Use purge_cache_with_callback instead\n wipe out anything you have cached."] pub purge_cache : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver) -> :: libc :: c_int > , # [doc = " wipe out anything you have cached."] pub purge_cache_with_callback : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , on_purge_cache_complete_callback : aws_simple_completion_callback , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > , # [doc = " wipe out anything cached for a specific host"] pub purge_host_cache : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , options : * const aws_host_resolver_purge_host_options) -> :: libc :: c_int > , # [doc = " get number of addresses for a given host."] pub get_host_address_count : :: std :: option :: Option < unsafe extern "C" fn (resolver : * mut aws_host_resolver , host_name : * const aws_string , flags : u32) -> usize > , } # [test] fn bindgen_test_layout_aws_host_resolver_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_resolver_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_resolver_vtable > () , 56usize , concat ! ("Size of: " , stringify ! (aws_host_resolver_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_resolver_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_resolver_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . resolve_host) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (resolve_host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . record_connection_failure) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (record_connection_failure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . purge_cache) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (purge_cache))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . purge_cache_with_callback) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (purge_cache_with_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . purge_host_cache) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (purge_host_cache))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_host_address_count) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_vtable) , "::" , stringify ! (get_host_address_count))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_resolver { pub allocator : * mut aws_allocator , pub impl_ : * mut :: libc :: c_void , pub vtable : * mut aws_host_resolver_vtable , pub ref_count : aws_ref_count , pub shutdown_options : aws_shutdown_callback_options , } # [test] fn bindgen_test_layout_aws_host_resolver () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_resolver > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_resolver > () , 64usize , concat ! ("Size of: " , stringify ! (aws_host_resolver))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_resolver > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_resolver))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver) , "::" , stringify ! (shutdown_options))) ; } impl Default for aws_host_resolver { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_host_resolver_default_options { pub max_entries : usize , pub el_group : * mut aws_event_loop_group , pub shutdown_options : * const aws_shutdown_callback_options , pub system_clock_override_fn : aws_io_clock_fn , } # [test] fn bindgen_test_layout_aws_host_resolver_default_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_host_resolver_default_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_host_resolver_default_options > () , 32usize , concat ! ("Size of: " , stringify ! (aws_host_resolver_default_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_host_resolver_default_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_host_resolver_default_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_entries) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_default_options) , "::" , stringify ! (max_entries))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . el_group) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_default_options) , "::" , stringify ! (el_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_default_options) , "::" , stringify ! (shutdown_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . system_clock_override_fn) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_host_resolver_default_options) , "::" , stringify ! (system_clock_override_fn))) ; } impl Default for aws_host_resolver_default_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Copies `from` to `to`."] pub fn aws_host_address_copy (from : * const aws_host_address , to : * mut aws_host_address) -> :: libc :: c_int ; } extern "C" { # [doc = " Moves `from` to `to`. After this call, from is no longer usable. Though, it could be resused for another\n move or copy operation."] pub fn aws_host_address_move (from : * mut aws_host_address , to : * mut aws_host_address) ; } extern "C" { # [doc = " Cleans up the memory for `address`"] pub fn aws_host_address_clean_up (address : * mut aws_host_address) ; } extern "C" { # [doc = " WARNING! do not call this function directly (getaddrinfo()): it blocks. Provide a pointer to this function for other\n resolution functions."] pub fn aws_default_dns_resolve (allocator : * mut aws_allocator , host_name : * const aws_string , output_addresses : * mut aws_array_list , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Creates a host resolver with the default behavior. Here's the behavior:\n\n Since there's not a reliable way to do non-blocking DNS without a ton of risky work that would need years of testing\n on every Unix system in existence, we work around it by doing a threaded implementation.\n\n When you request an address, it checks the cache. If the entry isn't in the cache it creates a new one.\n Each entry has a potentially short lived back-ground thread based on ttl for the records. Once we've populated the\n cache and you keep the resolver active, the resolution callback will be invoked immediately. When it's idle, it will\n take a little while in the background thread to fetch more, evaluate TTLs etc... In that case your callback will be\n invoked from the background thread.\n\n --------------------------------------------------------------------------------------------------------------------\n\n A few things to note about TTLs and connection failures.\n\n We attempt to honor your max ttl but will not honor it if dns queries are failing or all of your connections are\n marked as failed. Once we are able to query dns again, we will re-evaluate the TTLs.\n\n Upon notification connection failures, we move them to a separate list. Eventually we retry them when it's likely\n that the endpoint is healthy again or we don't really have another choice, but we try to keep them out of your\n hot path.\n\n ---------------------------------------------------------------------------------------------------------------------\n\n Finally, this entire design attempts to prevent problems where developers have to choose between large TTLs and thus\n sticky hosts or short TTLs and good fleet utilization but now higher latencies. In this design, we resolve every\n second in the background (only while you're actually using the record), but we do not expire the earlier resolved\n addresses until max ttl has passed.\n\n This for example, should enable you to hit thousands of hosts in the Amazon S3 fleet instead of just one or two."] pub fn aws_host_resolver_new_default (allocator : * mut aws_allocator , options : * const aws_host_resolver_default_options) -> * mut aws_host_resolver ; } extern "C" { # [doc = " Increments the reference count on the host resolver, allowing the caller to take a reference to it.\n\n Returns the same host resolver passed in."] pub fn aws_host_resolver_acquire (resolver : * mut aws_host_resolver) -> * mut aws_host_resolver ; } extern "C" { # [doc = " Decrements a host resolver's ref count. When the ref count drops to zero, the resolver will be destroyed."] pub fn aws_host_resolver_release (resolver : * mut aws_host_resolver) ; } extern "C" { # [doc = " calls resolve_host on the vtable. config will be copied."] pub fn aws_host_resolver_resolve_host (resolver : * mut aws_host_resolver , host_name : * const aws_string , res : aws_on_host_resolved_result_fn , config : * const aws_host_resolution_config , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " calls record_connection_failure on the vtable."] pub fn aws_host_resolver_record_connection_failure (resolver : * mut aws_host_resolver , address : * const aws_host_address) -> :: libc :: c_int ; } extern "C" { # [doc = " @Deprecated Use purge_cache_with_callback instead\n calls purge_cache on the vtable."] pub fn aws_host_resolver_purge_cache (resolver : * mut aws_host_resolver) -> :: libc :: c_int ; } extern "C" { # [doc = " Calls aws_host_resolver_purge_cache_with_callback on the vtable which will wipe out everything host resolver has\n cached."] pub fn aws_host_resolver_purge_cache_with_callback (resolver : * mut aws_host_resolver , on_purge_cache_complete_callback : aws_simple_completion_callback , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes the cache for a host asynchronously."] pub fn aws_host_resolver_purge_host_cache (resolver : * mut aws_host_resolver , options : * const aws_host_resolver_purge_host_options) -> :: libc :: c_int ; } extern "C" { # [doc = " get number of addresses for a given host."] pub fn aws_host_resolver_get_host_address_count (resolver : * mut aws_host_resolver , host_name : * const aws_string , flags : u32) -> usize ; } extern "C" { # [doc = " Returns the default host resolution config used internally if none specified.\n\n @return default host resolution config"] pub fn aws_host_resolver_init_default_resolution_config () -> aws_host_resolution_config ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_socket { _unused : [u8 ; 0] , } # [doc = " Generic event function for channel lifecycle events.\n\n Callbacks are provided for:\n (1) Channel creation\n (2) Channel setup - If TLS is being used, this function is called once the socket has connected, the channel has\n been initialized, and TLS has been successfully negotiated. A TLS handler has already been added to the channel. If\n TLS negotiation fails, this function will be called with the corresponding error code. If TLS is not being used, this\n function is called once the socket has connected and the channel has been initialized.\n (3) Channel shutdown\n\n These callbacks are always invoked within the thread of the event-loop that the channel is assigned to.\n\n This function does NOT always imply \"success\" -- if error_code is AWS_OP_SUCCESS then everything was successful,\n otherwise an error condition occurred."] pub type aws_client_bootstrap_on_channel_event_fn = :: std :: option :: Option < unsafe extern "C" fn (bootstrap : * mut aws_client_bootstrap , error_code : :: libc :: c_int , channel : * mut aws_channel , user_data : * mut :: libc :: c_void) > ; # [doc = " If ALPN is being used this function will be invoked by the channel once an ALPN message is received. The returned\n channel_handler will be added to, and managed by, the channel."] pub type aws_channel_on_protocol_negotiated_fn = :: std :: option :: Option < unsafe extern "C" fn (new_slot : * mut aws_channel_slot , protocol : * mut aws_byte_buf , user_data : * mut :: libc :: c_void) -> * mut aws_channel_handler > ; # [doc = " Called after client bootstrap has been completely cleaned up, after its last refcount is released."] pub type aws_client_bootstrap_shutdown_complete_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [doc = " aws_client_bootstrap handles creation and setup of channels that communicate via socket with a specific endpoint."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_client_bootstrap { pub allocator : * mut aws_allocator , pub event_loop_group : * mut aws_event_loop_group , pub host_resolver : * mut aws_host_resolver , pub host_resolver_config : aws_host_resolution_config , pub on_protocol_negotiated : aws_channel_on_protocol_negotiated_fn , pub ref_count : aws_ref_count , pub on_shutdown_complete : aws_client_bootstrap_shutdown_complete_fn , pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_client_bootstrap () { const UNINIT : :: std :: mem :: MaybeUninit < aws_client_bootstrap > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_client_bootstrap > () , 104usize , concat ! ("Size of: " , stringify ! (aws_client_bootstrap))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_client_bootstrap > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_client_bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . event_loop_group) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (event_loop_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolver) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (host_resolver))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolver_config) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (host_resolver_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_protocol_negotiated) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (on_protocol_negotiated))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_shutdown_complete) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (on_shutdown_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap) , "::" , stringify ! (user_data))) ; } impl Default for aws_client_bootstrap { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " aws_client_bootstrap creation options."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_client_bootstrap_options { pub event_loop_group : * mut aws_event_loop_group , pub host_resolver : * mut aws_host_resolver , pub host_resolution_config : * const aws_host_resolution_config , pub on_shutdown_complete : aws_client_bootstrap_shutdown_complete_fn , pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_client_bootstrap_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_client_bootstrap_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_client_bootstrap_options > () , 40usize , concat ! ("Size of: " , stringify ! (aws_client_bootstrap_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_client_bootstrap_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_client_bootstrap_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . event_loop_group) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap_options) , "::" , stringify ! (event_loop_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolver) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap_options) , "::" , stringify ! (host_resolver))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolution_config) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap_options) , "::" , stringify ! (host_resolution_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_shutdown_complete) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap_options) , "::" , stringify ! (on_shutdown_complete))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_client_bootstrap_options) , "::" , stringify ! (user_data))) ; } impl Default for aws_client_bootstrap_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " If TLS is being used, this function is called once the socket has received an incoming connection, the channel has\n been initialized, and TLS has been successfully negotiated. A TLS handler has already been added to the channel. If\n TLS negotiation fails, this function will be called with the corresponding error code.\n\n If TLS is not being used, this function is called once the socket has received an incoming connection and the channel\n has been initialized.\n\n This function is always called within the thread of the event-loop that the new channel is assigned to upon success.\n\n On failure, the channel might not be assigned to an event loop yet, and will thus be invoked on the listener's\n event-loop thread.\n\n This function does NOT mean \"success\", if error_code is AWS_OP_SUCCESS then everything was successful, otherwise an\n error condition occurred.\n\n If an error occurred, you do not need to shutdown the channel. The `aws_channel_client_shutdown_callback` will be\n invoked once the channel has finished shutting down."] pub type aws_server_bootstrap_on_accept_channel_setup_fn = :: std :: option :: Option < unsafe extern "C" fn (bootstrap : * mut aws_server_bootstrap , error_code : :: libc :: c_int , channel : * mut aws_channel , user_data : * mut :: libc :: c_void) > ; # [doc = " Once the channel shuts down, this function will be invoked within the thread of\n the event-loop that the channel is assigned to.\n\n Note: this function is only invoked if the channel was successfully setup,\n e.g. aws_server_bootstrap_on_accept_channel_setup_fn() was invoked without an error code."] pub type aws_server_bootstrap_on_accept_channel_shutdown_fn = :: std :: option :: Option < unsafe extern "C" fn (bootstrap : * mut aws_server_bootstrap , error_code : :: libc :: c_int , channel : * mut aws_channel , user_data : * mut :: libc :: c_void) > ; # [doc = " Once the server listener socket is finished destroying, and all the existing connections are closed, this fuction\n will be invoked."] pub type aws_server_bootstrap_on_server_listener_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (bootstrap : * mut aws_server_bootstrap , user_data : * mut :: libc :: c_void) > ; # [doc = " aws_server_bootstrap manages listening sockets, creating and setting up channels to handle each incoming connection."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_server_bootstrap { pub allocator : * mut aws_allocator , pub event_loop_group : * mut aws_event_loop_group , pub on_protocol_negotiated : aws_channel_on_protocol_negotiated_fn , pub ref_count : aws_ref_count , } # [test] fn bindgen_test_layout_aws_server_bootstrap () { const UNINIT : :: std :: mem :: MaybeUninit < aws_server_bootstrap > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_server_bootstrap > () , 48usize , concat ! ("Size of: " , stringify ! (aws_server_bootstrap))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_server_bootstrap > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_server_bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_server_bootstrap) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . event_loop_group) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_server_bootstrap) , "::" , stringify ! (event_loop_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_protocol_negotiated) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_server_bootstrap) , "::" , stringify ! (on_protocol_negotiated))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_server_bootstrap) , "::" , stringify ! (ref_count))) ; } impl Default for aws_server_bootstrap { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Socket-based channel creation options.\n\n bootstrap - configs name resolution and which event loop group the connection will be seated into\n host_name - host to connect to; if a dns address, will be resolved prior to connecting\n port - port to connect to\n socket_options - socket properties, including type (tcp vs. udp vs. unix domain) and connect timeout. TLS\n connections are currently restricted to tcp (AWS_SOCKET_STREAM) only.\n tls_options - (optional) tls context to apply after connection establishment. If NULL, the connection will\n not be protected by TLS.\n creation_callback - (optional) callback invoked when the channel is first created. This is always right after\n the connection was successfully established. *Does NOT* get called if the initial connect failed.\n setup_callback - callback invoked once the channel is ready for use and TLS has been negotiated or if an error\n is encountered\n shutdown_callback - callback invoked once the channel has shutdown.\n enable_read_back_pressure - controls whether or not back pressure will be applied in the channel\n user_data - arbitrary data to pass back to the various callbacks\n requested_event_loop - if set, the connection will be placed on the requested event loop rather than one\n chosen internally from the bootstrap's associated event loop group. It is an error to pass in an event loop\n that is not associated with the bootstrap's event loop group.\n\n Immediately after the `shutdown_callback` returns, the channel is cleaned up automatically. All callbacks are invoked\n in the thread of the event-loop that the new channel is assigned to.\n"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_socket_channel_bootstrap_options { pub bootstrap : * mut aws_client_bootstrap , pub host_name : * const :: libc :: c_char , pub port : u16 , pub socket_options : * const aws_socket_options , pub tls_options : * const aws_tls_connection_options , pub creation_callback : aws_client_bootstrap_on_channel_event_fn , pub setup_callback : aws_client_bootstrap_on_channel_event_fn , pub shutdown_callback : aws_client_bootstrap_on_channel_event_fn , pub enable_read_back_pressure : bool , pub user_data : * mut :: libc :: c_void , pub requested_event_loop : * mut aws_event_loop , pub host_resolution_override_config : * const aws_host_resolution_config , } # [test] fn bindgen_test_layout_aws_socket_channel_bootstrap_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_socket_channel_bootstrap_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_socket_channel_bootstrap_options > () , 96usize , concat ! ("Size of: " , stringify ! (aws_socket_channel_bootstrap_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_socket_channel_bootstrap_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_socket_channel_bootstrap_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . socket_options) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (socket_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_options) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (tls_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . creation_callback) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (creation_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . setup_callback) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (setup_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_back_pressure) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (enable_read_back_pressure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . requested_event_loop) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (requested_event_loop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_resolution_override_config) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_socket_channel_bootstrap_options) , "::" , stringify ! (host_resolution_override_config))) ; } impl Default for aws_socket_channel_bootstrap_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Arguments to setup a server socket listener which will also negotiate and configure TLS.\n This creates a socket listener bound to `host` and 'port' using socket options `options`, and TLS options\n `tls_options`. `incoming_callback` will be invoked once an incoming channel is ready for use and TLS is\n finished negotiating, or if an error is encountered. `shutdown_callback` will be invoked once the channel has\n shutdown. `destroy_callback` will be invoked after the server socket listener is destroyed, and all associated\n connections and channels have finished shutting down. Immediately after the `shutdown_callback` returns, the channel\n is cleaned up automatically. All callbacks are invoked in the thread of the event-loop that listener is assigned to.\n\n Upon shutdown of your application, you'll want to call `aws_server_bootstrap_destroy_socket_listener` with the return\n value from this function.\n\n The socket type in `options` must be AWS_SOCKET_STREAM if tls_options is set.\n DTLS is not currently supported for tls."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_server_socket_channel_bootstrap_options { pub bootstrap : * mut aws_server_bootstrap , pub host_name : * const :: libc :: c_char , pub port : u16 , pub socket_options : * const aws_socket_options , pub tls_options : * const aws_tls_connection_options , pub incoming_callback : aws_server_bootstrap_on_accept_channel_setup_fn , pub shutdown_callback : aws_server_bootstrap_on_accept_channel_shutdown_fn , pub destroy_callback : aws_server_bootstrap_on_server_listener_destroy_fn , pub enable_read_back_pressure : bool , pub user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_server_socket_channel_bootstrap_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_server_socket_channel_bootstrap_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_server_socket_channel_bootstrap_options > () , 80usize , concat ! ("Size of: " , stringify ! (aws_server_socket_channel_bootstrap_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_server_socket_channel_bootstrap_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_server_socket_channel_bootstrap_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bootstrap) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . socket_options) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (socket_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_options) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (tls_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . incoming_callback) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (incoming_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy_callback) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (destroy_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_back_pressure) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (enable_read_back_pressure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_server_socket_channel_bootstrap_options) , "::" , stringify ! (user_data))) ; } impl Default for aws_server_socket_channel_bootstrap_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Create the client bootstrap."] pub fn aws_client_bootstrap_new (allocator : * mut aws_allocator , options : * const aws_client_bootstrap_options) -> * mut aws_client_bootstrap ; } extern "C" { # [doc = " Increments a client bootstrap's ref count, allowing the caller to take a reference to it.\n\n Returns the same client bootstrap passed in."] pub fn aws_client_bootstrap_acquire (bootstrap : * mut aws_client_bootstrap) -> * mut aws_client_bootstrap ; } extern "C" { # [doc = " Decrements a client bootstrap's ref count. When the ref count drops to zero, the bootstrap will be destroyed."] pub fn aws_client_bootstrap_release (bootstrap : * mut aws_client_bootstrap) ; } extern "C" { # [doc = " When using TLS, if ALPN is used, this callback will be invoked from the channel. The returned handler will be added\n to the channel."] pub fn aws_client_bootstrap_set_alpn_callback (bootstrap : * mut aws_client_bootstrap , on_protocol_negotiated : aws_channel_on_protocol_negotiated_fn) -> :: libc :: c_int ; } extern "C" { # [doc = " Sets up a client socket channel."] pub fn aws_client_bootstrap_new_socket_channel (options : * mut aws_socket_channel_bootstrap_options) -> :: libc :: c_int ; } extern "C" { # [doc = " Initializes the server bootstrap with `allocator` and `el_group`. This object manages listeners, server connections,\n and channels."] pub fn aws_server_bootstrap_new (allocator : * mut aws_allocator , el_group : * mut aws_event_loop_group) -> * mut aws_server_bootstrap ; } extern "C" { # [doc = " Increments a server bootstrap's ref count, allowing the caller to take a reference to it.\n\n Returns the same server bootstrap passed in."] pub fn aws_server_bootstrap_acquire (bootstrap : * mut aws_server_bootstrap) -> * mut aws_server_bootstrap ; } extern "C" { # [doc = " Decrements a server bootstrap's ref count. When the ref count drops to zero, the bootstrap will be destroyed."] pub fn aws_server_bootstrap_release (bootstrap : * mut aws_server_bootstrap) ; } extern "C" { # [doc = " When using TLS, if ALPN is used, this callback will be invoked from the channel. The returned handler will be added\n to the channel."] pub fn aws_server_bootstrap_set_alpn_callback (bootstrap : * mut aws_server_bootstrap , on_protocol_negotiated : aws_channel_on_protocol_negotiated_fn) -> :: libc :: c_int ; } extern "C" { # [doc = " Sets up a server socket listener. If you are planning on using TLS, use\n `aws_server_bootstrap_new_tls_socket_listener` instead. This creates a socket listener bound to `local_endpoint`\n using socket options `options`. `incoming_callback` will be invoked once an incoming channel is ready for use or if\n an error is encountered. `shutdown_callback` will be invoked once the channel has shutdown. `destroy_callback` will\n be invoked after the server socket listener is destroyed, and all associated connections and channels have finished\n shutting down. Immediately after the `shutdown_callback` returns, the channel is cleaned up automatically. All\n callbacks are invoked the thread of the event-loop that the listening socket is assigned to\n\n Upon shutdown of your application, you'll want to call `aws_server_bootstrap_destroy_socket_listener` with the return\n value from this function.\n\n bootstrap_options is copied."] pub fn aws_server_bootstrap_new_socket_listener (bootstrap_options : * const aws_server_socket_channel_bootstrap_options) -> * mut aws_socket ; } extern "C" { # [doc = " Shuts down 'listener' and cleans up any resources associated with it. Any incoming channels on `listener` will still\n be active. `destroy_callback` will be invoked after the server socket listener is destroyed, and all associated\n connections and channels have finished shutting down."] pub fn aws_server_bootstrap_destroy_socket_listener (bootstrap : * mut aws_server_bootstrap , listener : * mut aws_socket) ; } pub const AWS_COMMON_HASH_TABLE_ITER_CONTINUE : _bindgen_ty_23 = _bindgen_ty_23 :: AWS_COMMON_HASH_TABLE_ITER_CONTINUE ; pub const AWS_COMMON_HASH_TABLE_ITER_DELETE : _bindgen_ty_23 = _bindgen_ty_23 :: AWS_COMMON_HASH_TABLE_ITER_DELETE ; pub const AWS_COMMON_HASH_TABLE_ITER_ERROR : _bindgen_ty_23 = _bindgen_ty_23 :: AWS_COMMON_HASH_TABLE_ITER_ERROR ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum _bindgen_ty_23 { AWS_COMMON_HASH_TABLE_ITER_CONTINUE = 1 , AWS_COMMON_HASH_TABLE_ITER_DELETE = 2 , AWS_COMMON_HASH_TABLE_ITER_ERROR = 4 , } # [doc = " Hash table data structure. This module provides an automatically resizing\n hash table implementation for general purpose use. The hash table stores a\n mapping between void * keys and values; it is expected that in most cases,\n these will point to a structure elsewhere in the heap, instead of inlining a\n key or value into the hash table element itself.\n\n Currently, this hash table implements a variant of robin hood hashing, but\n we do not guarantee that this won't change in the future.\n\n Associated with each hash function are four callbacks:\n\n hash_fn - A hash function from the keys to a uint64_t. It is critical that\n the hash function for a key does not change while the key is in the hash\n table; violating this results in undefined behavior. Collisions are\n tolerated, though naturally with reduced performance.\n\n equals_fn - An equality comparison function. This function must be\n reflexive and consistent with hash_fn.\n\n destroy_key_fn, destroy_value_fn - Optional callbacks invoked when the\n table is cleared or cleaned up and at the caller's option when an element\n is removed from the table. Either or both may be set to NULL, which\n has the same effect as a no-op destroy function.\n\n This datastructure can be safely moved between threads, subject to the\n requirements of the underlying allocator. It is also safe to invoke\n non-mutating operations on the hash table from multiple threads. A suitable\n memory barrier must be used when transitioning from single-threaded mutating\n usage to multithreaded usage."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct hash_table_state { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_hash_table { pub p_impl : * mut hash_table_state , } # [test] fn bindgen_test_layout_aws_hash_table () { const UNINIT : :: std :: mem :: MaybeUninit < aws_hash_table > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_hash_table > () , 8usize , concat ! ("Size of: " , stringify ! (aws_hash_table))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_hash_table > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_hash_table))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . p_impl) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_hash_table) , "::" , stringify ! (p_impl))) ; } impl Default for aws_hash_table { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Represents an element in the hash table. Various operations on the hash\n table may provide pointers to elements stored within the hash table;\n generally, calling code may alter value, but must not alter key (or any\n information used to compute key's hash code).\n\n Pointers to elements within the hash are invalidated whenever an operation\n which may change the number of elements in the hash is invoked (i.e. put,\n delete, clear, and clean_up), regardless of whether the number of elements\n actually changes."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_hash_element { pub key : * const :: libc :: c_void , pub value : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_hash_element () { const UNINIT : :: std :: mem :: MaybeUninit < aws_hash_element > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_hash_element > () , 16usize , concat ! ("Size of: " , stringify ! (aws_hash_element))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_hash_element > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_hash_element))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . key) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_hash_element) , "::" , stringify ! (key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_hash_element) , "::" , stringify ! (value))) ; } impl Default for aws_hash_element { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_hash_iter_status { AWS_HASH_ITER_STATUS_DONE = 0 , AWS_HASH_ITER_STATUS_DELETE_CALLED = 1 , AWS_HASH_ITER_STATUS_READY_FOR_USE = 2 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_hash_iter { pub map : * const aws_hash_table , pub element : aws_hash_element , pub slot : usize , pub limit : usize , pub status : aws_hash_iter_status , pub unused_0 : :: libc :: c_int , pub unused_1 : * mut :: libc :: c_void , pub unused_2 : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_hash_iter () { const UNINIT : :: std :: mem :: MaybeUninit < aws_hash_iter > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_hash_iter > () , 64usize , concat ! ("Size of: " , stringify ! (aws_hash_iter))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_hash_iter > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_hash_iter))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . map) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (map))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . element) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (element))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . slot) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (slot))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . limit) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (limit))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . status) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (status))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . unused_0) as usize - ptr as usize } , 44usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (unused_0))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . unused_1) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (unused_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . unused_2) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_hash_iter) , "::" , stringify ! (unused_2))) ; } impl Default for aws_hash_iter { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Prototype for a key hashing function pointer."] pub type aws_hash_fn = :: std :: option :: Option < unsafe extern "C" fn (key : * const :: libc :: c_void) -> u64 > ; # [doc = " Prototype for a hash table equality check function pointer.\n\n This type is usually used for a function that compares two hash table\n keys, but note that the same type is used for a function that compares\n two hash table values in aws_hash_table_eq.\n\n Equality functions used in a hash table must be reflexive (i.e., a == b if\n and only if b == a), and must be consistent with the hash function in use."] pub type aws_hash_callback_eq_fn = :: std :: option :: Option < unsafe extern "C" fn (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> bool > ; # [doc = " Prototype for a hash table key or value destructor function pointer.\n\n This function is used to destroy elements in the hash table when the\n table is cleared or cleaned up.\n\n Note that functions which remove individual elements from the hash\n table provide options of whether or not to invoke the destructors\n on the key and value of a removed element."] pub type aws_hash_callback_destroy_fn = :: std :: option :: Option < unsafe extern "C" fn (key_or_value : * mut :: libc :: c_void) > ; extern "C" { # [doc = " Initializes a hash map with initial capacity for 'size' elements\n without resizing. Uses hash_fn to compute the hash of each element.\n equals_fn to compute equality of two keys. Whenever an element is\n removed without being returned, destroy_key_fn is run on the pointer\n to the key and destroy_value_fn is run on the pointer to the value.\n Either or both may be NULL if a callback is not desired in this case."] pub fn aws_hash_table_init (map : * mut aws_hash_table , alloc : * mut aws_allocator , size : usize , hash_fn : aws_hash_fn , equals_fn : aws_hash_callback_eq_fn , destroy_key_fn : aws_hash_callback_destroy_fn , destroy_value_fn : aws_hash_callback_destroy_fn) -> :: libc :: c_int ; } extern "C" { # [doc = " Deletes every element from map and frees all associated memory.\n destroy_fn will be called for each element. aws_hash_table_init\n must be called before reusing the hash table.\n\n This method is idempotent."] pub fn aws_hash_table_clean_up (map : * mut aws_hash_table) ; } extern "C" { # [doc = " Safely swaps two hash tables. Note that we swap the entirety of the hash\n table, including which allocator is associated.\n\n Neither hash table is required to be initialized; if one or both is\n uninitialized, then the uninitialized state is also swapped."] pub fn aws_hash_table_swap (a : * mut aws_hash_table , b : * mut aws_hash_table) ; } extern "C" { # [doc = " Moves the hash table in 'from' to 'to'. After this move, 'from' will\n be identical to the state of the original 'to' hash table, and 'to'\n will be in the same state as if it had been passed to aws_hash_table_clean_up\n (that is, it will have no memory allocated, and it will be safe to\n either discard it or call aws_hash_table_clean_up again).\n\n Note that 'to' will not be cleaned up. You should make sure that 'to'\n is either uninitialized or cleaned up before moving a hashtable into\n it."] pub fn aws_hash_table_move (to : * mut aws_hash_table , from : * mut aws_hash_table) ; } extern "C" { # [doc = " Returns the current number of entries in the table."] pub fn aws_hash_table_get_entry_count (map : * const aws_hash_table) -> usize ; } extern "C" { # [doc = " Returns an iterator to be used for iterating through a hash table.\n Iterator will already point to the first element of the table it finds,\n which can be accessed as iter.element.\n\n This function cannot fail, but if there are no elements in the table,\n the returned iterator will return true for aws_hash_iter_done(&iter)."] pub fn aws_hash_iter_begin (map : * const aws_hash_table) -> aws_hash_iter ; } extern "C" { # [doc = " Returns true if iterator is done iterating through table, false otherwise.\n If this is true, the iterator will not include an element of the table."] pub fn aws_hash_iter_done (iter : * const aws_hash_iter) -> bool ; } extern "C" { # [doc = " Updates iterator so that it points to next element of hash table.\n\n This and the two previous functions are designed to be used together with\n the following idiom:\n\n for (struct aws_hash_iter iter = aws_hash_iter_begin(&map);\n !aws_hash_iter_done(&iter); aws_hash_iter_next(&iter)) {\n const key_type key = *(const key_type *)iter.element.key;\n value_type value = *(value_type *)iter.element.value;\n // etc.\n }\n\n Note that calling this on an iter which is \"done\" is idempotent:\n i.e. it will return another iter which is \"done\"."] pub fn aws_hash_iter_next (iter : * mut aws_hash_iter) ; } extern "C" { # [doc = " Deletes the element currently pointed-to by the hash iterator.\n After calling this method, the element member of the iterator\n should not be accessed until the next call to aws_hash_iter_next.\n\n @param destroy_contents If true, the destructors for the key and value\n will be called."] pub fn aws_hash_iter_delete (iter : * mut aws_hash_iter , destroy_contents : bool) ; } extern "C" { # [doc = " Attempts to locate an element at key. If the element is found, a\n pointer to the value is placed in *p_elem; if it is not found,\n *pElem is set to NULL. Either way, AWS_OP_SUCCESS is returned.\n\n This method does not change the state of the hash table. Therefore, it\n is safe to call _find from multiple threads on the same hash table,\n provided no mutating operations happen in parallel.\n\n Calling code may update the value in the hash table by modifying **pElem\n after a successful find. However, this pointer is not guaranteed to\n remain usable after a subsequent call to _put, _delete, _clear, or\n _clean_up."] pub fn aws_hash_table_find (map : * const aws_hash_table , key : * const :: libc :: c_void , p_elem : * mut * mut aws_hash_element) -> :: libc :: c_int ; } extern "C" { # [doc = " Attempts to locate an element at key. If no such element was found,\n creates a new element, with value initialized to NULL. In either case, a\n pointer to the element is placed in *p_elem.\n\n If was_created is non-NULL, *was_created is set to 0 if an existing\n element was found, or 1 is a new element was created.\n\n Returns AWS_OP_SUCCESS if an item was found or created.\n Raises AWS_ERROR_OOM if hash table expansion was required and memory\n allocation failed."] pub fn aws_hash_table_create (map : * mut aws_hash_table , key : * const :: libc :: c_void , p_elem : * mut * mut aws_hash_element , was_created : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Inserts a new element at key, with the given value. If another element\n exists at that key, the old element will be overwritten; both old key and\n value objects will be destroyed.\n\n If was_created is non-NULL, *was_created is set to 0 if an existing\n element was found, or 1 is a new element was created.\n\n Returns AWS_OP_SUCCESS if an item was found or created.\n Raises AWS_ERROR_OOM if hash table expansion was required and memory"] pub fn aws_hash_table_put (map : * mut aws_hash_table , key : * const :: libc :: c_void , value : * mut :: libc :: c_void , was_created : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes element at key. Always returns AWS_OP_SUCCESS.\n\n If pValue is non-NULL, the existing value (if any) is moved into\n (*value) before removing from the table, and destroy_fn is _not_\n invoked. If pValue is NULL, then (if the element existed) destroy_fn\n will be invoked on the element being removed.\n\n If was_present is non-NULL, it is set to 0 if the element was\n not present, or 1 if it was present (and is now removed)."] pub fn aws_hash_table_remove (map : * mut aws_hash_table , key : * const :: libc :: c_void , p_value : * mut aws_hash_element , was_present : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes element already known (typically by find()).\n\n p_value should point to a valid element returned by create() or find().\n\n NOTE: DO NOT call this method from inside of a aws_hash_table_foreach callback, return\n AWS_COMMON_HASH_TABLE_ITER_DELETE instead."] pub fn aws_hash_table_remove_element (map : * mut aws_hash_table , p_value : * mut aws_hash_element) -> :: libc :: c_int ; } extern "C" { # [doc = " Iterates through every element in the map and invokes the callback on\n that item. Iteration is performed in an arbitrary, implementation-defined\n order, and is not guaranteed to be consistent across invocations.\n\n The callback may change the value associated with the key by overwriting\n the value pointed-to by value. In this case, the on_element_removed\n callback will not be invoked, unless the callback invokes\n AWS_COMMON_HASH_TABLE_ITER_DELETE (in which case the on_element_removed\n is given the updated value).\n\n The callback must return a bitmask of zero or more of the following values\n ORed together:\n\n # AWS_COMMON_HASH_TABLE_ITER_CONTINUE - Continues iteration to the next\n element (if not set, iteration stops)\n # AWS_COMMON_HASH_TABLE_ITER_DELETE - Deletes the current value and\n continues iteration. destroy_fn will NOT be invoked.\n # AWS_COMMON_HASH_TABLE_ITER_ERROR - Stop iteration with error.\n No action will be taken for the current value and the value before this.\n No rolling back. The deleted value before will NOT be back.\n aws_hash_table_foreach returns AWS_OP_ERR after stropping the iteration.\n\n Invoking any method which may change the contents of the hashtable\n during iteration results in undefined behavior. However, you may safely\n invoke non-mutating operations during an iteration.\n\n This operation is mutating only if AWS_COMMON_HASH_TABLE_ITER_DELETE\n is returned at some point during iteration. Otherwise, it is non-mutating\n and is safe to invoke in parallel with other non-mutating operations."] pub fn aws_hash_table_foreach (map : * mut aws_hash_table , callback : :: std :: option :: Option < unsafe extern "C" fn (context : * mut :: libc :: c_void , p_element : * mut aws_hash_element) -> :: libc :: c_int > , context : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Compares two hash tables for equality. Both hash tables must have equivalent\n key comparators; values will be compared using the comparator passed into this\n function. The key hash function does not need to be equivalent between the\n two hash tables."] pub fn aws_hash_table_eq (a : * const aws_hash_table , b : * const aws_hash_table , value_eq : aws_hash_callback_eq_fn) -> bool ; } extern "C" { # [doc = " Removes every element from the hash map. destroy_fn will be called for\n each element."] pub fn aws_hash_table_clear (map : * mut aws_hash_table) ; } extern "C" { # [doc = " Convenience hash function for NULL-terminated C-strings"] pub fn aws_hash_c_string (item : * const :: libc :: c_void) -> u64 ; } extern "C" { # [doc = " Convenience hash function for struct aws_strings.\n Hash is same as used on the string bytes by aws_hash_c_string."] pub fn aws_hash_string (item : * const :: libc :: c_void) -> u64 ; } extern "C" { # [doc = " Convenience hash function for struct aws_byte_cursor.\n Hash is same as used on the string bytes by aws_hash_c_string."] pub fn aws_hash_byte_cursor_ptr (item : * const :: libc :: c_void) -> u64 ; } extern "C" { # [doc = " Convenience hash function which hashes the pointer value directly,\n without dereferencing. This can be used in cases where pointer identity\n is desired, or where a uintptr_t is encoded into a const void *."] pub fn aws_hash_ptr (item : * const :: libc :: c_void) -> u64 ; } extern "C" { pub fn aws_hash_combine (item1 : u64 , item2 : u64) -> u64 ; } extern "C" { # [doc = " Convenience eq callback for NULL-terminated C-strings"] pub fn aws_hash_callback_c_str_eq (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> bool ; } extern "C" { # [doc = " Convenience eq callback for AWS strings"] pub fn aws_hash_callback_string_eq (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> bool ; } extern "C" { # [doc = " Convenience destroy callback for AWS strings"] pub fn aws_hash_callback_string_destroy (a : * mut :: libc :: c_void) ; } extern "C" { # [doc = " Equality function which compares pointer equality."] pub fn aws_ptr_eq (a : * const :: libc :: c_void , b : * const :: libc :: c_void) -> bool ; } extern "C" { # [doc = " Best-effort check of hash_table_state data-structure invariants"] pub fn aws_hash_table_is_valid (map : * const aws_hash_table) -> bool ; } extern "C" { # [doc = " Given a pointer to a hash_iter, checks that it is well-formed, with all data-structure invariants."] pub fn aws_hash_iter_is_valid (iter : * const aws_hash_iter) -> bool ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_io_event_type { AWS_IO_EVENT_TYPE_READABLE = 1 , AWS_IO_EVENT_TYPE_WRITABLE = 2 , AWS_IO_EVENT_TYPE_REMOTE_HANG_UP = 4 , AWS_IO_EVENT_TYPE_CLOSED = 8 , AWS_IO_EVENT_TYPE_ERROR = 16 , } pub type aws_event_loop_on_event_fn = :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle , events : :: libc :: c_int , user_data : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_event_loop_vtable { pub destroy : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop) > , pub run : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop) -> :: libc :: c_int > , pub stop : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop) -> :: libc :: c_int > , pub wait_for_stop_completion : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop) -> :: libc :: c_int > , pub schedule_task_now : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , task : * mut aws_task) > , pub schedule_task_future : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , task : * mut aws_task , run_at_nanos : u64) > , pub cancel_task : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , task : * mut aws_task) > , pub subscribe_to_io_events : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle , events : :: libc :: c_int , on_event : aws_event_loop_on_event_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > , pub unsubscribe_from_io_events : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle) -> :: libc :: c_int > , pub free_io_event_resources : :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > , pub is_on_callers_thread : :: std :: option :: Option < unsafe extern "C" fn (event_loop : * mut aws_event_loop) -> bool > , } # [test] fn bindgen_test_layout_aws_event_loop_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_event_loop_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_event_loop_vtable > () , 88usize , concat ! ("Size of: " , stringify ! (aws_event_loop_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_event_loop_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_event_loop_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . destroy) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (destroy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . run) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (run))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . stop) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (stop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . wait_for_stop_completion) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (wait_for_stop_completion))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . schedule_task_now) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (schedule_task_now))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . schedule_task_future) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (schedule_task_future))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cancel_task) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (cancel_task))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . subscribe_to_io_events) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (subscribe_to_io_events))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . unsubscribe_from_io_events) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (unsubscribe_from_io_events))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . free_io_event_resources) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (free_io_event_resources))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . is_on_callers_thread) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_vtable) , "::" , stringify ! (is_on_callers_thread))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_event_loop { pub vtable : * mut aws_event_loop_vtable , pub alloc : * mut aws_allocator , pub clock : aws_io_clock_fn , pub local_data : aws_hash_table , pub current_load_factor : aws_atomic_var , pub latest_tick_start : u64 , pub current_tick_latency_sum : usize , pub next_flush_time : aws_atomic_var , pub impl_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_event_loop () { const UNINIT : :: std :: mem :: MaybeUninit < aws_event_loop > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_event_loop > () , 72usize , concat ! ("Size of: " , stringify ! (aws_event_loop))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_event_loop > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_event_loop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . alloc) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (alloc))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clock) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (clock))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . local_data) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (local_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . current_load_factor) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (current_load_factor))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . latest_tick_start) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (latest_tick_start))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . current_tick_latency_sum) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (current_tick_latency_sum))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . next_flush_time) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (next_flush_time))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_data) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop) , "::" , stringify ! (impl_data))) ; } impl Default for aws_event_loop { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_event_loop_on_local_object_removed_fn = :: std :: option :: Option < unsafe extern "C" fn (arg1 : * mut aws_event_loop_local_object) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_event_loop_local_object { pub key : * const :: libc :: c_void , pub object : * mut :: libc :: c_void , pub on_object_removed : aws_event_loop_on_local_object_removed_fn , } # [test] fn bindgen_test_layout_aws_event_loop_local_object () { const UNINIT : :: std :: mem :: MaybeUninit < aws_event_loop_local_object > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_event_loop_local_object > () , 24usize , concat ! ("Size of: " , stringify ! (aws_event_loop_local_object))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_event_loop_local_object > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_event_loop_local_object))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . key) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_local_object) , "::" , stringify ! (key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . object) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_local_object) , "::" , stringify ! (object))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_object_removed) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_local_object) , "::" , stringify ! (on_object_removed))) ; } impl Default for aws_event_loop_local_object { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_event_loop_options { pub clock : aws_io_clock_fn , pub thread_options : * mut aws_thread_options , } # [test] fn bindgen_test_layout_aws_event_loop_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_event_loop_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_event_loop_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_event_loop_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_event_loop_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_event_loop_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . clock) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_options) , "::" , stringify ! (clock))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . thread_options) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_options) , "::" , stringify ! (thread_options))) ; } impl Default for aws_event_loop_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_new_event_loop_fn = :: std :: option :: Option < unsafe extern "C" fn (alloc : * mut aws_allocator , options : * const aws_event_loop_options , new_loop_user_data : * mut :: libc :: c_void) -> * mut aws_event_loop > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_event_loop_group { pub allocator : * mut aws_allocator , pub event_loops : aws_array_list , pub ref_count : aws_ref_count , pub shutdown_options : aws_shutdown_callback_options , } # [test] fn bindgen_test_layout_aws_event_loop_group () { const UNINIT : :: std :: mem :: MaybeUninit < aws_event_loop_group > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_event_loop_group > () , 88usize , concat ! ("Size of: " , stringify ! (aws_event_loop_group))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_event_loop_group > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_event_loop_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_group) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . event_loops) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_group) , "::" , stringify ! (event_loops))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_group) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_options) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_event_loop_group) , "::" , stringify ! (shutdown_options))) ; } impl Default for aws_event_loop_group { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Creates an instance of the default event loop implementation for the current architecture and operating system."] pub fn aws_event_loop_new_default (alloc : * mut aws_allocator , clock : aws_io_clock_fn) -> * mut aws_event_loop ; } extern "C" { # [doc = " Creates an instance of the default event loop implementation for the current architecture and operating system using\n extendable options."] pub fn aws_event_loop_new_default_with_options (alloc : * mut aws_allocator , options : * const aws_event_loop_options) -> * mut aws_event_loop ; } extern "C" { # [doc = " Invokes the destroy() fn for the event loop implementation.\n If the event loop is still in a running state, this function will block waiting on the event loop to shutdown.\n If you do not want this function to block, call aws_event_loop_stop() manually first.\n If the event loop is shared by multiple threads then destroy must be called by exactly one thread. All other threads\n must ensure their API calls to the event loop happen-before the call to destroy."] pub fn aws_event_loop_destroy (event_loop : * mut aws_event_loop) ; } extern "C" { # [doc = " Initializes common event-loop data structures.\n This is only called from the *new() function of event loop implementations."] pub fn aws_event_loop_init_base (event_loop : * mut aws_event_loop , alloc : * mut aws_allocator , clock : aws_io_clock_fn) -> :: libc :: c_int ; } extern "C" { # [doc = " Common cleanup code for all implementations.\n This is only called from the *destroy() function of event loop implementations."] pub fn aws_event_loop_clean_up_base (event_loop : * mut aws_event_loop) ; } extern "C" { # [doc = " Fetches an object from the event-loop's data store. Key will be taken as the memory address of the memory pointed to\n by key. This function is not thread safe and should be called inside the event-loop's thread."] pub fn aws_event_loop_fetch_local_object (event_loop : * mut aws_event_loop , key : * mut :: libc :: c_void , obj : * mut aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Puts an item object the event-loop's data store. Key will be taken as the memory address of the memory pointed to by\n key. The lifetime of item must live until remove or a put item overrides it. This function is not thread safe and\n should be called inside the event-loop's thread."] pub fn aws_event_loop_put_local_object (event_loop : * mut aws_event_loop , obj : * mut aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Removes an object from the event-loop's data store. Key will be taken as the memory address of the memory pointed to\n by key. If removed_item is not null, the removed item will be moved to it if it exists. Otherwise, the default\n deallocation strategy will be used. This function is not thread safe and should be called inside the event-loop's\n thread."] pub fn aws_event_loop_remove_local_object (event_loop : * mut aws_event_loop , key : * mut :: libc :: c_void , removed_obj : * mut aws_event_loop_local_object) -> :: libc :: c_int ; } extern "C" { # [doc = " Triggers the running of the event loop. This function must not block. The event loop is not active until this\n function is invoked. This function can be called again on an event loop after calling aws_event_loop_stop() and\n aws_event_loop_wait_for_stop_completion()."] pub fn aws_event_loop_run (event_loop : * mut aws_event_loop) -> :: libc :: c_int ; } extern "C" { # [doc = " Triggers the event loop to stop, but does not wait for the loop to stop completely.\n This function may be called from outside or inside the event loop thread. It is safe to call multiple times.\n This function is called from destroy().\n\n If you do not call destroy(), an event loop can be run again by calling stop(), wait_for_stop_completion(), run()."] pub fn aws_event_loop_stop (event_loop : * mut aws_event_loop) -> :: libc :: c_int ; } extern "C" { # [doc = " For event-loop implementations to use for providing metrics info to the base event-loop. This enables the\n event-loop load balancer to take into account load when vending another event-loop to a caller.\n\n Call this function at the beginning of your event-loop tick: after wake-up, but before processing any IO or tasks."] pub fn aws_event_loop_register_tick_start (event_loop : * mut aws_event_loop) ; } extern "C" { # [doc = " For event-loop implementations to use for providing metrics info to the base event-loop. This enables the\n event-loop load balancer to take into account load when vending another event-loop to a caller.\n\n Call this function at the end of your event-loop tick: after processing IO and tasks."] pub fn aws_event_loop_register_tick_end (event_loop : * mut aws_event_loop) ; } extern "C" { # [doc = " Returns the current load factor (however that may be calculated). If the event-loop is not invoking\n aws_event_loop_register_tick_start() and aws_event_loop_register_tick_end(), this value will always be 0."] pub fn aws_event_loop_get_load_factor (event_loop : * mut aws_event_loop) -> usize ; } extern "C" { # [doc = " Blocks until the event loop stops completely.\n If you want to call aws_event_loop_run() again, you must call this after aws_event_loop_stop().\n It is not safe to call this function from inside the event loop thread."] pub fn aws_event_loop_wait_for_stop_completion (event_loop : * mut aws_event_loop) -> :: libc :: c_int ; } extern "C" { # [doc = " The event loop will schedule the task and run it on the event loop thread as soon as possible.\n Note that cancelled tasks may execute outside the event loop thread.\n This function may be called from outside or inside the event loop thread.\n\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_event_loop_schedule_task_now (event_loop : * mut aws_event_loop , task : * mut aws_task) ; } extern "C" { # [doc = " The event loop will schedule the task and run it at the specified time.\n Use aws_event_loop_current_clock_time() to query the current time in nanoseconds.\n Note that cancelled tasks may execute outside the event loop thread.\n This function may be called from outside or inside the event loop thread.\n\n The task should not be cleaned up or modified until its function is executed."] pub fn aws_event_loop_schedule_task_future (event_loop : * mut aws_event_loop , task : * mut aws_task , run_at_nanos : u64) ; } extern "C" { # [doc = " Cancels task.\n This function must be called from the event loop's thread, and is only guaranteed\n to work properly on tasks scheduled from within the event loop's thread.\n The task will be executed with the AWS_TASK_STATUS_CANCELED status inside this call."] pub fn aws_event_loop_cancel_task (event_loop : * mut aws_event_loop , task : * mut aws_task) ; } extern "C" { # [doc = " Subscribes on_event to events on the event-loop for handle. events is a bitwise concatenation of the events that were\n received. The definition for these values can be found in aws_io_event_type. Currently, only\n AWS_IO_EVENT_TYPE_READABLE and AWS_IO_EVENT_TYPE_WRITABLE are honored. You always are registered for error conditions\n and closure. This function may be called from outside or inside the event loop thread. However, the unsubscribe\n function must be called inside the event-loop's thread."] pub fn aws_event_loop_subscribe_to_io_events (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle , events : :: libc :: c_int , on_event : aws_event_loop_on_event_fn , user_data : * mut :: libc :: c_void) -> :: libc :: c_int ; } extern "C" { # [doc = " Unsubscribes handle from event-loop notifications.\n This function is not thread safe and should be called inside the event-loop's thread.\n\n NOTE: if you are using io completion ports, this is a risky call. We use it in places, but only when we're certain\n there's no pending events. If you want to use it, it's your job to make sure you don't have pending events before\n calling it."] pub fn aws_event_loop_unsubscribe_from_io_events (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle) -> :: libc :: c_int ; } extern "C" { # [doc = " Cleans up resources (user_data) associated with the I/O eventing subsystem for a given handle. This should only\n ever be necessary in the case where you are cleaning up an event loop during shutdown and its thread has already\n been joined."] pub fn aws_event_loop_free_io_event_resources (event_loop : * mut aws_event_loop , handle : * mut aws_io_handle) ; } extern "C" { # [doc = " Returns true if the event loop's thread is the same thread that called this function, otherwise false."] pub fn aws_event_loop_thread_is_callers_thread (event_loop : * mut aws_event_loop) -> bool ; } extern "C" { # [doc = " Gets the current timestamp for the event loop's clock, in nanoseconds. This function is thread-safe."] pub fn aws_event_loop_current_clock_time (event_loop : * mut aws_event_loop , time_nanos : * mut u64) -> :: libc :: c_int ; } extern "C" { # [doc = " Creates an event loop group, with clock, number of loops to manage, and the function to call for creating a new\n event loop."] pub fn aws_event_loop_group_new (alloc : * mut aws_allocator , clock : aws_io_clock_fn , el_count : u16 , new_loop_fn : aws_new_event_loop_fn , new_loop_user_data : * mut :: libc :: c_void , shutdown_options : * const aws_shutdown_callback_options) -> * mut aws_event_loop_group ; } extern "C" { # [doc = " Creates an event loop group, with clock, number of loops to manage, the function to call for creating a new\n event loop, and also pins all loops to hw threads on the same cpu_group (e.g. NUMA nodes). Note:\n If el_count exceeds the number of hw threads in the cpu_group it will be ignored on the assumption that if you\n care about NUMA, you don't want hyper-threads doing your IO and you especially don't want IO on a different node."] pub fn aws_event_loop_group_new_pinned_to_cpu_group (alloc : * mut aws_allocator , clock : aws_io_clock_fn , el_count : u16 , cpu_group : u16 , new_loop_fn : aws_new_event_loop_fn , new_loop_user_data : * mut :: libc :: c_void , shutdown_options : * const aws_shutdown_callback_options) -> * mut aws_event_loop_group ; } extern "C" { # [doc = " Initializes an event loop group with platform defaults. If max_threads == 0, then the\n loop count will be the number of available processors on the machine / 2 (to exclude hyper-threads).\n Otherwise, max_threads will be the number of event loops in the group."] pub fn aws_event_loop_group_new_default (alloc : * mut aws_allocator , max_threads : u16 , shutdown_options : * const aws_shutdown_callback_options) -> * mut aws_event_loop_group ; } extern "C" { # [doc = " Creates an event loop group, with clock, number of loops to manage, the function to call for creating a new\n event loop, and also pins all loops to hw threads on the same cpu_group (e.g. NUMA nodes). Note:\n If el_count exceeds the number of hw threads in the cpu_group it will be clamped to the number of hw threads\n on the assumption that if you care about NUMA, you don't want hyper-threads doing your IO and you especially\n don't want IO on a different node.\n\n If max_threads == 0, then the\n loop count will be the number of available processors in the cpu_group / 2 (to exclude hyper-threads)"] pub fn aws_event_loop_group_new_default_pinned_to_cpu_group (alloc : * mut aws_allocator , max_threads : u16 , cpu_group : u16 , shutdown_options : * const aws_shutdown_callback_options) -> * mut aws_event_loop_group ; } extern "C" { # [doc = " Increments the reference count on the event loop group, allowing the caller to take a reference to it.\n\n Returns the same event loop group passed in."] pub fn aws_event_loop_group_acquire (el_group : * mut aws_event_loop_group) -> * mut aws_event_loop_group ; } extern "C" { # [doc = " Decrements an event loop group's ref count. When the ref count drops to zero, the event loop group will be\n destroyed."] pub fn aws_event_loop_group_release (el_group : * mut aws_event_loop_group) ; } extern "C" { pub fn aws_event_loop_group_get_loop_at (el_group : * mut aws_event_loop_group , index : usize) -> * mut aws_event_loop ; } extern "C" { pub fn aws_event_loop_group_get_loop_count (el_group : * mut aws_event_loop_group) -> usize ; } extern "C" { # [doc = " Fetches the next loop for use. The purpose is to enable load balancing across loops. You should not depend on how\n this load balancing is done as it is subject to change in the future. Currently it uses the \"best-of-two\" algorithm\n based on the load factor of each loop."] pub fn aws_event_loop_group_get_next_loop (el_group : * mut aws_event_loop_group) -> * mut aws_event_loop ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_stream_seek_basis { AWS_SSB_BEGIN = 0 , AWS_SSB_END = 2 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_stream_status { pub is_end_of_stream : bool , pub is_valid : bool , } # [test] fn bindgen_test_layout_aws_stream_status () { const UNINIT : :: std :: mem :: MaybeUninit < aws_stream_status > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_stream_status > () , 2usize , concat ! ("Size of: " , stringify ! (aws_stream_status))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_stream_status > () , 1usize , concat ! ("Alignment of " , stringify ! (aws_stream_status))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . is_end_of_stream) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_stream_status) , "::" , stringify ! (is_end_of_stream))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . is_valid) as usize - ptr as usize } , 1usize , concat ! ("Offset of field: " , stringify ! (aws_stream_status) , "::" , stringify ! (is_valid))) ; } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_input_stream_vtable { pub seek : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream , offset : i64 , basis : aws_stream_seek_basis) -> :: libc :: c_int > , # [doc = " Stream as much data as will fit into the destination buffer and update its length.\n The destination buffer's capacity MUST NOT be changed.\n\n Return AWS_OP_SUCCESS if the read is successful.\n If AWS_OP_ERR is returned, the stream is assumed to be invalid and any data written to the buffer is ignored.\n\n If no more data is currently available, or the end of the stream has been reached, simply return AWS_OP_SUCCESS\n without touching the destination buffer."] pub read : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream , dest : * mut aws_byte_buf) -> :: libc :: c_int > , pub get_status : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream , status : * mut aws_stream_status) -> :: libc :: c_int > , pub get_length : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream , out_length : * mut i64) -> :: libc :: c_int > , # [doc = " Optional.\n If not set, the default aws_ref_count_acquire/release will be used.\n Set for high level language binding that has its own refcounting implementation and needs to be kept alive from\n C.\n If set, ref_count member will not be used."] pub acquire : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream) > , pub release : :: std :: option :: Option < unsafe extern "C" fn (stream : * mut aws_input_stream) > , } # [test] fn bindgen_test_layout_aws_input_stream_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_input_stream_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_input_stream_vtable > () , 48usize , concat ! ("Size of: " , stringify ! (aws_input_stream_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_input_stream_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_input_stream_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . seek) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (seek))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . read) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (read))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_status) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (get_status))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_length) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (get_length))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . acquire) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (acquire))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . release) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream_vtable) , "::" , stringify ! (release))) ; } # [doc = " Base class for input streams.\n Note: when you implement one input stream, the ref_count needs to be initialized to clean up the resource when\n reaches to zero."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_input_stream { pub impl_ : * mut :: libc :: c_void , pub vtable : * const aws_input_stream_vtable , pub ref_count : aws_ref_count , } # [test] fn bindgen_test_layout_aws_input_stream () { const UNINIT : :: std :: mem :: MaybeUninit < aws_input_stream > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_input_stream > () , 40usize , concat ! ("Size of: " , stringify ! (aws_input_stream))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_input_stream > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_input_stream))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_input_stream) , "::" , stringify ! (ref_count))) ; } impl Default for aws_input_stream { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Increments the reference count on the input stream, allowing the caller to take a reference to it.\n\n Returns the same input stream passed in."] pub fn aws_input_stream_acquire (stream : * mut aws_input_stream) -> * mut aws_input_stream ; } extern "C" { # [doc = " Decrements a input stream's ref count. When the ref count drops to zero, the input stream will be destroyed.\n\n Returns NULL always."] pub fn aws_input_stream_release (stream : * mut aws_input_stream) -> * mut aws_input_stream ; } extern "C" { pub fn aws_input_stream_seek (stream : * mut aws_input_stream , offset : i64 , basis : aws_stream_seek_basis) -> :: libc :: c_int ; } extern "C" { pub fn aws_input_stream_read (stream : * mut aws_input_stream , dest : * mut aws_byte_buf) -> :: libc :: c_int ; } extern "C" { pub fn aws_input_stream_get_status (stream : * mut aws_input_stream , status : * mut aws_stream_status) -> :: libc :: c_int ; } extern "C" { pub fn aws_input_stream_get_length (stream : * mut aws_input_stream , out_length : * mut i64) -> :: libc :: c_int ; } extern "C" { pub fn aws_input_stream_destroy (stream : * mut aws_input_stream) ; } extern "C" { pub fn aws_input_stream_new_from_cursor (allocator : * mut aws_allocator , cursor : * const aws_byte_cursor) -> * mut aws_input_stream ; } extern "C" { pub fn aws_input_stream_new_from_file (allocator : * mut aws_allocator , file_name : * const :: libc :: c_char) -> * mut aws_input_stream ; } extern "C" { pub fn aws_input_stream_new_from_open_file (allocator : * mut aws_allocator , file : * mut FILE) -> * mut aws_input_stream ; } # [doc = " Data representing a URI. uri_str is always allocated and filled in.\n The other portions are merely storing offsets into uri_str."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_uri { pub self_size : usize , pub allocator : * mut aws_allocator , pub uri_str : aws_byte_buf , pub scheme : aws_byte_cursor , pub authority : aws_byte_cursor , pub userinfo : aws_byte_cursor , pub user : aws_byte_cursor , pub password : aws_byte_cursor , pub host_name : aws_byte_cursor , pub port : u16 , pub path : aws_byte_cursor , pub query_string : aws_byte_cursor , pub path_and_query : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_uri () { const UNINIT : :: std :: mem :: MaybeUninit < aws_uri > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_uri > () , 200usize , concat ! ("Size of: " , stringify ! (aws_uri))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_uri > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_uri))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . self_size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (self_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . uri_str) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (uri_str))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . scheme) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (scheme))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . authority) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (authority))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . userinfo) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (userinfo))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (user))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . password) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (password))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . path) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (path))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . query_string) as usize - ptr as usize } , 168usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (query_string))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . path_and_query) as usize - ptr as usize } , 184usize , concat ! ("Offset of field: " , stringify ! (aws_uri) , "::" , stringify ! (path_and_query))) ; } impl Default for aws_uri { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " key/value pairs for a query string. If the query fragment was not in format key=value, the fragment value\n will be stored in key"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_uri_param { pub key : aws_byte_cursor , pub value : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_uri_param () { const UNINIT : :: std :: mem :: MaybeUninit < aws_uri_param > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_uri_param > () , 32usize , concat ! ("Size of: " , stringify ! (aws_uri_param))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_uri_param > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_uri_param))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . key) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_uri_param) , "::" , stringify ! (key))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . value) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_uri_param) , "::" , stringify ! (value))) ; } impl Default for aws_uri_param { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Arguments for building a URI instance. All members must\n be initialized before passing them to aws_uri_init().\n\n query_string and query_params are exclusive to each other. If you set\n query_string, do not prepend it with '?'"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_uri_builder_options { pub scheme : aws_byte_cursor , pub path : aws_byte_cursor , pub host_name : aws_byte_cursor , pub port : u16 , pub query_params : * mut aws_array_list , pub query_string : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_uri_builder_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_uri_builder_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_uri_builder_options > () , 80usize , concat ! ("Size of: " , stringify ! (aws_uri_builder_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_uri_builder_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_uri_builder_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . scheme) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (scheme))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . path) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (path))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . query_params) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (query_params))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . query_string) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_uri_builder_options) , "::" , stringify ! (query_string))) ; } impl Default for aws_uri_builder_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Parses 'uri_str' and initializes uri. Returns AWS_OP_SUCCESS, on success, AWS_OP_ERR on failure.\n After calling this function, the parts can be accessed."] pub fn aws_uri_init_parse (uri : * mut aws_uri , allocator : * mut aws_allocator , uri_str : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Initializes uri to values specified in options. Returns AWS_OP_SUCCESS, on success, AWS_OP_ERR on failure.\n After calling this function, the parts can be accessed."] pub fn aws_uri_init_from_builder_options (uri : * mut aws_uri , allocator : * mut aws_allocator , options : * mut aws_uri_builder_options) -> :: libc :: c_int ; } extern "C" { pub fn aws_uri_clean_up (uri : * mut aws_uri) ; } extern "C" { # [doc = " Returns the scheme portion of the uri (e.g. http, https, ftp, ftps, etc...). If the scheme was not present\n in the uri, the returned value will be empty. It is the users job to determine the appropriate defaults\n if this field is empty, based on protocol, port, etc..."] pub fn aws_uri_scheme (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " Returns the authority portion of the uri (host[:port]). If it was not present, this was a request uri. In that\n case, the value will be empty."] pub fn aws_uri_authority (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " Returns the path portion of the uri, including any leading '/'. If not present, this value will be empty."] pub fn aws_uri_path (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " Returns the query string portion of the uri, minus the '?'. If not present, this value will be empty."] pub fn aws_uri_query_string (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " Returns the 'host_name' portion of the authority. If no authority was present, this value will be empty."] pub fn aws_uri_host_name (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " Returns the port portion of the authority if it was present, otherwise, returns 0.\n If this is 0, it is the users job to determine the correct port based on scheme and protocol."] pub fn aws_uri_port (uri : * const aws_uri) -> u16 ; } extern "C" { # [doc = " Returns the path and query portion of the uri (i.e., the thing you send across the wire)."] pub fn aws_uri_path_and_query (uri : * const aws_uri) -> * const aws_byte_cursor ; } extern "C" { # [doc = " For iterating over the params in the uri query string.\n `param` is an in/out argument used to track progress, it MUST be zeroed out to start.\n If true is returned, `param` contains the value of the next param.\n If false is returned, there are no further params.\n\n Edge cases:\n 1) Entries without '=' sign are treated as having a key and no value.\n Example: First param in query string \"a&b=c\" has key=\"a\" value=\"\"\n\n 2) Blank entries are skipped.\n Example: The only param in query string \"&&a=b\" is key=\"a\" value=\"b\""] pub fn aws_uri_query_string_next_param (uri : * const aws_uri , param : * mut aws_uri_param) -> bool ; } extern "C" { # [doc = " Parses query string and stores the parameters in 'out_params'. Returns AWS_OP_SUCCESS on success and\n AWS_OP_ERR on failure. The user is responsible for initializing out_params with item size of struct aws_query_param.\n The user is also responsible for cleaning up out_params when finished."] pub fn aws_uri_query_string_params (uri : * const aws_uri , out_params : * mut aws_array_list) -> :: libc :: c_int ; } extern "C" { # [doc = " Writes the uri path encoding of a cursor to a buffer. This is the modified version of rfc3986 used by\n sigv4 signing."] pub fn aws_byte_buf_append_encoding_uri_path (buffer : * mut aws_byte_buf , cursor : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Writes the uri query param encoding (passthrough alnum + '-' '_' '~' '.') of a UTF-8 cursor to a buffer\n For example, reading \"a b_c\" would write \"a%20b_c\"."] pub fn aws_byte_buf_append_encoding_uri_param (buffer : * mut aws_byte_buf , cursor : * const aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { # [doc = " Writes the uri decoding of a UTF-8 cursor to a buffer,\n replacing %xx escapes by their single byte equivalent.\n For example, reading \"a%20b_c\" would write \"a b_c\"."] pub fn aws_byte_buf_append_decoding_uri (buffer : * mut aws_byte_buf , cursor : * const aws_byte_cursor) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_errors { AWS_ERROR_S3_MISSING_CONTENT_RANGE_HEADER = 14336 , AWS_ERROR_S3_INVALID_CONTENT_RANGE_HEADER = 14337 , AWS_ERROR_S3_MISSING_CONTENT_LENGTH_HEADER = 14338 , AWS_ERROR_S3_INVALID_CONTENT_LENGTH_HEADER = 14339 , AWS_ERROR_S3_MISSING_ETAG = 14340 , AWS_ERROR_S3_INTERNAL_ERROR = 14341 , AWS_ERROR_S3_SLOW_DOWN = 14342 , AWS_ERROR_S3_INVALID_RESPONSE_STATUS = 14343 , AWS_ERROR_S3_MISSING_UPLOAD_ID = 14344 , AWS_ERROR_S3_PROXY_PARSE_FAILED = 14345 , AWS_ERROR_S3_UNSUPPORTED_PROXY_SCHEME = 14346 , AWS_ERROR_S3_CANCELED = 14347 , AWS_ERROR_S3_INVALID_RANGE_HEADER = 14348 , AWS_ERROR_S3_MULTIRANGE_HEADER_UNSUPPORTED = 14349 , AWS_ERROR_S3_RESPONSE_CHECKSUM_MISMATCH = 14350 , AWS_ERROR_S3_CHECKSUM_CALCULATION_FAILED = 14351 , AWS_ERROR_S3_PAUSED = 14352 , AWS_ERROR_S3_LIST_PARTS_PARSE_FAILED = 14353 , AWS_ERROR_S3_RESUMED_PART_CHECKSUM_MISMATCH = 14354 , AWS_ERROR_S3_RESUME_FAILED = 14355 , AWS_ERROR_S3_OBJECT_MODIFIED = 14356 , AWS_ERROR_S3_NON_RECOVERABLE_ASYNC_ERROR = 14357 , AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE = 14358 , AWS_ERROR_S3_INCORRECT_CONTENT_LENGTH = 14359 , AWS_ERROR_S3_END_RANGE = 15359 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_subject { AWS_LS_S3_GENERAL = 14336 , AWS_LS_S3_CLIENT = 14337 , AWS_LS_S3_CLIENT_STATS = 14338 , AWS_LS_S3_REQUEST = 14339 , AWS_LS_S3_META_REQUEST = 14340 , AWS_LS_S3_ENDPOINT = 14341 , AWS_LS_S3_LAST = 15359 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_cpu_group_info { pub cpu_group : u16 , pub nic_name_array : * const aws_byte_cursor , pub nic_name_array_length : usize , } # [test] fn bindgen_test_layout_aws_s3_cpu_group_info () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_cpu_group_info > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_cpu_group_info > () , 24usize , concat ! ("Size of: " , stringify ! (aws_s3_cpu_group_info))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_cpu_group_info > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_cpu_group_info))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cpu_group) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_cpu_group_info) , "::" , stringify ! (cpu_group))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . nic_name_array) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_cpu_group_info) , "::" , stringify ! (nic_name_array))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . nic_name_array_length) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_cpu_group_info) , "::" , stringify ! (nic_name_array_length))) ; } impl Default for aws_s3_cpu_group_info { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_compute_platform_info { pub instance_type : aws_byte_cursor , pub max_throughput_gbps : u16 , pub cpu_group_info_array : * const aws_s3_cpu_group_info , pub cpu_group_info_array_length : usize , } # [test] fn bindgen_test_layout_aws_s3_compute_platform_info () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_compute_platform_info > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_compute_platform_info > () , 40usize , concat ! ("Size of: " , stringify ! (aws_s3_compute_platform_info))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_compute_platform_info > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_compute_platform_info))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . instance_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_compute_platform_info) , "::" , stringify ! (instance_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_throughput_gbps) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_compute_platform_info) , "::" , stringify ! (max_throughput_gbps))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cpu_group_info_array) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_compute_platform_info) , "::" , stringify ! (cpu_group_info_array))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cpu_group_info_array_length) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_compute_platform_info) , "::" , stringify ! (cpu_group_info_array_length))) ; } impl Default for aws_s3_compute_platform_info { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Initializes internal datastructures used by aws-c-s3.\n Must be called before using any functionality in aws-c-s3."] pub fn aws_s3_library_init (allocator : * mut aws_allocator) ; } extern "C" { # [doc = " Retrieves the pre-configured metadata for an ec2 instance type. If no such pre-configuration exists, returns NULL."] pub fn aws_s3_get_compute_platform_info_for_instance_type (instance_type_name : aws_byte_cursor) -> * mut aws_s3_compute_platform_info ; } extern "C" { # [doc = " Shuts down the internal datastructures used by aws-c-s3."] pub fn aws_s3_library_clean_up () ; } pub type aws_should_sign_header_fn = :: std :: option :: Option < unsafe extern "C" fn (name : * const aws_byte_cursor , userdata : * mut :: libc :: c_void) -> bool > ; # [repr (u32)] # [non_exhaustive] # [doc = " A primitive RTTI indicator for signing configuration structs\n\n There must be one entry per config structure type and it's a fatal error\n to put the wrong value in the \"config_type\" member of your config structure."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_signing_config_type { AWS_SIGNING_CONFIG_AWS = 1 , } # [doc = " All signing configuration structs must match this by having\n the config_type member as the first member."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_signing_config_base { pub config_type : aws_signing_config_type , } # [test] fn bindgen_test_layout_aws_signing_config_base () { const UNINIT : :: std :: mem :: MaybeUninit < aws_signing_config_base > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_signing_config_base > () , 4usize , concat ! ("Size of: " , stringify ! (aws_signing_config_base))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_signing_config_base > () , 4usize , concat ! ("Alignment of " , stringify ! (aws_signing_config_base))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_base) , "::" , stringify ! (config_type))) ; } impl Default for aws_signing_config_base { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (u32)] # [non_exhaustive] # [doc = " What version of the AWS signing process should we use."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_signing_algorithm { AWS_SIGNING_ALGORITHM_V4 = 0 , AWS_SIGNING_ALGORITHM_V4_ASYMMETRIC = 1 , } # [repr (u32)] # [non_exhaustive] # [doc = " What sort of signature should be computed from the signable?"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_signature_type { # [doc = " A signature for a full http request should be computed, with header updates applied to the signing result."] AWS_ST_HTTP_REQUEST_HEADERS = 0 , # [doc = " A signature for a full http request should be computed, with query param updates applied to the signing result."] AWS_ST_HTTP_REQUEST_QUERY_PARAMS = 1 , # [doc = " Compute a signature for a payload chunk. The signable's input stream should be the chunk data and the\n signable should contain the most recent signature value (either the original http request or the most recent\n chunk) in the \"previous-signature\" property."] AWS_ST_HTTP_REQUEST_CHUNK = 2 , # [doc = " Compute a signature for an event stream event. The signable's input stream should be the encoded event-stream\n message (headers + payload), the signable should contain the most recent signature value (either the original\n http request or the most recent event) in the \"previous-signature\" property.\n\n This option is only supported for Sigv4 for now."] AWS_ST_HTTP_REQUEST_EVENT = 3 , # [doc = " Compute a signature for an http request via it's already-computed canonical request. Only the authorization\n signature header is added to the signing result."] AWS_ST_CANONICAL_REQUEST_HEADERS = 4 , # [doc = " Compute a signature for an http request via it's already-computed canonical request. Only the authorization\n signature query param is added to the signing result."] AWS_ST_CANONICAL_REQUEST_QUERY_PARAMS = 5 , # [doc = " Compute a signature for the trailing headers.\n the signable should contain the most recent signature value (either the original http request or the most recent\n chunk) in the \"previous-signature\" property."] AWS_ST_HTTP_REQUEST_TRAILING_HEADERS = 6 , } extern "C" { # [doc = " The SHA-256 of an empty string:\n 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_empty_sha256 : aws_byte_cursor ; } extern "C" { # [doc = " 'UNSIGNED-PAYLOAD'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_unsigned_payload : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-UNSIGNED-PAYLOAD-TRAILER'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_streaming_unsigned_payload_trailer : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-AWS4-HMAC-SHA256-PAYLOAD'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_streaming_aws4_hmac_sha256_payload : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-AWS4-HMAC-SHA256-PAYLOAD-TRAILER'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_streaming_aws4_hmac_sha256_payload_trailer : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-AWS4-ECDSA-P256-SHA256-PAYLOAD'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_streaming_aws4_ecdsa_p256_sha256_payload : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-AWS4-ECDSA-P256-SHA256-PAYLOAD-TRAILER'\n For use with `aws_signing_config_aws.signed_body_value`."] pub static g_aws_signed_body_value_streaming_aws4_ecdsa_p256_sha256_payload_trailer : aws_byte_cursor ; } extern "C" { # [doc = " 'STREAMING-AWS4-HMAC-SHA256-EVENTS'\n For use with `aws_signing_config_aws.signed_body_value`.\n\n Event signing is only supported for Sigv4 for now."] pub static g_aws_signed_body_value_streaming_aws4_hmac_sha256_events : aws_byte_cursor ; } # [repr (u32)] # [non_exhaustive] # [doc = " Controls if signing adds a header containing the canonical request's body value"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_signed_body_header_type { # [doc = " Do not add a header"] AWS_SBHT_NONE = 0 , # [doc = " Add the \"x-amz-content-sha256\" header with the canonical request's body value"] AWS_SBHT_X_AMZ_CONTENT_SHA256 = 1 , } # [doc = " A configuration structure for use in AWS-related signing. Currently covers sigv4 only, but is not required to."] # [repr (C)] pub struct aws_signing_config_aws { # [doc = " What kind of config structure is this?"] pub config_type : aws_signing_config_type , # [doc = " What signing algorithm to use."] pub algorithm : aws_signing_algorithm , # [doc = " What sort of signature should be computed?"] pub signature_type : aws_signature_type , pub region : aws_byte_cursor , # [doc = " name of service to sign a request for"] pub service : aws_byte_cursor , # [doc = " Raw date to use during the signing process."] pub date : aws_date_time , # [doc = " Optional function to control which headers are a part of the canonical request.\n Skipping auth-required headers will result in an unusable signature. Headers injected by the signing process\n are not skippable.\n\n This function does not override the internal check function (x-amzn-trace-id, user-agent), but rather\n supplements it. In particular, a header will get signed if and only if it returns true to both\n the internal check (skips x-amzn-trace-id, user-agent) and this function (if defined)."] pub should_sign_header : aws_should_sign_header_fn , pub should_sign_header_ud : * mut :: libc :: c_void , pub flags : aws_signing_config_aws__bindgen_ty_1 , # [doc = " Optional string to use as the canonical request's body value.\n If string is empty, a value will be calculated from the payload during signing.\n Typically, this is the SHA-256 of the (request/chunk/event) payload, written as lowercase hex.\n If this has been precalculated, it can be set here. Special values used by certain services can also be set\n (e.g. \"UNSIGNED-PAYLOAD\" \"STREAMING-AWS4-HMAC-SHA256-PAYLOAD\" \"STREAMING-AWS4-HMAC-SHA256-EVENTS\")."] pub signed_body_value : aws_byte_cursor , # [doc = " Controls what body \"hash\" header, if any, should be added to the canonical request and the signed request:\n AWS_SBHT_NONE - no header should be added\n AWS_SBHT_X_AMZ_CONTENT_SHA256 - the body \"hash\" should be added in the X-Amz-Content-Sha256 header"] pub signed_body_header : aws_signed_body_header_type , pub credentials : * const aws_credentials , pub credentials_provider : * mut aws_credentials_provider , # [doc = " If non-zero and the signing transform is query param, then signing will add X-Amz-Expires to the query\n string, equal to the value specified here. If this value is zero or if header signing is being used then\n this parameter has no effect."] pub expiration_in_seconds : u64 , } # [repr (C)] # [repr (align (4))] # [derive (Debug , Default , Copy , Clone)] pub struct aws_signing_config_aws__bindgen_ty_1 { pub _bitfield_align_1 : [u8 ; 0] , pub _bitfield_1 : __BindgenBitfieldUnit < [u8 ; 1usize] > , pub __bindgen_padding_0 : [u8 ; 3usize] , } # [test] fn bindgen_test_layout_aws_signing_config_aws__bindgen_ty_1 () { assert_eq ! (:: std :: mem :: size_of :: < aws_signing_config_aws__bindgen_ty_1 > () , 4usize , concat ! ("Size of: " , stringify ! (aws_signing_config_aws__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_signing_config_aws__bindgen_ty_1 > () , 4usize , concat ! ("Alignment of " , stringify ! (aws_signing_config_aws__bindgen_ty_1))) ; } impl aws_signing_config_aws__bindgen_ty_1 { # [inline] pub fn use_double_uri_encode (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (0usize , 1u8) as u32) } } # [inline] pub fn set_use_double_uri_encode (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (0usize , 1u8 , val as u64) } } # [inline] pub fn should_normalize_uri_path (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (1usize , 1u8) as u32) } } # [inline] pub fn set_should_normalize_uri_path (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (1usize , 1u8 , val as u64) } } # [inline] pub fn omit_session_token (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (2usize , 1u8) as u32) } } # [inline] pub fn set_omit_session_token (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (2usize , 1u8 , val as u64) } } # [inline] pub fn new_bitfield_1 (use_double_uri_encode : u32 , should_normalize_uri_path : u32 , omit_session_token : u32) -> __BindgenBitfieldUnit < [u8 ; 1usize] > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [u8 ; 1usize] > = Default :: default () ; __bindgen_bitfield_unit . set (0usize , 1u8 , { let use_double_uri_encode : u32 = unsafe { :: std :: mem :: transmute (use_double_uri_encode) } ; use_double_uri_encode as u64 }) ; __bindgen_bitfield_unit . set (1usize , 1u8 , { let should_normalize_uri_path : u32 = unsafe { :: std :: mem :: transmute (should_normalize_uri_path) } ; should_normalize_uri_path as u64 }) ; __bindgen_bitfield_unit . set (2usize , 1u8 , { let omit_session_token : u32 = unsafe { :: std :: mem :: transmute (omit_session_token) } ; omit_session_token as u64 }) ; __bindgen_bitfield_unit } } # [test] fn bindgen_test_layout_aws_signing_config_aws () { const UNINIT : :: std :: mem :: MaybeUninit < aws_signing_config_aws > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_signing_config_aws > () , 256usize , concat ! ("Size of: " , stringify ! (aws_signing_config_aws))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_signing_config_aws > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_signing_config_aws))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . config_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (config_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . algorithm) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (algorithm))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . signature_type) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (signature_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . region) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (region))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . service) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (service))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . date) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (date))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . should_sign_header) as usize - ptr as usize } , 184usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (should_sign_header))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . should_sign_header_ud) as usize - ptr as usize } , 192usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (should_sign_header_ud))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . flags) as usize - ptr as usize } , 200usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (flags))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . signed_body_value) as usize - ptr as usize } , 208usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (signed_body_value))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . signed_body_header) as usize - ptr as usize } , 224usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (signed_body_header))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . credentials) as usize - ptr as usize } , 232usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (credentials))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . credentials_provider) as usize - ptr as usize } , 240usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (credentials_provider))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . expiration_in_seconds) as usize - ptr as usize } , 248usize , concat ! ("Offset of field: " , stringify ! (aws_signing_config_aws) , "::" , stringify ! (expiration_in_seconds))) ; } impl Default for aws_signing_config_aws { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Returns a c-string that describes the supplied signing algorithm\n\n @param algorithm signing algorithm to get a friendly string name for\n\n @return friendly string name of the supplied algorithm, or \"Unknown\" if the algorithm is not recognized"] pub fn aws_signing_algorithm_to_string (algorithm : aws_signing_algorithm) -> * const :: libc :: c_char ; } extern "C" { # [doc = " Checks a signing configuration for invalid settings combinations.\n\n @param config signing configuration to validate\n\n @return - AWS_OP_SUCCESS if the configuration is valid, AWS_OP_ERR otherwise"] pub fn aws_validate_aws_signing_config_aws (config : * const aws_signing_config_aws) -> :: libc :: c_int ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_request { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_meta_request { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_request_metrics { _unused : [u8 ; 0] , } # [repr (u32)] # [non_exhaustive] # [doc = " A Meta Request represents a group of generated requests that are being done on behalf of the\n original request. For example, one large GetObject request can be transformed into a series\n of ranged GetObject requests that are executed in parallel to improve throughput.\n\n The aws_s3_meta_request_type is a hint of transformation to be applied."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_meta_request_type { # [doc = " The Default meta request type sends any request to S3 as-is (with no transformation). For example,\n it can be used to pass a CreateBucket request."] AWS_S3_META_REQUEST_TYPE_DEFAULT = 0 , # [doc = " The GetObject request will be split into a series of ranged GetObject requests that are\n executed in parallel to improve throughput, when possible."] AWS_S3_META_REQUEST_TYPE_GET_OBJECT = 1 , # [doc = " The PutObject request will be split into MultiPart uploads that are executed in parallel\n to improve throughput, when possible.\n Note: put object supports both known and unknown body length. The client\n relies on Content-Length header to determine length of the body.\n Request with unknown content length are always sent using multipart\n upload regardless of final number of parts and do have the following limitations:\n - multipart threshold is ignored and all request are made through mpu,\n even if they only need one part\n - pause/resume is not supported\n - meta request will throw error if checksum header is provider (due to\n general limitation of checksum not being usable if meta request is\n getting split)"] AWS_S3_META_REQUEST_TYPE_PUT_OBJECT = 2 , # [doc = " The CopyObject meta request performs a multi-part copy\n using multiple S3 UploadPartCopy requests in parallel, or bypasses\n a CopyObject request to S3 if the object size is not large enough for\n a multipart upload.\n Note: copy support is still in development and has following limitations:\n - host header must use virtual host addressing style (path style is not\n supported) and both source and dest buckets must have dns compliant name\n - only {bucket}/{key} format is supported for source and passing arn as\n source will not work\n - source bucket is assumed to be in the same region as dest"] AWS_S3_META_REQUEST_TYPE_COPY_OBJECT = 3 , # [doc = " The CopyObject meta request performs a multi-part copy\n using multiple S3 UploadPartCopy requests in parallel, or bypasses\n a CopyObject request to S3 if the object size is not large enough for\n a multipart upload.\n Note: copy support is still in development and has following limitations:\n - host header must use virtual host addressing style (path style is not\n supported) and both source and dest buckets must have dns compliant name\n - only {bucket}/{key} format is supported for source and passing arn as\n source will not work\n - source bucket is assumed to be in the same region as dest"] AWS_S3_META_REQUEST_TYPE_MAX = 4 , } # [repr (u32)] # [non_exhaustive] # [doc = " The type of S3 request made. Used by metrics."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_request_type { AWS_S3_REQUEST_TYPE_DEFAULT = 0 , AWS_S3_REQUEST_TYPE_HEAD_OBJECT = 1 , AWS_S3_REQUEST_TYPE_GET_OBJECT = 2 , AWS_S3_REQUEST_TYPE_LIST_PARTS = 3 , AWS_S3_REQUEST_TYPE_CREATE_MULTIPART_UPLOAD = 4 , AWS_S3_REQUEST_TYPE_UPLOAD_PART = 5 , AWS_S3_REQUEST_TYPE_ABORT_MULTIPART_UPLOAD = 6 , AWS_S3_REQUEST_TYPE_COMPLETE_MULTIPART_UPLOAD = 7 , AWS_S3_REQUEST_TYPE_UPLOAD_PART_COPY = 8 , AWS_S3_REQUEST_TYPE_MAX = 9 , } # [doc = " Invoked to provide response headers received during execution of the meta request, both for\n success and error HTTP status codes.\n\n Return AWS_OP_SUCCESS to continue processing the request.\n\n Return aws_raise_error(E) to cancel the request.\n The error you raise will be reflected in `aws_s3_meta_request_result.error_code`.\n If you're not sure which error to raise, use AWS_ERROR_S3_CANCELED."] pub type aws_s3_meta_request_headers_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , headers : * const aws_http_headers , response_status : :: libc :: c_int , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Invoked to provide the response body as it is received.\n\n Note: If you set `enable_read_backpressure` true on the S3 client,\n you must maintain the flow-control window.\n The flow-control window shrinks as you receive body data via this callback.\n Whenever the flow-control window reaches 0 you will stop downloading data.\n Use aws_s3_meta_request_increment_read_window() to increment the window and keep data flowing.\n Maintain a larger window to keep up a high download throughput,\n parts cannot download in parallel unless the window is large enough to hold multiple parts.\n Maintain a smaller window to limit the amount of data buffered in memory.\n\n If `manual_window_management` is false, you do not need to maintain the flow-control window.\n No back-pressure is applied and data arrives as fast as possible.\n\n Return AWS_OP_SUCCESS to continue processing the request.\n\n Return aws_raise_error(E) to cancel the request.\n The error you raise will be reflected in `aws_s3_meta_request_result.error_code`.\n If you're not sure which error to raise, use AWS_ERROR_S3_CANCELED."] pub type aws_s3_meta_request_receive_body_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , body : * const aws_byte_cursor , range_start : u64 , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [doc = " Invoked when the entire meta request execution is complete."] pub type aws_s3_meta_request_finish_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , meta_request_result : * const aws_s3_meta_request_result , user_data : * mut :: libc :: c_void) > ; # [doc = " Information sent in the meta_request progress callback."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_s3_meta_request_progress { pub bytes_transferred : u64 , pub content_length : u64 , } # [test] fn bindgen_test_layout_aws_s3_meta_request_progress () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_meta_request_progress > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_meta_request_progress > () , 16usize , concat ! ("Size of: " , stringify ! (aws_s3_meta_request_progress))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_meta_request_progress > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_meta_request_progress))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . bytes_transferred) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_progress) , "::" , stringify ! (bytes_transferred))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . content_length) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_progress) , "::" , stringify ! (content_length))) ; } # [doc = " Invoked to report progress of a meta-request.\n For PutObject, progress refers to bytes uploaded.\n For CopyObject, progress refers to bytes copied.\n For GetObject, progress refers to bytes downloaded.\n For anything else, progress refers to response body bytes received."] pub type aws_s3_meta_request_progress_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , progress : * const aws_s3_meta_request_progress , user_data : * mut :: libc :: c_void) > ; # [doc = " Invoked to report the telemetry of the meta request once a single request finishes. Invoked from the thread of the\n connection that request made from.\n Note: *metrics is only valid for the duration of the callback. If you need to keep it around, use\n `aws_s3_request_metrics_acquire`"] pub type aws_s3_meta_request_telemetry_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , metrics : * mut aws_s3_request_metrics , user_data : * mut :: libc :: c_void) > ; pub type aws_s3_meta_request_shutdown_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; pub type aws_s3_client_shutdown_complete_callback_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_meta_request_tls_mode { AWS_MR_TLS_ENABLED = 0 , AWS_MR_TLS_DISABLED = 1 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_meta_request_compute_content_md5 { AWS_MR_CONTENT_MD5_DISABLED = 0 , AWS_MR_CONTENT_MD5_ENABLED = 1 , } impl aws_s3_checksum_algorithm { pub const AWS_SCA_CRC32C : aws_s3_checksum_algorithm = aws_s3_checksum_algorithm :: AWS_SCA_INIT ; } impl aws_s3_checksum_algorithm { pub const AWS_SCA_END : aws_s3_checksum_algorithm = aws_s3_checksum_algorithm :: AWS_SCA_SHA256 ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_checksum_algorithm { AWS_SCA_NONE = 0 , AWS_SCA_INIT = 1 , AWS_SCA_CRC32 = 2 , AWS_SCA_SHA1 = 3 , AWS_SCA_SHA256 = 4 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_checksum_location { AWS_SCL_NONE = 0 , AWS_SCL_HEADER = 1 , AWS_SCL_TRAILER = 2 , } # [doc = " Info about a single part, for you to review before the upload completes."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_upload_part_review { pub size : u64 , pub checksum : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_s3_upload_part_review () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_upload_part_review > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_upload_part_review > () , 24usize , concat ! ("Size of: " , stringify ! (aws_s3_upload_part_review))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_upload_part_review > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_upload_part_review))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . size) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_part_review) , "::" , stringify ! (size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . checksum) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_part_review) , "::" , stringify ! (checksum))) ; } impl Default for aws_s3_upload_part_review { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Info for you to review before an upload completes.\n\n WARNING: This feature is experimental/unstable.\n At this time, review is only available for multipart upload\n (when Content-Length is above the `multipart_upload_threshold`,\n or Content-Length not specified)."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_upload_review { pub checksum_algorithm : aws_s3_checksum_algorithm , pub part_count : usize , pub part_array : * mut aws_s3_upload_part_review , } # [test] fn bindgen_test_layout_aws_s3_upload_review () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_upload_review > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_upload_review > () , 24usize , concat ! ("Size of: " , stringify ! (aws_s3_upload_review))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_upload_review > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_upload_review))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . checksum_algorithm) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_review) , "::" , stringify ! (checksum_algorithm))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_count) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_review) , "::" , stringify ! (part_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_array) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_review) , "::" , stringify ! (part_array))) ; } impl Default for aws_s3_upload_review { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Optional callback, for you to review an upload before it completes.\n For example, you can review each part's checksum and fail the upload if\n you do not agree with them.\n\n @param meta_request pointer to the aws_s3_meta_request of the upload.\n @param info Detailed info about the upload.\n\n Return AWS_OP_SUCCESS to continue processing the request.\n\n Return aws_raise_error(E) to cancel the request.\n The error you raise will be reflected in `aws_s3_meta_request_result.error_code`.\n If you're not sure which error to raise, use AWS_ERROR_S3_CANCELED.\n\n WARNING: This feature is experimental/unstable.\n At this time, the callback is only invoked for multipart upload\n (when Content-Length is above the `multipart_upload_threshold`,\n or Content-Length not specified)."] pub type aws_s3_meta_request_upload_review_fn = :: std :: option :: Option < unsafe extern "C" fn (meta_request : * mut aws_s3_meta_request , review : * const aws_s3_upload_review , user_data : * mut :: libc :: c_void) -> :: libc :: c_int > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_s3_tcp_keep_alive_options { pub keep_alive_interval_sec : u16 , pub keep_alive_timeout_sec : u16 , pub keep_alive_max_failed_probes : u16 , } # [test] fn bindgen_test_layout_aws_s3_tcp_keep_alive_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_tcp_keep_alive_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_tcp_keep_alive_options > () , 6usize , concat ! ("Size of: " , stringify ! (aws_s3_tcp_keep_alive_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_tcp_keep_alive_options > () , 2usize , concat ! ("Alignment of " , stringify ! (aws_s3_tcp_keep_alive_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . keep_alive_interval_sec) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_tcp_keep_alive_options) , "::" , stringify ! (keep_alive_interval_sec))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . keep_alive_timeout_sec) as usize - ptr as usize } , 2usize , concat ! ("Offset of field: " , stringify ! (aws_s3_tcp_keep_alive_options) , "::" , stringify ! (keep_alive_timeout_sec))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . keep_alive_max_failed_probes) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (aws_s3_tcp_keep_alive_options) , "::" , stringify ! (keep_alive_max_failed_probes))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_client_config { pub max_active_connections_override : u32 , pub region : aws_byte_cursor , pub client_bootstrap : * mut aws_client_bootstrap , pub tls_mode : aws_s3_meta_request_tls_mode , pub tls_connection_options : * mut aws_tls_connection_options , pub signing_config : * mut aws_signing_config_aws , pub part_size : u64 , pub max_part_size : u64 , pub multipart_upload_threshold : u64 , pub throughput_target_gbps : f64 , pub retry_strategy : * mut aws_retry_strategy , # [doc = " TODO: move MD5 config to checksum config.\n For multi-part upload, content-md5 will be calculated if the AWS_MR_CONTENT_MD5_ENABLED is specified\n or initial request has content-md5 header.\n For single-part upload, keep the content-md5 in the initial request unchanged."] pub compute_content_md5 : aws_s3_meta_request_compute_content_md5 , pub shutdown_callback : aws_s3_client_shutdown_complete_callback_fn , pub shutdown_callback_user_data : * mut :: libc :: c_void , # [doc = " Optional.\n Proxy configuration for http connection.\n If the connection_type is AWS_HPCT_HTTP_LEGACY, it will be converted to AWS_HPCT_HTTP_TUNNEL if tls_mode is\n ENABLED. Otherwise, it will be converted to AWS_HPCT_HTTP_FORWARD."] pub proxy_options : * mut aws_http_proxy_options , # [doc = " Optional.\n Configuration for fetching proxy configuration from environment.\n By Default proxy_ev_settings.aws_http_proxy_env_var_type is set to AWS_HPEV_ENABLE which means read proxy\n configuration from environment.\n Only works when proxy_options is not set. If both are set, configuration from proxy_options is used."] pub proxy_ev_settings : * mut proxy_env_var_settings , # [doc = " Optional.\n If set to 0, default value is used."] pub connect_timeout_ms : u32 , # [doc = " Optional.\n Set keepalive to periodically transmit messages for detecting a disconnected peer."] pub tcp_keep_alive_options : * mut aws_s3_tcp_keep_alive_options , # [doc = " Optional.\n Configuration options for connection monitoring.\n If the transfer speed falls below the specified minimum_throughput_bytes_per_second, the operation is aborted.\n If set to NULL, default values are used."] pub monitoring_options : * mut aws_http_connection_monitoring_options , # [doc = " Enable backpressure and prevent response data from downloading faster than you can handle it.\n\n If false (default), no backpressure is applied and data will download as fast as possible.\n\n If true, each meta request has a flow-control window that shrinks as\n response body data is downloaded (headers do not affect the window).\n `initial_read_window` determines the starting size of each meta request's window.\n You will stop downloading data whenever the flow-control window reaches 0\n You must call aws_s3_meta_request_increment_read_window() to keep data flowing.\n\n WARNING: This feature is experimental.\n Currently, backpressure is only applied to GetObject requests which are split into multiple parts,\n and you may still receive some data after the window reaches 0."] pub enable_read_backpressure : bool , # [doc = " The starting size of each meta request's flow-control window, in bytes.\n Ignored unless `enable_read_backpressure` is true."] pub initial_read_window : usize , } # [test] fn bindgen_test_layout_aws_s3_client_config () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client_config > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client_config > () , 176usize , concat ! ("Size of: " , stringify ! (aws_s3_client_config))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client_config > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_active_connections_override) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (max_active_connections_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . region) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (region))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client_bootstrap) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (client_bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_mode) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (tls_mode))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_connection_options) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (tls_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . signing_config) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (signing_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_size) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_part_size) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (max_part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . multipart_upload_threshold) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (multipart_upload_threshold))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . throughput_target_gbps) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (throughput_target_gbps))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . retry_strategy) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (retry_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . compute_content_md5) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (compute_content_md5))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback_user_data) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (shutdown_callback_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_options) as usize - ptr as usize } , 120usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_settings) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (proxy_ev_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connect_timeout_ms) as usize - ptr as usize } , 136usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (connect_timeout_ms))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tcp_keep_alive_options) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (tcp_keep_alive_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . monitoring_options) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (monitoring_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_backpressure) as usize - ptr as usize } , 160usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (enable_read_backpressure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_read_window) as usize - ptr as usize } , 168usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_config) , "::" , stringify ! (initial_read_window))) ; } impl Default for aws_s3_client_config { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_checksum_config { # [doc = " The location of client added checksum header.\n\n If AWS_SCL_NONE. No request payload checksum will be add and calculated.\n\n If AWS_SCL_HEADER, the checksum will be calculated by client and added related header to the request sent.\n\n If AWS_SCL_TRAILER, the payload will be aws_chunked encoded, The checksum will be calculate while reading the\n payload by client. Related header will be added to the trailer part of the encoded payload. Note the payload of\n the original request cannot be aws-chunked encoded already. Otherwise, error will be raised."] pub location : aws_s3_checksum_location , # [doc = " The checksum algorithm used.\n Must be set if location is not AWS_SCL_NONE. Must be AWS_SCA_NONE if location is AWS_SCL_NONE."] pub checksum_algorithm : aws_s3_checksum_algorithm , # [doc = " Enable checksum mode header will be attached to GET requests, this will tell s3 to send back checksums headers if\n they exist. Calculate the corresponding checksum on the response bodies. The meta request will finish with a did\n validate field and set the error code to AWS_ERROR_S3_RESPONSE_CHECKSUM_MISMATCH if the calculated\n checksum, and checksum found in the response header do not match."] pub validate_response_checksum : bool , # [doc = " Optional array of `enum aws_s3_checksum_algorithm`.\n\n Ignored when validate_response_checksum is not set.\n If not set all the algorithms will be selected as default behavior.\n Owned by the caller.\n\n The list of algorithms for user to pick up when validate the checksum. Client will pick up the algorithm from the\n list with the priority based on performance, and the algorithm sent by server. The priority based on performance\n is [CRC32C, CRC32, SHA1, SHA256].\n\n If the response checksum was validated by client, the result will indicate which algorithm was picked."] pub validate_checksum_algorithms : * mut aws_array_list , } # [test] fn bindgen_test_layout_aws_s3_checksum_config () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_checksum_config > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_checksum_config > () , 24usize , concat ! ("Size of: " , stringify ! (aws_s3_checksum_config))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_checksum_config > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_checksum_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . location) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_checksum_config) , "::" , stringify ! (location))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . checksum_algorithm) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (aws_s3_checksum_config) , "::" , stringify ! (checksum_algorithm))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . validate_response_checksum) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_checksum_config) , "::" , stringify ! (validate_response_checksum))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . validate_checksum_algorithms) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_checksum_config) , "::" , stringify ! (validate_checksum_algorithms))) ; } impl Default for aws_s3_checksum_config { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Options for a new meta request, ie, file transfer that will be handled by the high performance client.\n\n There are several ways to pass the request's body data:\n 1) If the data is already in memory, set the body-stream on `message`.\n 2) If the data is on disk, set `send_filepath` for best performance.\n 3) If the data will be be produced in asynchronous chunks, set `send_async_stream`."] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_meta_request_options { pub type_ : aws_s3_meta_request_type , pub signing_config : * const aws_signing_config_aws , pub message : * mut aws_http_message , # [doc = " Optional.\n If set, this file is sent as the request body.\n This gives the best performance when sending data from a file.\n Do not set if the body is being passed by other means (see note above)."] pub send_filepath : aws_byte_cursor , # [doc = " Optional - EXPERIMENTAL/UNSTABLE\n If set, the request body comes from this async stream.\n Use this when outgoing data will be produced in asynchronous chunks.\n Do not set if the body is being passed by other means (see note above)."] pub send_async_stream : * mut aws_async_input_stream , # [doc = " Optional.\n if set, the flexible checksum will be performed by client based on the config."] pub checksum_config : * const aws_s3_checksum_config , pub user_data : * mut :: libc :: c_void , # [doc = " Optional.\n Invoked to provide response headers received during execution of the meta request.\n Note: this callback will not be fired for cases when resuming an\n operation that was already completed (ex. pausing put object after it\n uploaded all data and then resuming it)\n See `aws_s3_meta_request_headers_callback_fn`."] pub headers_callback : aws_s3_meta_request_headers_callback_fn , # [doc = " Invoked to provide the response body as it is received.\n See `aws_s3_meta_request_receive_body_callback_fn`."] pub body_callback : aws_s3_meta_request_receive_body_callback_fn , # [doc = " Invoked when the entire meta request execution is complete.\n See `aws_s3_meta_request_finish_fn`."] pub finish_callback : aws_s3_meta_request_finish_fn , pub shutdown_callback : aws_s3_meta_request_shutdown_fn , # [doc = " Invoked to report progress of the meta request execution.\n See `aws_s3_meta_request_progress_fn`."] pub progress_callback : aws_s3_meta_request_progress_fn , # [doc = " Optional.\n To get telemetry metrics when a single request finishes.\n If set the request will keep track of the metrics from `aws_s3_request_metrics`, and fire the callback when the\n request finishes receiving response.\n See `aws_s3_meta_request_telemetry_fn`\n\n Notes:\n - The callback will be invoked multiple times from different threads."] pub telemetry_callback : aws_s3_meta_request_telemetry_fn , # [doc = " Optional.\n Callback for reviewing an upload before it completes.\n WARNING: experimental/unstable\n See `aws_s3_upload_review_fn`"] pub upload_review_callback : aws_s3_meta_request_upload_review_fn , # [doc = " Optional.\n Endpoint override for request. Can be used to override scheme and port of\n the endpoint.\n There is some overlap between Host header and Endpoint and corner cases\n are handled as follows:\n - Only Host header is set - Host is used to construct endpoint. https is\n default with corresponding port\n - Only endpoint is set - Host header is created from endpoint. Port and\n Scheme from endpoint is used.\n - Both Host and Endpoint is set - Host header must match Authority of\n Endpoint uri. Port and Scheme from endpoint is used."] pub endpoint : * mut aws_uri , # [doc = " Optional.\n For meta requests that support pause/resume (e.g. PutObject), serialized resume token returned by\n aws_s3_meta_request_pause() can be provided here.\n Note: If PutObject request specifies a checksum algorithm, client will calculate checksums while skipping parts\n from the buffer and compare them them to previously uploaded part checksums."] pub resume_token : * mut aws_s3_meta_request_resume_token , } # [test] fn bindgen_test_layout_aws_s3_meta_request_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_meta_request_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_meta_request_options > () , 136usize , concat ! ("Size of: " , stringify ! (aws_s3_meta_request_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_meta_request_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_meta_request_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . type_) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (type_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . signing_config) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (signing_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . message) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (message))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . send_filepath) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (send_filepath))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . send_async_stream) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (send_async_stream))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . checksum_config) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (checksum_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_data) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . headers_callback) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (headers_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . body_callback) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (body_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . finish_callback) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (finish_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . progress_callback) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (progress_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . telemetry_callback) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (telemetry_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . upload_review_callback) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (upload_review_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoint) as usize - ptr as usize } , 120usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (endpoint))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . resume_token) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_options) , "::" , stringify ! (resume_token))) ; } impl Default for aws_s3_meta_request_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_meta_request_result { pub error_response_headers : * mut aws_http_headers , pub error_response_body : * mut aws_byte_buf , pub response_status : :: libc :: c_int , pub did_validate : bool , pub validation_algorithm : aws_s3_checksum_algorithm , pub error_code : :: libc :: c_int , } # [test] fn bindgen_test_layout_aws_s3_meta_request_result () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_meta_request_result > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_meta_request_result > () , 32usize , concat ! ("Size of: " , stringify ! (aws_s3_meta_request_result))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_meta_request_result > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_meta_request_result))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_response_headers) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (error_response_headers))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_response_body) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (error_response_body))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . response_status) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (response_status))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . did_validate) as usize - ptr as usize } , 20usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (did_validate))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . validation_algorithm) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (validation_algorithm))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . error_code) as usize - ptr as usize } , 28usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_result) , "::" , stringify ! (error_code))) ; } impl Default for aws_s3_meta_request_result { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_s3_client_new (allocator : * mut aws_allocator , client_config : * const aws_s3_client_config) -> * mut aws_s3_client ; } extern "C" { # [doc = " Add a reference, keeping this object alive.\n The reference must be released when you are done with it, or it's memory will never be cleaned up.\n You must not pass in NULL.\n Always returns the same pointer that was passed in."] pub fn aws_s3_client_acquire (client : * mut aws_s3_client) -> * mut aws_s3_client ; } extern "C" { # [doc = " Release a reference.\n When the reference count drops to 0, this object will be cleaned up.\n It's OK to pass in NULL (nothing happens).\n Always returns NULL."] pub fn aws_s3_client_release (client : * mut aws_s3_client) -> * mut aws_s3_client ; } extern "C" { pub fn aws_s3_client_make_meta_request (client : * mut aws_s3_client , options : * const aws_s3_meta_request_options) -> * mut aws_s3_meta_request ; } extern "C" { # [doc = " Increment the flow-control window, so that response data continues downloading.\n\n If the client was created with `enable_read_backpressure` set true,\n each meta request has a flow-control window that shrinks as response\n body data is downloaded (headers do not affect the size of the window).\n The client's `initial_read_window` determines the starting size of each meta request's window.\n If a meta request's flow-control window reaches 0, no further data will be downloaded.\n If the `initial_read_window` is 0, the request will not start until the window is incremented.\n Maintain a larger window to keep up a high download throughput,\n parts cannot download in parallel unless the window is large enough to hold multiple parts.\n Maintain a smaller window to limit the amount of data buffered in memory.\n\n If `enable_read_backpressure` is false this call will have no effect,\n no backpressure is being applied and data is being downloaded as fast as possible.\n\n WARNING: This feature is experimental.\n Currently, backpressure is only applied to GetObject requests which are split into multiple parts,\n and you may still receive some data after the window reaches 0."] pub fn aws_s3_meta_request_increment_read_window (meta_request : * mut aws_s3_meta_request , bytes : u64) ; } extern "C" { pub fn aws_s3_meta_request_cancel (meta_request : * mut aws_s3_meta_request) ; } extern "C" { # [doc = " Note: pause is currently only supported on upload requests.\n In order to pause an ongoing upload, call aws_s3_meta_request_pause() that\n will return resume token. Token can be used to query the state of operation\n at the pausing time.\n To resume an upload that was paused, supply resume token in the meta\n request options structure member aws_s3_meta_request_options.resume_token.\n The upload can be resumed either from the same client or a different one.\n Corner cases for resume upload are as follows:\n - upload is not MPU - fail with AWS_ERROR_UNSUPPORTED_OPERATION\n - pausing before MPU is created - NULL resume token returned. NULL resume\n token is equivalent to restarting upload\n - pausing in the middle of part transfer - return resume token. scheduling of\n new part uploads stops.\n - pausing after completeMPU started - return resume token. if s3 cannot find\n find associated MPU id when resuming with that token and num of parts\n uploaded equals to total num parts, then operation is a no op. Otherwise\n operation fails.\n Note: for no op case the call will succeed and finish/shutdown request callbacks will\n fire, but on headers callback will not fire.\n Note: similar to cancel pause does not cancel requests already in flight and\n and parts might complete after pause is requested.\n @param meta_request pointer to the aws_s3_meta_request of the upload to be paused\n @param resume_token resume token\n @return either AWS_OP_ERR or AWS_OP_SUCCESS"] pub fn aws_s3_meta_request_pause (meta_request : * mut aws_s3_meta_request , out_resume_token : * mut * mut aws_s3_meta_request_resume_token) -> :: libc :: c_int ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_upload_resume_token_options { pub upload_id : aws_byte_cursor , pub part_size : u64 , pub total_num_parts : usize , # [doc = " Optional.\n\n Note: during resume num_parts_uploaded is used for sanity checking against\n uploads on s3 side.\n In cases where upload id does not exist (already resumed using this token\n or pause called after upload completes, etc...) and num_parts_uploaded\n equals to total num parts, resume will become a noop."] pub num_parts_completed : usize , } # [test] fn bindgen_test_layout_aws_s3_upload_resume_token_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_upload_resume_token_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_upload_resume_token_options > () , 40usize , concat ! ("Size of: " , stringify ! (aws_s3_upload_resume_token_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_upload_resume_token_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_upload_resume_token_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . upload_id) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_resume_token_options) , "::" , stringify ! (upload_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_size) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_resume_token_options) , "::" , stringify ! (part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . total_num_parts) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_resume_token_options) , "::" , stringify ! (total_num_parts))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_parts_completed) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_upload_resume_token_options) , "::" , stringify ! (num_parts_completed))) ; } impl Default for aws_s3_upload_resume_token_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Create upload resume token from persisted data.\n Note: Data required for resume token varies per operation."] pub fn aws_s3_meta_request_resume_token_new_upload (allocator : * mut aws_allocator , options : * const aws_s3_upload_resume_token_options) -> * mut aws_s3_meta_request_resume_token ; } extern "C" { pub fn aws_s3_meta_request_resume_token_acquire (resume_token : * mut aws_s3_meta_request_resume_token) -> * mut aws_s3_meta_request_resume_token ; } extern "C" { pub fn aws_s3_meta_request_resume_token_release (resume_token : * mut aws_s3_meta_request_resume_token) -> * mut aws_s3_meta_request_resume_token ; } extern "C" { pub fn aws_s3_meta_request_resume_token_type (resume_token : * mut aws_s3_meta_request_resume_token) -> aws_s3_meta_request_type ; } extern "C" { pub fn aws_s3_meta_request_resume_token_part_size (resume_token : * mut aws_s3_meta_request_resume_token) -> u64 ; } extern "C" { pub fn aws_s3_meta_request_resume_token_total_num_parts (resume_token : * mut aws_s3_meta_request_resume_token) -> usize ; } extern "C" { pub fn aws_s3_meta_request_resume_token_num_parts_completed (resume_token : * mut aws_s3_meta_request_resume_token) -> usize ; } extern "C" { pub fn aws_s3_meta_request_resume_token_upload_id (resume_token : * mut aws_s3_meta_request_resume_token) -> aws_byte_cursor ; } extern "C" { # [doc = " Add a reference, keeping this object alive.\n The reference must be released when you are done with it, or it's memory will never be cleaned up.\n You must not pass in NULL.\n Always returns the same pointer that was passed in."] pub fn aws_s3_meta_request_acquire (meta_request : * mut aws_s3_meta_request) -> * mut aws_s3_meta_request ; } extern "C" { # [doc = " Release a reference.\n When the reference count drops to 0, this object will be cleaned up.\n It's OK to pass in NULL (nothing happens).\n Always returns NULL."] pub fn aws_s3_meta_request_release (meta_request : * mut aws_s3_meta_request) -> * mut aws_s3_meta_request ; } extern "C" { # [doc = " Initialize the configuration for a default S3 signing."] pub fn aws_s3_init_default_signing_config (signing_config : * mut aws_signing_config_aws , region : aws_byte_cursor , credentials_provider : * mut aws_credentials_provider) ; } extern "C" { # [doc = " Add a reference, keeping this object alive.\n The reference must be released when you are done with it, or it's memory will never be cleaned up.\n Always returns the same pointer that was passed in."] pub fn aws_s3_request_metrics_acquire (metrics : * mut aws_s3_request_metrics) -> * mut aws_s3_request_metrics ; } extern "C" { # [doc = " Release a reference.\n When the reference count drops to 0, this object will be cleaned up.\n It's OK to pass in NULL (nothing happens).\n Always returns NULL."] pub fn aws_s3_request_metrics_release (metrics : * mut aws_s3_request_metrics) -> * mut aws_s3_request_metrics ; } extern "C" { # [doc = " Getters for s3 request metrics ************************************************/\n/**\n Get the request ID from aws_s3_request_metrics.\n If unavailable, AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE will be raised.\n If available, out_request_id will be set to a string. Be warned this string's lifetime is tied to the metrics\n object."] pub fn aws_s3_request_metrics_get_request_id (metrics : * const aws_s3_request_metrics , out_request_id : * mut * const aws_string) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_start_timestamp_ns (metrics : * const aws_s3_request_metrics , out_start_time : * mut u64) ; } extern "C" { pub fn aws_s3_request_metrics_get_end_timestamp_ns (metrics : * const aws_s3_request_metrics , out_end_time : * mut u64) ; } extern "C" { pub fn aws_s3_request_metrics_get_total_duration_ns (metrics : * const aws_s3_request_metrics , out_total_duration : * mut u64) ; } extern "C" { pub fn aws_s3_request_metrics_get_send_start_timestamp_ns (metrics : * const aws_s3_request_metrics , out_send_start_time : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_send_end_timestamp_ns (metrics : * const aws_s3_request_metrics , out_send_end_time : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_sending_duration_ns (metrics : * const aws_s3_request_metrics , out_sending_duration : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_receive_start_timestamp_ns (metrics : * const aws_s3_request_metrics , out_receive_start_time : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_receive_end_timestamp_ns (metrics : * const aws_s3_request_metrics , out_receive_end_time : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_receiving_duration_ns (metrics : * const aws_s3_request_metrics , out_receiving_duration : * mut u64) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_response_status_code (metrics : * const aws_s3_request_metrics , out_response_status : * mut :: libc :: c_int) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_response_headers (metrics : * const aws_s3_request_metrics , out_response_headers : * mut * mut aws_http_headers) -> :: libc :: c_int ; } extern "C" { # [doc = " Get the path and query of the request.\n If unavailable, AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE will be raised.\n If available, out_request_path_query will be set to a string. Be warned this string's lifetime is tied to the metrics\n object."] pub fn aws_s3_request_metrics_get_request_path_query (metrics : * const aws_s3_request_metrics , out_request_path_query : * mut * const aws_string) ; } extern "C" { # [doc = " Get the host_address of the request.\n If unavailable, AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE will be raised.\n If available, out_host_address will be set to a string. Be warned this string's lifetime is tied to the metrics\n object."] pub fn aws_s3_request_metrics_get_host_address (metrics : * const aws_s3_request_metrics , out_host_address : * mut * const aws_string) ; } extern "C" { # [doc = " Get the IP address of the request connected to.\n If unavailable, AWS_ERROR_S3_METRIC_DATA_NOT_AVAILABLE will be raised.\n If available, out_ip_address will be set to a string. Be warned this string's lifetime is tied to the metrics object."] pub fn aws_s3_request_metrics_get_ip_address (metrics : * const aws_s3_request_metrics , out_ip_address : * mut * const aws_string) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_connection_id (metrics : * const aws_s3_request_metrics , out_connection_id : * mut usize) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_thread_id (metrics : * const aws_s3_request_metrics , out_thread_id : * mut aws_thread_id_t) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_request_stream_id (metrics : * const aws_s3_request_metrics , out_stream_id : * mut u32) -> :: libc :: c_int ; } extern "C" { pub fn aws_s3_request_metrics_get_request_type (metrics : * const aws_s3_request_metrics , out_request_type : * mut aws_s3_request_type) ; } extern "C" { pub fn aws_s3_request_metrics_get_error_code (metrics : * const aws_s3_request_metrics) -> :: libc :: c_int ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_endpoints_request_context { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_endpoints_rule_engine { _unused : [u8 ; 0] , } extern "C" { # [doc = " Creates a new S3 endpoint resolver.\n Warning: Before using this header, you have to enable it by\n setting cmake config AWS_ENABLE_S3_ENDPOINT_RESOLVER=ON"] pub fn aws_s3_endpoint_resolver_new (allocator : * mut aws_allocator) -> * mut aws_endpoints_rule_engine ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_endpoints_ruleset { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_partitions_config { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_endpoints_parameter { _unused : [u8 ; 0] , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_endpoints_resolved_endpoint { _unused : [u8 ; 0] , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_endpoints_parameter_type { AWS_ENDPOINTS_PARAMETER_STRING = 0 , AWS_ENDPOINTS_PARAMETER_BOOLEAN = 1 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_endpoints_resolved_endpoint_type { AWS_ENDPOINTS_RESOLVED_ENDPOINT = 0 , AWS_ENDPOINTS_RESOLVED_ERROR = 1 , } extern "C" { pub fn aws_endpoints_get_supported_ruleset_version () -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_parameter_get_type (parameter : * const aws_endpoints_parameter) -> aws_endpoints_parameter_type ; } extern "C" { pub fn aws_endpoints_parameter_get_built_in (parameter : * const aws_endpoints_parameter) -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_parameter_get_default_string (parameter : * const aws_endpoints_parameter , out_cursor : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_parameter_get_default_boolean (parameter : * const aws_endpoints_parameter , out_bool : * mut * const bool) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_parameter_get_is_required (parameter : * const aws_endpoints_parameter) -> bool ; } extern "C" { pub fn aws_endpoints_parameter_get_documentation (parameter : * const aws_endpoints_parameter) -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_parameters_get_is_deprecated (parameter : * const aws_endpoints_parameter) -> bool ; } extern "C" { pub fn aws_endpoints_parameter_get_deprecated_message (parameter : * const aws_endpoints_parameter) -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_parameter_get_deprecated_since (parameter : * const aws_endpoints_parameter) -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_ruleset_new_from_string (allocator : * mut aws_allocator , ruleset_json : aws_byte_cursor) -> * mut aws_endpoints_ruleset ; } extern "C" { pub fn aws_endpoints_ruleset_acquire (ruleset : * mut aws_endpoints_ruleset) -> * mut aws_endpoints_ruleset ; } extern "C" { pub fn aws_endpoints_ruleset_release (ruleset : * mut aws_endpoints_ruleset) -> * mut aws_endpoints_ruleset ; } extern "C" { pub fn aws_endpoints_ruleset_get_parameters (ruleset : * mut aws_endpoints_ruleset) -> * const aws_hash_table ; } extern "C" { pub fn aws_endpoints_ruleset_get_version (ruleset : * const aws_endpoints_ruleset) -> aws_byte_cursor ; } extern "C" { pub fn aws_endpoints_ruleset_get_service_id (ruleset : * const aws_endpoints_ruleset) -> aws_byte_cursor ; } extern "C" { # [doc = " Create new rule engine for a given ruleset.\n In cases of failure NULL is returned and last error is set."] pub fn aws_endpoints_rule_engine_new (allocator : * mut aws_allocator , ruleset : * mut aws_endpoints_ruleset , partitions_config : * mut aws_partitions_config) -> * mut aws_endpoints_rule_engine ; } extern "C" { pub fn aws_endpoints_rule_engine_acquire (rule_engine : * mut aws_endpoints_rule_engine) -> * mut aws_endpoints_rule_engine ; } extern "C" { pub fn aws_endpoints_rule_engine_release (rule_engine : * mut aws_endpoints_rule_engine) -> * mut aws_endpoints_rule_engine ; } extern "C" { pub fn aws_endpoints_request_context_new (allocator : * mut aws_allocator) -> * mut aws_endpoints_request_context ; } extern "C" { pub fn aws_endpoints_request_context_acquire (request_context : * mut aws_endpoints_request_context) -> * mut aws_endpoints_request_context ; } extern "C" { pub fn aws_endpoints_request_context_release (request_context : * mut aws_endpoints_request_context) -> * mut aws_endpoints_request_context ; } extern "C" { pub fn aws_endpoints_request_context_add_string (allocator : * mut aws_allocator , context : * mut aws_endpoints_request_context , name : aws_byte_cursor , value : aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_request_context_add_boolean (allocator : * mut aws_allocator , context : * mut aws_endpoints_request_context , name : aws_byte_cursor , value : bool) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_rule_engine_resolve (engine : * mut aws_endpoints_rule_engine , context : * const aws_endpoints_request_context , out_resolved_endpoint : * mut * mut aws_endpoints_resolved_endpoint) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_acquire (resolved_endpoint : * mut aws_endpoints_resolved_endpoint) -> * mut aws_endpoints_resolved_endpoint ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_release (resolved_endpoint : * mut aws_endpoints_resolved_endpoint) -> * mut aws_endpoints_resolved_endpoint ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_get_type (resolved_endpoint : * const aws_endpoints_resolved_endpoint) -> aws_endpoints_resolved_endpoint_type ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_get_url (resolved_endpoint : * const aws_endpoints_resolved_endpoint , out_url : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_get_properties (resolved_endpoint : * const aws_endpoints_resolved_endpoint , out_properties : * mut aws_byte_cursor) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_get_headers (resolved_endpoint : * const aws_endpoints_resolved_endpoint , out_headers : * mut * const aws_hash_table) -> :: libc :: c_int ; } extern "C" { pub fn aws_endpoints_resolved_endpoint_get_error (resolved_endpoint : * const aws_endpoints_resolved_endpoint , out_error : * mut aws_byte_cursor) -> :: libc :: c_int ; } # [repr (C)] pub struct aws_mutex { pub mutex_handle : pthread_mutex_t , pub initialized : bool , } # [test] fn bindgen_test_layout_aws_mutex () { const UNINIT : :: std :: mem :: MaybeUninit < aws_mutex > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_mutex > () , 48usize , concat ! ("Size of: " , stringify ! (aws_mutex))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_mutex > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_mutex))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . mutex_handle) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_mutex) , "::" , stringify ! (mutex_handle))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initialized) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_mutex) , "::" , stringify ! (initialized))) ; } impl Default for aws_mutex { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Initializes a new platform instance of mutex."] pub fn aws_mutex_init (mutex : * mut aws_mutex) -> :: libc :: c_int ; } extern "C" { # [doc = " Cleans up internal resources."] pub fn aws_mutex_clean_up (mutex : * mut aws_mutex) ; } extern "C" { # [doc = " Blocks until it acquires the lock. While on some platforms such as Windows,\n this may behave as a reentrant mutex, you should not treat it like one. On\n platforms it is possible for it to be non-reentrant, it will be."] pub fn aws_mutex_lock (mutex : * mut aws_mutex) -> :: libc :: c_int ; } extern "C" { # [doc = " Attempts to acquire the lock but returns immediately if it can not.\n While on some platforms such as Windows, this may behave as a reentrant mutex,\n you should not treat it like one. On platforms it is possible for it to be non-reentrant, it will be.\n Note: For windows, minimum support server version is Windows Server 2008 R2 [desktop apps | UWP apps]"] pub fn aws_mutex_try_lock (mutex : * mut aws_mutex) -> :: libc :: c_int ; } extern "C" { # [doc = " Releases the lock."] pub fn aws_mutex_unlock (mutex : * mut aws_mutex) -> :: libc :: c_int ; } # [repr (i32)] # [non_exhaustive] # [doc = " Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n SPDX-License-Identifier: Apache-2.0."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_status_code { AWS_HTTP_STATUS_CODE_UNKNOWN = - 1 , AWS_HTTP_STATUS_CODE_100_CONTINUE = 100 , AWS_HTTP_STATUS_CODE_101_SWITCHING_PROTOCOLS = 101 , AWS_HTTP_STATUS_CODE_102_PROCESSING = 102 , AWS_HTTP_STATUS_CODE_103_EARLY_HINTS = 103 , AWS_HTTP_STATUS_CODE_200_OK = 200 , AWS_HTTP_STATUS_CODE_201_CREATED = 201 , AWS_HTTP_STATUS_CODE_202_ACCEPTED = 202 , AWS_HTTP_STATUS_CODE_203_NON_AUTHORITATIVE_INFORMATION = 203 , AWS_HTTP_STATUS_CODE_204_NO_CONTENT = 204 , AWS_HTTP_STATUS_CODE_205_RESET_CONTENT = 205 , AWS_HTTP_STATUS_CODE_206_PARTIAL_CONTENT = 206 , AWS_HTTP_STATUS_CODE_207_MULTI_STATUS = 207 , AWS_HTTP_STATUS_CODE_208_ALREADY_REPORTED = 208 , AWS_HTTP_STATUS_CODE_226_IM_USED = 226 , AWS_HTTP_STATUS_CODE_300_MULTIPLE_CHOICES = 300 , AWS_HTTP_STATUS_CODE_301_MOVED_PERMANENTLY = 301 , AWS_HTTP_STATUS_CODE_302_FOUND = 302 , AWS_HTTP_STATUS_CODE_303_SEE_OTHER = 303 , AWS_HTTP_STATUS_CODE_304_NOT_MODIFIED = 304 , AWS_HTTP_STATUS_CODE_305_USE_PROXY = 305 , AWS_HTTP_STATUS_CODE_307_TEMPORARY_REDIRECT = 307 , AWS_HTTP_STATUS_CODE_308_PERMANENT_REDIRECT = 308 , AWS_HTTP_STATUS_CODE_400_BAD_REQUEST = 400 , AWS_HTTP_STATUS_CODE_401_UNAUTHORIZED = 401 , AWS_HTTP_STATUS_CODE_402_PAYMENT_REQUIRED = 402 , AWS_HTTP_STATUS_CODE_403_FORBIDDEN = 403 , AWS_HTTP_STATUS_CODE_404_NOT_FOUND = 404 , AWS_HTTP_STATUS_CODE_405_METHOD_NOT_ALLOWED = 405 , AWS_HTTP_STATUS_CODE_406_NOT_ACCEPTABLE = 406 , AWS_HTTP_STATUS_CODE_407_PROXY_AUTHENTICATION_REQUIRED = 407 , AWS_HTTP_STATUS_CODE_408_REQUEST_TIMEOUT = 408 , AWS_HTTP_STATUS_CODE_409_CONFLICT = 409 , AWS_HTTP_STATUS_CODE_410_GONE = 410 , AWS_HTTP_STATUS_CODE_411_LENGTH_REQUIRED = 411 , AWS_HTTP_STATUS_CODE_412_PRECONDITION_FAILED = 412 , AWS_HTTP_STATUS_CODE_413_REQUEST_ENTITY_TOO_LARGE = 413 , AWS_HTTP_STATUS_CODE_414_REQUEST_URI_TOO_LONG = 414 , AWS_HTTP_STATUS_CODE_415_UNSUPPORTED_MEDIA_TYPE = 415 , AWS_HTTP_STATUS_CODE_416_REQUESTED_RANGE_NOT_SATISFIABLE = 416 , AWS_HTTP_STATUS_CODE_417_EXPECTATION_FAILED = 417 , AWS_HTTP_STATUS_CODE_421_MISDIRECTED_REQUEST = 421 , AWS_HTTP_STATUS_CODE_422_UNPROCESSABLE_ENTITY = 422 , AWS_HTTP_STATUS_CODE_423_LOCKED = 423 , AWS_HTTP_STATUS_CODE_424_FAILED_DEPENDENCY = 424 , AWS_HTTP_STATUS_CODE_425_TOO_EARLY = 425 , AWS_HTTP_STATUS_CODE_426_UPGRADE_REQUIRED = 426 , AWS_HTTP_STATUS_CODE_428_PRECONDITION_REQUIRED = 428 , AWS_HTTP_STATUS_CODE_429_TOO_MANY_REQUESTS = 429 , AWS_HTTP_STATUS_CODE_431_REQUEST_HEADER_FIELDS_TOO_LARGE = 431 , AWS_HTTP_STATUS_CODE_451_UNAVAILABLE_FOR_LEGAL_REASON = 451 , AWS_HTTP_STATUS_CODE_500_INTERNAL_SERVER_ERROR = 500 , AWS_HTTP_STATUS_CODE_501_NOT_IMPLEMENTED = 501 , AWS_HTTP_STATUS_CODE_502_BAD_GATEWAY = 502 , AWS_HTTP_STATUS_CODE_503_SERVICE_UNAVAILABLE = 503 , AWS_HTTP_STATUS_CODE_504_GATEWAY_TIMEOUT = 504 , AWS_HTTP_STATUS_CODE_505_HTTP_VERSION_NOT_SUPPORTED = 505 , AWS_HTTP_STATUS_CODE_506_VARIANT_ALSO_NEGOTIATES = 506 , AWS_HTTP_STATUS_CODE_507_INSUFFICIENT_STORAGE = 507 , AWS_HTTP_STATUS_CODE_508_LOOP_DETECTED = 508 , AWS_HTTP_STATUS_CODE_510_NOT_EXTENDED = 510 , AWS_HTTP_STATUS_CODE_511_NETWORK_AUTHENTICATION_REQUIRED = 511 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_config { _unused : [u8 ; 0] , } # [repr (u32)] # [non_exhaustive] # [doc = " @Deprecated - Supported proxy authentication modes. Superceded by proxy strategy."] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_proxy_authentication_type { AWS_HPAT_NONE = 0 , AWS_HPAT_BASIC = 1 , } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_proxy_env_var_type { # [doc = " Default.\n Disable reading from environment variable for proxy."] AWS_HPEV_DISABLE = 0 , # [doc = " Enable get proxy URL from environment variable, when the manual proxy options of connection manager is not set.\n env HTTPS_PROXY/https_proxy will be checked when the main connection use tls.\n env HTTP_PROXY/http_proxy will be checked when the main connection NOT use tls.\n The lower case version has precedence."] AWS_HPEV_ENABLE = 1 , } # [repr (u32)] # [non_exhaustive] # [doc = " Supported proxy connection types"] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_proxy_connection_type { # [doc = " Deprecated, but 0-valued for backwards compatibility\n\n If tls options are provided (for the main connection) then treat the proxy as a tunneling proxy\n If tls options are not provided (for the main connection), then treat the proxy as a forwarding proxy"] AWS_HPCT_HTTP_LEGACY = 0 , # [doc = " Use the proxy to forward http requests. Attempting to use both this mode and TLS on the tunnel destination\n is a configuration error."] AWS_HPCT_HTTP_FORWARD = 1 , # [doc = " Use the proxy to establish a connection to a remote endpoint via a CONNECT request through the proxy.\n Works for both plaintext and tls connections."] AWS_HPCT_HTTP_TUNNEL = 2 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct proxy_env_var_settings { pub env_var_type : aws_http_proxy_env_var_type , pub connection_type : aws_http_proxy_connection_type , pub tls_options : * const aws_tls_connection_options , } # [test] fn bindgen_test_layout_proxy_env_var_settings () { const UNINIT : :: std :: mem :: MaybeUninit < proxy_env_var_settings > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < proxy_env_var_settings > () , 16usize , concat ! ("Size of: " , stringify ! (proxy_env_var_settings))) ; assert_eq ! (:: std :: mem :: align_of :: < proxy_env_var_settings > () , 8usize , concat ! ("Alignment of " , stringify ! (proxy_env_var_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . env_var_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (proxy_env_var_settings) , "::" , stringify ! (env_var_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connection_type) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (proxy_env_var_settings) , "::" , stringify ! (connection_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_options) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (proxy_env_var_settings) , "::" , stringify ! (tls_options))) ; } impl Default for proxy_env_var_settings { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Options for http proxy server usage"] # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_options { # [doc = " Type of proxy connection to make"] pub connection_type : aws_http_proxy_connection_type , # [doc = " Proxy host to connect to"] pub host : aws_byte_cursor , # [doc = " Port to make the proxy connection to"] pub port : u16 , # [doc = " Optional.\n TLS configuration for the Local <-> Proxy connection\n Must be distinct from the the TLS options in the parent aws_http_connection_options struct"] pub tls_options : * const aws_tls_connection_options , # [doc = " Optional\n Advanced option that allows the user to create a custom strategy that gives low-level control of\n certain logical flows within the proxy logic.\n\n For tunneling proxies it allows custom retry and adaptive negotiation of CONNECT requests.\n For forwarding proxies it allows custom request transformations."] pub proxy_strategy : * mut aws_http_proxy_strategy , # [doc = " @Deprecated - What type of proxy authentication to use, if any.\n Replaced by instantiating a proxy_strategy"] pub auth_type : aws_http_proxy_authentication_type , # [doc = " @Deprecated - Optional user name to use for basic authentication\n Replaced by instantiating a proxy_strategy via aws_http_proxy_strategy_new_basic_auth()"] pub auth_username : aws_byte_cursor , # [doc = " @Deprecated - Optional password to use for basic authentication\n Replaced by instantiating a proxy_strategy via aws_http_proxy_strategy_new_basic_auth()"] pub auth_password : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_http_proxy_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_options > () , 88usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connection_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (connection_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (host))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_options) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (tls_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_strategy) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (proxy_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . auth_type) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (auth_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . auth_username) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (auth_username))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . auth_password) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_options) , "::" , stringify ! (auth_password))) ; } impl Default for aws_http_proxy_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " Synchronous (for now) callback function to fetch a token used in modifying CONNECT requests"] pub type aws_http_proxy_negotiation_get_token_sync_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void , out_error_code : * mut :: libc :: c_int) -> * mut aws_string > ; # [doc = " Synchronous (for now) callback function to fetch a token used in modifying CONNECT request. Includes a (byte string)\n context intended to be used as part of a challenge-response flow."] pub type aws_http_proxy_negotiation_get_challenge_token_sync_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void , challenge_context : * const aws_byte_cursor , out_error_code : * mut :: libc :: c_int) -> * mut aws_string > ; # [doc = " Proxy negotiation logic must call this function to indicate an unsuccessful outcome"] pub type aws_http_proxy_negotiation_terminate_fn = :: std :: option :: Option < unsafe extern "C" fn (message : * mut aws_http_message , error_code : :: libc :: c_int , internal_proxy_user_data : * mut :: libc :: c_void) > ; # [doc = " Proxy negotiation logic must call this function to forward the potentially-mutated request back to the proxy\n connection logic."] pub type aws_http_proxy_negotiation_http_request_forward_fn = :: std :: option :: Option < unsafe extern "C" fn (message : * mut aws_http_message , internal_proxy_user_data : * mut :: libc :: c_void) > ; # [doc = " User-supplied transform callback which implements the proxy request flow and ultimately, across all execution\n pathways, invokes either the terminate function or the forward function appropriately.\n\n For tunneling proxy connections, this request flow transform only applies to the CONNECT stage of proxy\n connection establishment.\n\n For forwarding proxy connections, this request flow transform applies to every single http request that goes\n out on the connection.\n\n Forwarding proxy connections cannot yet support a truly async request transform without major surgery on http\n stream creation, so for now, we split into an async version (for tunneling proxies) and a separate\n synchronous version for forwarding proxies. Also forwarding proxies are a kind of legacy dead-end in some\n sense.\n"] pub type aws_http_proxy_negotiation_http_request_transform_async_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator , message : * mut aws_http_message , negotiation_termination_callback : aws_http_proxy_negotiation_terminate_fn , negotiation_http_request_forward_callback : aws_http_proxy_negotiation_http_request_forward_fn , internal_proxy_user_data : * mut :: libc :: c_void) > ; pub type aws_http_proxy_negotiation_http_request_transform_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator , message : * mut aws_http_message) -> :: libc :: c_int > ; # [doc = " Tunneling proxy connections only. A callback that lets the negotiator examine the headers in the\n response to the most recent CONNECT request as they arrive."] pub type aws_http_proxy_negotiation_connect_on_incoming_headers_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator , header_block : aws_http_header_block , header_array : * const aws_http_header , num_headers : usize) -> :: libc :: c_int > ; # [doc = " Tunneling proxy connections only. A callback that lets the negotiator examine the status code of the\n response to the most recent CONNECT request."] pub type aws_http_proxy_negotiator_connect_status_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator , status_code : aws_http_status_code) -> :: libc :: c_int > ; # [doc = " Tunneling proxy connections only. A callback that lets the negotiator examine the body of the response\n to the most recent CONNECT request."] pub type aws_http_proxy_negotiator_connect_on_incoming_body_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator , data : * const aws_byte_cursor) -> :: libc :: c_int > ; # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_http_proxy_negotiation_retry_directive { AWS_HPNRD_STOP = 0 , AWS_HPNRD_NEW_CONNECTION = 1 , AWS_HPNRD_CURRENT_CONNECTION = 2 , } pub type aws_http_proxy_negotiator_get_retry_directive_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_negotiator : * mut aws_http_proxy_negotiator) -> aws_http_proxy_negotiation_retry_directive > ; # [doc = " Vtable for forwarding-based proxy negotiators"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http_proxy_negotiator_forwarding_vtable { pub forward_request_transform : aws_http_proxy_negotiation_http_request_transform_fn , } # [test] fn bindgen_test_layout_aws_http_proxy_negotiator_forwarding_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_negotiator_forwarding_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_negotiator_forwarding_vtable > () , 8usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_negotiator_forwarding_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_negotiator_forwarding_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_negotiator_forwarding_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . forward_request_transform) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_forwarding_vtable) , "::" , stringify ! (forward_request_transform))) ; } # [doc = " Vtable for tunneling-based proxy negotiators"] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http_proxy_negotiator_tunnelling_vtable { pub connect_request_transform : aws_http_proxy_negotiation_http_request_transform_async_fn , pub on_incoming_headers_callback : aws_http_proxy_negotiation_connect_on_incoming_headers_fn , pub on_status_callback : aws_http_proxy_negotiator_connect_status_fn , pub on_incoming_body_callback : aws_http_proxy_negotiator_connect_on_incoming_body_fn , pub get_retry_directive : aws_http_proxy_negotiator_get_retry_directive_fn , } # [test] fn bindgen_test_layout_aws_http_proxy_negotiator_tunnelling_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_negotiator_tunnelling_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_negotiator_tunnelling_vtable > () , 40usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_negotiator_tunnelling_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connect_request_transform) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable) , "::" , stringify ! (connect_request_transform))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_incoming_headers_callback) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable) , "::" , stringify ! (on_incoming_headers_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_status_callback) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable) , "::" , stringify ! (on_status_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . on_incoming_body_callback) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable) , "::" , stringify ! (on_incoming_body_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_retry_directive) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator_tunnelling_vtable) , "::" , stringify ! (get_retry_directive))) ; } # [repr (C)] # [derive (Copy , Clone)] pub struct aws_http_proxy_negotiator { pub ref_count : aws_ref_count , pub impl_ : * mut :: libc :: c_void , pub strategy_vtable : aws_http_proxy_negotiator__bindgen_ty_1 , } # [repr (C)] # [derive (Copy , Clone)] pub union aws_http_proxy_negotiator__bindgen_ty_1 { pub forwarding_vtable : * mut aws_http_proxy_negotiator_forwarding_vtable , pub tunnelling_vtable : * mut aws_http_proxy_negotiator_tunnelling_vtable , } # [test] fn bindgen_test_layout_aws_http_proxy_negotiator__bindgen_ty_1 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_negotiator__bindgen_ty_1 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_negotiator__bindgen_ty_1 > () , 8usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_negotiator__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_negotiator__bindgen_ty_1 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_negotiator__bindgen_ty_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . forwarding_vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator__bindgen_ty_1) , "::" , stringify ! (forwarding_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tunnelling_vtable) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator__bindgen_ty_1) , "::" , stringify ! (tunnelling_vtable))) ; } impl Default for aws_http_proxy_negotiator__bindgen_ty_1 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [test] fn bindgen_test_layout_aws_http_proxy_negotiator () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_negotiator > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_negotiator > () , 40usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_negotiator))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_negotiator > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_negotiator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . strategy_vtable) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_negotiator) , "::" , stringify ! (strategy_vtable))) ; } impl Default for aws_http_proxy_negotiator { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } pub type aws_http_proxy_strategy_create_negotiator_fn = :: std :: option :: Option < unsafe extern "C" fn (proxy_strategy : * mut aws_http_proxy_strategy , allocator : * mut aws_allocator) -> * mut aws_http_proxy_negotiator > ; # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_http_proxy_strategy_vtable { pub create_negotiator : aws_http_proxy_strategy_create_negotiator_fn , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_vtable > () , 8usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . create_negotiator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_vtable) , "::" , stringify ! (create_negotiator))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy { pub ref_count : aws_ref_count , pub vtable : * mut aws_http_proxy_strategy_vtable , pub impl_ : * mut :: libc :: c_void , pub proxy_connection_type : aws_http_proxy_connection_type , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy > () , 48usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . impl_) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy) , "::" , stringify ! (impl_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_connection_type) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy) , "::" , stringify ! (proxy_connection_type))) ; } impl Default for aws_http_proxy_strategy { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy_basic_auth_options { pub proxy_connection_type : aws_http_proxy_connection_type , pub user_name : aws_byte_cursor , pub password : aws_byte_cursor , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_basic_auth_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_basic_auth_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_basic_auth_options > () , 40usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_basic_auth_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_basic_auth_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_basic_auth_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_connection_type) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_basic_auth_options) , "::" , stringify ! (proxy_connection_type))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . user_name) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_basic_auth_options) , "::" , stringify ! (user_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . password) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_basic_auth_options) , "::" , stringify ! (password))) ; } impl Default for aws_http_proxy_strategy_basic_auth_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy_tunneling_kerberos_options { pub get_token : aws_http_proxy_negotiation_get_token_sync_fn , pub get_token_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_tunneling_kerberos_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_tunneling_kerberos_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_tunneling_kerberos_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_tunneling_kerberos_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_tunneling_kerberos_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_tunneling_kerberos_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_token) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_kerberos_options) , "::" , stringify ! (get_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_token_user_data) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_kerberos_options) , "::" , stringify ! (get_token_user_data))) ; } impl Default for aws_http_proxy_strategy_tunneling_kerberos_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy_tunneling_ntlm_options { pub get_token : aws_http_proxy_negotiation_get_token_sync_fn , pub get_challenge_token : aws_http_proxy_negotiation_get_challenge_token_sync_fn , pub get_challenge_token_user_data : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_tunneling_ntlm_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_tunneling_ntlm_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_tunneling_ntlm_options > () , 24usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_tunneling_ntlm_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_tunneling_ntlm_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_tunneling_ntlm_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_token) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_ntlm_options) , "::" , stringify ! (get_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_challenge_token) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_ntlm_options) , "::" , stringify ! (get_challenge_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_challenge_token_user_data) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_ntlm_options) , "::" , stringify ! (get_challenge_token_user_data))) ; } impl Default for aws_http_proxy_strategy_tunneling_ntlm_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy_tunneling_adaptive_options { pub kerberos_options : * mut aws_http_proxy_strategy_tunneling_kerberos_options , pub ntlm_options : * mut aws_http_proxy_strategy_tunneling_ntlm_options , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_tunneling_adaptive_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_tunneling_adaptive_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_tunneling_adaptive_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_tunneling_adaptive_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_tunneling_adaptive_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_tunneling_adaptive_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . kerberos_options) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_adaptive_options) , "::" , stringify ! (kerberos_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ntlm_options) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_adaptive_options) , "::" , stringify ! (ntlm_options))) ; } impl Default for aws_http_proxy_strategy_tunneling_adaptive_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_http_proxy_strategy_tunneling_sequence_options { pub strategies : * mut * mut aws_http_proxy_strategy , pub strategy_count : u32 , } # [test] fn bindgen_test_layout_aws_http_proxy_strategy_tunneling_sequence_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_http_proxy_strategy_tunneling_sequence_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_http_proxy_strategy_tunneling_sequence_options > () , 16usize , concat ! ("Size of: " , stringify ! (aws_http_proxy_strategy_tunneling_sequence_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_http_proxy_strategy_tunneling_sequence_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_http_proxy_strategy_tunneling_sequence_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . strategies) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_sequence_options) , "::" , stringify ! (strategies))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . strategy_count) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_http_proxy_strategy_tunneling_sequence_options) , "::" , stringify ! (strategy_count))) ; } impl Default for aws_http_proxy_strategy_tunneling_sequence_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { # [doc = " Take a reference to an http proxy negotiator\n @param proxy_negotiator negotiator to take a reference to\n @return the strategy"] pub fn aws_http_proxy_negotiator_acquire (proxy_negotiator : * mut aws_http_proxy_negotiator) -> * mut aws_http_proxy_negotiator ; } extern "C" { # [doc = " Release a reference to an http proxy negotiator\n @param proxy_negotiator negotiator to release a reference to"] pub fn aws_http_proxy_negotiator_release (proxy_negotiator : * mut aws_http_proxy_negotiator) ; } extern "C" { # [doc = " Creates a new proxy negotiator from a proxy strategy\n @param allocator memory allocator to use\n @param strategy strategy to creation a new negotiator for\n @return a new proxy negotiator if successful, otherwise NULL"] pub fn aws_http_proxy_strategy_create_negotiator (strategy : * mut aws_http_proxy_strategy , allocator : * mut aws_allocator) -> * mut aws_http_proxy_negotiator ; } extern "C" { # [doc = " Take a reference to an http proxy strategy\n @param proxy_strategy strategy to take a reference to\n @return the strategy"] pub fn aws_http_proxy_strategy_acquire (proxy_strategy : * mut aws_http_proxy_strategy) -> * mut aws_http_proxy_strategy ; } extern "C" { # [doc = " Release a reference to an http proxy strategy\n @param proxy_strategy strategy to release a reference to"] pub fn aws_http_proxy_strategy_release (proxy_strategy : * mut aws_http_proxy_strategy) ; } extern "C" { # [doc = " A constructor for a proxy strategy that performs basic authentication by adding the appropriate\n header and header value to requests or CONNECT requests.\n\n @param allocator memory allocator to use\n @param config basic authentication configuration info\n @return a new proxy strategy if successfully constructed, otherwise NULL"] pub fn aws_http_proxy_strategy_new_basic_auth (allocator : * mut aws_allocator , config : * mut aws_http_proxy_strategy_basic_auth_options) -> * mut aws_http_proxy_strategy ; } extern "C" { # [doc = " Constructor for an adaptive tunneling proxy strategy. This strategy attempts a vanilla CONNECT and if that\n fails it may make followup CONNECT attempts using kerberos or ntlm tokens, based on configuration and proxy\n response properties.\n\n @param allocator memory allocator to use\n @param config configuration options for the strategy\n @return a new proxy strategy if successfully constructed, otherwise NULL"] pub fn aws_http_proxy_strategy_new_tunneling_adaptive (allocator : * mut aws_allocator , config : * mut aws_http_proxy_strategy_tunneling_adaptive_options) -> * mut aws_http_proxy_strategy ; } extern "C" { # [doc = " Create a persistent proxy configuration from http connection options\n @param allocator memory allocator to use\n @param options http connection options to source proxy configuration from\n @return"] pub fn aws_http_proxy_config_new_from_connection_options (allocator : * mut aws_allocator , options : * const aws_http_client_connection_options) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Create a persistent proxy configuration from http connection manager options\n @param allocator memory allocator to use\n @param options http connection manager options to source proxy configuration from\n @return"] pub fn aws_http_proxy_config_new_from_manager_options (allocator : * mut aws_allocator , options : * const aws_http_connection_manager_options) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Create a persistent proxy configuration from non-persistent proxy options. The resulting\n proxy configuration assumes a tunneling connection type.\n\n @param allocator memory allocator to use\n @param options http proxy options to source proxy configuration from\n @return"] pub fn aws_http_proxy_config_new_tunneling_from_proxy_options (allocator : * mut aws_allocator , options : * const aws_http_proxy_options) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Create a persistent proxy configuration from non-persistent proxy options.\n Legacy connection type of proxy options will be rejected.\n\n @param allocator memory allocator to use\n @param options http proxy options to source proxy configuration from\n @return"] pub fn aws_http_proxy_config_new_from_proxy_options (allocator : * mut aws_allocator , options : * const aws_http_proxy_options) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Create a persistent proxy configuration from non-persistent proxy options.\n\n @param allocator memory allocator to use\n @param options http proxy options to source proxy configuration from\n @param is_tls_connection tls connection info of the main connection to determine connection_type\n when the connection_type is legacy.\n @return"] pub fn aws_http_proxy_config_new_from_proxy_options_with_tls_info (allocator : * mut aws_allocator , proxy_options : * const aws_http_proxy_options , is_tls_connection : bool) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Clones an existing proxy configuration. A refactor could remove this (do a \"move\" between the old and new user\n data in the one spot it's used) but that should wait until we have better test cases for the logic where this\n gets invoked (ntlm/kerberos chains).\n\n @param allocator memory allocator to use\n @param proxy_config http proxy configuration to clone\n @return"] pub fn aws_http_proxy_config_new_clone (allocator : * mut aws_allocator , proxy_config : * const aws_http_proxy_config) -> * mut aws_http_proxy_config ; } extern "C" { # [doc = " Destroys an http proxy configuration\n @param config http proxy configuration to destroy"] pub fn aws_http_proxy_config_destroy (config : * mut aws_http_proxy_config) ; } extern "C" { # [doc = " Initializes non-persistent http proxy options from a persistent http proxy configuration\n @param options http proxy options to initialize\n @param config the http proxy config to use as an initialization source"] pub fn aws_http_proxy_options_init_from_config (options : * mut aws_http_proxy_options , config : * const aws_http_proxy_config) ; } extern "C" { # [doc = " Establish an arbitrary protocol connection through an http proxy via tunneling CONNECT. Alpn is\n not required for this connection process to succeed, but we encourage its use if available.\n\n @param channel_options configuration options for the socket level connection\n @param proxy_options configuration options for the proxy connection\n\n @return AWS_OP_SUCCESS if the asynchronous channel kickoff succeeded, AWS_OP_ERR otherwise"] pub fn aws_http_proxy_new_socket_channel (channel_options : * mut aws_socket_channel_bootstrap_options , proxy_options : * const aws_http_proxy_options) -> :: libc :: c_int ; } # [repr (u32)] # [non_exhaustive] # [derive (Debug , Copy , Clone , Hash , PartialEq , Eq)] pub enum aws_s3_connection_finish_code { AWS_S3_CONNECTION_FINISH_CODE_SUCCESS = 0 , AWS_S3_CONNECTION_FINISH_CODE_FAILED = 1 , AWS_S3_CONNECTION_FINISH_CODE_RETRY = 2 , } pub type aws_s3_endpoint_shutdown_fn = :: std :: option :: Option < unsafe extern "C" fn (user_data : * mut :: libc :: c_void) > ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_endpoint_options { pub host_name : * mut aws_string , pub shutdown_callback : aws_s3_endpoint_shutdown_fn , pub client_bootstrap : * mut aws_client_bootstrap , pub tls_connection_options : * const aws_tls_connection_options , pub dns_host_address_ttl_seconds : usize , pub client : * mut aws_s3_client , pub max_connections : u32 , pub port : u16 , # [doc = " Optional.\n Proxy configuration for http connection."] pub proxy_config : * mut aws_http_proxy_config , # [doc = " Optional.\n Configuration for fetching proxy configuration from environment.\n By Default proxy_ev_settings.aws_http_proxy_env_var_type is set to AWS_HPEV_ENABLE which means read proxy\n configuration from environment.\n Only works when proxy_config is not set. If both are set, configuration from proxy_config is used."] pub proxy_ev_settings : * mut proxy_env_var_settings , # [doc = " Optional.\n If set to 0, default value is used."] pub connect_timeout_ms : u32 , # [doc = " Optional.\n Set keepalive to periodically transmit messages for detecting a disconnected peer."] pub tcp_keep_alive_options : * mut aws_s3_tcp_keep_alive_options , # [doc = " Optional.\n Configuration options for connection monitoring.\n If the transfer speed falls below the specified minimum_throughput_bytes_per_second, the operation is aborted."] pub monitoring_options : * mut aws_http_connection_monitoring_options , } # [test] fn bindgen_test_layout_aws_s3_endpoint_options () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_endpoint_options > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_endpoint_options > () , 96usize , concat ! ("Size of: " , stringify ! (aws_s3_endpoint_options))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_endpoint_options > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_endpoint_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client_bootstrap) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (client_bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_connection_options) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (tls_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . dns_host_address_ttl_seconds) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (dns_host_address_ttl_seconds))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (client))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_connections) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (max_connections))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . port) as usize - ptr as usize } , 52usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (port))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_config) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (proxy_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_settings) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (proxy_ev_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connect_timeout_ms) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (connect_timeout_ms))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tcp_keep_alive_options) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (tcp_keep_alive_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . monitoring_options) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_options) , "::" , stringify ! (monitoring_options))) ; } impl Default for aws_s3_endpoint_options { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_s3_endpoint_system_vtable { pub acquire : :: std :: option :: Option < unsafe extern "C" fn (endpoint : * mut aws_s3_endpoint , already_holding_lock : bool) > , pub release : :: std :: option :: Option < unsafe extern "C" fn (endpoint : * mut aws_s3_endpoint) > , } # [test] fn bindgen_test_layout_aws_s3_endpoint_system_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_endpoint_system_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_endpoint_system_vtable > () , 16usize , concat ! ("Size of: " , stringify ! (aws_s3_endpoint_system_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_endpoint_system_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_endpoint_system_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . acquire) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_system_vtable) , "::" , stringify ! (acquire))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . release) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint_system_vtable) , "::" , stringify ! (release))) ; } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_endpoint { pub client_synced_data : aws_s3_endpoint__bindgen_ty_1 , pub allocator : * mut aws_allocator , pub host_name : * mut aws_string , pub http_connection_manager : * mut aws_http_connection_manager , pub client : * mut aws_s3_client , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_s3_endpoint__bindgen_ty_1 { pub ref_count : usize , } # [test] fn bindgen_test_layout_aws_s3_endpoint__bindgen_ty_1 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_endpoint__bindgen_ty_1 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_endpoint__bindgen_ty_1 > () , 8usize , concat ! ("Size of: " , stringify ! (aws_s3_endpoint__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_endpoint__bindgen_ty_1 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_endpoint__bindgen_ty_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint__bindgen_ty_1) , "::" , stringify ! (ref_count))) ; } # [test] fn bindgen_test_layout_aws_s3_endpoint () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_endpoint > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_endpoint > () , 40usize , concat ! ("Size of: " , stringify ! (aws_s3_endpoint))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_endpoint > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_endpoint))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client_synced_data) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint) , "::" , stringify ! (client_synced_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . host_name) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint) , "::" , stringify ! (host_name))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http_connection_manager) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint) , "::" , stringify ! (http_connection_manager))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_endpoint) , "::" , stringify ! (client))) ; } impl Default for aws_s3_endpoint { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_connection { pub endpoint : * mut aws_s3_endpoint , pub http_connection : * mut aws_http_connection , pub request : * mut aws_s3_request , pub retry_token : * mut aws_retry_token , } # [test] fn bindgen_test_layout_aws_s3_connection () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_connection > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_connection > () , 32usize , concat ! ("Size of: " , stringify ! (aws_s3_connection))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_connection > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_connection))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoint) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_connection) , "::" , stringify ! (endpoint))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . http_connection) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_connection) , "::" , stringify ! (http_connection))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . request) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_connection) , "::" , stringify ! (request))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . retry_token) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_connection) , "::" , stringify ! (retry_token))) ; } impl Default for aws_s3_connection { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_s3_client_vtable { pub meta_request_factory : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client , options : * const aws_s3_meta_request_options) -> * mut aws_s3_meta_request > , pub create_connection_for_request : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client , request : * mut aws_s3_request) > , pub acquire_http_connection : :: std :: option :: Option < unsafe extern "C" fn (conn_manager : * mut aws_http_connection_manager , on_connection_acquired_callback : aws_http_connection_manager_on_connection_setup_fn , user_data : * mut :: libc :: c_void) > , pub get_host_address_count : :: std :: option :: Option < unsafe extern "C" fn (host_resolver : * mut aws_host_resolver , host_name : * const aws_string , flags : u32) -> usize > , pub schedule_process_work_synced : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client) > , pub process_work : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client) > , pub endpoint_shutdown_callback : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client) > , pub finish_destroy : :: std :: option :: Option < unsafe extern "C" fn (client : * mut aws_s3_client) > , } # [test] fn bindgen_test_layout_aws_s3_client_vtable () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client_vtable > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client_vtable > () , 64usize , concat ! ("Size of: " , stringify ! (aws_s3_client_vtable))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client_vtable > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client_vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . meta_request_factory) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (meta_request_factory))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . create_connection_for_request) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (create_connection_for_request))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . acquire_http_connection) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (acquire_http_connection))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . get_host_address_count) as usize - ptr as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (get_host_address_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . schedule_process_work_synced) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (schedule_process_work_synced))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_work) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (process_work))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoint_shutdown_callback) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (endpoint_shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . finish_destroy) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client_vtable) , "::" , stringify ! (finish_destroy))) ; } # [repr (C)] pub struct aws_s3_client { pub allocator : * mut aws_allocator , pub vtable : * mut aws_s3_client_vtable , pub ref_count : aws_ref_count , pub client_bootstrap : * mut aws_client_bootstrap , pub process_work_event_loop : * mut aws_event_loop , pub body_streaming_elg : * mut aws_event_loop_group , pub region : * mut aws_string , pub part_size : usize , pub max_part_size : u64 , pub multipart_upload_threshold : u64 , pub tls_connection_options : * mut aws_tls_connection_options , pub cached_signing_config : * mut aws_cached_signing_config_aws , pub throughput_target_gbps : f64 , pub ideal_vip_count : u32 , # [doc = " For multi-part upload, content-md5 will be calculated if the AWS_MR_CONTENT_MD5_ENABLED is specified\n or initial request has content-md5 header.\n For single-part upload, if the content-md5 header is specified, it will remain unchanged. If the header is not\n specified, and this is set to AWS_MR_CONTENT_MD5_ENABLED, it will be calculated."] pub compute_content_md5 : aws_s3_meta_request_compute_content_md5 , pub max_active_connections_override : u32 , pub max_allowed_connections : aws_atomic_var , pub retry_strategy : * mut aws_retry_strategy , # [doc = " Optional.\n Proxy configuration for http connection."] pub proxy_config : * mut aws_http_proxy_config , # [doc = " Optional.\n Configuration for fetching proxy configuration from environment.\n By Default proxy_ev_settings.aws_http_proxy_env_var_type is set to AWS_HPEV_ENABLE which means read proxy\n configuration from environment.\n Only works when proxy_config is not set. If both are set, configuration from proxy_config is used."] pub proxy_ev_settings : * mut proxy_env_var_settings , # [doc = " Optional.\n If set to 0, default value is used."] pub connect_timeout_ms : u32 , # [doc = " Optional.\n Set keepalive to periodically transmit messages for detecting a disconnected peer."] pub tcp_keep_alive_options : * mut aws_s3_tcp_keep_alive_options , # [doc = " Configuration options for connection monitoring.\n If the transfer speed falls below the specified minimum_throughput_bytes_per_second, the operation is aborted.\n If user passes in NULL, default values are used."] pub monitoring_options : aws_http_connection_monitoring_options , pub proxy_ev_tls_options : * mut aws_tls_connection_options , pub shutdown_callback : aws_s3_client_shutdown_complete_callback_fn , pub shutdown_callback_user_data : * mut :: libc :: c_void , pub enable_read_backpressure : bool , pub initial_read_window : usize , pub stats : aws_s3_client__bindgen_ty_1 , pub synced_data : aws_s3_client__bindgen_ty_2 , pub threaded_data : aws_s3_client__bindgen_ty_3 , } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_client__bindgen_ty_1 { pub num_requests_in_flight : aws_atomic_var , pub num_requests_network_io : [aws_atomic_var ; 4usize] , pub num_requests_stream_queued_waiting : aws_atomic_var , pub num_requests_streaming_response : aws_atomic_var , } # [test] fn bindgen_test_layout_aws_s3_client__bindgen_ty_1 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client__bindgen_ty_1 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client__bindgen_ty_1 > () , 56usize , concat ! ("Size of: " , stringify ! (aws_s3_client__bindgen_ty_1))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client__bindgen_ty_1 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client__bindgen_ty_1))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_requests_in_flight) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_1) , "::" , stringify ! (num_requests_in_flight))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_requests_network_io) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_1) , "::" , stringify ! (num_requests_network_io))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_requests_stream_queued_waiting) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_1) , "::" , stringify ! (num_requests_stream_queued_waiting))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_requests_streaming_response) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_1) , "::" , stringify ! (num_requests_streaming_response))) ; } impl Default for aws_s3_client__bindgen_ty_1 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] pub struct aws_s3_client__bindgen_ty_2 { pub lock : aws_mutex , pub endpoints : aws_hash_table , pub num_failed_prepare_requests : u32 , pub pending_meta_request_work : aws_linked_list , pub prepared_requests : aws_linked_list , pub process_work_task : aws_task , pub num_endpoints_allocated : u32 , pub _bitfield_align_1 : [u8 ; 0] , pub _bitfield_1 : __BindgenBitfieldUnit < [u8 ; 1usize] > , pub __bindgen_padding_0 : [u8 ; 3usize] , } # [test] fn bindgen_test_layout_aws_s3_client__bindgen_ty_2 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client__bindgen_ty_2 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client__bindgen_ty_2 > () , 200usize , concat ! ("Size of: " , stringify ! (aws_s3_client__bindgen_ty_2))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client__bindgen_ty_2 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client__bindgen_ty_2))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . lock) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (lock))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . endpoints) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (endpoints))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_failed_prepare_requests) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (num_failed_prepare_requests))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . pending_meta_request_work) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (pending_meta_request_work))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . prepared_requests) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (prepared_requests))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_work_task) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (process_work_task))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_endpoints_allocated) as usize - ptr as usize } , 192usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_2) , "::" , stringify ! (num_endpoints_allocated))) ; } impl Default for aws_s3_client__bindgen_ty_2 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } impl aws_s3_client__bindgen_ty_2 { # [inline] pub fn active (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (0usize , 1u8) as u32) } } # [inline] pub fn set_active (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (0usize , 1u8 , val as u64) } } # [inline] pub fn start_destroy_executing (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (1usize , 1u8) as u32) } } # [inline] pub fn set_start_destroy_executing (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (1usize , 1u8 , val as u64) } } # [inline] pub fn process_work_task_scheduled (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (2usize , 1u8) as u32) } } # [inline] pub fn set_process_work_task_scheduled (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (2usize , 1u8 , val as u64) } } # [inline] pub fn process_work_task_in_progress (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (3usize , 1u8) as u32) } } # [inline] pub fn set_process_work_task_in_progress (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (3usize , 1u8 , val as u64) } } # [inline] pub fn body_streaming_elg_allocated (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (4usize , 1u8) as u32) } } # [inline] pub fn set_body_streaming_elg_allocated (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (4usize , 1u8 , val as u64) } } # [inline] pub fn finish_destroy (& self) -> u32 { unsafe { :: std :: mem :: transmute (self . _bitfield_1 . get (5usize , 1u8) as u32) } } # [inline] pub fn set_finish_destroy (& mut self , val : u32) { unsafe { let val : u32 = :: std :: mem :: transmute (val) ; self . _bitfield_1 . set (5usize , 1u8 , val as u64) } } # [inline] pub fn new_bitfield_1 (active : u32 , start_destroy_executing : u32 , process_work_task_scheduled : u32 , process_work_task_in_progress : u32 , body_streaming_elg_allocated : u32 , finish_destroy : u32) -> __BindgenBitfieldUnit < [u8 ; 1usize] > { let mut __bindgen_bitfield_unit : __BindgenBitfieldUnit < [u8 ; 1usize] > = Default :: default () ; __bindgen_bitfield_unit . set (0usize , 1u8 , { let active : u32 = unsafe { :: std :: mem :: transmute (active) } ; active as u64 }) ; __bindgen_bitfield_unit . set (1usize , 1u8 , { let start_destroy_executing : u32 = unsafe { :: std :: mem :: transmute (start_destroy_executing) } ; start_destroy_executing as u64 }) ; __bindgen_bitfield_unit . set (2usize , 1u8 , { let process_work_task_scheduled : u32 = unsafe { :: std :: mem :: transmute (process_work_task_scheduled) } ; process_work_task_scheduled as u64 }) ; __bindgen_bitfield_unit . set (3usize , 1u8 , { let process_work_task_in_progress : u32 = unsafe { :: std :: mem :: transmute (process_work_task_in_progress) } ; process_work_task_in_progress as u64 }) ; __bindgen_bitfield_unit . set (4usize , 1u8 , { let body_streaming_elg_allocated : u32 = unsafe { :: std :: mem :: transmute (body_streaming_elg_allocated) } ; body_streaming_elg_allocated as u64 }) ; __bindgen_bitfield_unit . set (5usize , 1u8 , { let finish_destroy : u32 = unsafe { :: std :: mem :: transmute (finish_destroy) } ; finish_destroy as u64 }) ; __bindgen_bitfield_unit } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_client__bindgen_ty_3 { pub request_queue : aws_linked_list , pub meta_requests : aws_linked_list , pub request_queue_size : u32 , pub num_requests_being_prepared : u32 , } # [test] fn bindgen_test_layout_aws_s3_client__bindgen_ty_3 () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client__bindgen_ty_3 > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client__bindgen_ty_3 > () , 72usize , concat ! ("Size of: " , stringify ! (aws_s3_client__bindgen_ty_3))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client__bindgen_ty_3 > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client__bindgen_ty_3))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . request_queue) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_3) , "::" , stringify ! (request_queue))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . meta_requests) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_3) , "::" , stringify ! (meta_requests))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . request_queue_size) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_3) , "::" , stringify ! (request_queue_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_requests_being_prepared) as usize - ptr as usize } , 68usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client__bindgen_ty_3) , "::" , stringify ! (num_requests_being_prepared))) ; } impl Default for aws_s3_client__bindgen_ty_3 { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [test] fn bindgen_test_layout_aws_s3_client () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_client > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_client > () , 584usize , concat ! ("Size of: " , stringify ! (aws_s3_client))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_client > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_client))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . vtable) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (vtable))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . client_bootstrap) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (client_bootstrap))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . process_work_event_loop) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (process_work_event_loop))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . body_streaming_elg) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (body_streaming_elg))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . region) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (region))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_size) as usize - ptr as usize } , 72usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_part_size) as usize - ptr as usize } , 80usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (max_part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . multipart_upload_threshold) as usize - ptr as usize } , 88usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (multipart_upload_threshold))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tls_connection_options) as usize - ptr as usize } , 96usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (tls_connection_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . cached_signing_config) as usize - ptr as usize } , 104usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (cached_signing_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . throughput_target_gbps) as usize - ptr as usize } , 112usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (throughput_target_gbps))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ideal_vip_count) as usize - ptr as usize } , 120usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (ideal_vip_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . compute_content_md5) as usize - ptr as usize } , 124usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (compute_content_md5))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_active_connections_override) as usize - ptr as usize } , 128usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (max_active_connections_override))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . max_allowed_connections) as usize - ptr as usize } , 136usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (max_allowed_connections))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . retry_strategy) as usize - ptr as usize } , 144usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (retry_strategy))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_config) as usize - ptr as usize } , 152usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (proxy_config))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_settings) as usize - ptr as usize } , 160usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (proxy_ev_settings))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . connect_timeout_ms) as usize - ptr as usize } , 168usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (connect_timeout_ms))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . tcp_keep_alive_options) as usize - ptr as usize } , 176usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (tcp_keep_alive_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . monitoring_options) as usize - ptr as usize } , 184usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (monitoring_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . proxy_ev_tls_options) as usize - ptr as usize } , 216usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (proxy_ev_tls_options))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback) as usize - ptr as usize } , 224usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (shutdown_callback))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . shutdown_callback_user_data) as usize - ptr as usize } , 232usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (shutdown_callback_user_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . enable_read_backpressure) as usize - ptr as usize } , 240usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (enable_read_backpressure))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . initial_read_window) as usize - ptr as usize } , 248usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (initial_read_window))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . stats) as usize - ptr as usize } , 256usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (stats))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . synced_data) as usize - ptr as usize } , 312usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (synced_data))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . threaded_data) as usize - ptr as usize } , 512usize , concat ! ("Offset of field: " , stringify ! (aws_s3_client) , "::" , stringify ! (threaded_data))) ; } impl Default for aws_s3_client { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct aws_s3_meta_request_resume_token { pub allocator : * mut aws_allocator , pub ref_count : aws_ref_count , pub type_ : aws_s3_meta_request_type , pub multipart_upload_id : * mut aws_string , pub part_size : usize , pub total_num_parts : usize , pub num_parts_completed : usize , } # [test] fn bindgen_test_layout_aws_s3_meta_request_resume_token () { const UNINIT : :: std :: mem :: MaybeUninit < aws_s3_meta_request_resume_token > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < aws_s3_meta_request_resume_token > () , 72usize , concat ! ("Size of: " , stringify ! (aws_s3_meta_request_resume_token))) ; assert_eq ! (:: std :: mem :: align_of :: < aws_s3_meta_request_resume_token > () , 8usize , concat ! ("Alignment of " , stringify ! (aws_s3_meta_request_resume_token))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . allocator) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (allocator))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . ref_count) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (ref_count))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . type_) as usize - ptr as usize } , 32usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (type_))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . multipart_upload_id) as usize - ptr as usize } , 40usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (multipart_upload_id))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . part_size) as usize - ptr as usize } , 48usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (part_size))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . total_num_parts) as usize - ptr as usize } , 56usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (total_num_parts))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . num_parts_completed) as usize - ptr as usize } , 64usize , concat ! ("Offset of field: " , stringify ! (aws_s3_meta_request_resume_token) , "::" , stringify ! (num_parts_completed))) ; } impl Default for aws_s3_meta_request_resume_token { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } extern "C" { pub fn aws_s3_client_notify_connection_finished (client : * mut aws_s3_client , connection : * mut aws_s3_connection , error_code : :: libc :: c_int , finish_code : aws_s3_connection_finish_code) ; } extern "C" { pub fn aws_s3_meta_request_resume_token_new (allocator : * mut aws_allocator) -> * mut aws_s3_meta_request_resume_token ; } extern "C" { pub fn aws_s3_set_dns_ttl (ttl : usize) ; } extern "C" { pub fn aws_s3_client_get_max_requests_prepare (client : * mut aws_s3_client) -> u32 ; } extern "C" { pub fn aws_s3_client_get_max_active_connections (client : * mut aws_s3_client , meta_request : * mut aws_s3_meta_request) -> u32 ; } extern "C" { pub fn aws_s3_client_get_max_requests_in_flight (client : * mut aws_s3_client) -> u32 ; } extern "C" { pub fn aws_s3_client_queue_requests_threaded (client : * mut aws_s3_client , request_list : * mut aws_linked_list , queue_front : bool) -> u32 ; } extern "C" { pub fn aws_s3_client_dequeue_request_threaded (client : * mut aws_s3_client) -> * mut aws_s3_request ; } extern "C" { pub fn aws_s3_client_schedule_process_work (client : * mut aws_s3_client) ; } extern "C" { pub fn aws_s3_client_update_meta_requests_threaded (client : * mut aws_s3_client) ; } extern "C" { pub fn aws_s3_client_update_connections_threaded (client : * mut aws_s3_client) ; } extern "C" { pub fn aws_s3_endpoint_new (allocator : * mut aws_allocator , options : * const aws_s3_endpoint_options) -> * mut aws_s3_endpoint ; } extern "C" { pub fn aws_s3_client_lock_synced_data (client : * mut aws_s3_client) ; } extern "C" { pub fn aws_s3_client_unlock_synced_data (client : * mut aws_s3_client) ; } extern "C" { pub fn aws_s3_endpoint_set_system_vtable (vtable : * const aws_s3_endpoint_system_vtable) ; } extern "C" { pub fn aws_s3_endpoint_acquire (endpoint : * mut aws_s3_endpoint , already_holding_lock : bool) -> * mut aws_s3_endpoint ; } extern "C" { pub fn aws_s3_endpoint_release (endpoint : * mut aws_s3_endpoint) ; } extern "C" { pub static g_max_num_connections_per_vip : u32 ; } extern "C" { pub static g_num_conns_per_vip_meta_request_look_up : [u32 ; 0usize] ; } pub type __builtin_va_list = [__va_list_tag ; 1usize] ; # [repr (C)] # [derive (Debug , Copy , Clone)] pub struct __va_list_tag { pub gp_offset : :: libc :: c_uint , pub fp_offset : :: libc :: c_uint , pub overflow_arg_area : * mut :: libc :: c_void , pub reg_save_area : * mut :: libc :: c_void , } # [test] fn bindgen_test_layout___va_list_tag () { const UNINIT : :: std :: mem :: MaybeUninit < __va_list_tag > = :: std :: mem :: MaybeUninit :: uninit () ; let ptr = UNINIT . as_ptr () ; assert_eq ! (:: std :: mem :: size_of :: < __va_list_tag > () , 24usize , concat ! ("Size of: " , stringify ! (__va_list_tag))) ; assert_eq ! (:: std :: mem :: align_of :: < __va_list_tag > () , 8usize , concat ! ("Alignment of " , stringify ! (__va_list_tag))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . gp_offset) as usize - ptr as usize } , 0usize , concat ! ("Offset of field: " , stringify ! (__va_list_tag) , "::" , stringify ! (gp_offset))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . fp_offset) as usize - ptr as usize } , 4usize , concat ! ("Offset of field: " , stringify ! (__va_list_tag) , "::" , stringify ! (fp_offset))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . overflow_arg_area) as usize - ptr as usize } , 8usize , concat ! ("Offset of field: " , stringify ! (__va_list_tag) , "::" , stringify ! (overflow_arg_area))) ; assert_eq ! (unsafe { :: std :: ptr :: addr_of ! ((* ptr) . reg_save_area) as usize - ptr as usize } , 16usize , concat ! ("Offset of field: " , stringify ! (__va_list_tag) , "::" , stringify ! (reg_save_area))) ; } impl Default for __va_list_tag { fn default () -> Self { let mut s = :: std :: mem :: MaybeUninit :: < Self > :: uninit () ; unsafe { :: std :: ptr :: write_bytes (s . as_mut_ptr () , 0 , 1) ; s . assume_init () } } } # [doc = " (Optional)\n Use a cached merged profile collection. A merge collection has both config file\n (~/.aws/config) and credentials file based profile collection (~/.aws/credentials) using\n `aws_profile_collection_new_from_merge`.\n If this option is provided, `config_file_name_override` and `credentials_file_name_override` will be ignored."] # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_profile_collection { pub _address : u8 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_tls_ctx { pub _address : u8 , } # [repr (C)] # [derive (Debug , Default , Copy , Clone)] pub struct aws_cached_signing_config_aws { pub _address : u8 , } [INFO] [stdout] | + + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: 2 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished dev [unoptimized + debuginfo] target(s) in 1.03s [INFO] running `Command { std: "docker" "inspect" "053e2a17a5d0694629a4481c58c2cec92cb32142699f5b8bcd0a135731e5e27d", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "053e2a17a5d0694629a4481c58c2cec92cb32142699f5b8bcd0a135731e5e27d", kill_on_drop: false }` [INFO] [stdout] 053e2a17a5d0694629a4481c58c2cec92cb32142699f5b8bcd0a135731e5e27d