diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd81472..f145424 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,9 @@ on: # Only run on pull requests against main. branches: [main] +permissions: + contents: write + jobs: # We run this job first, to create any GitHub release that we might need. # Creating a release can only be done once, so we need to split it out from @@ -23,16 +26,14 @@ jobs: runs-on: ubuntu-latest outputs: release_version: ${{ steps.extract_release_version.outputs.release_version }} - upload_url: ${{ steps.create_release.outputs.upload_url }} steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Extract release version id: extract_release_version run: | release_version="$(echo '${{ github.ref }}' | sed 's,^.*/\([^/]*\)$,\1,; s,^v,,' )" echo Release version: $release_version - echo "::set-output name=release_version::$release_version" + echo "release_version=$release_version" >> $GITHUB_OUTPUT - name: Extract release body from CHANGELOG.md id: extract_release_body if: ${{ startsWith(github.ref, 'refs/tags/v') }} @@ -49,13 +50,11 @@ jobs: - name: "Make release" id: create_release if: ${{ startsWith(github.ref, 'refs/tags/v') }} - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: softprops/action-gh-release@v2 with: - tag_name: ${{ github.ref }} - release_name: "${{ steps.extract_release_version.outputs.release_version }}" + name: ${{ steps.extract_release_version.outputs.release_version }} body_path: RELEASE_BODY.md + prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc') }} # We use a matrix to run our build on every supported platform. build: @@ -75,14 +74,14 @@ jobs: host: x86_64-unknown-linux-musl cargo: cross os: ubuntu-latest - - target: x86_64-apple-darwin - host: x86_64-apple-darwin - cargo: cargo - os: macos-latest - - target: aarch64-apple-darwin - host: x86_64-apple-darwin - cargo: cargo - os: macos-latest + # - target: x86_64-apple-darwin + # host: x86_64-apple-darwin + # cargo: cargo + # os: macos-latest + # - target: aarch64-apple-darwin + # host: x86_64-apple-darwin + # cargo: cargo + # os: macos-latest runs-on: ${{ matrix.os }} @@ -92,25 +91,27 @@ jobs: if: runner.os == 'macOS' run: | brew install automake - - uses: abelfodil/protoc-action@v1 + - name: Install protoc + run: | + if [ "${{ runner.os }}" = "macOS" ]; then + brew install protobuf + else + sudo apt-get update + sudo apt-get install -y protobuf-compiler + fi + # Checks-out our repository first so `rust-toolchain` is present when we + # install Rust. + - uses: actions/checkout@v4 with: - protoc-version: "3.0.0" + submodules: recursive - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 + uses: dtolnay/rust-toolchain@stable with: - profile: minimal - # We track latest stable Rust instead of hardcoding it because it - # virtually never breaks old code. - toolchain: stable components: rustfmt, clippy - target: ${{ matrix.target }} - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v2 - with: - submodules: recursive + targets: ${{ matrix.target }} - name: Install Just run: | - version=1.13.0 + version=1.42.4 basename=just-$version-${{ matrix.host }} curl -fLO https://github.com/casey/just/releases/download/$version/$basename.tar.gz tar xf $basename.tar.gz just @@ -118,7 +119,7 @@ jobs: rm -rf $basename.tar.gz - name: Install cargo-deny run: | - version=0.14.20 + version=0.20.2 basename=cargo-deny-$version-${{ matrix.host }} curl -fLO https://github.com/EmbarkStudios/cargo-deny/releases/download/$version/$basename.tar.gz tar xf $basename.tar.gz @@ -151,14 +152,10 @@ jobs: run: | release_file=geocode-csv_${{ needs.create_release.outputs.release_version }}_${{ matrix.target }}.zip zip -j $release_file target/${{ matrix.target }}/release/geocode-csv - echo "::set-output name=release_file::$release_file" - - name: Upload Release Asset + echo "release_file=$release_file" >> $GITHUB_OUTPUT + - name: Upload release asset if: ${{ startsWith(github.ref, 'refs/tags/v') }} - uses: actions/upload-release-asset@v1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create_release.outputs.upload_url }} - asset_path: ./${{ steps.build_release.outputs.release_file }} - asset_name: ${{ steps.build_release.outputs.release_file }} - asset_content_type: application/zip + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release upload "${{ github.ref_name }}" "${{ steps.build_release.outputs.release_file }}" --clobber diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f7791b..dba4144 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,37 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +## [1.5.0-alpha.1] - 2026-09-14 + +### Changed + +- The BigTable cache now loads Application Default Credentials with `google-cloud-auth` and injects them into `bigtable_rs`. Impersonated service accounts and GitHub `external_account` files work. A missing or unparseable `GOOGLE_APPLICATION_CREDENTIALS` file is an error. The process never falls through to the `gcloud` CLI. + +## [1.4.1-alpha.1] - 2026-09-01 + +### Added + +- `libpostal` output now includes the `building` and `metro_station` columns, which the address parser can produce but which we previously discarded. +- `--refresh-failures-after-days`, `--refresh-failures-max-attempts`, optional `--refresh-successes-after-days`, and `--refresh-rate` re-geocode stale BigTable cache entries on the read path. Failures back off exponentially (`period * 2^attempts`) and stop after max attempts. A per-key-per-day rate cap bounds spend so a bulk-loaded backlog does not all come due on one day. New rows keep the legacy `N` payload so older binaries can still read them; refresh metadata is appended after that payload. If a success refresh comes back as no match, the prior success is kept. + +### Changed + +- Reworked the set of `libpostal` output columns to match the labels the address parser can actually emit (per `address_parser.h`). This removes ten columns that were always empty (`archipelago`, `continent`, `country_code`, `county`, `hamlet`, `municipality`, `neighbourhood`, `postal_city`, `region`, `village`), because they came from OpenCage's address-_formatting_ vocabulary rather than libpostal's parser vocabulary. This changes the columns emitted by `--include-libpostal`. +- Upgraded all dependencies to latest versions, including `bigtable_rs` 0.4, `reqwest` 0.13, `sha2` 0.11, `strum` 0.28, `clap` 4.6, `tikv-jemallocator` 0.7. +- Replaced hand-rolled `hyper`/`hyper-util`/`http-body-util`/`hyper-rustls` HTTP client for Smarty API with `reqwest`, removing four direct dependencies. +- Replaced `jemallocator` with `tikv-jemallocator`, the actively maintained fork. +- Replaced `lazy_static` with `std::sync::LazyLock` in `libpostal-sys` and `libpostal-rust`. +- Consolidated `strum` + `strum_macros` into `strum` with `derive` feature. +- Removed standalone `serde_derive` dependency (already re-exported by `serde` with `derive` feature). +- Bumped Rust edition from 2018 to 2021. + +### Fixed + +- When normalizing addresses, we no longer drop the secondary-unit designators `level` (e.g. "2nd Floor"), `staircase`, and `entrance` that libpostal parses out. These are now appended to the street, alongside `building`, so they reach the downstream geocoder instead of being silently discarded (the same class of bug as the earlier "city parsed as suburb" fix). +- `island` (e.g. "Maui") is now kept as part of the city during normalization instead of being dropped. + ## [1.4.0] - 2024-04-26 ### Added diff --git a/Cargo.lock b/Cargo.lock index 062912c..ce64101 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,194 +1,175 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "aho-corasick" -version = "0.7.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" -dependencies = [ - "memchr", -] +version = 4 [[package]] name = "aho-corasick" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +checksum = "c982642fa9e8606056828ee9a8505737230110bb1099153c79efe865c59d12ba" dependencies = [ "memchr", ] -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - [[package]] name = "android_system_properties" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +checksum = "ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc" dependencies = [ "libc", ] [[package]] name = "anstream" -version = "0.6.13" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "once_cell_polyfill", + "windows-sys 0.61.2", ] [[package]] name = "anyhow" -version = "1.0.81" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" -dependencies = [ - "backtrace", -] +checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" [[package]] -name = "async-stream" -version = "0.3.5" +name = "arcstr" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" -dependencies = [ - "async-stream-impl", - "futures-core", - "pin-project-lite", -] +checksum = "03918c3dbd7701a85c6b9887732e2921175f26c350b4563841d0958c21d57e6d" [[package]] -name = "async-stream-impl" -version = "0.3.5" +name = "async-lock" +version = "3.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", + "event-listener", + "event-listener-strategy", + "pin-project-lite", ] [[package]] name = "async-trait" -version = "0.1.79" +version = "0.1.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" +checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 3.0.5", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" -version = "1.1.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" [[package]] name = "autotools" -version = "0.2.6" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef941527c41b0fc0dd48511a8154cd5fc7e29200a0ff8b7203c5d777dbc795cf" +dependencies = [ + "cc", +] + +[[package]] +name = "aws-lc-rs" +version = "1.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b281d307588d634de920874890732659e2e7672f72b5e10e81badc1a8a83621e" +dependencies = [ + "aws-lc-sys", + "untrusted 0.7.1", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef8da1805e028a172334c3b680f93e71126f2327622faef2ec3d893c0a4ad77" +checksum = "9bff6c3b54fad79a2e60b8102caf565819711497c1f5f092f49508e2f5c31b27" dependencies = [ "cc", + "cmake", + "dunce", + "fs_extra", + "pkg-config", ] [[package]] name = "axum" -version = "0.6.20" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +checksum = "31b698c5f9a010f6573133b09e0de5408834d0c82f8d7475a89fc1867a71cd90" dependencies = [ - "async-trait", "axum-core", - "bitflags 1.3.2", "bytes", "futures-util", - "headers", "http", "http-body", + "http-body-util", "hyper", + "hyper-util", "itoa", "matchit", "memchr", "mime", "percent-encoding", "pin-project-lite", - "rustversion", - "serde", + "serde_core", "serde_json", "serde_path_to_error", "sync_wrapper", @@ -201,110 +182,120 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.3.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" dependencies = [ - "async-trait", "bytes", - "futures-util", + "futures-core", "http", "http-body", + "http-body-util", "mime", - "rustversion", + "pin-project-lite", + "sync_wrapper", "tower-layer", "tower-service", "tracing", ] [[package]] -name = "backtrace" -version = "0.3.71" +name = "base64" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64" -version = "0.21.7" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" [[package]] name = "bb8" -version = "0.8.3" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df7c2093d15d6a1d33b1f972e1c5ea3177748742b97a5f392aa83a65262c6780" +checksum = "457d7ed3f888dfd2c7af56d4975cade43c622f74bdcddfed6d4352f57acc6310" dependencies = [ - "async-trait", - "futures-channel", "futures-util", "parking_lot", + "portable-atomic", "tokio", ] [[package]] name = "bb8-redis" -version = "0.13.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd456361ba8e4e7f5fe58e1697ce078a149c85ebce13bf9c6b483d3f566fc9c3" +checksum = "dc1063effc7f6cf848bcbcc6e31b5962be75215835587d3109607c643d616f66" dependencies = [ - "async-trait", "bb8", "redis", ] [[package]] name = "bigtable_rs" -version = "0.2.8" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eceda96067c3436bec0061f99700cb18a47bafb4a55737d9ffd77b84b68f75e0" +checksum = "935e1cc0582ff23989286ba57333b4acf7522912cd65ce4f0dc0756619646980" dependencies = [ + "futures-util", "gcp_auth", + "googleapis-tonic-google-bigtable-v2", "http", + "hyper-util", "log", - "prost", "prost-build", - "prost-types", - "prost-wkt", "prost-wkt-build", - "prost-wkt-types", - "serde", - "serde_with", "thiserror", "tokio", "tonic", - "tonic-build", + "tonic-prost", + "tonic-prost-build", "tower", + "urlencoding", ] [[package]] name = "bincode" -version = "2.0.0-rc.3" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11ea1a0346b94ef188834a65c068a03aec181c94896d481d7a0a40d85b0ce95" +checksum = "36eaf5d7b090263e8150820482d5d93cd964a81e4019913c972f4edcc6edb740" dependencies = [ "bincode_derive", "serde", + "unty", ] [[package]] name = "bincode_derive" -version = "2.0.0-rc.3" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e30759b3b99a1b802a7a3aa21c85c3ded5c28e1c83170d82d70f08bbf7f3e4c" +checksum = "bf95709a440f45e986983918d0e8a1f30a9b1df04918fc828670606804ac3c09" dependencies = [ "virtue", ] +[[package]] +name = "bindgen" +version = "0.72.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" +dependencies = [ + "bitflags 2.13.2", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex 1.3.0", + "syn 2.0.119", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -313,63 +304,117 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "3ded4057c258ba199e2d26386d3af3780957ecaee6c4ef4041c6b4b8b97c0b06" [[package]] name = "block-buffer" -version = "0.10.4" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2f6c7dbe95a6ed67ad9f18e57daf93a2f034c524b99fd2b76d18fdfeb6660aa" +dependencies = [ + "hybrid-array", +] + +[[package]] +name = "bs58" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" dependencies = [ - "generic-array", + "tinyvec", ] [[package]] name = "bumpalo" -version = "3.15.4" +version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" [[package]] name = "bytes" -version = "1.6.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" +dependencies = [ + "serde", +] [[package]] name = "cc" -version = "1.0.90" +version = "1.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3eb0f42d6c360dc3f8a821f6bf2fdea7f72bfd36b3076eb0e6d1e9e0752fff4" +dependencies = [ + "find-msvc-tools", + "jobserver", + "libc", + "shlex 2.0.1", +] + +[[package]] +name = "cexpr" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "cfg_aliases" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527" + +[[package]] +name = "chacha20" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" +dependencies = [ + "cfg-if", + "cpufeatures", + "rand_core 0.10.1", +] [[package]] name = "chrono" -version = "0.4.35" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" dependencies = [ - "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.4", + "windows-link", +] + +[[package]] +name = "clang-sys" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "157a8ba7b480713b56f4c09fd13fc3e0a22a5dfab8097ba61cbc5feef950788a" +dependencies = [ + "glob", + "libc", + "libloading", ] [[package]] name = "clap" -version = "4.5.3" +version = "4.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "949626d00e063efc93b6dca932419ceb5432f99769911c0b995f7e884c778813" +checksum = "473c7e07f409a8d772161724aa8db6a765a2532a70f9667eeb7b49d3d02fbdca" dependencies = [ "clap_builder", "clap_derive", @@ -377,34 +422,34 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "7b48fea5a88e9ae728a2dcbedbfc0e730f7d60da42e1cb049a83c9fb8b789889" dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim 0.11.0", + "strsim", "terminal_size", ] [[package]] name = "clap_derive" -version = "4.5.3" +version = "4.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90239a040c80f5e14809ca132ddc4176ab33d5e17e49691793296e3fcb34d72f" +checksum = "d012d2b9d65aca7f18f4d9878a045bc17899bba951561ba5ec3c2ba1eed9a061" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", - "syn 2.0.55", + "syn 3.0.5", ] [[package]] name = "clap_lex" -version = "0.7.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" [[package]] name = "cli_test_dir" @@ -412,17 +457,32 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc7e8a289c9ba144ed96a2f5776b320192ccb2f22212b9aabf61fd15dedb4b3a" +[[package]] +name = "cmake" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678" +dependencies = [ + "cc", +] + +[[package]] +name = "cmov" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9ea0ac24bc397ab3c98583a3c9ba74fa56b09a4449bbe172b9b1ddb016027a" + [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" [[package]] name = "combine" -version = "4.6.6" +version = "4.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" +checksum = "cfc320937d09e6de266b31b9afb480f197d7a861be86be7cb2ea7e5d1bfffc5e" dependencies = [ "bytes", "futures-core", @@ -432,11 +492,17 @@ dependencies = [ "tokio-util", ] +[[package]] +name = "const-oid" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c" + [[package]] name = "core-foundation" -version = "0.9.4" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" dependencies = [ "core-foundation-sys", "libc", @@ -444,70 +510,78 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "5ca28b0ae3115b884660db4118d803791fd6756b6e88f39c0f3f7859060d7566" dependencies = [ "libc", ] [[package]] name = "crossbeam-epoch" -version = "0.9.18" +version = "0.9.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +checksum = "dc74980687109a3b14c72fd458107bf0baa1da1a1a805e178d15501ba9b86d9d" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "a31eee39dddec8330830986fcd7625edb5a24ec90ea038215273bbc3adb08ac6" [[package]] name = "crypto-common" -version = "0.1.6" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453" dependencies = [ - "generic-array", - "typenum", + "hybrid-array", ] [[package]] name = "csv" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe" +checksum = "52cd9d68cf7efc6ddfaaee42e7288d3a99d613d4b50f76ce9827ae0c6e14f938" dependencies = [ "csv-core", "itoa", "ryu", - "serde", + "serde_core", ] [[package]] name = "csv-core" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70" +checksum = "704a3c26996a80471189265814dbc2c257598b96b8a7feae2d31ace646bb9782" dependencies = [ "memchr", ] +[[package]] +name = "ctutils" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5515a3834141de9eafb9717ad39eea8247b5674e6066c404e8c4b365d2a29e" +dependencies = [ + "cmov", +] + [[package]] name = "darling" -version = "0.20.8" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" +checksum = "ed17f5901b6630b993ca003def43f2f8ef4014fc13b047b57aad617ff32bc2ec" dependencies = [ "darling_core", "darling_macro", @@ -515,63 +589,108 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.8" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2cf1c23a687a1feeb728783b993c4e1ad83d99f351801977dd809b48d0a70f" +checksum = "6837e2cf7485aaae18f86181d2f0e9a7ed297a025e220aeabf63fdebd3a2ddff" dependencies = [ - "fnv", "ident_case", "proc-macro2", "quote", - "strsim 0.10.0", - "syn 2.0.55", + "strsim", + "syn 3.0.5", ] [[package]] name = "darling_macro" -version = "0.20.8" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" +checksum = "2ac7135c3ef02b2f7833bbeb1be5ba7f966dcde8a87c6b87f65a778d71a02785" dependencies = [ "darling_core", "quote", - "syn 2.0.55", + "syn 3.0.5", +] + +[[package]] +name = "defmt" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2953bfe4f93bbd20cc71198842756f77d161884c99ebbabc41d80231ded88d1" +dependencies = [ + "bitflags 1.3.2", + "defmt-macros", +] + +[[package]] +name = "defmt-macros" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bad9c72e7ca2137e0dc3813245a0d282fd6daad32fd800af018306a9169b5fe8" +dependencies = [ + "defmt-parser", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "defmt-parser" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" +dependencies = [ + "thiserror", ] [[package]] name = "deranged" -version = "0.3.11" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" dependencies = [ - "powerfmt", - "serde", + "serde_core", ] [[package]] name = "digest" -version = "0.10.7" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2" dependencies = [ "block-buffer", + "const-oid", "crypto-common", + "ctutils", ] [[package]] -name = "either" -version = "1.10.0" +name = "displaydoc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6232dd377dcc64799954cbd3a9bb882e9cdc1308ccd87b1c098f1fb2eaf82a8" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.5", +] + +[[package]] +name = "dunce" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] -name = "encoding_rs" -version = "0.8.33" +name = "dyn-clone" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" -dependencies = [ - "cfg-if", -] +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + +[[package]] +name = "either" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34" [[package]] name = "endian-type" @@ -581,40 +700,68 @@ checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] -name = "erased-serde" -version = "0.4.4" +name = "errno" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b73807008a3c7f171cc40312f37d95ef0396e048b5848d775f54b1a4dd4a0d3" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ - "serde", + "libc", + "windows-sys 0.61.2", ] [[package]] -name = "errno" -version = "0.3.8" +name = "event-listener" +version = "5.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "5a23add41df1562121a9393cb065eab5146a1242410f23a644851e90cfd669d2" dependencies = [ - "libc", - "windows-sys 0.52.0", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" +dependencies = [ + "event-listener", + "pin-project-lite", +] + +[[package]] +name = "evmap" +version = "11.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b8874945f036109c72242964c1174cf99434e30cfa45bf45fedc983f50046f8" +dependencies = [ + "hashbag", + "left-right", + "smallvec", ] [[package]] name = "fastrand" -version = "2.0.2" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" + +[[package]] +name = "find-msvc-tools" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "3e0f1c7c3a72c66fd80abe965175f7523475c0489a87d3ff9d6e8c87d87a9d2d" [[package]] name = "fixedbitset" -version = "0.4.2" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" [[package]] name = "fnv" @@ -622,20 +769,38 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "foldhash" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" + [[package]] name = "form_urlencoded" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" dependencies = [ "percent-encoding", ] +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + [[package]] name = "futures" -version = "0.3.30" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "9a31d2a3fbaaeb2af2368bbdd904aa8e812d3c04a1ee10d3171f52d556e5d0a3" dependencies = [ "futures-channel", "futures-core", @@ -648,9 +813,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "b1f9e3d69d39e4862ffed03ed071a76f9a13ba1d9109d355b0f0aa6b15e393c4" dependencies = [ "futures-core", "futures-sink", @@ -658,15 +823,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "031b47cf1a3c6cc8bc2fc76cd437f521619387907d469316e7c0bc278f1f5432" dependencies = [ "futures-core", "futures-task", @@ -675,38 +840,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "9fb9654ba8355388abeb8dcb4fc62f511300867002afc858860463bdd9fe0c44" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 3.0.5", ] [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "1944426bf7d03f1d14f708785e4b33efd750b36d48a157b836b3efc15ede8e1d" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" dependencies = [ "futures-channel", "futures-core", @@ -716,25 +881,27 @@ dependencies = [ "futures-task", "memchr", "pin-project-lite", - "pin-utils", "slab", ] [[package]] name = "gcp_auth" -version = "0.10.0" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de2c71ea685b88a1aa50e9fb66fe0e1cb29d755f58cca41fb8c91ef604d4f4d4" +checksum = "26d27dbcc645b60b8e7f6e2868a9d7102ece97d1bb49c1288b5321fcc67f7260" dependencies = [ "async-trait", - "base64", + "aws-lc-rs", + "base64 0.22.1", + "bytes", "chrono", - "home", + "http", + "http-body-util", "hyper", "hyper-rustls", - "ring", - "rustls 0.21.10", - "rustls-pemfile 1.0.4", + "hyper-util", + "rustls", + "rustls-pki-types", "serde", "serde_json", "thiserror", @@ -742,22 +909,26 @@ dependencies = [ "tracing", "tracing-futures", "url", - "which 5.0.0", ] [[package]] -name = "generic-array" -version = "0.14.7" +name = "generator" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +checksum = "b3b854b0e584ead1a33f18b2fcad7cf7be18b3875c78816b753639aa501513ae" dependencies = [ - "typenum", - "version_check", + "cc", + "cfg-if", + "libc", + "log", + "rustversion", + "windows-link", + "windows-result", ] [[package]] name = "geocode-csv" -version = "1.4.0" +version = "1.5.0-alpha.1" dependencies = [ "anyhow", "async-trait", @@ -770,9 +941,9 @@ dependencies = [ "cli_test_dir", "csv", "futures", - "hyper", - "hyper-rustls", - "jemallocator", + "gcp_auth", + "google-cloud-auth", + "googleapis-tonic-google-bigtable-v2", "leaky-bucket", "libpostal-rust", "metrics", @@ -780,12 +951,15 @@ dependencies = [ "opinionated_metrics", "redis", "reqwest", + "rustls", + "scoped-env", "serde", - "serde_derive", "serde_json", + "serial_test", "sha2", "strum", - "strum_macros", + "tempfile", + "tikv-jemallocator", "tokio", "tokio-stream", "tracing", @@ -795,34 +969,189 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +dependencies = [ + "cfg-if", + "libc", + "r-efi 5.3.0", + "wasip2", +] + +[[package]] +name = "getrandom" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" dependencies = [ "cfg-if", + "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "r-efi 6.0.0", + "rand_core 0.10.1", + "wasm-bindgen", ] [[package]] -name = "gimli" -version = "0.28.1" +name = "glob" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" + +[[package]] +name = "google-cloud-auth" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff461519b1a948200f163574be072753bcfb462a323f0eb426629d89872dd685" +dependencies = [ + "async-trait", + "base64 0.23.1", + "bytes", + "google-cloud-gax", + "hex", + "hmac", + "http", + "jiff", + "reqwest", + "rustc_version", + "rustls", + "rustls-pki-types", + "serde", + "serde_json", + "sha2", + "thiserror", + "time", + "tokio", + "url", +] + +[[package]] +name = "google-cloud-gax" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5615cff28ee59cfe52fbb4c11b8b1e77f650296e2ea4f4c2b7757ac6b19e752" +dependencies = [ + "bytes", + "futures", + "google-cloud-rpc", + "google-cloud-wkt", + "http", + "pin-project", + "rand 0.10.2", + "serde", + "serde_json", + "thiserror", + "tokio", + "tokio-stream", +] + +[[package]] +name = "google-cloud-rpc" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2162c08a89118130979ba261080e960e44cdcb2d6e2ab8ca9b1da245285d353" +dependencies = [ + "bytes", + "google-cloud-wkt", + "serde", + "serde_json", + "serde_with", +] + +[[package]] +name = "google-cloud-wkt" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fccf98cfd5481a5f5a285181ab0c62123d7d47cd2bb7299448440649349e4e7" +dependencies = [ + "base64 0.22.1", + "bytes", + "serde", + "serde_json", + "serde_with", + "thiserror", + "time", + "url", +] + +[[package]] +name = "googleapis-tonic-google-api" +version = "0.30.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fca39f3577e656ca9ad97737fc1a397f45c46f54d047a43af1fb680287b5ace8" +dependencies = [ + "prost", + "prost-types", + "tonic", + "tonic-prost", +] + +[[package]] +name = "googleapis-tonic-google-bigtable-v2" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26a7cb407adead1bd3b623453ecc47556e07377a514793c0df52e9845caefadb" +dependencies = [ + "googleapis-tonic-google-api", + "googleapis-tonic-google-rpc", + "googleapis-tonic-google-type", + "prost", + "prost-types", + "tonic", + "tonic-prost", +] + +[[package]] +name = "googleapis-tonic-google-rpc" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f8922a81782e57325a059334bcec9730f7865eea2a1a1453896efe53a65b6af" +dependencies = [ + "prost", + "prost-types", + "tonic", + "tonic-prost", +] + +[[package]] +name = "googleapis-tonic-google-type" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc35fc04d6bb84eab8fff7c6a40357bfd647af0d5dfc41597a4ae6d8e0d84a2d" +dependencies = [ + "prost", + "prost-types", + "tonic", + "tonic-prost", +] [[package]] name = "h2" -version = "0.3.25" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fbd2820c5e49886948654ab546d0688ff24530286bdcf8fca3cefb16d4618eb" +checksum = "ef8e5e5a340588f4452631496976cf8636d4a7ecf600239fdc27615d2530bc16" dependencies = [ + "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "futures-util", "http", - "indexmap 2.2.6", + "indexmap 2.14.2", "slab", "tokio", "tokio-util", @@ -830,49 +1159,40 @@ dependencies = [ ] [[package]] -name = "hashbrown" -version = "0.12.3" +name = "hashbag" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash", -] +checksum = "7040a10f52cba493ddb09926e15d10a9d8a28043708a405931fe4c6f19fac064" [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] -name = "headers" -version = "0.3.9" +name = "hashbrown" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" dependencies = [ - "base64", - "bytes", - "headers-core", - "http", - "httpdate", - "mime", - "sha1", + "foldhash 0.1.5", ] [[package]] -name = "headers-core" -version = "0.2.0" +name = "hashbrown" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" dependencies = [ - "http", + "foldhash 0.2.0", ] [[package]] -name = "heck" -version = "0.4.1" +name = "hashbrown" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" [[package]] name = "heck" @@ -880,12 +1200,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - [[package]] name = "hex" version = "0.4.3" @@ -893,41 +1207,52 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] -name = "home" -version = "0.5.9" +name = "hmac" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "6303bc9732ae41b04cb554b844a762b4115a61bfaa81e3e83050991eeb56863f" dependencies = [ - "windows-sys 0.52.0", + "digest", ] [[package]] name = "http" -version = "0.2.12" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" +checksum = "918d3568bebf352712bc2ef3d46a8bcf1a75b373be6539de198e9105cbbf9ce0" dependencies = [ "bytes", - "fnv", "itoa", ] [[package]] name = "http-body" -version = "0.4.6" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +checksum = "ca2a8f2913ee65f60facd6a5905613afaa448497a0230cc41ce022d93290bc2c" dependencies = [ "bytes", "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23169fe34a5fbcdd3f3862e78fb9b6fccd5f02a6dc6f732547005d45631ce71c" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.8.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "httpdate" @@ -935,16 +1260,25 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "hybrid-array" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27f864f10dfb56725ce5ce5472bc52252c8f93a4ab86327122cebf62c5f59a17" +dependencies = [ + "typenum", +] + [[package]] name = "hyper" -version = "0.14.28" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "27b501faa50e7a26c3d3560ca625132f4078a17771f4810baf70475ae48cbe43" dependencies = [ + "atomic-waker", "bytes", "futures-channel", "futures-core", - "futures-util", "h2", "http", "http-body", @@ -952,51 +1286,74 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "smallvec", "tokio", - "tower-service", - "tracing", "want", ] [[package]] name = "hyper-rustls" -version = "0.24.2" +version = "0.27.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" +checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" dependencies = [ - "futures-util", "http", "hyper", - "log", - "rustls 0.21.10", + "hyper-util", + "rustls", "rustls-native-certs", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls", + "tower-service", ] [[package]] name = "hyper-timeout" -version = "0.4.1" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" +dependencies = [ + "hyper", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" dependencies = [ + "base64 0.22.1", + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", "hyper", + "ipnet", + "libc", + "percent-encoding", "pin-project-lite", + "socket2", "tokio", - "tokio-io-timeout", + "tower-service", + "tracing", ] [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", + "log", "wasm-bindgen", "windows-core", ] @@ -1010,6 +1367,89 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa68d21081c4a05d5a901a1c62add574c77048b6a1c67be3b50ce0b60d4ca513" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d56e28588da92eee5c3201a6eff33fabdd49b62269c8938d4ff050ce4d900deb" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12f9cf5f235641ed274641dd81c3f28d870e276763d0797aeeab72317b1c646f" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1563da1ed3e0b3bf3d74c9b85917ac9c56464d2f57242270c09c9e752f8021a0" + +[[package]] +name = "icu_properties" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e7ca276ad3145661a65914e6daf131ca5120cd3dcee8f8f3214b8875184a148" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e590f038c1464a96894fd6d10127e90a8be4509f56ff7ecef851b15cee0b7caa" + +[[package]] +name = "icu_provider" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d27bbb9d3abbefac45d55f647c9de1d44aafcd1186eb91879afef17c396c3e73" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -1018,12 +1458,23 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" -version = "0.5.0" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "icu_normalizer", + "icu_properties", ] [[package]] @@ -1039,99 +1490,224 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "cc4e190f5d26ca7051642629da2c52fc03bde85a03197c99408dcd291734c855" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.17.1", "serde", + "serde_core", ] [[package]] -name = "inventory" -version = "0.3.15" +name = "ipnet" +version = "2.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f958d3d68f4167080a18141e10381e7634563984a537f2a49a30fd8e53ac5767" +checksum = "791930b43c0d5973160d90a8f3894509f2b273430f5c5c73b668636d0287c5c0" [[package]] -name = "ipnet" -version = "2.9.0" +name = "is_terminal_polyfill" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "itertools" -version = "0.11.0" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] -name = "jemalloc-sys" -version = "0.5.4+5.3.0-patched" +name = "jiff" +version = "0.2.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac6c1946e1cea1788cbfde01c993b52a10e2da07f4bac608228d1bed20bfebf2" +checksum = "0ab1baf72f08796de0260609515130699b890ac25f30e610ad894bc5856cafdb" dependencies = [ - "cc", - "libc", + "defmt", + "jiff-core", + "jiff-static", + "jiff-tzdb-platform", + "log", + "portable-atomic", + "portable-atomic-util", + "serde_core", + "windows-link", ] [[package]] -name = "jemallocator" -version = "0.5.4" +name = "jiff-core" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e52fe76043ccecc9005d2305ebaadf7d7fc0cc89ca6baa10a94d6bc68c7128c" +dependencies = [ + "defmt", + "log", +] + +[[package]] +name = "jiff-static" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "378268a1116ad67ae6228701118ac9f491d78fda38a40a1f1a9e1348de6f7212" +dependencies = [ + "jiff-core", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "jiff-tzdb" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "142bd39932ad231f10513df9ab62661fead8719872150b7ad02a2df79f4e141e" + +[[package]] +name = "jiff-tzdb-platform" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "875a5a69ac2bab1a891711cf5eccbec1ce0341ea805560dcd90b7a2e925132e8" +dependencies = [ + "jiff-tzdb", +] + +[[package]] +name = "jni" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498" +dependencies = [ + "cfg-if", + "combine", + "jni-macros", + "jni-sys", + "log", + "simd_cesu8", + "thiserror", + "walkdir", + "windows-link", +] + +[[package]] +name = "jni-macros" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "simd_cesu8", + "syn 2.0.119", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0de374a9f8e63150e6f5e8a60cc14c668226d7a347d8aee1a45766e3c4dd3bc" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" dependencies = [ - "jemalloc-sys", + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn 2.0.119", +] + +[[package]] +name = "jobserver" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3" +dependencies = [ + "getrandom 0.4.3", "libc", ] [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "ce57d20d1ea864ce2ac172ab472d409214f4fd359f0b2a2775abdf522e2af99e" dependencies = [ + "cfg-if", + "futures-util", "wasm-bindgen", ] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "leaky-bucket" -version = "1.0.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb491abd89e9794d50f93c8db610a29509123e3fbbc9c8c67a528e9391cd853" +checksum = "0a396bb213c2d09ed6c5495fd082c991b6ab39c9daf4fff59e6727f85c73e4c5" dependencies = [ "parking_lot", + "pin-project-lite", "tokio", - "tracing", +] + +[[package]] +name = "left-right" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bc015ded5d9b3054dbbdb63332cdd6ee42352ccef19e911e25117490e2f48ee" +dependencies = [ + "crossbeam-utils", + "loom", + "slab", ] [[package]] name = "libc" -version = "0.2.153" +version = "0.2.189" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" + +[[package]] +name = "libloading" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" +dependencies = [ + "cfg-if", + "windows-link", +] [[package]] name = "libpostal-rust" -version = "0.1.1" +version = "0.1.2" dependencies = [ - "lazy_static", "libpostal-sys", "thiserror", "tracing", @@ -1139,85 +1715,98 @@ dependencies = [ [[package]] name = "libpostal-sys" -version = "0.1.1" +version = "0.1.2" dependencies = [ "autotools", - "lazy_static", + "bindgen", ] [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "litemap" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "47d9d19d1d6efa0109d2f65ff4c85cddd50bd572e5a00127ab10987290bcefae" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "224399e74b87b5f3557511d98dff8b14089b3dadafcab6bb93eab67d3aace965" dependencies = [ - "autocfg", "scopeguard", ] [[package]] name = "log" -version = "0.4.21" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" [[package]] -name = "mach" -version = "0.3.2" +name = "loom" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" +checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" dependencies = [ - "libc", + "cfg-if", + "generator", + "scoped-tls", + "tracing", + "tracing-subscriber", ] +[[package]] +name = "lru-slab" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4050469837a6ff301cd14c1f8f24f88549e6d548f24f64e2148eb0f72cebc51f" + [[package]] name = "matchers" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" dependencies = [ - "regex-automata 0.1.10", + "regex-automata", ] [[package]] name = "matchit" -version = "0.7.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" [[package]] name = "memchr" -version = "2.7.1" +version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" [[package]] name = "metrics" -version = "0.20.1" +version = "0.24.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b9b8653cec6897f73b519a43fba5ee3d50f62fe9af80b428accdcc093b4a849" +checksum = "89550ee9f79e88fef3119de263694973a8adb26c21d75322164fb8c493039fe2" dependencies = [ - "ahash", - "metrics-macros", - "portable-atomic 0.3.20", + "portable-atomic", + "rapidhash", ] [[package]] name = "metrics-exporter-newrelic" -version = "0.2.0" +version = "0.2.1" dependencies = [ "http", "metrics", "metrics-util", "reqwest", "serde", - "serde_derive", "serde_json", "thiserror", "tokio", @@ -1226,48 +1815,37 @@ dependencies = [ [[package]] name = "metrics-exporter-prometheus" -version = "0.11.0" +version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8603921e1f54ef386189335f288441af761e0fc61bcb552168d9cedfe63ebc70" +checksum = "1db0d8f1fc9e62caebd0319e11eaec5822b0186c171568f0480b46a0137f9108" dependencies = [ - "indexmap 1.9.3", + "base64 0.22.1", + "evmap", + "indexmap 2.14.2", "metrics", "metrics-util", - "parking_lot", - "portable-atomic 0.3.20", "quanta", "thiserror", ] -[[package]] -name = "metrics-macros" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "731f8ecebd9f3a4aa847dfe75455e4757a45da40a7793d2f0b1f9b6ed18b23f3" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "metrics-util" -version = "0.14.0" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d24dc2dbae22bff6f1f9326ffce828c9f07ef9cc1e8002e5279f845432a30a" +checksum = "96f8722f8562635f92f8ed992f26df0532266eb03d5202607c20c0d7e9745e13" dependencies = [ - "aho-corasick 0.7.20", + "aho-corasick", "crossbeam-epoch", "crossbeam-utils", - "hashbrown 0.12.3", - "indexmap 1.9.3", + "hashbrown 0.16.1", + "indexmap 2.14.2", "metrics", - "num_cpus", "ordered-float", - "parking_lot", - "portable-atomic 0.3.20", "quanta", "radix_trie", + "rand 0.9.5", + "rand_xoshiro", + "rapidhash", "sketches-ddsketch", ] @@ -1278,30 +1856,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] -name = "miniz_oxide" -version = "0.7.2" +name = "minimal-lexical" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" -dependencies = [ - "adler", -] +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "mio" -version = "0.8.11" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "4b18443e9c262bfe8fa82f51666e2642c53393f7e5c27b3e1aeab922cff5b9d8" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.48.0", + "wasi", + "windows-sys 0.61.2", ] [[package]] name = "multimap" -version = "0.8.3" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" +checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084" [[package]] name = "nibble_vec" @@ -1312,65 +1887,61 @@ dependencies = [ "smallvec", ] +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "nu-ansi-term" -version = "0.46.0" +version = "0.50.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" dependencies = [ - "overload", - "winapi", + "windows-sys 0.61.2", ] [[package]] name = "num-conv" -version = "0.1.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" [[package]] name = "num-traits" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] [[package]] -name = "num_cpus" -version = "1.16.0" +name = "once_cell" +version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" [[package]] -name = "object" -version = "0.32.2" +name = "once_cell_polyfill" +version = "1.70.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" [[package]] name = "openssl-probe" -version = "0.1.5" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" [[package]] name = "opinionated_metrics" -version = "0.2.0" +version = "0.2.1" dependencies = [ "metrics", "metrics-exporter-newrelic", @@ -1381,24 +1952,24 @@ dependencies = [ [[package]] name = "ordered-float" -version = "2.10.1" +version = "5.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f19d67e5a2795c94e73e0bb1cc1a7edeb2e28efd39e2e1c9b7a40c1108b11c" +checksum = "8c7c9e0d9b23589f26070720bac724174bfec1083e82f7854cdd0267518343c0" dependencies = [ "num-traits", ] [[package]] -name = "overload" -version = "0.1.1" +name = "parking" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "93857453250e3077bd71ff98b6a65ea6621a19bb0f559a85248955ac12c45a1a" dependencies = [ "lock_api", "parking_lot_core", @@ -1406,79 +1977,89 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-targets 0.48.5", + "windows-link", ] [[package]] name = "percent-encoding" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "petgraph" -version = "0.6.4" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "8701b58ea97060d5e5b155d383a69952a60943f0e6dfe30b04c287beb0b27455" dependencies = [ "fixedbitset", - "indexmap 2.2.6", + "hashbrown 0.15.5", + "indexmap 2.14.2", ] [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "2466b2336ed02bcdca6b294417127b90ec92038d1d5c4fbeac971a922e0e0924" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.119", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" [[package]] -name = "pin-utils" -version = "0.1.0" +name = "pkg-config" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +checksum = "f6b464fbc74e149a392436b17d523f769e057cb6877f6a5c4618bc6f11800548" [[package]] name = "portable-atomic" -version = "0.3.20" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e30165d31df606f5726b090ec7592c308a0eaf61721ff64c9a3018e344a8753e" +checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85" + +[[package]] +name = "portable-atomic-util" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10ab3eb7f3becc3a1cbc4f2c6f20267996cfc1a6467a873763411b136a122715" dependencies = [ - "portable-atomic 1.6.0", + "portable-atomic", ] [[package]] -name = "portable-atomic" -version = "1.6.0" +name = "potential_utf" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" +checksum = "d83eb9bc6d8e5cf568e7a1101d60ee05e81ed50ea106026f3d18deeb046d7661" +dependencies = [ + "zerovec", +] [[package]] name = "powerfmt" @@ -1488,34 +2069,37 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] [[package]] name = "prettyplease" -version = "0.2.17" +version = "0.2.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3928fb5db768cb86f891ff014f0144589297e3c6a1aba6ed7cecfdace270c7" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ "proc-macro2", - "syn 2.0.55", + "syn 2.0.119", ] [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" dependencies = [ "unicode-ident", ] [[package]] name = "prost" -version = "0.12.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" +checksum = "528ac67416ff8646872a3c02cad9cc4ee5dc9f9540c9b10771855c95cb2e5ae1" dependencies = [ "bytes", "prost-derive", @@ -1523,16 +2107,14 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.12.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c55e02e35260070b6f716a2423c2ff1c3bb1642ddca6f99e1f26d06268a0e2d2" +checksum = "03da047801ff44bb6a4d407d4860c05fd70bb81714e6b2f3812603d5b145b042" dependencies = [ - "bytes", - "heck 0.4.1", - "itertools", + "heck", + "itertools 0.14.0", "log", "multimap", - "once_cell", "petgraph", "prettyplease", "prost", @@ -1540,124 +2122,158 @@ dependencies = [ "pulldown-cmark", "pulldown-cmark-to-cmark", "regex", - "syn 2.0.55", + "syn 2.0.119", "tempfile", - "which 4.4.2", ] [[package]] name = "prost-derive" -version = "0.12.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" +checksum = "b570b25f7617e43d59005d0990ccb79e950a423952cea19671b7a876da390adf" dependencies = [ "anyhow", - "itertools", + "itertools 0.14.0", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.119", ] [[package]] name = "prost-types" -version = "0.12.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193898f59edcf43c26227dcd4c8427f00d99d61e95dcde58dabd49fa291d470e" +checksum = "f94967dc7688f3054c7fac87473ffae4cc4c3904800e2d9f5b857246d8963b0a" dependencies = [ "prost", ] [[package]] -name = "prost-wkt" -version = "0.5.0" +name = "prost-wkt-build" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d8ef9c3f0f1dab910d2b7e2c24a8e4322e122eba6d7a1921eeebcebbc046c40" +checksum = "cb5cd191fad9142d096efc97c64715db73db4adb60c38ebdf22f5b54cd6ea712" dependencies = [ - "chrono", - "inventory", + "heck", "prost", - "serde", - "serde_derive", - "serde_json", - "typetag", + "prost-build", + "prost-types", + "quote", ] [[package]] -name = "prost-wkt-build" -version = "0.5.0" +name = "pulldown-cmark" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b31cae9a54ca84fee1504740a82eebf2479532905e106f63ca0c3bc8d780321" +checksum = "e9f068eba8e7071c5f9511831b44f32c740d5adf574e990f946ddb53db2f314e" dependencies = [ - "heck 0.4.1", - "prost", - "prost-build", - "prost-types", - "quote", + "bitflags 2.13.2", + "memchr", + "unicase", ] [[package]] -name = "prost-wkt-types" -version = "0.5.0" +name = "pulldown-cmark-to-cmark" +version = "22.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435be4a8704091b4c5fb1d79799de7f2dbff53af05edf29385237f8cf7ab37ee" +checksum = "ab1ad36992cead65f02aa399a373a42730922f1525d988172634fdefdecb8a60" dependencies = [ - "chrono", - "prost", - "prost-build", - "prost-types", - "prost-wkt", - "prost-wkt-build", - "regex", - "serde", - "serde_derive", - "serde_json", + "pulldown-cmark", ] [[package]] -name = "pulldown-cmark" -version = "0.9.6" +name = "quanta" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57206b407293d2bcd3af849ce869d52068623f19e1b5ff8e8778e3309439682b" +checksum = "f3ab5a9d756f0d97bdc89019bd2e4ea098cf9cde50ee7564dde6b81ccc8f06c7" dependencies = [ - "bitflags 2.5.0", - "memchr", - "unicase", + "crossbeam-utils", + "libc", + "once_cell", + "raw-cpuid", + "wasi", + "web-sys", + "winapi", ] [[package]] -name = "pulldown-cmark-to-cmark" -version = "10.0.4" +name = "quinn" +version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0194e6e1966c23cc5fd988714f85b18d548d773e81965413555d96569931833d" +checksum = "4051e23e9185c255a7e33ef59cdbca87a22d359052eecd22fc6b901fb37d9d11" dependencies = [ - "pulldown-cmark", + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls", + "socket2", + "thiserror", + "tokio", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-proto" +version = "0.11.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9746dbde176634f4f2f1faf2404e30a31b2bc1e9cafb5329c95d8177a18c9fc" +dependencies = [ + "aws-lc-rs", + "bytes", + "getrandom 0.4.3", + "lru-slab", + "rand 0.10.2", + "rand_pcg", + "ring", + "rustc-hash", + "rustls", + "rustls-pki-types", + "slab", + "thiserror", + "tinyvec", + "tracing", + "web-time", ] [[package]] -name = "quanta" -version = "0.10.1" +name = "quinn-udp" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e31331286705f455e56cca62e0e717158474ff02b7936c1fa596d983f4ae27" +checksum = "35a133f956daabe89a61a685c2649f13d82d5aa4bd5d12d1277e1072a21c0694" dependencies = [ - "crossbeam-utils", + "cfg_aliases", "libc", - "mach", "once_cell", - "raw-cpuid", - "wasi 0.10.2+wasi-snapshot-preview1", - "web-sys", - "winapi", + "socket2", + "tracing", + "windows-sys 0.61.2", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + [[package]] name = "radix_trie" version = "0.2.1" @@ -1670,318 +2286,404 @@ dependencies = [ [[package]] name = "rand" -version = "0.8.5" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41" dependencies = [ - "libc", "rand_chacha", - "rand_core", + "rand_core 0.9.5", +] + +[[package]] +name = "rand" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7f5fa3a058cd35567ef9bfa5e75732bee0f9e4c55fa90477bef2dfcdbc4be80" +dependencies = [ + "chacha20", + "getrandom 0.4.3", + "rand_core 0.10.1", ] [[package]] name = "rand_chacha" -version = "0.3.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.9.5", ] [[package]] name = "rand_core" -version = "0.6.4" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" +dependencies = [ + "getrandom 0.3.4", +] + +[[package]] +name = "rand_core" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" + +[[package]] +name = "rand_pcg" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "caa0f4137e1c0a72f4c651489402276c8e8e1cf081f3b0ba156d2cbeef09e86a" +dependencies = [ + "rand_core 0.10.1", +] + +[[package]] +name = "rand_xoshiro" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f703f4665700daf5512dcca5f43afa6af89f09db47fb56be587f80636bda2d41" +dependencies = [ + "rand_core 0.9.5", +] + +[[package]] +name = "rapidhash" +version = "4.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5da7e78a036ce858e8d55b7e7dc8ba3a88b78350fd2155d3591bbd966b58589e" dependencies = [ - "getrandom", + "rustversion", ] [[package]] name = "raw-cpuid" -version = "10.7.0" +version = "11.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c297679cb867470fa8c9f67dbba74a78d78e3e98d7cf2b08d6d71540f797332" +checksum = "498cd0dc59d73224351ee52a95fee0f1a617a2eae0e7d9d720cc622c73a54186" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.13.2", ] [[package]] name = "redis" -version = "0.23.3" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f49cdc0bb3f412bf8e7d1bd90fe1d9eb10bc5c399ba90973c14662a27b3f8ba" +checksum = "2acbc41a996f7652b2ddd9dfd98cc4ff602cfd742ae35382f07f608405ab50ed" dependencies = [ - "async-trait", + "arcstr", + "async-lock", "bytes", + "cfg-if", "combine", "futures-util", "itoa", "percent-encoding", "pin-project-lite", "ryu", + "socket2", "tokio", "tokio-util", "url", + "xxhash-rust", ] [[package]] name = "redox_syscall" -version = "0.4.1" +version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "ed2bf2547551a7053d6fdfafda3f938979645c44812fbfcda098faae3f1a362d" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.13.2", ] [[package]] -name = "regex" -version = "1.10.4" +name = "ref-cast" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "7e440fb4e4b4147295338efb76001ab9e4efc0e5839df2c47fc5ac2381d365c3" dependencies = [ - "aho-corasick 1.1.3", - "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.2", + "ref-cast-impl", ] [[package]] -name = "regex-automata" -version = "0.1.10" +name = "ref-cast-impl" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +checksum = "92ecd8964f8453721699a1ed72037b0db49ce2f5a5138486ee89bed6f67cdf3a" dependencies = [ - "regex-syntax 0.6.29", + "proc-macro2", + "quote", + "syn 3.0.5", ] [[package]] -name = "regex-automata" -version = "0.4.6" +name = "regex" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "f020237b6c8eed93db2e2cb53c00c60a8e1bc73da7d073199a1180401450218d" dependencies = [ - "aho-corasick 1.1.3", + "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-automata", + "regex-syntax", ] [[package]] -name = "regex-syntax" -version = "0.6.29" +name = "regex-automata" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +checksum = "ad8553b9b26413251cbf30e620595c7a41b3887f03da04579c0e6b0d6a06b4b2" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" [[package]] name = "reqwest" -version = "0.11.27" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" +checksum = "16a1cfa75cc186dd73d5818e510e042e40927bccc9c236b061cea97e1eb08029" dependencies = [ - "base64", + "base64 0.23.1", "bytes", - "encoding_rs", + "futures-channel", "futures-core", "futures-util", - "h2", "http", "http-body", + "http-body-util", "hyper", "hyper-rustls", - "ipnet", + "hyper-util", "js-sys", "log", - "mime", - "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.10", - "rustls-pemfile 1.0.4", + "quinn", + "rustls", + "rustls-pki-types", + "rustls-platform-verifier", "serde", "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls", + "tower", + "tower-http", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots", - "winreg", ] [[package]] name = "ring" -version = "0.17.8" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", - "getrandom", + "getrandom 0.2.17", "libc", - "spin", - "untrusted", + "untrusted 0.9.0", "windows-sys 0.52.0", ] [[package]] -name = "rustc-demangle" -version = "0.1.23" +name = "rustc-hash" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" [[package]] -name = "rustix" -version = "0.38.32" +name = "rustc_version" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "bitflags 2.5.0", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", + "semver", ] [[package]] -name = "rustls" -version = "0.21.10" +name = "rustix" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ - "log", - "ring", - "rustls-webpki 0.101.7", - "sct", + "bitflags 2.13.2", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", ] [[package]] name = "rustls" -version = "0.22.2" +version = "0.23.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" +checksum = "0d41d731c7d2f962d1ccc364cec258de3c0e93b38c2fb3ba97ac74513048d634" dependencies = [ + "aws-lc-rs", "log", - "ring", + "once_cell", "rustls-pki-types", - "rustls-webpki 0.102.2", + "rustls-webpki", "subtle", "zeroize", ] [[package]] name = "rustls-native-certs" -version = "0.6.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +checksum = "dab5152771c58876a2146916e53e35057e1a4dfa2b9df0f0305b07f611fdea4d" dependencies = [ "openssl-probe", - "rustls-pemfile 1.0.4", + "rustls-pki-types", "schannel", "security-framework", ] [[package]] -name = "rustls-pemfile" -version = "1.0.4" +name = "rustls-pki-types" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +checksum = "2f4925028c7eb5d1fcdaf196971378ed9d2c1c4efc7dc5d011256f76c99c0a96" dependencies = [ - "base64", + "web-time", + "zeroize", ] [[package]] -name = "rustls-pemfile" -version = "2.1.1" +name = "rustls-platform-verifier" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f48172685e6ff52a556baa527774f61fcaa884f59daf3375c62a3f1cd2549dab" +checksum = "26d1e2536ce4f35f4846aa13bff16bd0ff40157cdb14cc056c7b14ba41233ba0" dependencies = [ - "base64", - "rustls-pki-types", + "core-foundation", + "core-foundation-sys", + "jni", + "log", + "once_cell", + "rustls", + "rustls-native-certs", + "rustls-platform-verifier-android", + "rustls-webpki", + "security-framework", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.61.2", ] [[package]] -name = "rustls-pki-types" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "868e20fada228fefaf6b652e00cc73623d54f8171e7352c18bb281571f2d92da" - -[[package]] -name = "rustls-webpki" -version = "0.101.7" +name = "rustls-platform-verifier-android" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring", - "untrusted", -] +checksum = "f87165f0995f63a9fbeea62b64d10b4d9d8e78ec6d7d51fb2125fda7bb36788f" [[package]] name = "rustls-webpki" -version = "0.102.2" +version = "0.103.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +checksum = "f3c3cf1d8b1e7d4927e2d154c3fcb02979afb9939629c62cd9048d4f07b60ac2" dependencies = [ + "aws-lc-rs", "ring", "rustls-pki-types", - "untrusted", + "untrusted 0.9.0", ] [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" + +[[package]] +name = "same-file" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] -name = "scopeguard" -version = "1.2.0" +name = "schemars" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] [[package]] -name = "sct" -version = "0.7.1" +name = "schemars" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +checksum = "687274d293b6cdc6e73e0fee520bf2049650090d7164f87672d212a3c530cf4a" dependencies = [ - "ring", - "untrusted", + "dyn-clone", + "ref-cast", + "serde", + "serde_json", ] +[[package]] +name = "scoped-env" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a86338a78d9058ae1bb70bf4ec558e9c51c611b443a356f7d041d29bb6c1c026" + +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + [[package]] name = "security-framework" -version = "2.9.2" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.13.2", "core-foundation", "core-foundation-sys", "libc", @@ -1990,54 +2692,73 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" dependencies = [ "core-foundation-sys", "libc", ] +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + [[package]] name = "serde" -version = "1.0.197" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.229" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 3.0.5", ] [[package]] name = "serde_json" -version = "1.0.114" +version = "1.0.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.14.2", "itoa", - "ryu", + "memchr", "serde", + "serde_core", + "zmij", ] [[package]] name = "serde_path_to_error" -version = "0.1.16" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" +checksum = "10a9ff822e371bb5403e391ecd83e182e0e77ba7f6fe0160b795797109d1b457" dependencies = [ "itoa", "serde", + "serde_core", ] [[package]] @@ -2054,17 +2775,20 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.7.0" +version = "3.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee80b0e361bbf88fd2f6e242ccd19cfda072cb0faa6ae694ecee08199938569a" +checksum = "935177bb8c0cd8ca1a4e6d1a2ac8988bea69cab4f9d3a31311e012ad27868ea4" dependencies = [ - "base64", + "base64 0.23.1", + "bs58", "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.2.6", - "serde", - "serde_derive", + "indexmap 2.14.2", + "jiff", + "schemars 0.9.0", + "schemars 1.2.2", + "serde_core", "serde_json", "serde_with_macros", "time", @@ -2072,32 +2796,46 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.7.0" +version = "3.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6561dc161a9224638a31d876ccdfefbc1df91d3f3a8342eddb35f055d48c7655" +checksum = "1d607aa01a3cb0ad757d6fd216136910db3c97b102fe686585689615a02dbcdc" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.55", + "syn 3.0.5", ] [[package]] -name = "sha1" -version = "0.10.6" +name = "serial_test" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +checksum = "a6df5ed973ad8d834e09f824f9e9f449af6b9a3745f78dec7cc752770bd3bf11" dependencies = [ - "cfg-if", - "cpufeatures", - "digest", + "futures-executor", + "futures-util", + "log", + "once_cell", + "parking_lot", + "serial_test_derive", +] + +[[package]] +name = "serial_test_derive" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a22144e767da4ddd8416dbf383700542ffd8a5dc493dfecedfe1fe3ad03c98ae" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.5", ] [[package]] name = "sha2" -version = "0.10.8" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "446ba717509524cb3f22f17ecc096f10f4822d76ab5c0b9822c5f9c284e825f4" dependencies = [ "cfg-if", "cpufeatures", @@ -2114,84 +2852,115 @@ dependencies = [ ] [[package]] -name = "sketches-ddsketch" -version = "0.2.2" +name = "shlex" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85636c14b73d81f541e525f585c0a2109e6744e1565b5c1668e31c70c10ed65c" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] -name = "slab" -version = "0.4.9" +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" dependencies = [ - "autocfg", + "errno", + "libc", +] + +[[package]] +name = "simd_cesu8" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11031e251abf8611c80f460e19dbdeb54a66db918e49c65a7065b46ac7aec520" +dependencies = [ + "rustc_version", + "simdutf8", ] +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + +[[package]] +name = "sketches-ddsketch" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c6f73aeb92d671e0cc4dca167e59b2deb6387c375391bc99ee743f326994a2b" + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + [[package]] name = "smallvec" -version = "1.13.2" +version = "1.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "ba467056f1b547ed52077911161fc86985becbc60e8e1857c8a144dab0def891" [[package]] name = "socket2" -version = "0.5.6" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "c3d1e2c7f27f8d4cb10542a02c49005dbd6e93095799d6f3be745fae9f8fedd4" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - -[[package]] -name = "strsim" -version = "0.10.0" +name = "stable_deref_trait" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "strsim" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.25.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +checksum = "9628de9b8791db39ceda2b119bbe13134770b56c138ec1d3af810d045c04f9bd" +dependencies = [ + "strum_macros", +] [[package]] name = "strum_macros" -version = "0.25.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" +checksum = "ab85eea0270ee17587ed4156089e10b9e6880ee688791d45a905f5b1ca36f664" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", - "rustversion", - "syn 2.0.55", + "syn 2.0.119", ] [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "1.0.109" +version = "2.0.119" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" dependencies = [ "proc-macro2", "quote", @@ -2200,9 +2969,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.55" +version = "3.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0" +checksum = "12df2e0110f65b775f769bb17ef989067a1d931b2eb822bd4346631eeada89f9" dependencies = [ "proc-macro2", "quote", @@ -2211,237 +2980,229 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "system-configuration" -version = "0.5.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "system-configuration-sys", + "futures-core", ] [[package]] -name = "system-configuration-sys" -version = "0.5.0" +name = "synstructure" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ - "core-foundation-sys", - "libc", + "proc-macro2", + "quote", + "syn 2.0.119", ] [[package]] name = "tempfile" -version = "3.10.1" +version = "3.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ - "cfg-if", "fastrand", + "getrandom 0.4.3", + "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] name = "terminal_size" -version = "0.3.0" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +checksum = "230a1b821ccbd75b185820a1f1ff7b14d21da1e442e22c0863ea5f08771a8874" dependencies = [ "rustix", - "windows-sys 0.48.0", + "windows-sys 0.61.2", ] [[package]] name = "thiserror" -version = "1.0.58" +version = "2.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "2.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 3.0.5", ] [[package]] name = "thread_local" -version = "1.1.8" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +checksum = "1ad99c4c6d32803332c548b1af0540b357b3f5fc0be8f6c6bfe8b2e6ae784070" dependencies = [ "cfg-if", - "once_cell", +] + +[[package]] +name = "tikv-jemalloc-sys" +version = "0.7.1+5.3.1-0-g81034ce1f1373e37dc865038e1bc8eeecf559ce8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a2825c78386b4ae0314074867860ba9577875de945f05992c38815cbec327f0" +dependencies = [ + "cc", + "libc", +] + +[[package]] +name = "tikv-jemallocator" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "249f09e49ab1609436f34c776e84231bead18d6a955f119f939bdc1d847561bd" +dependencies = [ + "libc", + "tikv-jemalloc-sys", ] [[package]] name = "time" -version = "0.3.34" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "cdb87b95ec50ddfa440816d227a17b2ccbdda963a316a727fda0fc4334f7d134" dependencies = [ "deranged", - "itoa", "num-conv", "powerfmt", - "serde", + "serde_core", "time-core", "time-macros", ] [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "7e689342a48d2ea927c87ea50cabf8594854bf940e9310208848d680d668ed85" dependencies = [ "num-conv", "time-core", ] [[package]] -name = "tinyvec" -version = "1.6.0" +name = "tinystr" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "b1e27c91459209c2986af3dcf603a5a74a4368754ce37414f59acc971167f643" dependencies = [ - "tinyvec_macros", + "displaydoc", + "zerovec", ] [[package]] -name = "tinyvec_macros" -version = "0.1.1" +name = "tinyvec" +version = "1.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +checksum = "fd3ca314f692efd6c868f8408f53fe444634a845f96c028b97d35f6a1f79f0ee" [[package]] name = "tokio" -version = "1.36.0" +version = "1.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "202caea871b69668250d242070849eb495be178ed697a3e98aebce5bc81a0bed" dependencies = [ - "backtrace", "bytes", "libc", "mio", - "num_cpus", "parking_lot", "pin-project-lite", + "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.48.0", -] - -[[package]] -name = "tokio-io-timeout" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" -dependencies = [ - "pin-project-lite", - "tokio", + "windows-sys 0.61.2", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "78773a2a397f451582ce068015985c33193cf6dea8b74d2a639fe457b2f07b0e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 3.0.5", ] [[package]] name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls 0.21.10", - "tokio", -] - -[[package]] -name = "tokio-rustls" -version = "0.25.0" +version = "0.26.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +checksum = "b0c85f2c3ef0b1cd58b36682f4b17aaa995f0e5db534d85692b4903abce21f67" dependencies = [ - "rustls 0.22.2", - "rustls-pki-types", + "rustls", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "a3d06f0b082ba57c26b79407372e57cf2a1e28124f78e9479fe80322cf53420b" dependencies = [ "futures-core", "pin-project-lite", "tokio", + "tokio-util", ] [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "494815d09bf52b5548659851081238f0ca39ff638363907596da739561c62c52" dependencies = [ "bytes", "futures-core", "futures-sink", + "libc", "pin-project-lite", "tokio", - "tracing", ] [[package]] name = "tonic" -version = "0.11.0" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76c4eb7a4e9ef9d4763600161f12f5070b92a578e1b634db88a6887844c91a13" +checksum = "ac2a5518c70fa84342385732db33fb3f44bc4cc748936eb5833d2df34d6445ef" dependencies = [ - "async-stream", "async-trait", "axum", - "base64", + "base64 0.22.1", "bytes", "h2", "http", "http-body", + "http-body-util", "hyper", "hyper-timeout", + "hyper-util", "percent-encoding", "pin-project", - "prost", - "rustls-pemfile 2.1.1", - "rustls-pki-types", + "socket2", + "sync_wrapper", "tokio", - "tokio-rustls 0.25.0", + "tokio-rustls", "tokio-stream", "tower", "tower-layer", @@ -2451,30 +3212,55 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.11.0" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c68f61875ac5293cf72e6c8cf0158086428c82c37229e98c840878f1706b0322" +dependencies = [ + "prettyplease", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "tonic-prost" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50849f68853be452acf590cde0b146665b8d507b3b8af17261df47e02c209ea0" +dependencies = [ + "bytes", + "prost", + "tonic", +] + +[[package]] +name = "tonic-prost-build" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4ef6dd70a610078cb4e338a0f79d06bc759ff1b22d2120c2ff02ae264ba9c2" +checksum = "654e5643eff75d7f8c99197ce1440ed19a3474eada74c12bbac488b2cafdae27" dependencies = [ "prettyplease", "proc-macro2", "prost-build", + "prost-types", "quote", - "syn 2.0.55", + "syn 2.0.119", + "tempfile", + "tonic-build", ] [[package]] name = "tower" -version = "0.4.13" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" dependencies = [ "futures-core", "futures-util", - "indexmap 1.9.3", - "pin-project", + "indexmap 2.14.2", "pin-project-lite", - "rand", "slab", + "sync_wrapper", "tokio", "tokio-util", "tower-layer", @@ -2482,23 +3268,41 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower-http" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" +dependencies = [ + "bitflags 2.13.2", + "bytes", + "futures-util", + "http", + "http-body", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", + "url", +] + [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" dependencies = [ "log", "pin-project-lite", @@ -2508,20 +3312,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.119", ] [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" dependencies = [ "once_cell", "valuable", @@ -2550,14 +3354,14 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" dependencies = [ "matchers", "nu-ansi-term", "once_cell", - "regex", + "regex-automata", "sharded-slab", "smallvec", "thread_local", @@ -2574,63 +3378,27 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" - -[[package]] -name = "typetag" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "661d18414ec032a49ece2d56eee03636e43c4e8d577047ab334c0ba892e29aaf" -dependencies = [ - "erased-serde", - "inventory", - "once_cell", - "serde", - "typetag-impl", -] - -[[package]] -name = "typetag-impl" -version = "0.2.16" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac73887f47b9312552aa90ef477927ff014d63d1920ca8037c6c1951eab64bb1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.55", -] +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" [[package]] name = "unicase" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.15" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] -name = "unicode-normalization" -version = "0.1.23" +name = "untrusted" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" -dependencies = [ - "tinyvec", -] +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "untrusted" @@ -2638,40 +3406,63 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" +[[package]] +name = "unty" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d49784317cd0d1ee7ec5c716dd598ec5b4483ea832a2dced265471cc0f690ae" + [[package]] name = "url" -version = "2.5.0" +version = "2.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" dependencies = [ "form_urlencoded", "idna", "percent-encoding", + "serde", ] +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "valuable" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] -name = "version_check" -version = "0.9.4" +name = "virtue" +version = "0.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "051eb1abcf10076295e815102942cc58f9d5e3b4560e46e53c21e8ff6f3af7b1" [[package]] -name = "virtue" -version = "0.0.13" +name = "walkdir" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dcc60c0624df774c82a0ef104151231d37da4962957d691c011c852b2473314" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] [[package]] name = "want" @@ -2684,58 +3475,47 @@ dependencies = [ [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] -name = "wasm-bindgen" -version = "0.2.92" +name = "wasip2" +version = "1.0.4+wasi-0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" dependencies = [ - "cfg-if", - "wasm-bindgen-macro", + "wit-bindgen", ] [[package]] -name = "wasm-bindgen-backend" -version = "0.2.92" +name = "wasm-bindgen" +version = "0.2.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "aecb87a33d3b0c5e3b7aa46336eaf486cffafbd281b195e4c8b80d50df2351bf" dependencies = [ - "bumpalo", - "log", + "cfg-if", "once_cell", - "proc-macro2", - "quote", - "syn 2.0.55", + "rustversion", + "wasm-bindgen-macro", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "6ef4c5d3d2cdf5c54f4231181768f5510842e350db025faf1f7163b1030ed928" dependencies = [ - "cfg-if", "js-sys", "wasm-bindgen", - "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "a690d511e3c1a8b3a55e33511e3c2c00c78415cd23650f32b808627f5696b9ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2743,62 +3523,53 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "411e4887f0071ef2d2164a9d5fdf2d20efbef78fccd3a78b0c10a1dc5295e48a" dependencies = [ + "bumpalo", "proc-macro2", "quote", - "syn 2.0.55", - "wasm-bindgen-backend", + "syn 3.0.5", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "81941cd78d0c92026c33e5e01312845a4cb1e9af3407f9134b100dd03144103e" +dependencies = [ + "unicode-ident", +] [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "9fbddc4a036f00ec4f18c83445bd3115cb306a91da554919a099d9222fe4a7f8" dependencies = [ "js-sys", "wasm-bindgen", ] [[package]] -name = "webpki-roots" -version = "0.25.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" - -[[package]] -name = "which" -version = "4.4.2" +name = "web-time" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ - "either", - "home", - "once_cell", - "rustix", + "js-sys", + "wasm-bindgen", ] [[package]] -name = "which" -version = "5.0.0" +name = "webpki-root-certs" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bf3ea8596f3a0dd5980b46430f2058dfe2c36a27ccfbb1845d6fbfcd9ba6e14" +checksum = "b96554aa2acc8ccdb7e1c9a58a7a68dd5d13bccc69cd124cb09406db612a1c9b" dependencies = [ - "either", - "home", - "once_cell", - "rustix", - "windows-sys 0.48.0", + "rustls-pki-types", ] [[package]] @@ -2817,6 +3588,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -2825,20 +3605,61 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.52.0" +version = "0.62.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" dependencies = [ - "windows-targets 0.52.4", + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", ] [[package]] -name = "windows-sys" -version = "0.48.0" +name = "windows-implement" +version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "053e2e040ab57b9dc951b72c264860db7eb3b0200ba345b4e4c3b14f67855ddf" dependencies = [ - "windows-targets 0.48.5", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-interface" +version = "0.59.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f316c4a2570ba26bbec722032c4099d8c8bc095efccdc15688708623367e358" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-result" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" +dependencies = [ + "windows-link", ] [[package]] @@ -2847,135 +3668,205 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets", ] [[package]] -name = "windows-targets" -version = "0.48.5" +name = "windows-sys" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-link", ] [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.4" +name = "windows_aarch64_msvc" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" +name = "windows_i686_gnu" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] -name = "windows_aarch64_msvc" -version = "0.52.4" +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] -name = "windows_i686_gnu" -version = "0.48.5" +name = "windows_i686_msvc" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] -name = "windows_i686_gnu" -version = "0.52.4" +name = "windows_x86_64_gnu" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] -name = "windows_i686_msvc" -version = "0.48.5" +name = "windows_x86_64_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] -name = "windows_i686_msvc" -version = "0.52.4" +name = "windows_x86_64_msvc" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" +name = "wit-bindgen" +version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" [[package]] -name = "windows_x86_64_gnu" -version = "0.52.4" +name = "writeable" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" [[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" +name = "xxhash-rust" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +checksum = "aee1b19627c7c60102ab80d3a9cbe18de90bfe03bfa6c3715447681f0e8c8af6" [[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.4" +name = "yoke" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] [[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" +name = "yoke-derive" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "synstructure", +] [[package]] -name = "windows_x86_64_msvc" -version = "0.52.4" +name = "zerocopy" +version = "0.8.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "d35102a9f36d089ccae9e4c6802bc118be4487b80aaffc0ab4e0cf5ce92d2873" +dependencies = [ + "zerocopy-derive", +] [[package]] -name = "winreg" -version = "0.50.0" +name = "zerocopy-derive" +version = "0.8.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +checksum = "146c01f5ab44258da43cf276c74a2763db2ff3969c9c652c3f2de07041d0b2bc" dependencies = [ - "cfg-if", - "windows-sys 0.48.0", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "zerofrom" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "synstructure", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" + +[[package]] +name = "zerotrie" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea269c3bd32f0a32c321907a2ae912ba6f4649bb0fc764a15627e99a7095a3f" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0464e17806c1d976d5cba29399c7f08e516e279e2ba493f63123b5fca67dd8" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34df6fc39dbd26ddc9c10e6a2984476e13acce22e64e4487636ef494369225da" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.5", +] + +[[package]] +name = "zmij" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/Cargo.toml b/Cargo.toml index 2675241..028cf6c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "geocode-csv" -version = "1.4.0" -authors = ["Eric Kidd "] -edition = "2018" +version = "1.5.0-alpha.1" +authors = ["Eric Kidd ", "Seamus Abshere "] +edition = "2021" description = "CLI tool to bulk geocode CSV data using the Smarty API or libpostal" license = "Apache-2.0 OR MIT" @@ -11,68 +11,63 @@ repository = "https://github.com/faradayio/geocode-csv" documentation = "https://github.com/faradayio/geocode-csv" [dev-dependencies] -cli_test_dir = "0.1.7" -reqwest = { version = "0.11.18", default-features = false, features = [ - "blocking", -] } +cli_test_dir = "^0.1.8" +reqwest = { version = "^0.13.5", default-features = false, features = ["blocking", "json", "rustls"] } +scoped-env = "^2.1.0" +serial_test = "^4.0.1" +tempfile = "^3.27.0" [dependencies] -anyhow = { version = "1.0.40", features = ["backtrace"] } -async-trait = "0.1.52" -axum = { version = "0.6.19", default-features = false, features = [ +anyhow = { version = "^1.0.104", features = ["backtrace"] } +async-trait = "^0.1.92" +axum = { version = "^0.8.9", default-features = false, features = [ "http1", "tokio", "tower-log", "tracing", - "headers", "json", ] } -bb8 = "0.8.0" -bb8-redis = "0.13.1" -bigtable_rs = "0.2.5" -bincode = { version = "2.0.0-rc.2", features = ["serde"] } -clap = { version = "4.3.0", features = ["derive", "wrap_help"] } -csv = "1.0.7" -futures = "0.3.4" -hyper = { version = "0.14.7", features = ["client", "http2", "stream"] } -hyper-rustls = { version = "0.24.1", features = [ - "rustls-native-certs", - "http2", -] } -leaky-bucket = "1.0.1" +bb8 = "^0.9.1" +bb8-redis = "^0.26.0" +bigtable_rs = "^0.4.1" +googleapis-tonic-google-bigtable-v2 = "0.39.0" +# bincode 3.0.0 on crates.io is a tombstone that only emits compile_error!. +bincode = { version = "2.0.1", features = ["serde"] } +clap = { version = "^4.6.6", features = ["derive", "wrap_help"] } +csv = "^1.4.0" +futures = "^0.3.34" +gcp_auth = { version = "^0.12.7", default-features = false } +google-cloud-auth = { version = "^1.16", default-features = false } +leaky-bucket = "^1.1.2" libpostal-rust = { version = "0.1.1", path = "crates/libpostal-rust" } -# These need to be updated alongside `opinionated_metrics` and its supporting -# crates. -metrics = "0.20.1" -metrics-util = "0.14.0" +metrics = "^0.24.6" +metrics-util = "^0.20.4" opinionated_metrics = { version = "0.2.0", path = "crates/opinionated_metrics" } -redis = { version = "0.23.2", default-features = false, features = [ +reqwest = { version = "^0.13.5", default-features = false, features = ["json", "rustls"] } +redis = { version = "^1.7.0", default-features = false, features = [ "aio", "tokio-comp", ] } -serde = { version = "1.0.92", features = ["derive"] } -# Last version of `serde_derive` that can be built from source. See -# https://github.com/serde-rs/serde/issues/2538. -serde_derive = "1.0.184" +rustls = { version = "^0.23", default-features = false, features = ["aws-lc-rs"] } +serde = { version = "^1.0.229", features = ["derive"] } # IMPORTANT: We require `preserve_order` to correctly handle "structure" JSON # specifications in a way that puts the right data in the right output columns. -serde_json = { version = "1.0.39", features = ["preserve_order"] } -sha2 = "0.10.1" -strum = "0.25.0" -strum_macros = "0.25.2" -tokio = { version = "1.6.0", features = [ +serde_json = { version = "^1.0.151", features = ["preserve_order"] } +sha2 = "^0.11.0" +strum = { version = "^0.28.0", features = ["derive"] } +tokio = { version = "^1.53.1", features = [ "io-util", "macros", "rt-multi-thread", "sync", ] } -tokio-stream = "0.1.6" -tracing = "0.1.29" -tracing-subscriber = { version = "0.3.7", features = ["env-filter"] } -url = "2.1.1" +tokio-stream = "^0.1.19" +tracing = "^0.1.44" +tracing-subscriber = { version = "^0.3.23", features = ["env-filter"] } +url = "^2.5.8" [target.'cfg(not(target_env = "msvc"))'.dependencies] -jemallocator = { version = "0.5.4", features = ["profiling"], optional = true } +tikv-jemallocator = { version = "^0.7.0", features = ["profiling"], optional = true } # [profile.release] # debug = true diff --git a/README.md b/README.md index 5173a49..7dd02b0 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,32 @@ You can geocode multiple addresses per row as follows: This will insert two sets of columns, one beginning with `geocoded_shipping_` and the other with `geocoded_billing_`. +## Caching + +Pass `--cache=redis://...` or `--cache=bigtable://PROJECT/INSTANCE/TABLE` to store every geocoding result, including "no match" results, in a key/value store. Later runs read from the cache first and only call Smarty for addresses they have not seen. + +### Refreshing stale cache entries + +Smarty's coverage improves over time, so an address that failed to match last year may match today. With a BigTable cache, you can ask `geocode-csv` to re-geocode cached results as it reads them: + +```sh +geocode-csv --spec address_spec.json \ + --cache=bigtable://PROJECT/INSTANCE/TABLE \ + --refresh-failures-after-days=90 \ + --refresh-failures-max-attempts=4 \ + --refresh-rate=0.1 \ + < in.csv > out.csv +``` + +- `--refresh-failures-after-days=N` re-checks a cached "no match" once it is `N` days old. Each failed re-check doubles the wait (`N`, `2N`, `4N`, ...). +- `--refresh-failures-max-attempts=M` stops re-checking a failure after `M` refreshes. +- `--refresh-successes-after-days=N` (optional) re-checks a successful geocode once it is `N` days old. If Smarty then returns no match, the old result is kept. +- `--refresh-rate=F`, with `F` in `(0, 1]`, is required whenever a refresh period is set. Of the cache entries this run reads that are due for refresh, only fraction `F` are actually re-geocoded on any given day. The decision is derived from the cache key and the date, so the same entry gets the same answer all day. Use this to stop a cache that was loaded all at once from coming due all at once. + +Refresh only works with BigTable, because Redis does not record when a key was written. `--cache-hits-only` disables refresh. + +Rows written by this version can still be read by older versions of `geocode-csv`. + ## Build You'll need to run: diff --git a/crates/libpostal-rust/CHANGELOG.md b/crates/libpostal-rust/CHANGELOG.md index bd31b22..cd0f5ea 100644 --- a/crates/libpostal-rust/CHANGELOG.md +++ b/crates/libpostal-rust/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Changed + +- Replaced `lazy_static` with `std::sync::LazyLock`. +- Updated `thiserror` to 2.x. + ## [0.1.1] - 2022-02-17 ### Fixed diff --git a/crates/libpostal-rust/Cargo.toml b/crates/libpostal-rust/Cargo.toml index 88a5659..408d186 100644 --- a/crates/libpostal-rust/Cargo.toml +++ b/crates/libpostal-rust/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libpostal-rust" -version = "0.1.1" -authors = ["Eric Kidd "] +version = "0.1.2" +authors = ["Eric Kidd ", "Seamus Abshere "] edition = "2021" description = "High-level wrappers for libpostal address normalization (with locks to support thread-safe initialization)" @@ -12,7 +12,6 @@ repository = "https://github.com/faradayio/geocode-csv" documentation = "https://docs.rs/libpostal-rust" [dependencies] -lazy_static = "1.4.0" libpostal-sys = { version = "0.1.1", path = "../libpostal-sys" } -thiserror = "1.0.30" -tracing = "0.1.29" +thiserror = "2.0.20" +tracing = "0.1.44" diff --git a/crates/libpostal-rust/src/lib.rs b/crates/libpostal-rust/src/lib.rs index 3cf1a4f..0ba2ee4 100644 --- a/crates/libpostal-rust/src/lib.rs +++ b/crates/libpostal-rust/src/lib.rs @@ -42,7 +42,7 @@ use init::{ use libpostal_sys::{ libpostal_address_parser_response_destroy, libpostal_expand_address, libpostal_expansion_array_destroy, libpostal_get_address_parser_default_options, - libpostal_get_default_options, libpostal_parse_address, size_t, GLOBAL_LOCK, + libpostal_get_default_options, libpostal_parse_address, GLOBAL_LOCK, }; mod errors; @@ -123,7 +123,7 @@ pub fn expand_address(addr: &str, _opt: &ExpandAddressOptions) -> Result Result> = RwLock::new(None); -} +static DATA_DIRECTORY: LazyLock>> = + LazyLock::new(|| RwLock::new(None)); /// Probe for a libpostal data directory, returning the path, if any. pub(crate) fn probe_data_directory() -> Result { diff --git a/crates/libpostal-sys/CHANGELOG.md b/crates/libpostal-sys/CHANGELOG.md index bd31b22..00085b7 100644 --- a/crates/libpostal-sys/CHANGELOG.md +++ b/crates/libpostal-sys/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Changed + +- Replaced `lazy_static` with `std::sync::LazyLock`. +- Updated `autotools` to 0.2.7. + ## [0.1.1] - 2022-02-17 ### Fixed diff --git a/crates/libpostal-sys/Cargo.toml b/crates/libpostal-sys/Cargo.toml index d58c3ec..978cfae 100644 --- a/crates/libpostal-sys/Cargo.toml +++ b/crates/libpostal-sys/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "libpostal-sys" -version = "0.1.1" -authors = ["Eric Kidd "] +version = "0.1.2" +authors = ["Eric Kidd ", "Seamus Abshere "] edition = "2021" links = "postal" @@ -19,12 +19,9 @@ exclude = [ ] [build-dependencies] -autotools = "0.2" -# This turns out to be pretty heavy build dependency. Better to run it once -# manually, because we have a bundled `libpostal` that only changes when we -# update it. See the README.md file. -#bindgen = "0.53.1" +autotools = "0.2.7" +# Updated bindgen to latest version to fix null pointer dereference issues +bindgen = "0.72.1" [dependencies] -lazy_static = "1.4.0" diff --git a/crates/libpostal-sys/build.rs b/crates/libpostal-sys/build.rs index 79f3b3b..95497eb 100644 --- a/crates/libpostal-sys/build.rs +++ b/crates/libpostal-sys/build.rs @@ -5,11 +5,12 @@ //! as an Ubuntu PPE. use std::env; +use std::path::PathBuf; /// The main entry point to our build script. fn main() { build_libpostal(); - //bindgen_libpostal(); + bindgen_libpostal(); } /// Use `autotools` to compile `libpostal` as a static library. @@ -76,36 +77,34 @@ fn build_libpostal() { println!("cargo:rustc-link-lib=static=postal"); } -// We're doing this manually for now. See lib.rs. -// -// /// Use `bindgen` to generate a Rust version of `libpostal.h`. Note that this is -// /// very low-level, and it will require `unsafe` and the Rust C FFI to use. But -// /// at least we won't need to _declare_ the C header details. -// /// -// /// This is copied from https://rust-lang.github.io/rust-bindgen/tutorial-3.html -// /// and adapted only slightly. -// fn bindgen_libpostal() { -// // Tell cargo to invalidate the built crate whenever the wrapper changes -// println!("cargo:rerun-if-changed=wrapper.h"); +/// Use `bindgen` to generate a Rust version of `libpostal.h`. Note that this is +/// very low-level, and it will require `unsafe` and the Rust C FFI to use. But +/// at least we won't need to _declare_ the C header details. +/// +/// This is copied from https://rust-lang.github.io/rust-bindgen/tutorial-3.html +/// and adapted only slightly. +fn bindgen_libpostal() { + // Tell cargo to invalidate the built crate whenever the wrapper changes + println!("cargo:rerun-if-changed=wrapper.h"); -// // The bindgen::Builder is the main entry point -// // to bindgen, and lets you build up options for -// // the resulting bindings. -// let bindings = bindgen::Builder::default() -// // The input header we would like to generate -// // bindings for. -// .header("wrapper.h") -// // Tell cargo to invalidate the built crate whenever any of the -// // included header files changed. -// .parse_callbacks(Box::new(bindgen::CargoCallbacks)) -// // Finish the builder and generate the bindings. -// .generate() -// // Unwrap the Result and panic on failure. -// .expect("Unable to generate bindings"); + // The bindgen::Builder is the main entry point + // to bindgen, and lets you build up options for + // the resulting bindings. + let bindings = bindgen::Builder::default() + // The input header we would like to generate + // bindings for. + .header("wrapper.h") + // Tell cargo to invalidate the built crate whenever any of the + // included header files changed. + .parse_callbacks(Box::new(bindgen::CargoCallbacks::new())) + // Finish the builder and generate the bindings. + .generate() + // Unwrap the Result and panic on failure. + .expect("Unable to generate bindings"); -// // Write the bindings to the $OUT_DIR/bindings.rs file. -// let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); -// bindings -// .write_to_file(out_path.join("bindings.rs")) -// .expect("Couldn't write bindings!"); -// } + // Write the bindings to the $OUT_DIR/bindings.rs file. + let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); + bindings + .write_to_file(out_path.join("bindings.rs")) + .expect("Couldn't write bindings!"); +} diff --git a/crates/libpostal-sys/libpostal b/crates/libpostal-sys/libpostal index 56c4a5d..70c79af 160000 --- a/crates/libpostal-sys/libpostal +++ b/crates/libpostal-sys/libpostal @@ -1 +1 @@ -Subproject commit 56c4a5daf747343cd192490d05c35df693f314a3 +Subproject commit 70c79af0fecf21864854824179bd228c8532ce80 diff --git a/crates/libpostal-sys/src/bindings.rs b/crates/libpostal-sys/src/bindings.rs deleted file mode 100644 index 814cd04..0000000 --- a/crates/libpostal-sys/src/bindings.rs +++ /dev/null @@ -1,5078 +0,0 @@ -/* automatically generated by rust-bindgen 0.59.2 */ - -pub const _STDIO_H: u32 = 1; -pub const _FEATURES_H: u32 = 1; -pub const _DEFAULT_SOURCE: u32 = 1; -pub const __USE_ISOC11: u32 = 1; -pub const __USE_ISOC99: u32 = 1; -pub const __USE_ISOC95: u32 = 1; -pub const __USE_POSIX_IMPLICITLY: u32 = 1; -pub const _POSIX_SOURCE: u32 = 1; -pub const _POSIX_C_SOURCE: u32 = 200809; -pub const __USE_POSIX: u32 = 1; -pub const __USE_POSIX2: u32 = 1; -pub const __USE_POSIX199309: u32 = 1; -pub const __USE_POSIX199506: u32 = 1; -pub const __USE_XOPEN2K: u32 = 1; -pub const __USE_XOPEN2K8: u32 = 1; -pub const _ATFILE_SOURCE: u32 = 1; -pub const __USE_MISC: u32 = 1; -pub const __USE_ATFILE: u32 = 1; -pub const __USE_FORTIFY_LEVEL: u32 = 0; -pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0; -pub const _STDC_PREDEF_H: u32 = 1; -pub const __STDC_IEC_559__: u32 = 1; -pub const __STDC_IEC_559_COMPLEX__: u32 = 1; -pub const __STDC_ISO_10646__: u32 = 201706; -pub const __STDC_NO_THREADS__: u32 = 1; -pub const __GNU_LIBRARY__: u32 = 6; -pub const __GLIBC__: u32 = 2; -pub const __GLIBC_MINOR__: u32 = 27; -pub const _SYS_CDEFS_H: u32 = 1; -pub const __glibc_c99_flexarr_available: u32 = 1; -pub const __WORDSIZE: u32 = 64; -pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1; -pub const __SYSCALL_WORDSIZE: u32 = 64; -pub const __HAVE_GENERIC_SELECTION: u32 = 1; -pub const __GLIBC_USE_LIB_EXT2: u32 = 0; -pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0; -pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0; -pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0; -pub const _BITS_TYPES_H: u32 = 1; -pub const _BITS_TYPESIZES_H: u32 = 1; -pub const __OFF_T_MATCHES_OFF64_T: u32 = 1; -pub const __INO_T_MATCHES_INO64_T: u32 = 1; -pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1; -pub const __FD_SETSIZE: u32 = 1024; -pub const ____FILE_defined: u32 = 1; -pub const __FILE_defined: u32 = 1; -pub const _BITS_LIBIO_H: u32 = 1; -pub const _BITS_G_CONFIG_H: u32 = 1; -pub const ____mbstate_t_defined: u32 = 1; -pub const _G_HAVE_MMAP: u32 = 1; -pub const _G_HAVE_MREMAP: u32 = 1; -pub const _G_IO_IO_FILE_VERSION: u32 = 131073; -pub const _G_BUFSIZ: u32 = 8192; -pub const _IO_BUFSIZ: u32 = 8192; -pub const __GNUC_VA_LIST: u32 = 1; -pub const _IO_UNIFIED_JUMPTABLES: u32 = 1; -pub const EOF: i32 = -1; -pub const _IOS_INPUT: u32 = 1; -pub const _IOS_OUTPUT: u32 = 2; -pub const _IOS_ATEND: u32 = 4; -pub const _IOS_APPEND: u32 = 8; -pub const _IOS_TRUNC: u32 = 16; -pub const _IOS_NOCREATE: u32 = 32; -pub const _IOS_NOREPLACE: u32 = 64; -pub const _IOS_BIN: u32 = 128; -pub const _IO_MAGIC: u32 = 4222418944; -pub const _OLD_STDIO_MAGIC: u32 = 4206624768; -pub const _IO_MAGIC_MASK: u32 = 4294901760; -pub const _IO_USER_BUF: u32 = 1; -pub const _IO_UNBUFFERED: u32 = 2; -pub const _IO_NO_READS: u32 = 4; -pub const _IO_NO_WRITES: u32 = 8; -pub const _IO_EOF_SEEN: u32 = 16; -pub const _IO_ERR_SEEN: u32 = 32; -pub const _IO_DELETE_DONT_CLOSE: u32 = 64; -pub const _IO_LINKED: u32 = 128; -pub const _IO_IN_BACKUP: u32 = 256; -pub const _IO_LINE_BUF: u32 = 512; -pub const _IO_TIED_PUT_GET: u32 = 1024; -pub const _IO_CURRENTLY_PUTTING: u32 = 2048; -pub const _IO_IS_APPENDING: u32 = 4096; -pub const _IO_IS_FILEBUF: u32 = 8192; -pub const _IO_BAD_SEEN: u32 = 16384; -pub const _IO_USER_LOCK: u32 = 32768; -pub const _IO_FLAGS2_MMAP: u32 = 1; -pub const _IO_FLAGS2_NOTCANCEL: u32 = 2; -pub const _IO_FLAGS2_USER_WBUF: u32 = 8; -pub const _IO_SKIPWS: u32 = 1; -pub const _IO_LEFT: u32 = 2; -pub const _IO_RIGHT: u32 = 4; -pub const _IO_INTERNAL: u32 = 8; -pub const _IO_DEC: u32 = 16; -pub const _IO_OCT: u32 = 32; -pub const _IO_HEX: u32 = 64; -pub const _IO_SHOWBASE: u32 = 128; -pub const _IO_SHOWPOINT: u32 = 256; -pub const _IO_UPPERCASE: u32 = 512; -pub const _IO_SHOWPOS: u32 = 1024; -pub const _IO_SCIENTIFIC: u32 = 2048; -pub const _IO_FIXED: u32 = 4096; -pub const _IO_UNITBUF: u32 = 8192; -pub const _IO_STDIO: u32 = 16384; -pub const _IO_DONT_CLOSE: u32 = 32768; -pub const _IO_BOOLALPHA: u32 = 65536; -pub const _IOFBF: u32 = 0; -pub const _IOLBF: u32 = 1; -pub const _IONBF: u32 = 2; -pub const BUFSIZ: u32 = 8192; -pub const SEEK_SET: u32 = 0; -pub const SEEK_CUR: u32 = 1; -pub const SEEK_END: u32 = 2; -pub const P_tmpdir: &[u8; 5usize] = b"/tmp\0"; -pub const _BITS_STDIO_LIM_H: u32 = 1; -pub const L_tmpnam: u32 = 20; -pub const TMP_MAX: u32 = 238328; -pub const FILENAME_MAX: u32 = 4096; -pub const L_ctermid: u32 = 9; -pub const FOPEN_MAX: u32 = 16; -pub const _STDLIB_H: u32 = 1; -pub const WNOHANG: u32 = 1; -pub const WUNTRACED: u32 = 2; -pub const WSTOPPED: u32 = 2; -pub const WEXITED: u32 = 4; -pub const WCONTINUED: u32 = 8; -pub const WNOWAIT: u32 = 16777216; -pub const __WNOTHREAD: u32 = 536870912; -pub const __WALL: u32 = 1073741824; -pub const __WCLONE: u32 = 2147483648; -pub const __ENUM_IDTYPE_T: u32 = 1; -pub const __W_CONTINUED: u32 = 65535; -pub const __WCOREFLAG: u32 = 128; -pub const __HAVE_FLOAT128: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT128: u32 = 0; -pub const __HAVE_FLOAT64X: u32 = 1; -pub const __HAVE_FLOAT64X_LONG_DOUBLE: u32 = 1; -pub const __HAVE_FLOAT16: u32 = 0; -pub const __HAVE_FLOAT32: u32 = 1; -pub const __HAVE_FLOAT64: u32 = 1; -pub const __HAVE_FLOAT32X: u32 = 1; -pub const __HAVE_FLOAT128X: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT16: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT32: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT64: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT32X: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT64X: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT128X: u32 = 0; -pub const __HAVE_FLOATN_NOT_TYPEDEF: u32 = 0; -pub const __ldiv_t_defined: u32 = 1; -pub const __lldiv_t_defined: u32 = 1; -pub const RAND_MAX: u32 = 2147483647; -pub const EXIT_FAILURE: u32 = 1; -pub const EXIT_SUCCESS: u32 = 0; -pub const _SYS_TYPES_H: u32 = 1; -pub const __clock_t_defined: u32 = 1; -pub const __clockid_t_defined: u32 = 1; -pub const __time_t_defined: u32 = 1; -pub const __timer_t_defined: u32 = 1; -pub const _BITS_STDINT_INTN_H: u32 = 1; -pub const __BIT_TYPES_DEFINED__: u32 = 1; -pub const _ENDIAN_H: u32 = 1; -pub const __LITTLE_ENDIAN: u32 = 1234; -pub const __BIG_ENDIAN: u32 = 4321; -pub const __PDP_ENDIAN: u32 = 3412; -pub const __BYTE_ORDER: u32 = 1234; -pub const __FLOAT_WORD_ORDER: u32 = 1234; -pub const LITTLE_ENDIAN: u32 = 1234; -pub const BIG_ENDIAN: u32 = 4321; -pub const PDP_ENDIAN: u32 = 3412; -pub const BYTE_ORDER: u32 = 1234; -pub const _BITS_BYTESWAP_H: u32 = 1; -pub const _BITS_UINTN_IDENTITY_H: u32 = 1; -pub const _SYS_SELECT_H: u32 = 1; -pub const __FD_ZERO_STOS: &[u8; 6usize] = b"stosq\0"; -pub const __sigset_t_defined: u32 = 1; -pub const __timeval_defined: u32 = 1; -pub const _STRUCT_TIMESPEC: u32 = 1; -pub const FD_SETSIZE: u32 = 1024; -pub const _SYS_SYSMACROS_H: u32 = 1; -pub const _BITS_SYSMACROS_H: u32 = 1; -pub const _BITS_PTHREADTYPES_COMMON_H: u32 = 1; -pub const _THREAD_SHARED_TYPES_H: u32 = 1; -pub const _BITS_PTHREADTYPES_ARCH_H: u32 = 1; -pub const __SIZEOF_PTHREAD_MUTEX_T: u32 = 40; -pub const __SIZEOF_PTHREAD_ATTR_T: u32 = 56; -pub const __SIZEOF_PTHREAD_RWLOCK_T: u32 = 56; -pub const __SIZEOF_PTHREAD_BARRIER_T: u32 = 32; -pub const __SIZEOF_PTHREAD_MUTEXATTR_T: u32 = 4; -pub const __SIZEOF_PTHREAD_COND_T: u32 = 48; -pub const __SIZEOF_PTHREAD_CONDATTR_T: u32 = 4; -pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: u32 = 8; -pub const __SIZEOF_PTHREAD_BARRIERATTR_T: u32 = 4; -pub const __PTHREAD_MUTEX_LOCK_ELISION: u32 = 1; -pub const __PTHREAD_MUTEX_NUSERS_AFTER_KIND: u32 = 0; -pub const __PTHREAD_MUTEX_USE_UNION: u32 = 0; -pub const __PTHREAD_RWLOCK_INT_FLAGS_SHARED: u32 = 1; -pub const __PTHREAD_MUTEX_HAVE_PREV: u32 = 1; -pub const __have_pthread_attr_t: u32 = 1; -pub const _ALLOCA_H: u32 = 1; -pub const _STDINT_H: u32 = 1; -pub const _BITS_WCHAR_H: u32 = 1; -pub const _BITS_STDINT_UINTN_H: u32 = 1; -pub const INT8_MIN: i32 = -128; -pub const INT16_MIN: i32 = -32768; -pub const INT32_MIN: i32 = -2147483648; -pub const INT8_MAX: u32 = 127; -pub const INT16_MAX: u32 = 32767; -pub const INT32_MAX: u32 = 2147483647; -pub const UINT8_MAX: u32 = 255; -pub const UINT16_MAX: u32 = 65535; -pub const UINT32_MAX: u32 = 4294967295; -pub const INT_LEAST8_MIN: i32 = -128; -pub const INT_LEAST16_MIN: i32 = -32768; -pub const INT_LEAST32_MIN: i32 = -2147483648; -pub const INT_LEAST8_MAX: u32 = 127; -pub const INT_LEAST16_MAX: u32 = 32767; -pub const INT_LEAST32_MAX: u32 = 2147483647; -pub const UINT_LEAST8_MAX: u32 = 255; -pub const UINT_LEAST16_MAX: u32 = 65535; -pub const UINT_LEAST32_MAX: u32 = 4294967295; -pub const INT_FAST8_MIN: i32 = -128; -pub const INT_FAST16_MIN: i64 = -9223372036854775808; -pub const INT_FAST32_MIN: i64 = -9223372036854775808; -pub const INT_FAST8_MAX: u32 = 127; -pub const INT_FAST16_MAX: u64 = 9223372036854775807; -pub const INT_FAST32_MAX: u64 = 9223372036854775807; -pub const UINT_FAST8_MAX: u32 = 255; -pub const UINT_FAST16_MAX: i32 = -1; -pub const UINT_FAST32_MAX: i32 = -1; -pub const INTPTR_MIN: i64 = -9223372036854775808; -pub const INTPTR_MAX: u64 = 9223372036854775807; -pub const UINTPTR_MAX: i32 = -1; -pub const PTRDIFF_MIN: i64 = -9223372036854775808; -pub const PTRDIFF_MAX: u64 = 9223372036854775807; -pub const SIG_ATOMIC_MIN: i32 = -2147483648; -pub const SIG_ATOMIC_MAX: u32 = 2147483647; -pub const SIZE_MAX: i32 = -1; -pub const WINT_MIN: u32 = 0; -pub const WINT_MAX: u32 = 4294967295; -pub const true_: u32 = 1; -pub const false_: u32 = 0; -pub const __bool_true_false_are_defined: u32 = 1; -pub const LIBPOSTAL_MAX_LANGUAGE_LEN: u32 = 4; -pub const LIBPOSTAL_ADDRESS_NONE: u32 = 0; -pub const LIBPOSTAL_ADDRESS_ANY: u32 = 1; -pub const LIBPOSTAL_ADDRESS_NAME: u32 = 2; -pub const LIBPOSTAL_ADDRESS_HOUSE_NUMBER: u32 = 4; -pub const LIBPOSTAL_ADDRESS_STREET: u32 = 8; -pub const LIBPOSTAL_ADDRESS_UNIT: u32 = 16; -pub const LIBPOSTAL_ADDRESS_LEVEL: u32 = 32; -pub const LIBPOSTAL_ADDRESS_STAIRCASE: u32 = 64; -pub const LIBPOSTAL_ADDRESS_ENTRANCE: u32 = 128; -pub const LIBPOSTAL_ADDRESS_CATEGORY: u32 = 256; -pub const LIBPOSTAL_ADDRESS_NEAR: u32 = 512; -pub const LIBPOSTAL_ADDRESS_TOPONYM: u32 = 8192; -pub const LIBPOSTAL_ADDRESS_POSTAL_CODE: u32 = 16384; -pub const LIBPOSTAL_ADDRESS_PO_BOX: u32 = 32768; -pub const LIBPOSTAL_ADDRESS_ALL: u32 = 65535; -pub const LIBPOSTAL_NORMALIZE_STRING_LATIN_ASCII: u32 = 1; -pub const LIBPOSTAL_NORMALIZE_STRING_TRANSLITERATE: u32 = 2; -pub const LIBPOSTAL_NORMALIZE_STRING_STRIP_ACCENTS: u32 = 4; -pub const LIBPOSTAL_NORMALIZE_STRING_DECOMPOSE: u32 = 8; -pub const LIBPOSTAL_NORMALIZE_STRING_LOWERCASE: u32 = 16; -pub const LIBPOSTAL_NORMALIZE_STRING_TRIM: u32 = 32; -pub const LIBPOSTAL_NORMALIZE_STRING_REPLACE_HYPHENS: u32 = 64; -pub const LIBPOSTAL_NORMALIZE_STRING_COMPOSE: u32 = 128; -pub const LIBPOSTAL_NORMALIZE_STRING_SIMPLE_LATIN_ASCII: u32 = 256; -pub const LIBPOSTAL_NORMALIZE_STRING_REPLACE_NUMEX: u32 = 512; -pub const LIBPOSTAL_NORMALIZE_TOKEN_REPLACE_HYPHENS: u32 = 1; -pub const LIBPOSTAL_NORMALIZE_TOKEN_DELETE_HYPHENS: u32 = 2; -pub const LIBPOSTAL_NORMALIZE_TOKEN_DELETE_FINAL_PERIOD: u32 = 4; -pub const LIBPOSTAL_NORMALIZE_TOKEN_DELETE_ACRONYM_PERIODS: u32 = 8; -pub const LIBPOSTAL_NORMALIZE_TOKEN_DROP_ENGLISH_POSSESSIVES: u32 = 16; -pub const LIBPOSTAL_NORMALIZE_TOKEN_DELETE_OTHER_APOSTROPHE: u32 = 32; -pub const LIBPOSTAL_NORMALIZE_TOKEN_SPLIT_ALPHA_FROM_NUMERIC: u32 = 64; -pub const LIBPOSTAL_NORMALIZE_TOKEN_REPLACE_DIGITS: u32 = 128; -pub const LIBPOSTAL_NORMALIZE_TOKEN_REPLACE_NUMERIC_TOKEN_LETTERS: u32 = 256; -pub const LIBPOSTAL_NORMALIZE_TOKEN_REPLACE_NUMERIC_HYPHENS: u32 = 512; -pub const LIBPOSTAL_NORMALIZE_DEFAULT_STRING_OPTIONS: u32 = 245; -pub const LIBPOSTAL_NORMALIZE_DEFAULT_TOKEN_OPTIONS: u32 = 61; -pub const LIBPOSTAL_NORMALIZE_TOKEN_OPTIONS_DROP_PERIODS: u32 = 12; -pub const LIBPOSTAL_NORMALIZE_DEFAULT_TOKEN_OPTIONS_NUMERIC: u32 = 125; -pub type size_t = ::std::os::raw::c_ulong; -pub type __u_char = ::std::os::raw::c_uchar; -pub type __u_short = ::std::os::raw::c_ushort; -pub type __u_int = ::std::os::raw::c_uint; -pub type __u_long = ::std::os::raw::c_ulong; -pub type __int8_t = ::std::os::raw::c_schar; -pub type __uint8_t = ::std::os::raw::c_uchar; -pub type __int16_t = ::std::os::raw::c_short; -pub type __uint16_t = ::std::os::raw::c_ushort; -pub type __int32_t = ::std::os::raw::c_int; -pub type __uint32_t = ::std::os::raw::c_uint; -pub type __int64_t = ::std::os::raw::c_long; -pub type __uint64_t = ::std::os::raw::c_ulong; -pub type __quad_t = ::std::os::raw::c_long; -pub type __u_quad_t = ::std::os::raw::c_ulong; -pub type __intmax_t = ::std::os::raw::c_long; -pub type __uintmax_t = ::std::os::raw::c_ulong; -pub type __dev_t = ::std::os::raw::c_ulong; -pub type __uid_t = ::std::os::raw::c_uint; -pub type __gid_t = ::std::os::raw::c_uint; -pub type __ino_t = ::std::os::raw::c_ulong; -pub type __ino64_t = ::std::os::raw::c_ulong; -pub type __mode_t = ::std::os::raw::c_uint; -pub type __nlink_t = ::std::os::raw::c_ulong; -pub type __off_t = ::std::os::raw::c_long; -pub type __off64_t = ::std::os::raw::c_long; -pub type __pid_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __fsid_t { - pub __val: [::std::os::raw::c_int; 2usize], -} -#[test] -fn bindgen_test_layout___fsid_t() { - assert_eq!( - ::std::mem::size_of::<__fsid_t>(), - 8usize, - concat!("Size of: ", stringify!(__fsid_t)) - ); - assert_eq!( - ::std::mem::align_of::<__fsid_t>(), - 4usize, - concat!("Alignment of ", stringify!(__fsid_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__fsid_t>())).__val as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__fsid_t), - "::", - stringify!(__val) - ) - ); -} -pub type __clock_t = ::std::os::raw::c_long; -pub type __rlim_t = ::std::os::raw::c_ulong; -pub type __rlim64_t = ::std::os::raw::c_ulong; -pub type __id_t = ::std::os::raw::c_uint; -pub type __time_t = ::std::os::raw::c_long; -pub type __useconds_t = ::std::os::raw::c_uint; -pub type __suseconds_t = ::std::os::raw::c_long; -pub type __daddr_t = ::std::os::raw::c_int; -pub type __key_t = ::std::os::raw::c_int; -pub type __clockid_t = ::std::os::raw::c_int; -pub type __timer_t = *mut ::std::os::raw::c_void; -pub type __blksize_t = ::std::os::raw::c_long; -pub type __blkcnt_t = ::std::os::raw::c_long; -pub type __blkcnt64_t = ::std::os::raw::c_long; -pub type __fsblkcnt_t = ::std::os::raw::c_ulong; -pub type __fsblkcnt64_t = ::std::os::raw::c_ulong; -pub type __fsfilcnt_t = ::std::os::raw::c_ulong; -pub type __fsfilcnt64_t = ::std::os::raw::c_ulong; -pub type __fsword_t = ::std::os::raw::c_long; -pub type __ssize_t = ::std::os::raw::c_long; -pub type __syscall_slong_t = ::std::os::raw::c_long; -pub type __syscall_ulong_t = ::std::os::raw::c_ulong; -pub type __loff_t = __off64_t; -pub type __caddr_t = *mut ::std::os::raw::c_char; -pub type __intptr_t = ::std::os::raw::c_long; -pub type __socklen_t = ::std::os::raw::c_uint; -pub type __sig_atomic_t = ::std::os::raw::c_int; -pub type __FILE = _IO_FILE; -pub type FILE = _IO_FILE; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct __mbstate_t { - pub __count: ::std::os::raw::c_int, - pub __value: __mbstate_t__bindgen_ty_1, -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union __mbstate_t__bindgen_ty_1 { - pub __wch: ::std::os::raw::c_uint, - pub __wchb: [::std::os::raw::c_char; 4usize], -} -#[test] -fn bindgen_test_layout___mbstate_t__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::<__mbstate_t__bindgen_ty_1>(), - 4usize, - concat!("Size of: ", stringify!(__mbstate_t__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::<__mbstate_t__bindgen_ty_1>(), - 4usize, - concat!("Alignment of ", stringify!(__mbstate_t__bindgen_ty_1)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__mbstate_t__bindgen_ty_1>())).__wch as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t__bindgen_ty_1), - "::", - stringify!(__wch) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__mbstate_t__bindgen_ty_1>())).__wchb as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t__bindgen_ty_1), - "::", - stringify!(__wchb) - ) - ); -} -#[test] -fn bindgen_test_layout___mbstate_t() { - assert_eq!( - ::std::mem::size_of::<__mbstate_t>(), - 8usize, - concat!("Size of: ", stringify!(__mbstate_t)) - ); - assert_eq!( - ::std::mem::align_of::<__mbstate_t>(), - 4usize, - concat!("Alignment of ", stringify!(__mbstate_t)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__mbstate_t>())).__count as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t), - "::", - stringify!(__count) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__mbstate_t>())).__value as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__mbstate_t), - "::", - stringify!(__value) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct _G_fpos_t { - pub __pos: __off_t, - pub __state: __mbstate_t, -} -#[test] -fn bindgen_test_layout__G_fpos_t() { - assert_eq!( - ::std::mem::size_of::<_G_fpos_t>(), - 16usize, - concat!("Size of: ", stringify!(_G_fpos_t)) - ); - assert_eq!( - ::std::mem::align_of::<_G_fpos_t>(), - 8usize, - concat!("Alignment of ", stringify!(_G_fpos_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_G_fpos_t>())).__pos as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos_t), - "::", - stringify!(__pos) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_G_fpos_t>())).__state as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos_t), - "::", - stringify!(__state) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct _G_fpos64_t { - pub __pos: __off64_t, - pub __state: __mbstate_t, -} -#[test] -fn bindgen_test_layout__G_fpos64_t() { - assert_eq!( - ::std::mem::size_of::<_G_fpos64_t>(), - 16usize, - concat!("Size of: ", stringify!(_G_fpos64_t)) - ); - assert_eq!( - ::std::mem::align_of::<_G_fpos64_t>(), - 8usize, - concat!("Alignment of ", stringify!(_G_fpos64_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_G_fpos64_t>())).__pos as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos64_t), - "::", - stringify!(__pos) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_G_fpos64_t>())).__state as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_G_fpos64_t), - "::", - stringify!(__state) - ) - ); -} -pub type va_list = __builtin_va_list; -pub type __gnuc_va_list = __builtin_va_list; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _IO_jump_t { - _unused: [u8; 0], -} -pub type _IO_lock_t = ::std::os::raw::c_void; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _IO_marker { - pub _next: *mut _IO_marker, - pub _sbuf: *mut _IO_FILE, - pub _pos: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout__IO_marker() { - assert_eq!( - ::std::mem::size_of::<_IO_marker>(), - 24usize, - concat!("Size of: ", stringify!(_IO_marker)) - ); - assert_eq!( - ::std::mem::align_of::<_IO_marker>(), - 8usize, - concat!("Alignment of ", stringify!(_IO_marker)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_marker>()))._next as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_IO_marker), - "::", - stringify!(_next) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_marker>()))._sbuf as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_IO_marker), - "::", - stringify!(_sbuf) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_marker>()))._pos as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_IO_marker), - "::", - stringify!(_pos) - ) - ); -} -pub const __codecvt_result___codecvt_ok: __codecvt_result = 0; -pub const __codecvt_result___codecvt_partial: __codecvt_result = 1; -pub const __codecvt_result___codecvt_error: __codecvt_result = 2; -pub const __codecvt_result___codecvt_noconv: __codecvt_result = 3; -pub type __codecvt_result = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _IO_FILE { - pub _flags: ::std::os::raw::c_int, - pub _IO_read_ptr: *mut ::std::os::raw::c_char, - pub _IO_read_end: *mut ::std::os::raw::c_char, - pub _IO_read_base: *mut ::std::os::raw::c_char, - pub _IO_write_base: *mut ::std::os::raw::c_char, - pub _IO_write_ptr: *mut ::std::os::raw::c_char, - pub _IO_write_end: *mut ::std::os::raw::c_char, - pub _IO_buf_base: *mut ::std::os::raw::c_char, - pub _IO_buf_end: *mut ::std::os::raw::c_char, - pub _IO_save_base: *mut ::std::os::raw::c_char, - pub _IO_backup_base: *mut ::std::os::raw::c_char, - pub _IO_save_end: *mut ::std::os::raw::c_char, - pub _markers: *mut _IO_marker, - pub _chain: *mut _IO_FILE, - pub _fileno: ::std::os::raw::c_int, - pub _flags2: ::std::os::raw::c_int, - pub _old_offset: __off_t, - pub _cur_column: ::std::os::raw::c_ushort, - pub _vtable_offset: ::std::os::raw::c_schar, - pub _shortbuf: [::std::os::raw::c_char; 1usize], - pub _lock: *mut _IO_lock_t, - pub _offset: __off64_t, - pub __pad1: *mut ::std::os::raw::c_void, - pub __pad2: *mut ::std::os::raw::c_void, - pub __pad3: *mut ::std::os::raw::c_void, - pub __pad4: *mut ::std::os::raw::c_void, - pub __pad5: size_t, - pub _mode: ::std::os::raw::c_int, - pub _unused2: [::std::os::raw::c_char; 20usize], -} -#[test] -fn bindgen_test_layout__IO_FILE() { - assert_eq!( - ::std::mem::size_of::<_IO_FILE>(), - 216usize, - concat!("Size of: ", stringify!(_IO_FILE)) - ); - assert_eq!( - ::std::mem::align_of::<_IO_FILE>(), - 8usize, - concat!("Alignment of ", stringify!(_IO_FILE)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._flags as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_IO_FILE>()))._IO_read_ptr as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_ptr) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_IO_FILE>()))._IO_read_end as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_end) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_IO_FILE>()))._IO_read_base as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_read_base) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_IO_FILE>()))._IO_write_base as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_base) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_IO_FILE>()))._IO_write_ptr as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_ptr) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_IO_FILE>()))._IO_write_end as *const _ as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_write_end) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_IO_FILE>()))._IO_buf_base as *const _ as usize - }, - 56usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_base) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_IO_FILE>()))._IO_buf_end as *const _ as usize - }, - 64usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_buf_end) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_IO_FILE>()))._IO_save_base as *const _ as usize - }, - 72usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_base) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_IO_FILE>()))._IO_backup_base as *const _ as usize - }, - 80usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_backup_base) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_IO_FILE>()))._IO_save_end as *const _ as usize - }, - 88usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_IO_save_end) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._markers as *const _ as usize }, - 96usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_markers) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._chain as *const _ as usize }, - 104usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_chain) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._fileno as *const _ as usize }, - 112usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_fileno) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._flags2 as *const _ as usize }, - 116usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_flags2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_IO_FILE>()))._old_offset as *const _ as usize - }, - 120usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_old_offset) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_IO_FILE>()))._cur_column as *const _ as usize - }, - 128usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_cur_column) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<_IO_FILE>()))._vtable_offset as *const _ as usize - }, - 130usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_vtable_offset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._shortbuf as *const _ as usize }, - 131usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_shortbuf) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._lock as *const _ as usize }, - 136usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_lock) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._offset as *const _ as usize }, - 144usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_offset) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>())).__pad1 as *const _ as usize }, - 152usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(__pad1) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>())).__pad2 as *const _ as usize }, - 160usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(__pad2) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>())).__pad3 as *const _ as usize }, - 168usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(__pad3) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>())).__pad4 as *const _ as usize }, - 176usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(__pad4) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>())).__pad5 as *const _ as usize }, - 184usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(__pad5) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._mode as *const _ as usize }, - 192usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_mode) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<_IO_FILE>()))._unused2 as *const _ as usize }, - 196usize, - concat!( - "Offset of field: ", - stringify!(_IO_FILE), - "::", - stringify!(_unused2) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct _IO_FILE_plus { - _unused: [u8; 0], -} -extern "C" { - pub static mut _IO_2_1_stdin_: _IO_FILE_plus; -} -extern "C" { - pub static mut _IO_2_1_stdout_: _IO_FILE_plus; -} -extern "C" { - pub static mut _IO_2_1_stderr_: _IO_FILE_plus; -} -pub type __io_read_fn = ::std::option::Option< - unsafe extern "C" fn( - __cookie: *mut ::std::os::raw::c_void, - __buf: *mut ::std::os::raw::c_char, - __nbytes: size_t, - ) -> __ssize_t, ->; -pub type __io_write_fn = ::std::option::Option< - unsafe extern "C" fn( - __cookie: *mut ::std::os::raw::c_void, - __buf: *const ::std::os::raw::c_char, - __n: size_t, - ) -> __ssize_t, ->; -pub type __io_seek_fn = ::std::option::Option< - unsafe extern "C" fn( - __cookie: *mut ::std::os::raw::c_void, - __pos: *mut __off64_t, - __w: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int, ->; -pub type __io_close_fn = ::std::option::Option< - unsafe extern "C" fn( - __cookie: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int, ->; -extern "C" { - pub fn __underflow(arg1: *mut _IO_FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __uflow(arg1: *mut _IO_FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn __overflow( - arg1: *mut _IO_FILE, - arg2: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _IO_getc(__fp: *mut _IO_FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _IO_putc( - __c: ::std::os::raw::c_int, - __fp: *mut _IO_FILE, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _IO_feof(__fp: *mut _IO_FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _IO_ferror(__fp: *mut _IO_FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _IO_peekc_locked(__fp: *mut _IO_FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _IO_flockfile(arg1: *mut _IO_FILE); -} -extern "C" { - pub fn _IO_funlockfile(arg1: *mut _IO_FILE); -} -extern "C" { - pub fn _IO_ftrylockfile(arg1: *mut _IO_FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _IO_vfscanf( - arg1: *mut _IO_FILE, - arg2: *const ::std::os::raw::c_char, - arg3: *mut __va_list_tag, - arg4: *mut ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _IO_vfprintf( - arg1: *mut _IO_FILE, - arg2: *const ::std::os::raw::c_char, - arg3: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _IO_padn( - arg1: *mut _IO_FILE, - arg2: ::std::os::raw::c_int, - arg3: __ssize_t, - ) -> __ssize_t; -} -extern "C" { - pub fn _IO_sgetn( - arg1: *mut _IO_FILE, - arg2: *mut ::std::os::raw::c_void, - arg3: size_t, - ) -> size_t; -} -extern "C" { - pub fn _IO_seekoff( - arg1: *mut _IO_FILE, - arg2: __off64_t, - arg3: ::std::os::raw::c_int, - arg4: ::std::os::raw::c_int, - ) -> __off64_t; -} -extern "C" { - pub fn _IO_seekpos( - arg1: *mut _IO_FILE, - arg2: __off64_t, - arg3: ::std::os::raw::c_int, - ) -> __off64_t; -} -extern "C" { - pub fn _IO_free_backup_area(arg1: *mut _IO_FILE); -} -pub type off_t = __off_t; -pub type ssize_t = __ssize_t; -pub type fpos_t = _G_fpos_t; -extern "C" { - pub static mut stdin: *mut _IO_FILE; -} -extern "C" { - pub static mut stdout: *mut _IO_FILE; -} -extern "C" { - pub static mut stderr: *mut _IO_FILE; -} -extern "C" { - pub fn remove(__filename: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn rename( - __old: *const ::std::os::raw::c_char, - __new: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn renameat( - __oldfd: ::std::os::raw::c_int, - __old: *const ::std::os::raw::c_char, - __newfd: ::std::os::raw::c_int, - __new: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn tmpfile() -> *mut FILE; -} -extern "C" { - pub fn tmpnam(__s: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn tmpnam_r(__s: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn tempnam( - __dir: *const ::std::os::raw::c_char, - __pfx: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn fclose(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fflush(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fflush_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fopen( - __filename: *const ::std::os::raw::c_char, - __modes: *const ::std::os::raw::c_char, - ) -> *mut FILE; -} -extern "C" { - pub fn freopen( - __filename: *const ::std::os::raw::c_char, - __modes: *const ::std::os::raw::c_char, - __stream: *mut FILE, - ) -> *mut FILE; -} -extern "C" { - pub fn fdopen( - __fd: ::std::os::raw::c_int, - __modes: *const ::std::os::raw::c_char, - ) -> *mut FILE; -} -extern "C" { - pub fn fmemopen( - __s: *mut ::std::os::raw::c_void, - __len: size_t, - __modes: *const ::std::os::raw::c_char, - ) -> *mut FILE; -} -extern "C" { - pub fn open_memstream( - __bufloc: *mut *mut ::std::os::raw::c_char, - __sizeloc: *mut size_t, - ) -> *mut FILE; -} -extern "C" { - pub fn setbuf(__stream: *mut FILE, __buf: *mut ::std::os::raw::c_char); -} -extern "C" { - pub fn setvbuf( - __stream: *mut FILE, - __buf: *mut ::std::os::raw::c_char, - __modes: ::std::os::raw::c_int, - __n: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setbuffer( - __stream: *mut FILE, - __buf: *mut ::std::os::raw::c_char, - __size: size_t, - ); -} -extern "C" { - pub fn setlinebuf(__stream: *mut FILE); -} -extern "C" { - pub fn fprintf( - __stream: *mut FILE, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn printf( - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sprintf( - __s: *mut ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vfprintf( - __s: *mut FILE, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vprintf( - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vsprintf( - __s: *mut ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn snprintf( - __s: *mut ::std::os::raw::c_char, - __maxlen: ::std::os::raw::c_ulong, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vsnprintf( - __s: *mut ::std::os::raw::c_char, - __maxlen: ::std::os::raw::c_ulong, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vdprintf( - __fd: ::std::os::raw::c_int, - __fmt: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn dprintf( - __fd: ::std::os::raw::c_int, - __fmt: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fscanf( - __stream: *mut FILE, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn scanf( - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn sscanf( - __s: *const ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "\u{1}__isoc99_fscanf"] - pub fn fscanf1( - __stream: *mut FILE, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "\u{1}__isoc99_scanf"] - pub fn scanf1( - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "\u{1}__isoc99_sscanf"] - pub fn sscanf1( - __s: *const ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vfscanf( - __s: *mut FILE, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vscanf( - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn vsscanf( - __s: *const ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "\u{1}__isoc99_vfscanf"] - pub fn vfscanf1( - __s: *mut FILE, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "\u{1}__isoc99_vscanf"] - pub fn vscanf1( - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - #[link_name = "\u{1}__isoc99_vsscanf"] - pub fn vsscanf1( - __s: *const ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fgetc(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getc(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getchar() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getc_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getchar_unlocked() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fgetc_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fputc( - __c: ::std::os::raw::c_int, - __stream: *mut FILE, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putc( - __c: ::std::os::raw::c_int, - __stream: *mut FILE, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putchar(__c: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fputc_unlocked( - __c: ::std::os::raw::c_int, - __stream: *mut FILE, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putc_unlocked( - __c: ::std::os::raw::c_int, - __stream: *mut FILE, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putchar_unlocked(__c: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getw(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn putw( - __w: ::std::os::raw::c_int, - __stream: *mut FILE, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fgets( - __s: *mut ::std::os::raw::c_char, - __n: ::std::os::raw::c_int, - __stream: *mut FILE, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn __getdelim( - __lineptr: *mut *mut ::std::os::raw::c_char, - __n: *mut size_t, - __delimiter: ::std::os::raw::c_int, - __stream: *mut FILE, - ) -> __ssize_t; -} -extern "C" { - pub fn getdelim( - __lineptr: *mut *mut ::std::os::raw::c_char, - __n: *mut size_t, - __delimiter: ::std::os::raw::c_int, - __stream: *mut FILE, - ) -> __ssize_t; -} -extern "C" { - pub fn getline( - __lineptr: *mut *mut ::std::os::raw::c_char, - __n: *mut size_t, - __stream: *mut FILE, - ) -> __ssize_t; -} -extern "C" { - pub fn fputs( - __s: *const ::std::os::raw::c_char, - __stream: *mut FILE, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn puts(__s: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ungetc( - __c: ::std::os::raw::c_int, - __stream: *mut FILE, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fread( - __ptr: *mut ::std::os::raw::c_void, - __size: size_t, - __n: size_t, - __stream: *mut FILE, - ) -> size_t; -} -extern "C" { - pub fn fwrite( - __ptr: *const ::std::os::raw::c_void, - __size: size_t, - __n: size_t, - __s: *mut FILE, - ) -> size_t; -} -extern "C" { - pub fn fread_unlocked( - __ptr: *mut ::std::os::raw::c_void, - __size: size_t, - __n: size_t, - __stream: *mut FILE, - ) -> size_t; -} -extern "C" { - pub fn fwrite_unlocked( - __ptr: *const ::std::os::raw::c_void, - __size: size_t, - __n: size_t, - __stream: *mut FILE, - ) -> size_t; -} -extern "C" { - pub fn fseek( - __stream: *mut FILE, - __off: ::std::os::raw::c_long, - __whence: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ftell(__stream: *mut FILE) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn rewind(__stream: *mut FILE); -} -extern "C" { - pub fn fseeko( - __stream: *mut FILE, - __off: __off_t, - __whence: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ftello(__stream: *mut FILE) -> __off_t; -} -extern "C" { - pub fn fgetpos(__stream: *mut FILE, __pos: *mut fpos_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fsetpos(__stream: *mut FILE, __pos: *const fpos_t) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn clearerr(__stream: *mut FILE); -} -extern "C" { - pub fn feof(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ferror(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn clearerr_unlocked(__stream: *mut FILE); -} -extern "C" { - pub fn feof_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ferror_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn perror(__s: *const ::std::os::raw::c_char); -} -extern "C" { - pub static mut sys_nerr: ::std::os::raw::c_int; -} -extern "C" { - pub static mut sys_errlist: [*const ::std::os::raw::c_char; 0usize]; -} -extern "C" { - pub fn fileno(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fileno_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn popen( - __command: *const ::std::os::raw::c_char, - __modes: *const ::std::os::raw::c_char, - ) -> *mut FILE; -} -extern "C" { - pub fn pclose(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ctermid(__s: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn flockfile(__stream: *mut FILE); -} -extern "C" { - pub fn ftrylockfile(__stream: *mut FILE) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn funlockfile(__stream: *mut FILE); -} -pub type wchar_t = ::std::os::raw::c_int; -pub const idtype_t_P_ALL: idtype_t = 0; -pub const idtype_t_P_PID: idtype_t = 1; -pub const idtype_t_P_PGID: idtype_t = 2; -pub type idtype_t = ::std::os::raw::c_uint; -pub type _Float32 = f32; -pub type _Float64 = f64; -pub type _Float32x = f64; -pub type _Float64x = u128; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct div_t { - pub quot: ::std::os::raw::c_int, - pub rem: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_div_t() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(div_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(div_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(div_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, - 4usize, - concat!( - "Offset of field: ", - stringify!(div_t), - "::", - stringify!(rem) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct ldiv_t { - pub quot: ::std::os::raw::c_long, - pub rem: ::std::os::raw::c_long, -} -#[test] -fn bindgen_test_layout_ldiv_t() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(ldiv_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(ldiv_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(ldiv_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(ldiv_t), - "::", - stringify!(rem) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct lldiv_t { - pub quot: ::std::os::raw::c_longlong, - pub rem: ::std::os::raw::c_longlong, -} -#[test] -fn bindgen_test_layout_lldiv_t() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(lldiv_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(lldiv_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).quot as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(lldiv_t), - "::", - stringify!(quot) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rem as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(lldiv_t), - "::", - stringify!(rem) - ) - ); -} -extern "C" { - pub fn __ctype_get_mb_cur_max() -> size_t; -} -extern "C" { - pub fn atof(__nptr: *const ::std::os::raw::c_char) -> f64; -} -extern "C" { - pub fn atoi(__nptr: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn atol(__nptr: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn atoll(__nptr: *const ::std::os::raw::c_char) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn strtod( - __nptr: *const ::std::os::raw::c_char, - __endptr: *mut *mut ::std::os::raw::c_char, - ) -> f64; -} -extern "C" { - pub fn strtof( - __nptr: *const ::std::os::raw::c_char, - __endptr: *mut *mut ::std::os::raw::c_char, - ) -> f32; -} -extern "C" { - pub fn strtold( - __nptr: *const ::std::os::raw::c_char, - __endptr: *mut *mut ::std::os::raw::c_char, - ) -> u128; -} -extern "C" { - pub fn strtol( - __nptr: *const ::std::os::raw::c_char, - __endptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn strtoul( - __nptr: *const ::std::os::raw::c_char, - __endptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_ulong; -} -extern "C" { - pub fn strtoq( - __nptr: *const ::std::os::raw::c_char, - __endptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn strtouq( - __nptr: *const ::std::os::raw::c_char, - __endptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_ulonglong; -} -extern "C" { - pub fn strtoll( - __nptr: *const ::std::os::raw::c_char, - __endptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn strtoull( - __nptr: *const ::std::os::raw::c_char, - __endptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_ulonglong; -} -extern "C" { - pub fn l64a(__n: ::std::os::raw::c_long) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn a64l(__s: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; -} -pub type u_char = __u_char; -pub type u_short = __u_short; -pub type u_int = __u_int; -pub type u_long = __u_long; -pub type quad_t = __quad_t; -pub type u_quad_t = __u_quad_t; -pub type fsid_t = __fsid_t; -pub type loff_t = __loff_t; -pub type ino_t = __ino_t; -pub type dev_t = __dev_t; -pub type gid_t = __gid_t; -pub type mode_t = __mode_t; -pub type nlink_t = __nlink_t; -pub type uid_t = __uid_t; -pub type pid_t = __pid_t; -pub type id_t = __id_t; -pub type daddr_t = __daddr_t; -pub type caddr_t = __caddr_t; -pub type key_t = __key_t; -pub type clock_t = __clock_t; -pub type clockid_t = __clockid_t; -pub type time_t = __time_t; -pub type timer_t = __timer_t; -pub type ulong = ::std::os::raw::c_ulong; -pub type ushort = ::std::os::raw::c_ushort; -pub type uint = ::std::os::raw::c_uint; -pub type u_int8_t = ::std::os::raw::c_uchar; -pub type u_int16_t = ::std::os::raw::c_ushort; -pub type u_int32_t = ::std::os::raw::c_uint; -pub type u_int64_t = ::std::os::raw::c_ulong; -pub type register_t = ::std::os::raw::c_long; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __sigset_t { - pub __val: [::std::os::raw::c_ulong; 16usize], -} -#[test] -fn bindgen_test_layout___sigset_t() { - assert_eq!( - ::std::mem::size_of::<__sigset_t>(), - 128usize, - concat!("Size of: ", stringify!(__sigset_t)) - ); - assert_eq!( - ::std::mem::align_of::<__sigset_t>(), - 8usize, - concat!("Alignment of ", stringify!(__sigset_t)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::<__sigset_t>())).__val as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__sigset_t), - "::", - stringify!(__val) - ) - ); -} -pub type sigset_t = __sigset_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct timeval { - pub tv_sec: __time_t, - pub tv_usec: __suseconds_t, -} -#[test] -fn bindgen_test_layout_timeval() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(timeval)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(timeval)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_sec as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(timeval), - "::", - stringify!(tv_sec) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_usec as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(timeval), - "::", - stringify!(tv_usec) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct timespec { - pub tv_sec: __time_t, - pub tv_nsec: __syscall_slong_t, -} -#[test] -fn bindgen_test_layout_timespec() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(timespec)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(timespec)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_sec as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(timespec), - "::", - stringify!(tv_sec) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).tv_nsec as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(timespec), - "::", - stringify!(tv_nsec) - ) - ); -} -pub type suseconds_t = __suseconds_t; -pub type __fd_mask = ::std::os::raw::c_long; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct fd_set { - pub __fds_bits: [__fd_mask; 16usize], -} -#[test] -fn bindgen_test_layout_fd_set() { - assert_eq!( - ::std::mem::size_of::(), - 128usize, - concat!("Size of: ", stringify!(fd_set)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(fd_set)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__fds_bits as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(fd_set), - "::", - stringify!(__fds_bits) - ) - ); -} -pub type fd_mask = __fd_mask; -extern "C" { - pub fn select( - __nfds: ::std::os::raw::c_int, - __readfds: *mut fd_set, - __writefds: *mut fd_set, - __exceptfds: *mut fd_set, - __timeout: *mut timeval, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn pselect( - __nfds: ::std::os::raw::c_int, - __readfds: *mut fd_set, - __writefds: *mut fd_set, - __exceptfds: *mut fd_set, - __timeout: *const timespec, - __sigmask: *const __sigset_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn gnu_dev_major(__dev: __dev_t) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn gnu_dev_minor(__dev: __dev_t) -> ::std::os::raw::c_uint; -} -extern "C" { - pub fn gnu_dev_makedev( - __major: ::std::os::raw::c_uint, - __minor: ::std::os::raw::c_uint, - ) -> __dev_t; -} -pub type blksize_t = __blksize_t; -pub type blkcnt_t = __blkcnt_t; -pub type fsblkcnt_t = __fsblkcnt_t; -pub type fsfilcnt_t = __fsfilcnt_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_rwlock_arch_t { - pub __readers: ::std::os::raw::c_uint, - pub __writers: ::std::os::raw::c_uint, - pub __wrphase_futex: ::std::os::raw::c_uint, - pub __writers_futex: ::std::os::raw::c_uint, - pub __pad3: ::std::os::raw::c_uint, - pub __pad4: ::std::os::raw::c_uint, - pub __cur_writer: ::std::os::raw::c_int, - pub __shared: ::std::os::raw::c_int, - pub __rwelision: ::std::os::raw::c_schar, - pub __pad1: [::std::os::raw::c_uchar; 7usize], - pub __pad2: ::std::os::raw::c_ulong, - pub __flags: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout___pthread_rwlock_arch_t() { - assert_eq!( - ::std::mem::size_of::<__pthread_rwlock_arch_t>(), - 56usize, - concat!("Size of: ", stringify!(__pthread_rwlock_arch_t)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_rwlock_arch_t>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_rwlock_arch_t)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__readers as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__readers) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__writers as *const _ - as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__writers) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__wrphase_futex - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__wrphase_futex) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__writers_futex - as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__writers_futex) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__pad3 as *const _ - as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad3) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__pad4 as *const _ - as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad4) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__cur_writer - as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__cur_writer) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__shared as *const _ - as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__shared) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__rwelision as *const _ - as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__rwelision) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__pad1 as *const _ - as usize - }, - 33usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__pad2 as *const _ - as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__pad2) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_rwlock_arch_t>())).__flags as *const _ - as usize - }, - 48usize, - concat!( - "Offset of field: ", - stringify!(__pthread_rwlock_arch_t), - "::", - stringify!(__flags) - ) - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_internal_list { - pub __prev: *mut __pthread_internal_list, - pub __next: *mut __pthread_internal_list, -} -#[test] -fn bindgen_test_layout___pthread_internal_list() { - assert_eq!( - ::std::mem::size_of::<__pthread_internal_list>(), - 16usize, - concat!("Size of: ", stringify!(__pthread_internal_list)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_internal_list>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_internal_list)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_internal_list>())).__prev as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_internal_list), - "::", - stringify!(__prev) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_internal_list>())).__next as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_internal_list), - "::", - stringify!(__next) - ) - ); -} -pub type __pthread_list_t = __pthread_internal_list; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_mutex_s { - pub __lock: ::std::os::raw::c_int, - pub __count: ::std::os::raw::c_uint, - pub __owner: ::std::os::raw::c_int, - pub __nusers: ::std::os::raw::c_uint, - pub __kind: ::std::os::raw::c_int, - pub __spins: ::std::os::raw::c_short, - pub __elision: ::std::os::raw::c_short, - pub __list: __pthread_list_t, -} -#[test] -fn bindgen_test_layout___pthread_mutex_s() { - assert_eq!( - ::std::mem::size_of::<__pthread_mutex_s>(), - 40usize, - concat!("Size of: ", stringify!(__pthread_mutex_s)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_mutex_s>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_mutex_s)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_mutex_s>())).__lock as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__lock) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_mutex_s>())).__count as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__count) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_mutex_s>())).__owner as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__owner) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_mutex_s>())).__nusers as *const _ as usize - }, - 12usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__nusers) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_mutex_s>())).__kind as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__kind) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_mutex_s>())).__spins as *const _ as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__spins) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_mutex_s>())).__elision as *const _ - as usize - }, - 22usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__elision) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_mutex_s>())).__list as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__pthread_mutex_s), - "::", - stringify!(__list) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub struct __pthread_cond_s { - pub __bindgen_anon_1: __pthread_cond_s__bindgen_ty_1, - pub __bindgen_anon_2: __pthread_cond_s__bindgen_ty_2, - pub __g_refs: [::std::os::raw::c_uint; 2usize], - pub __g_size: [::std::os::raw::c_uint; 2usize], - pub __g1_orig_size: ::std::os::raw::c_uint, - pub __wrefs: ::std::os::raw::c_uint, - pub __g_signals: [::std::os::raw::c_uint; 2usize], -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union __pthread_cond_s__bindgen_ty_1 { - pub __wseq: ::std::os::raw::c_ulonglong, - pub __wseq32: __pthread_cond_s__bindgen_ty_1__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_cond_s__bindgen_ty_1__bindgen_ty_1 { - pub __low: ::std::os::raw::c_uint, - pub __high: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout___pthread_cond_s__bindgen_ty_1__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::<__pthread_cond_s__bindgen_ty_1__bindgen_ty_1>(), - 8usize, - concat!( - "Size of: ", - stringify!(__pthread_cond_s__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_cond_s__bindgen_ty_1__bindgen_ty_1>(), - 4usize, - concat!( - "Alignment of ", - stringify!(__pthread_cond_s__bindgen_ty_1__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_1__bindgen_ty_1>())) - .__low as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(__low) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_1__bindgen_ty_1>())) - .__high as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_1__bindgen_ty_1), - "::", - stringify!(__high) - ) - ); -} -#[test] -fn bindgen_test_layout___pthread_cond_s__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::<__pthread_cond_s__bindgen_ty_1>(), - 8usize, - concat!("Size of: ", stringify!(__pthread_cond_s__bindgen_ty_1)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_cond_s__bindgen_ty_1>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_cond_s__bindgen_ty_1)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_1>())).__wseq - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_1), - "::", - stringify!(__wseq) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_1>())).__wseq32 - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_1), - "::", - stringify!(__wseq32) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union __pthread_cond_s__bindgen_ty_2 { - pub __g1_start: ::std::os::raw::c_ulonglong, - pub __g1_start32: __pthread_cond_s__bindgen_ty_2__bindgen_ty_1, -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_cond_s__bindgen_ty_2__bindgen_ty_1 { - pub __low: ::std::os::raw::c_uint, - pub __high: ::std::os::raw::c_uint, -} -#[test] -fn bindgen_test_layout___pthread_cond_s__bindgen_ty_2__bindgen_ty_1() { - assert_eq!( - ::std::mem::size_of::<__pthread_cond_s__bindgen_ty_2__bindgen_ty_1>(), - 8usize, - concat!( - "Size of: ", - stringify!(__pthread_cond_s__bindgen_ty_2__bindgen_ty_1) - ) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_cond_s__bindgen_ty_2__bindgen_ty_1>(), - 4usize, - concat!( - "Alignment of ", - stringify!(__pthread_cond_s__bindgen_ty_2__bindgen_ty_1) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_2__bindgen_ty_1>())) - .__low as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_2__bindgen_ty_1), - "::", - stringify!(__low) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_2__bindgen_ty_1>())) - .__high as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_2__bindgen_ty_1), - "::", - stringify!(__high) - ) - ); -} -#[test] -fn bindgen_test_layout___pthread_cond_s__bindgen_ty_2() { - assert_eq!( - ::std::mem::size_of::<__pthread_cond_s__bindgen_ty_2>(), - 8usize, - concat!("Size of: ", stringify!(__pthread_cond_s__bindgen_ty_2)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_cond_s__bindgen_ty_2>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_cond_s__bindgen_ty_2)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_2>())).__g1_start - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_2), - "::", - stringify!(__g1_start) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cond_s__bindgen_ty_2>())).__g1_start32 - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s__bindgen_ty_2), - "::", - stringify!(__g1_start32) - ) - ); -} -#[test] -fn bindgen_test_layout___pthread_cond_s() { - assert_eq!( - ::std::mem::size_of::<__pthread_cond_s>(), - 48usize, - concat!("Size of: ", stringify!(__pthread_cond_s)) - ); - assert_eq!( - ::std::mem::align_of::<__pthread_cond_s>(), - 8usize, - concat!("Alignment of ", stringify!(__pthread_cond_s)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cond_s>())).__g_refs as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_refs) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cond_s>())).__g_size as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_size) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cond_s>())).__g1_orig_size as *const _ - as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g1_orig_size) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cond_s>())).__wrefs as *const _ as usize - }, - 36usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__wrefs) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__pthread_cond_s>())).__g_signals as *const _ - as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(__pthread_cond_s), - "::", - stringify!(__g_signals) - ) - ); -} -pub type pthread_t = ::std::os::raw::c_ulong; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_mutexattr_t { - pub __size: [::std::os::raw::c_char; 4usize], - pub __align: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_pthread_mutexattr_t() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(pthread_mutexattr_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_mutexattr_t)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__size as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutexattr_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__align as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutexattr_t), - "::", - stringify!(__align) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_condattr_t { - pub __size: [::std::os::raw::c_char; 4usize], - pub __align: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_pthread_condattr_t() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(pthread_condattr_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_condattr_t)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__size as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_condattr_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__align as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_condattr_t), - "::", - stringify!(__align) - ) - ); -} -pub type pthread_key_t = ::std::os::raw::c_uint; -pub type pthread_once_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_attr_t { - pub __size: [::std::os::raw::c_char; 56usize], - pub __align: ::std::os::raw::c_long, -} -#[test] -fn bindgen_test_layout_pthread_attr_t() { - assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(pthread_attr_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_attr_t)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__size as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__align as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_attr_t), - "::", - stringify!(__align) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_mutex_t { - pub __data: __pthread_mutex_s, - pub __size: [::std::os::raw::c_char; 40usize], - pub __align: ::std::os::raw::c_long, -} -#[test] -fn bindgen_test_layout_pthread_mutex_t() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(pthread_mutex_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_mutex_t)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__data as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__data) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__size as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__align as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_mutex_t), - "::", - stringify!(__align) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_cond_t { - pub __data: __pthread_cond_s, - pub __size: [::std::os::raw::c_char; 48usize], - pub __align: ::std::os::raw::c_longlong, -} -#[test] -fn bindgen_test_layout_pthread_cond_t() { - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(pthread_cond_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_cond_t)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__data as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__data) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__size as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__align as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_cond_t), - "::", - stringify!(__align) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_rwlock_t { - pub __data: __pthread_rwlock_arch_t, - pub __size: [::std::os::raw::c_char; 56usize], - pub __align: ::std::os::raw::c_long, -} -#[test] -fn bindgen_test_layout_pthread_rwlock_t() { - assert_eq!( - ::std::mem::size_of::(), - 56usize, - concat!("Size of: ", stringify!(pthread_rwlock_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_rwlock_t)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__data as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlock_t), - "::", - stringify!(__data) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__size as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlock_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__align as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlock_t), - "::", - stringify!(__align) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_rwlockattr_t { - pub __size: [::std::os::raw::c_char; 8usize], - pub __align: ::std::os::raw::c_long, -} -#[test] -fn bindgen_test_layout_pthread_rwlockattr_t() { - assert_eq!( - ::std::mem::size_of::(), - 8usize, - concat!("Size of: ", stringify!(pthread_rwlockattr_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_rwlockattr_t)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__size as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlockattr_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__align as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_rwlockattr_t), - "::", - stringify!(__align) - ) - ); -} -pub type pthread_spinlock_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_barrier_t { - pub __size: [::std::os::raw::c_char; 32usize], - pub __align: ::std::os::raw::c_long, -} -#[test] -fn bindgen_test_layout_pthread_barrier_t() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(pthread_barrier_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(pthread_barrier_t)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__size as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrier_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__align as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrier_t), - "::", - stringify!(__align) - ) - ); -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_barrierattr_t { - pub __size: [::std::os::raw::c_char; 4usize], - pub __align: ::std::os::raw::c_int, -} -#[test] -fn bindgen_test_layout_pthread_barrierattr_t() { - assert_eq!( - ::std::mem::size_of::(), - 4usize, - concat!("Size of: ", stringify!(pthread_barrierattr_t)) - ); - assert_eq!( - ::std::mem::align_of::(), - 4usize, - concat!("Alignment of ", stringify!(pthread_barrierattr_t)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__size as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrierattr_t), - "::", - stringify!(__size) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__align as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(pthread_barrierattr_t), - "::", - stringify!(__align) - ) - ); -} -extern "C" { - pub fn random() -> ::std::os::raw::c_long; -} -extern "C" { - pub fn srandom(__seed: ::std::os::raw::c_uint); -} -extern "C" { - pub fn initstate( - __seed: ::std::os::raw::c_uint, - __statebuf: *mut ::std::os::raw::c_char, - __statelen: size_t, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn setstate( - __statebuf: *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct random_data { - pub fptr: *mut i32, - pub rptr: *mut i32, - pub state: *mut i32, - pub rand_type: ::std::os::raw::c_int, - pub rand_deg: ::std::os::raw::c_int, - pub rand_sep: ::std::os::raw::c_int, - pub end_ptr: *mut i32, -} -#[test] -fn bindgen_test_layout_random_data() { - assert_eq!( - ::std::mem::size_of::(), - 48usize, - concat!("Size of: ", stringify!(random_data)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(random_data)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).fptr as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(fptr) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).rptr as *const _ as usize }, - 8usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(rptr) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).state as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(state) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).rand_type as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(rand_type) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).rand_deg as *const _ as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(rand_deg) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).rand_sep as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(rand_sep) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).end_ptr as *const _ as usize - }, - 40usize, - concat!( - "Offset of field: ", - stringify!(random_data), - "::", - stringify!(end_ptr) - ) - ); -} -extern "C" { - pub fn random_r( - __buf: *mut random_data, - __result: *mut i32, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn srandom_r( - __seed: ::std::os::raw::c_uint, - __buf: *mut random_data, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn initstate_r( - __seed: ::std::os::raw::c_uint, - __statebuf: *mut ::std::os::raw::c_char, - __statelen: size_t, - __buf: *mut random_data, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setstate_r( - __statebuf: *mut ::std::os::raw::c_char, - __buf: *mut random_data, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn rand() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn srand(__seed: ::std::os::raw::c_uint); -} -extern "C" { - pub fn rand_r(__seed: *mut ::std::os::raw::c_uint) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn drand48() -> f64; -} -extern "C" { - pub fn erand48(__xsubi: *mut ::std::os::raw::c_ushort) -> f64; -} -extern "C" { - pub fn lrand48() -> ::std::os::raw::c_long; -} -extern "C" { - pub fn nrand48(__xsubi: *mut ::std::os::raw::c_ushort) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn mrand48() -> ::std::os::raw::c_long; -} -extern "C" { - pub fn jrand48(__xsubi: *mut ::std::os::raw::c_ushort) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn srand48(__seedval: ::std::os::raw::c_long); -} -extern "C" { - pub fn seed48( - __seed16v: *mut ::std::os::raw::c_ushort, - ) -> *mut ::std::os::raw::c_ushort; -} -extern "C" { - pub fn lcong48(__param: *mut ::std::os::raw::c_ushort); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct drand48_data { - pub __x: [::std::os::raw::c_ushort; 3usize], - pub __old_x: [::std::os::raw::c_ushort; 3usize], - pub __c: ::std::os::raw::c_ushort, - pub __init: ::std::os::raw::c_ushort, - pub __a: ::std::os::raw::c_ulonglong, -} -#[test] -fn bindgen_test_layout_drand48_data() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(drand48_data)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(drand48_data)) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__x as *const _ as usize }, - 0usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__x) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__old_x as *const _ as usize - }, - 6usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__old_x) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__c as *const _ as usize }, - 12usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__c) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).__init as *const _ as usize - }, - 14usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__init) - ) - ); - assert_eq!( - unsafe { &(*(::std::ptr::null::())).__a as *const _ as usize }, - 16usize, - concat!( - "Offset of field: ", - stringify!(drand48_data), - "::", - stringify!(__a) - ) - ); -} -extern "C" { - pub fn drand48_r( - __buffer: *mut drand48_data, - __result: *mut f64, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn erand48_r( - __xsubi: *mut ::std::os::raw::c_ushort, - __buffer: *mut drand48_data, - __result: *mut f64, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn lrand48_r( - __buffer: *mut drand48_data, - __result: *mut ::std::os::raw::c_long, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nrand48_r( - __xsubi: *mut ::std::os::raw::c_ushort, - __buffer: *mut drand48_data, - __result: *mut ::std::os::raw::c_long, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mrand48_r( - __buffer: *mut drand48_data, - __result: *mut ::std::os::raw::c_long, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn jrand48_r( - __xsubi: *mut ::std::os::raw::c_ushort, - __buffer: *mut drand48_data, - __result: *mut ::std::os::raw::c_long, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn srand48_r( - __seedval: ::std::os::raw::c_long, - __buffer: *mut drand48_data, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn seed48_r( - __seed16v: *mut ::std::os::raw::c_ushort, - __buffer: *mut drand48_data, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn lcong48_r( - __param: *mut ::std::os::raw::c_ushort, - __buffer: *mut drand48_data, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn malloc(__size: ::std::os::raw::c_ulong) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn calloc( - __nmemb: ::std::os::raw::c_ulong, - __size: ::std::os::raw::c_ulong, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn realloc( - __ptr: *mut ::std::os::raw::c_void, - __size: ::std::os::raw::c_ulong, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn free(__ptr: *mut ::std::os::raw::c_void); -} -extern "C" { - pub fn alloca(__size: ::std::os::raw::c_ulong) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn valloc(__size: size_t) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn posix_memalign( - __memptr: *mut *mut ::std::os::raw::c_void, - __alignment: size_t, - __size: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn aligned_alloc( - __alignment: size_t, - __size: size_t, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn abort(); -} -extern "C" { - pub fn atexit( - __func: ::std::option::Option, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn at_quick_exit( - __func: ::std::option::Option, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn on_exit( - __func: ::std::option::Option< - unsafe extern "C" fn( - __status: ::std::os::raw::c_int, - __arg: *mut ::std::os::raw::c_void, - ), - >, - __arg: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn exit(__status: ::std::os::raw::c_int); -} -extern "C" { - pub fn quick_exit(__status: ::std::os::raw::c_int); -} -extern "C" { - pub fn _Exit(__status: ::std::os::raw::c_int); -} -extern "C" { - pub fn getenv( - __name: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn putenv(__string: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn setenv( - __name: *const ::std::os::raw::c_char, - __value: *const ::std::os::raw::c_char, - __replace: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn unsetenv(__name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn clearenv() -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mktemp( - __template: *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn mkstemp(__template: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mkstemps( - __template: *mut ::std::os::raw::c_char, - __suffixlen: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mkdtemp( - __template: *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn system(__command: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn realpath( - __name: *const ::std::os::raw::c_char, - __resolved: *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -pub type __compar_fn_t = ::std::option::Option< - unsafe extern "C" fn( - arg1: *const ::std::os::raw::c_void, - arg2: *const ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int, ->; -extern "C" { - pub fn bsearch( - __key: *const ::std::os::raw::c_void, - __base: *const ::std::os::raw::c_void, - __nmemb: size_t, - __size: size_t, - __compar: __compar_fn_t, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn qsort( - __base: *mut ::std::os::raw::c_void, - __nmemb: size_t, - __size: size_t, - __compar: __compar_fn_t, - ); -} -extern "C" { - pub fn abs(__x: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn labs(__x: ::std::os::raw::c_long) -> ::std::os::raw::c_long; -} -extern "C" { - pub fn llabs(__x: ::std::os::raw::c_longlong) -> ::std::os::raw::c_longlong; -} -extern "C" { - pub fn div( - __numer: ::std::os::raw::c_int, - __denom: ::std::os::raw::c_int, - ) -> div_t; -} -extern "C" { - pub fn ldiv( - __numer: ::std::os::raw::c_long, - __denom: ::std::os::raw::c_long, - ) -> ldiv_t; -} -extern "C" { - pub fn lldiv( - __numer: ::std::os::raw::c_longlong, - __denom: ::std::os::raw::c_longlong, - ) -> lldiv_t; -} -extern "C" { - pub fn ecvt( - __value: f64, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn fcvt( - __value: f64, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn gcvt( - __value: f64, - __ndigit: ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn qecvt( - __value: u128, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn qfcvt( - __value: u128, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn qgcvt( - __value: u128, - __ndigit: ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn ecvt_r( - __value: f64, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_char, - __len: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn fcvt_r( - __value: f64, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_char, - __len: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn qecvt_r( - __value: u128, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_char, - __len: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn qfcvt_r( - __value: u128, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_char, - __len: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mblen( - __s: *const ::std::os::raw::c_char, - __n: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mbtowc( - __pwc: *mut wchar_t, - __s: *const ::std::os::raw::c_char, - __n: size_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn wctomb( - __s: *mut ::std::os::raw::c_char, - __wchar: wchar_t, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mbstowcs( - __pwcs: *mut wchar_t, - __s: *const ::std::os::raw::c_char, - __n: size_t, - ) -> size_t; -} -extern "C" { - pub fn wcstombs( - __s: *mut ::std::os::raw::c_char, - __pwcs: *const wchar_t, - __n: size_t, - ) -> size_t; -} -extern "C" { - pub fn rpmatch(__response: *const ::std::os::raw::c_char) - -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getsubopt( - __optionp: *mut *mut ::std::os::raw::c_char, - __tokens: *const *mut ::std::os::raw::c_char, - __valuep: *mut *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn getloadavg( - __loadavg: *mut f64, - __nelem: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_int; -} -pub type int_least8_t = ::std::os::raw::c_schar; -pub type int_least16_t = ::std::os::raw::c_short; -pub type int_least32_t = ::std::os::raw::c_int; -pub type int_least64_t = ::std::os::raw::c_long; -pub type uint_least8_t = ::std::os::raw::c_uchar; -pub type uint_least16_t = ::std::os::raw::c_ushort; -pub type uint_least32_t = ::std::os::raw::c_uint; -pub type uint_least64_t = ::std::os::raw::c_ulong; -pub type int_fast8_t = ::std::os::raw::c_schar; -pub type int_fast16_t = ::std::os::raw::c_long; -pub type int_fast32_t = ::std::os::raw::c_long; -pub type int_fast64_t = ::std::os::raw::c_long; -pub type uint_fast8_t = ::std::os::raw::c_uchar; -pub type uint_fast16_t = ::std::os::raw::c_ulong; -pub type uint_fast32_t = ::std::os::raw::c_ulong; -pub type uint_fast64_t = ::std::os::raw::c_ulong; -pub type intmax_t = __intmax_t; -pub type uintmax_t = __uintmax_t; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_END: libpostal_token_type_t = 0; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_WORD: libpostal_token_type_t = 1; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_ABBREVIATION: - libpostal_token_type_t = 2; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_IDEOGRAPHIC_CHAR: - libpostal_token_type_t = 3; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_HANGUL_SYLLABLE: - libpostal_token_type_t = 4; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_ACRONYM: libpostal_token_type_t = - 5; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_PHRASE: libpostal_token_type_t = - 10; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_EMAIL: libpostal_token_type_t = - 20; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_URL: libpostal_token_type_t = 21; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_US_PHONE: - libpostal_token_type_t = 22; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_INTL_PHONE: - libpostal_token_type_t = 23; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_NUMERIC: libpostal_token_type_t = - 50; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_ORDINAL: libpostal_token_type_t = - 51; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_ROMAN_NUMERAL: - libpostal_token_type_t = 52; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_IDEOGRAPHIC_NUMBER: - libpostal_token_type_t = 53; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_PERIOD: libpostal_token_type_t = - 100; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_EXCLAMATION: - libpostal_token_type_t = 101; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_QUESTION_MARK: - libpostal_token_type_t = 102; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_COMMA: libpostal_token_type_t = - 103; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_COLON: libpostal_token_type_t = - 104; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_SEMICOLON: - libpostal_token_type_t = 105; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_PLUS: libpostal_token_type_t = - 106; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_AMPERSAND: - libpostal_token_type_t = 107; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_AT_SIGN: libpostal_token_type_t = - 108; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_POUND: libpostal_token_type_t = - 109; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_ELLIPSIS: - libpostal_token_type_t = 110; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_DASH: libpostal_token_type_t = - 111; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_BREAKING_DASH: - libpostal_token_type_t = 112; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_HYPHEN: libpostal_token_type_t = - 113; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_PUNCT_OPEN: - libpostal_token_type_t = 114; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_PUNCT_CLOSE: - libpostal_token_type_t = 115; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_DOUBLE_QUOTE: - libpostal_token_type_t = 119; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_SINGLE_QUOTE: - libpostal_token_type_t = 120; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_OPEN_QUOTE: - libpostal_token_type_t = 121; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_CLOSE_QUOTE: - libpostal_token_type_t = 122; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_SLASH: libpostal_token_type_t = - 124; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_BACKSLASH: - libpostal_token_type_t = 125; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_GREATER_THAN: - libpostal_token_type_t = 126; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_LESS_THAN: - libpostal_token_type_t = 127; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_OTHER: libpostal_token_type_t = - 200; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_WHITESPACE: - libpostal_token_type_t = 300; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_NEWLINE: libpostal_token_type_t = - 301; -pub const libpostal_token_type_t_LIBPOSTAL_TOKEN_TYPE_INVALID_CHAR: - libpostal_token_type_t = 500; -pub type libpostal_token_type_t = ::std::os::raw::c_uint; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct libpostal_normalize_options { - pub languages: *mut *mut ::std::os::raw::c_char, - pub num_languages: size_t, - pub address_components: u16, - pub latin_ascii: bool, - pub transliterate: bool, - pub strip_accents: bool, - pub decompose: bool, - pub lowercase: bool, - pub trim_string: bool, - pub drop_parentheticals: bool, - pub replace_numeric_hyphens: bool, - pub delete_numeric_hyphens: bool, - pub split_alpha_from_numeric: bool, - pub replace_word_hyphens: bool, - pub delete_word_hyphens: bool, - pub delete_final_periods: bool, - pub delete_acronym_periods: bool, - pub drop_english_possessives: bool, - pub delete_apostrophes: bool, - pub expand_numex: bool, - pub roman_numerals: bool, -} -#[test] -fn bindgen_test_layout_libpostal_normalize_options() { - assert_eq!( - ::std::mem::size_of::(), - 40usize, - concat!("Size of: ", stringify!(libpostal_normalize_options)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(libpostal_normalize_options)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).languages - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libpostal_normalize_options), - "::", - stringify!(languages) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).num_languages - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libpostal_normalize_options), - "::", - stringify!(num_languages) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).address_components - as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(libpostal_normalize_options), - "::", - stringify!(address_components) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).latin_ascii - as *const _ as usize - }, - 18usize, - concat!( - "Offset of field: ", - stringify!(libpostal_normalize_options), - "::", - stringify!(latin_ascii) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).transliterate - as *const _ as usize - }, - 19usize, - concat!( - "Offset of field: ", - stringify!(libpostal_normalize_options), - "::", - stringify!(transliterate) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).strip_accents - as *const _ as usize - }, - 20usize, - concat!( - "Offset of field: ", - stringify!(libpostal_normalize_options), - "::", - stringify!(strip_accents) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).decompose - as *const _ as usize - }, - 21usize, - concat!( - "Offset of field: ", - stringify!(libpostal_normalize_options), - "::", - stringify!(decompose) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).lowercase - as *const _ as usize - }, - 22usize, - concat!( - "Offset of field: ", - stringify!(libpostal_normalize_options), - "::", - stringify!(lowercase) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).trim_string - as *const _ as usize - }, - 23usize, - concat!( - "Offset of field: ", - stringify!(libpostal_normalize_options), - "::", - stringify!(trim_string) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).drop_parentheticals - as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(libpostal_normalize_options), - "::", - stringify!(drop_parentheticals) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .replace_numeric_hyphens as *const _ as usize - }, - 25usize, - concat!( - "Offset of field: ", - stringify!(libpostal_normalize_options), - "::", - stringify!(replace_numeric_hyphens) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .delete_numeric_hyphens as *const _ as usize - }, - 26usize, - concat!( - "Offset of field: ", - stringify!(libpostal_normalize_options), - "::", - stringify!(delete_numeric_hyphens) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .split_alpha_from_numeric as *const _ as usize - }, - 27usize, - concat!( - "Offset of field: ", - stringify!(libpostal_normalize_options), - "::", - stringify!(split_alpha_from_numeric) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .replace_word_hyphens as *const _ as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(libpostal_normalize_options), - "::", - stringify!(replace_word_hyphens) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).delete_word_hyphens - as *const _ as usize - }, - 29usize, - concat!( - "Offset of field: ", - stringify!(libpostal_normalize_options), - "::", - stringify!(delete_word_hyphens) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .delete_final_periods as *const _ as usize - }, - 30usize, - concat!( - "Offset of field: ", - stringify!(libpostal_normalize_options), - "::", - stringify!(delete_final_periods) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .delete_acronym_periods as *const _ as usize - }, - 31usize, - concat!( - "Offset of field: ", - stringify!(libpostal_normalize_options), - "::", - stringify!(delete_acronym_periods) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .drop_english_possessives as *const _ as usize - }, - 32usize, - concat!( - "Offset of field: ", - stringify!(libpostal_normalize_options), - "::", - stringify!(drop_english_possessives) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).delete_apostrophes - as *const _ as usize - }, - 33usize, - concat!( - "Offset of field: ", - stringify!(libpostal_normalize_options), - "::", - stringify!(delete_apostrophes) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).expand_numex - as *const _ as usize - }, - 34usize, - concat!( - "Offset of field: ", - stringify!(libpostal_normalize_options), - "::", - stringify!(expand_numex) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).roman_numerals - as *const _ as usize - }, - 35usize, - concat!( - "Offset of field: ", - stringify!(libpostal_normalize_options), - "::", - stringify!(roman_numerals) - ) - ); -} -pub type libpostal_normalize_options_t = libpostal_normalize_options; -extern "C" { - pub fn libpostal_get_default_options() -> libpostal_normalize_options_t; -} -extern "C" { - pub fn libpostal_expand_address( - input: *mut ::std::os::raw::c_char, - options: libpostal_normalize_options_t, - n: *mut size_t, - ) -> *mut *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn libpostal_expand_address_root( - input: *mut ::std::os::raw::c_char, - options: libpostal_normalize_options_t, - n: *mut size_t, - ) -> *mut *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn libpostal_expansion_array_destroy( - expansions: *mut *mut ::std::os::raw::c_char, - n: size_t, - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct libpostal_address_parser_response { - pub num_components: size_t, - pub components: *mut *mut ::std::os::raw::c_char, - pub labels: *mut *mut ::std::os::raw::c_char, -} -#[test] -fn bindgen_test_layout_libpostal_address_parser_response() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(libpostal_address_parser_response)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libpostal_address_parser_response) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .num_components as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libpostal_address_parser_response), - "::", - stringify!(num_components) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).components - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libpostal_address_parser_response), - "::", - stringify!(components) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).labels - as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(libpostal_address_parser_response), - "::", - stringify!(labels) - ) - ); -} -pub type libpostal_address_parser_response_t = libpostal_address_parser_response; -pub type libpostal_parsed_address_components_t = libpostal_address_parser_response_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct libpostal_address_parser_options { - pub language: *mut ::std::os::raw::c_char, - pub country: *mut ::std::os::raw::c_char, -} -#[test] -fn bindgen_test_layout_libpostal_address_parser_options() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(libpostal_address_parser_options)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libpostal_address_parser_options) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).language - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libpostal_address_parser_options), - "::", - stringify!(language) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).country - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libpostal_address_parser_options), - "::", - stringify!(country) - ) - ); -} -pub type libpostal_address_parser_options_t = libpostal_address_parser_options; -extern "C" { - pub fn libpostal_address_parser_response_destroy( - self_: *mut libpostal_address_parser_response_t, - ); -} -extern "C" { - pub fn libpostal_get_address_parser_default_options( - ) -> libpostal_address_parser_options_t; -} -extern "C" { - pub fn libpostal_parse_address( - address: *mut ::std::os::raw::c_char, - options: libpostal_address_parser_options_t, - ) -> *mut libpostal_address_parser_response_t; -} -extern "C" { - pub fn libpostal_parser_print_features(print_features: bool) -> bool; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct libpostal_language_classifier_response { - pub num_languages: size_t, - pub languages: *mut *mut ::std::os::raw::c_char, - pub probs: *mut f64, -} -#[test] -fn bindgen_test_layout_libpostal_language_classifier_response() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!( - "Size of: ", - stringify!(libpostal_language_classifier_response) - ) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libpostal_language_classifier_response) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .num_languages as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libpostal_language_classifier_response), - "::", - stringify!(num_languages) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .languages as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libpostal_language_classifier_response), - "::", - stringify!(languages) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).probs - as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(libpostal_language_classifier_response), - "::", - stringify!(probs) - ) - ); -} -pub type libpostal_language_classifier_response_t = - libpostal_language_classifier_response; -extern "C" { - pub fn libpostal_classify_language( - address: *mut ::std::os::raw::c_char, - ) -> *mut libpostal_language_classifier_response_t; -} -extern "C" { - pub fn libpostal_language_classifier_response_destroy( - self_: *mut libpostal_language_classifier_response_t, - ); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct libpostal_near_dupe_hash_options { - pub with_name: bool, - pub with_address: bool, - pub with_unit: bool, - pub with_city_or_equivalent: bool, - pub with_small_containing_boundaries: bool, - pub with_postal_code: bool, - pub with_latlon: bool, - pub latitude: f64, - pub longitude: f64, - pub geohash_precision: u32, - pub name_and_address_keys: bool, - pub name_only_keys: bool, - pub address_only_keys: bool, -} -#[test] -fn bindgen_test_layout_libpostal_near_dupe_hash_options() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(libpostal_near_dupe_hash_options)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libpostal_near_dupe_hash_options) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).with_name - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libpostal_near_dupe_hash_options), - "::", - stringify!(with_name) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).with_address - as *const _ as usize - }, - 1usize, - concat!( - "Offset of field: ", - stringify!(libpostal_near_dupe_hash_options), - "::", - stringify!(with_address) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).with_unit - as *const _ as usize - }, - 2usize, - concat!( - "Offset of field: ", - stringify!(libpostal_near_dupe_hash_options), - "::", - stringify!(with_unit) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .with_city_or_equivalent as *const _ as usize - }, - 3usize, - concat!( - "Offset of field: ", - stringify!(libpostal_near_dupe_hash_options), - "::", - stringify!(with_city_or_equivalent) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .with_small_containing_boundaries as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(libpostal_near_dupe_hash_options), - "::", - stringify!(with_small_containing_boundaries) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .with_postal_code as *const _ as usize - }, - 5usize, - concat!( - "Offset of field: ", - stringify!(libpostal_near_dupe_hash_options), - "::", - stringify!(with_postal_code) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).with_latlon - as *const _ as usize - }, - 6usize, - concat!( - "Offset of field: ", - stringify!(libpostal_near_dupe_hash_options), - "::", - stringify!(with_latlon) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).latitude - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libpostal_near_dupe_hash_options), - "::", - stringify!(latitude) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).longitude - as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(libpostal_near_dupe_hash_options), - "::", - stringify!(longitude) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .geohash_precision as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(libpostal_near_dupe_hash_options), - "::", - stringify!(geohash_precision) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .name_and_address_keys as *const _ as usize - }, - 28usize, - concat!( - "Offset of field: ", - stringify!(libpostal_near_dupe_hash_options), - "::", - stringify!(name_and_address_keys) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).name_only_keys - as *const _ as usize - }, - 29usize, - concat!( - "Offset of field: ", - stringify!(libpostal_near_dupe_hash_options), - "::", - stringify!(name_only_keys) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .address_only_keys as *const _ as usize - }, - 30usize, - concat!( - "Offset of field: ", - stringify!(libpostal_near_dupe_hash_options), - "::", - stringify!(address_only_keys) - ) - ); -} -pub type libpostal_near_dupe_hash_options_t = libpostal_near_dupe_hash_options; -extern "C" { - pub fn libpostal_get_near_dupe_hash_default_options( - ) -> libpostal_near_dupe_hash_options_t; -} -extern "C" { - pub fn libpostal_near_dupe_hashes( - num_components: size_t, - labels: *mut *mut ::std::os::raw::c_char, - values: *mut *mut ::std::os::raw::c_char, - options: libpostal_near_dupe_hash_options_t, - num_hashes: *mut size_t, - ) -> *mut *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn libpostal_near_dupe_hashes_languages( - num_components: size_t, - labels: *mut *mut ::std::os::raw::c_char, - values: *mut *mut ::std::os::raw::c_char, - options: libpostal_near_dupe_hash_options_t, - num_languages: size_t, - languages: *mut *mut ::std::os::raw::c_char, - num_hashes: *mut size_t, - ) -> *mut *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn libpostal_place_languages( - num_components: size_t, - labels: *mut *mut ::std::os::raw::c_char, - values: *mut *mut ::std::os::raw::c_char, - num_languages: *mut size_t, - ) -> *mut *mut ::std::os::raw::c_char; -} -pub const libpostal_duplicate_status_t_LIBPOSTAL_NULL_DUPLICATE_STATUS: - libpostal_duplicate_status_t = -1; -pub const libpostal_duplicate_status_t_LIBPOSTAL_NON_DUPLICATE: - libpostal_duplicate_status_t = 0; -pub const libpostal_duplicate_status_t_LIBPOSTAL_POSSIBLE_DUPLICATE_NEEDS_REVIEW: - libpostal_duplicate_status_t = 3; -pub const libpostal_duplicate_status_t_LIBPOSTAL_LIKELY_DUPLICATE: - libpostal_duplicate_status_t = 6; -pub const libpostal_duplicate_status_t_LIBPOSTAL_EXACT_DUPLICATE: - libpostal_duplicate_status_t = 9; -pub type libpostal_duplicate_status_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct libpostal_duplicate_options { - pub num_languages: size_t, - pub languages: *mut *mut ::std::os::raw::c_char, -} -#[test] -fn bindgen_test_layout_libpostal_duplicate_options() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(libpostal_duplicate_options)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(libpostal_duplicate_options)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).num_languages - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libpostal_duplicate_options), - "::", - stringify!(num_languages) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).languages - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libpostal_duplicate_options), - "::", - stringify!(languages) - ) - ); -} -pub type libpostal_duplicate_options_t = libpostal_duplicate_options; -extern "C" { - pub fn libpostal_get_default_duplicate_options() -> libpostal_duplicate_options_t; -} -extern "C" { - pub fn libpostal_get_duplicate_options_with_languages( - num_languages: size_t, - languages: *mut *mut ::std::os::raw::c_char, - ) -> libpostal_duplicate_options_t; -} -extern "C" { - pub fn libpostal_is_name_duplicate( - value1: *mut ::std::os::raw::c_char, - value2: *mut ::std::os::raw::c_char, - options: libpostal_duplicate_options_t, - ) -> libpostal_duplicate_status_t; -} -extern "C" { - pub fn libpostal_is_street_duplicate( - value1: *mut ::std::os::raw::c_char, - value2: *mut ::std::os::raw::c_char, - options: libpostal_duplicate_options_t, - ) -> libpostal_duplicate_status_t; -} -extern "C" { - pub fn libpostal_is_house_number_duplicate( - value1: *mut ::std::os::raw::c_char, - value2: *mut ::std::os::raw::c_char, - options: libpostal_duplicate_options_t, - ) -> libpostal_duplicate_status_t; -} -extern "C" { - pub fn libpostal_is_po_box_duplicate( - value1: *mut ::std::os::raw::c_char, - value2: *mut ::std::os::raw::c_char, - options: libpostal_duplicate_options_t, - ) -> libpostal_duplicate_status_t; -} -extern "C" { - pub fn libpostal_is_unit_duplicate( - value1: *mut ::std::os::raw::c_char, - value2: *mut ::std::os::raw::c_char, - options: libpostal_duplicate_options_t, - ) -> libpostal_duplicate_status_t; -} -extern "C" { - pub fn libpostal_is_floor_duplicate( - value1: *mut ::std::os::raw::c_char, - value2: *mut ::std::os::raw::c_char, - options: libpostal_duplicate_options_t, - ) -> libpostal_duplicate_status_t; -} -extern "C" { - pub fn libpostal_is_postal_code_duplicate( - value1: *mut ::std::os::raw::c_char, - value2: *mut ::std::os::raw::c_char, - options: libpostal_duplicate_options_t, - ) -> libpostal_duplicate_status_t; -} -extern "C" { - pub fn libpostal_is_toponym_duplicate( - num_components1: size_t, - labels1: *mut *mut ::std::os::raw::c_char, - values1: *mut *mut ::std::os::raw::c_char, - num_components2: size_t, - labels2: *mut *mut ::std::os::raw::c_char, - values2: *mut *mut ::std::os::raw::c_char, - options: libpostal_duplicate_options_t, - ) -> libpostal_duplicate_status_t; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct libpostal_fuzzy_duplicate_options { - pub num_languages: size_t, - pub languages: *mut *mut ::std::os::raw::c_char, - pub needs_review_threshold: f64, - pub likely_dupe_threshold: f64, -} -#[test] -fn bindgen_test_layout_libpostal_fuzzy_duplicate_options() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(libpostal_fuzzy_duplicate_options)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libpostal_fuzzy_duplicate_options) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).num_languages - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libpostal_fuzzy_duplicate_options), - "::", - stringify!(num_languages) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).languages - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libpostal_fuzzy_duplicate_options), - "::", - stringify!(languages) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .needs_review_threshold as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(libpostal_fuzzy_duplicate_options), - "::", - stringify!(needs_review_threshold) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())) - .likely_dupe_threshold as *const _ as usize - }, - 24usize, - concat!( - "Offset of field: ", - stringify!(libpostal_fuzzy_duplicate_options), - "::", - stringify!(likely_dupe_threshold) - ) - ); -} -pub type libpostal_fuzzy_duplicate_options_t = libpostal_fuzzy_duplicate_options; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct libpostal_fuzzy_duplicate_status { - pub status: libpostal_duplicate_status_t, - pub similarity: f64, -} -#[test] -fn bindgen_test_layout_libpostal_fuzzy_duplicate_status() { - assert_eq!( - ::std::mem::size_of::(), - 16usize, - concat!("Size of: ", stringify!(libpostal_fuzzy_duplicate_status)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!( - "Alignment of ", - stringify!(libpostal_fuzzy_duplicate_status) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).status - as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libpostal_fuzzy_duplicate_status), - "::", - stringify!(status) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).similarity - as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libpostal_fuzzy_duplicate_status), - "::", - stringify!(similarity) - ) - ); -} -pub type libpostal_fuzzy_duplicate_status_t = libpostal_fuzzy_duplicate_status; -extern "C" { - pub fn libpostal_get_default_fuzzy_duplicate_options( - ) -> libpostal_fuzzy_duplicate_options_t; -} -extern "C" { - pub fn libpostal_get_default_fuzzy_duplicate_options_with_languages( - num_languages: size_t, - languages: *mut *mut ::std::os::raw::c_char, - ) -> libpostal_fuzzy_duplicate_options_t; -} -extern "C" { - pub fn libpostal_is_name_duplicate_fuzzy( - num_tokens1: size_t, - tokens1: *mut *mut ::std::os::raw::c_char, - token_scores1: *mut f64, - num_tokens2: size_t, - tokens2: *mut *mut ::std::os::raw::c_char, - token_scores2: *mut f64, - options: libpostal_fuzzy_duplicate_options_t, - ) -> libpostal_fuzzy_duplicate_status_t; -} -extern "C" { - pub fn libpostal_is_street_duplicate_fuzzy( - num_tokens1: size_t, - tokens1: *mut *mut ::std::os::raw::c_char, - token_scores1: *mut f64, - num_tokens2: size_t, - tokens2: *mut *mut ::std::os::raw::c_char, - token_scores2: *mut f64, - options: libpostal_fuzzy_duplicate_options_t, - ) -> libpostal_fuzzy_duplicate_status_t; -} -extern "C" { - pub fn libpostal_setup() -> bool; -} -extern "C" { - pub fn libpostal_setup_datadir(datadir: *mut ::std::os::raw::c_char) -> bool; -} -extern "C" { - pub fn libpostal_teardown(); -} -extern "C" { - pub fn libpostal_setup_parser() -> bool; -} -extern "C" { - pub fn libpostal_setup_parser_datadir( - datadir: *mut ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn libpostal_teardown_parser(); -} -extern "C" { - pub fn libpostal_setup_language_classifier() -> bool; -} -extern "C" { - pub fn libpostal_setup_language_classifier_datadir( - datadir: *mut ::std::os::raw::c_char, - ) -> bool; -} -extern "C" { - pub fn libpostal_teardown_language_classifier(); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct libpostal_token { - pub offset: size_t, - pub len: size_t, - pub type_: u16, -} -#[test] -fn bindgen_test_layout_libpostal_token() { - assert_eq!( - ::std::mem::size_of::(), - 24usize, - concat!("Size of: ", stringify!(libpostal_token)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(libpostal_token)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).offset as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libpostal_token), - "::", - stringify!(offset) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).len as *const _ as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libpostal_token), - "::", - stringify!(len) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).type_ as *const _ as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(libpostal_token), - "::", - stringify!(type_) - ) - ); -} -pub type libpostal_token_t = libpostal_token; -extern "C" { - pub fn libpostal_tokenize( - input: *mut ::std::os::raw::c_char, - whitespace: bool, - n: *mut size_t, - ) -> *mut libpostal_token_t; -} -extern "C" { - pub fn libpostal_normalize_string_languages( - input: *mut ::std::os::raw::c_char, - options: u64, - num_languages: size_t, - languages: *mut *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn libpostal_normalize_string( - input: *mut ::std::os::raw::c_char, - options: u64, - ) -> *mut ::std::os::raw::c_char; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct libpostal_normalized_token { - pub str_: *mut ::std::os::raw::c_char, - pub token: libpostal_token_t, -} -#[test] -fn bindgen_test_layout_libpostal_normalized_token() { - assert_eq!( - ::std::mem::size_of::(), - 32usize, - concat!("Size of: ", stringify!(libpostal_normalized_token)) - ); - assert_eq!( - ::std::mem::align_of::(), - 8usize, - concat!("Alignment of ", stringify!(libpostal_normalized_token)) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).str_ as *const _ - as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(libpostal_normalized_token), - "::", - stringify!(str_) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::())).token as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(libpostal_normalized_token), - "::", - stringify!(token) - ) - ); -} -pub type libpostal_normalized_token_t = libpostal_normalized_token; -extern "C" { - pub fn libpostal_normalized_tokens( - input: *mut ::std::os::raw::c_char, - string_options: u64, - token_options: u64, - whitespace: bool, - n: *mut size_t, - ) -> *mut libpostal_normalized_token_t; -} -extern "C" { - pub fn libpostal_normalized_tokens_languages( - input: *mut ::std::os::raw::c_char, - string_options: u64, - token_options: u64, - whitespace: bool, - num_languages: size_t, - languages: *mut *mut ::std::os::raw::c_char, - n: *mut size_t, - ) -> *mut libpostal_normalized_token_t; -} -pub type __builtin_va_list = [__va_list_tag; 1usize]; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __va_list_tag { - pub gp_offset: ::std::os::raw::c_uint, - pub fp_offset: ::std::os::raw::c_uint, - pub overflow_arg_area: *mut ::std::os::raw::c_void, - pub reg_save_area: *mut ::std::os::raw::c_void, -} -#[test] -fn bindgen_test_layout___va_list_tag() { - 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::null::<__va_list_tag>())).gp_offset as *const _ as usize - }, - 0usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(gp_offset) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__va_list_tag>())).fp_offset as *const _ as usize - }, - 4usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(fp_offset) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__va_list_tag>())).overflow_arg_area as *const _ - as usize - }, - 8usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(overflow_arg_area) - ) - ); - assert_eq!( - unsafe { - &(*(::std::ptr::null::<__va_list_tag>())).reg_save_area as *const _ - as usize - }, - 16usize, - concat!( - "Offset of field: ", - stringify!(__va_list_tag), - "::", - stringify!(reg_save_area) - ) - ); -} diff --git a/crates/libpostal-sys/src/lib.rs b/crates/libpostal-sys/src/lib.rs index 765b131..d9c41fd 100644 --- a/crates/libpostal-sys/src/lib.rs +++ b/crates/libpostal-sys/src/lib.rs @@ -6,10 +6,12 @@ // Ignore test-only warnings caused by // https://github.com/rust-lang/rust-bindgen/issues/1651. #![cfg_attr(test, allow(deref_nullptr))] +// Allow clippy warnings in generated bindgen code +#![allow(clippy::missing_safety_doc)] +#![allow(clippy::ptr_offset_with_cast)] +#![allow(clippy::useless_transmute)] -use std::sync::{Arc, Mutex}; - -use lazy_static::lazy_static; +use std::sync::{Arc, LazyLock, Mutex}; /// Which portions of this library have been initialized? /// @@ -27,27 +29,21 @@ pub struct InitializationState { pub language_classifier_initialized: bool, } -lazy_static! { - /// You _must_ take this lock before doing _anything_ with this library. - /// `libpostal` is [not thread safe][threads]. - /// - /// [threads]: https://github.com/openvenues/libpostal/issues/34 - pub static ref GLOBAL_LOCK: Arc> = Arc::new(Mutex::new(InitializationState { - initialized: false, - parser_initialized: false, - language_classifier_initialized: false, - })); -} - -// We could use build.rs to automatically generate these bindings, then include -//them like this. include!(concat!(env!("OUT_DIR"), "/bindings.rs")); +/// You _must_ take this lock before doing _anything_ with this library. +/// `libpostal` is [not thread safe][threads]. +/// +/// [threads]: https://github.com/openvenues/libpostal/issues/34 +pub static GLOBAL_LOCK: LazyLock>> = + LazyLock::new(|| { + Arc::new(Mutex::new(InitializationState { + initialized: false, + parser_initialized: false, + language_classifier_initialized: false, + })) + }); -// Assume our bindings were generated using: -// -// bindgen wrapper.h -o src/bindings.rs -// -// See the README.md file. -include!("bindings.rs"); +// Use build.rs to automatically generate these bindings +include!(concat!(env!("OUT_DIR"), "/bindings.rs")); #[cfg(test)] mod tests { @@ -97,7 +93,7 @@ mod tests { CString::new("Quatre-vingt-douze Ave des Champs-Élysées") .expect("CString::new failed"); let normalization_options = libpostal_get_default_options(); - let mut num_expansions: size_t = 0; + let mut num_expansions: usize = 0; let expansions = libpostal_expand_address( street_address.as_ptr() as *mut _, normalization_options, diff --git a/crates/metrics-exporter-newrelic/CHANGELOG.md b/crates/metrics-exporter-newrelic/CHANGELOG.md index bbe406b..0d3d870 100644 --- a/crates/metrics-exporter-newrelic/CHANGELOG.md +++ b/crates/metrics-exporter-newrelic/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Changed + +- Updated `reqwest` to 0.13 (replaced `rustls-tls` feature with `rustls`). +- Removed standalone `serde_derive` dependency in favor of `serde` with `derive` feature. +- Updated `thiserror` to 2.x, `tokio` to 1.51. + ## [0.2.0] - 2022-10-26 ### Changed diff --git a/crates/metrics-exporter-newrelic/Cargo.toml b/crates/metrics-exporter-newrelic/Cargo.toml index 02bcb7a..6ebdd78 100644 --- a/crates/metrics-exporter-newrelic/Cargo.toml +++ b/crates/metrics-exporter-newrelic/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "metrics-exporter-newrelic" -version = "0.2.0" -authors = ["Eric Kidd "] +version = "0.2.1" +authors = ["Eric Kidd ", "Seamus Abshere "] edition = "2021" description = "Basic `metrics` exporter for use with NewRelic" @@ -12,13 +12,12 @@ repository = "https://github.com/faradayio/geocode-csv" documentation = "https://docs.rs/metrics-exporter-newrelic" [dependencies] -http = "0.2.6" -metrics = "0.20.1" -metrics-util = "0.14.0" -reqwest = { version = "0.11.9", default-features = false, features = ["json", "rustls-tls"] } -serde = "1.0.136" -serde_derive = "1.0.136" -serde_json = "1.0.78" -thiserror = "1.0.30" -tokio = { version = "1.16.1", default-features = false, features = ["sync"] } -tracing = "0.1.29" +http = "1.5.0" +metrics = "0.24.6" +metrics-util = "0.20.4" +reqwest = { version = "0.13.5", default-features = false, features = ["json", "rustls"] } +serde = { version = "1.0.229", features = ["derive"] } +serde_json = "1.0.151" +thiserror = "2.0.20" +tokio = { version = "1.53.1", default-features = false, features = ["sync"] } +tracing = "0.1.44" diff --git a/crates/metrics-exporter-newrelic/src/client.rs b/crates/metrics-exporter-newrelic/src/client.rs index d88f2fd..38eea1e 100644 --- a/crates/metrics-exporter-newrelic/src/client.rs +++ b/crates/metrics-exporter-newrelic/src/client.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; -use serde_derive::Serialize; +use serde::Serialize; use serde_json::{json, Value}; use tracing::{instrument, trace}; diff --git a/crates/metrics-exporter-newrelic/src/errors.rs b/crates/metrics-exporter-newrelic/src/errors.rs index 354d0c8..e0be3e4 100644 --- a/crates/metrics-exporter-newrelic/src/errors.rs +++ b/crates/metrics-exporter-newrelic/src/errors.rs @@ -3,6 +3,8 @@ use metrics::SetRecorderError; use thiserror::Error; +use crate::NewRelicRecorder; + /// An error occurred building or installing our metrics recorder. #[derive(Debug, Error)] #[non_exhaustive] @@ -11,7 +13,7 @@ pub enum BuildError { #[non_exhaustive] SetRecorderError { #[from] - source: SetRecorderError, + source: SetRecorderError, }, } diff --git a/crates/metrics-exporter-newrelic/src/lib.rs b/crates/metrics-exporter-newrelic/src/lib.rs index 9aceb25..1c0402f 100644 --- a/crates/metrics-exporter-newrelic/src/lib.rs +++ b/crates/metrics-exporter-newrelic/src/lib.rs @@ -287,7 +287,7 @@ impl NewRelicRecorder { /// Install this recorder as the global default recorder. pub fn install(self) -> Result { let handle = self.handle(); - metrics::set_boxed_recorder(Box::new(self))?; + metrics::set_global_recorder(self)?; Ok(handle) } } @@ -320,19 +320,27 @@ impl Recorder for NewRelicRecorder { // NewRelic does not use this information. } - fn register_counter(&self, key: &Key) -> Counter { + fn register_counter( + &self, + key: &Key, + _metadata: &metrics::Metadata<'_>, + ) -> Counter { self.inner .registry .get_or_create_counter(key, |c| c.clone().into()) } - fn register_gauge(&self, key: &Key) -> Gauge { + fn register_gauge(&self, key: &Key, _metadata: &metrics::Metadata<'_>) -> Gauge { self.inner .registry .get_or_create_gauge(key, |c| c.clone().into()) } - fn register_histogram(&self, key: &Key) -> Histogram { + fn register_histogram( + &self, + key: &Key, + _metadata: &metrics::Metadata<'_>, + ) -> Histogram { self.inner .registry .get_or_create_histogram(key, |c| c.clone().into()) diff --git a/crates/opinionated_metrics/CHANGELOG.md b/crates/opinionated_metrics/CHANGELOG.md index 1e9a8d7..f165311 100644 --- a/crates/opinionated_metrics/CHANGELOG.md +++ b/crates/opinionated_metrics/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Changed + +- Updated `thiserror` to 2.x. + ## [0.2.0] - 2022-10-26 ### Changed diff --git a/crates/opinionated_metrics/Cargo.toml b/crates/opinionated_metrics/Cargo.toml index a3215a3..1fe2d4b 100644 --- a/crates/opinionated_metrics/Cargo.toml +++ b/crates/opinionated_metrics/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "opinionated_metrics" -version = "0.2.0" -authors = ["Eric Kidd "] +version = "0.2.1" +authors = ["Eric Kidd ", "Seamus Abshere "] edition = "2021" description = "Automatic configuration of exporters for `metrics`" @@ -12,9 +12,9 @@ repository = "https://github.com/faradayio/geocode-csv" documentation = "https://docs.rs/opinionated_metrics" [dependencies] -metrics = "0.20.1" +metrics = "0.24.6" metrics-exporter-newrelic = { version = "0.2.0", path = "../metrics-exporter-newrelic" } # We'll add back Prometheus features like http-listener as we support them. -metrics-exporter-prometheus = { version = "0.11.0", default-features = false } -thiserror = "1.0.30" -tracing = "0.1.29" \ No newline at end of file +metrics-exporter-prometheus = { version = "0.18.3", default-features = false } +thiserror = "2.0.20" +tracing = "0.1.44" diff --git a/deny.toml b/deny.toml index cf1dcac..a139840 100644 --- a/deny.toml +++ b/deny.toml @@ -3,39 +3,31 @@ # These policies can be enforced using `cargo deny check`. [advisories] -ignore = [] +version = 2 +ignore = [ + # 3.0.0 is a tombstone that only emits compile_error!. 2.0.1 is the last + # real release, and our cache payload format is encoded with it. + { id = "RUSTSEC-2025-0141", reason = "bincode 3.0.0 is not a real upgrade; cache format depends on 2.0.1" }, +] [licenses] -# Don't allow code with an unclear license. -unlicensed = "deny" - -# Don't allow "copylefted" licenses unless they're listed below. -copyleft = "deny" - -# Allow common non-restrictive licenses. +version = 2 +# Allow common non-restrictive licenses. Do not allow OpenSSL: we refuse the +# OpenSSL library itself, and we do not want `ring` (whose license includes +# "OpenSSL") sneaking back in next to aws-lc-rs. allow = [ "MIT", "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause", + "BSL-1.0", "CC0-1.0", + "CDLA-Permissive-2.0", "ISC", - "MPL-2.0", - "OpenSSL", - "Unicode-DFS-2016", + "Unicode-3.0", + "Zlib" ] -# Many organizations ban AGPL-licensed code -# https://opensource.google/docs/using/agpl-policy/ -deny = ["AGPL-3.0"] - -[[licenses.clarify]] -# Ring has a messy license. We should either commit 100% to ring everywhere, or -# to native-tls everywhere, and not mix the two. -name = "ring" -expression = "ISC AND OpenSSL AND MIT" -license-files = [{ path = "LICENSE", hash = 3171872035 }] - [[licenses.clarify]] name = "encoding_rs" expression = "(MIT OR Apache-2.0) AND BSD-3-Clause AND CC0-1.0" @@ -47,16 +39,18 @@ multiple-versions = "warn" deny = [ # This never causes anything but portability misery. + { name = "openssl" }, { name = "openssl-sys" }, + { name = "native-tls" }, # `serde_derive` shipped unreproducible binary builds for a while. See # https://github.com/serde-rs/serde/issues/2538. { name = "serde_derive", version = ">1.0.171,<1.0.184" }, ] -skip = [ - # This seems to be included by portable-atomic 0.3.20 for some reason. - { name = "portable-atomic", version = "1.6.0" }, -] +#skip = [ +# # This seems to be included by portable-atomic 0.3.20 for some reason. +# { name = "portable-atomic", version = "1.6.0" }, +#] skip-tree = [ # This has a bunch of old dependencies. diff --git a/run_tests_with_secrets.py b/run_tests_with_secrets.py new file mode 100755 index 0000000..d87ba3f --- /dev/null +++ b/run_tests_with_secrets.py @@ -0,0 +1,153 @@ +#!/usr/bin/env python3 +"""Run the full geocode-csv test suite, including the #[ignore]d integration tests. + +The ignored tests exercise real external services: the Smarty API, a BigTable +cache, a local Redis cache, and the bundled libpostal model. We require the +necessary credentials in the environment and make sure a local Redis is +listening before handing off to `cargo test`. Nothing is skipped. +""" + +import os +import shutil +import socket +import subprocess +import sys +import time +from dataclasses import dataclass + +REDIS_HOST = "localhost" +REDIS_PORT = 6379 + +REQUIRED_ENVIRONMENT_VARIABLES = ( + "SMARTY_AUTH_ID", + "SMARTY_AUTH_TOKEN", + "BIGTABLE_CACHE_URL", +) + + +@dataclass +class CargoTest: + """A single `cargo test` invocation: arguments for cargo itself, plus + arguments passed through to the test harness after `--`.""" + + description: str + cargo_arguments: list + test_harness_arguments: list + + def run(self): + command = [ + "cargo", + "test", + *self.cargo_arguments, + "--", + *self.test_harness_arguments, + ] + print(f"\n=== {self.description} ===") + print(f"$ {' '.join(command)}", flush=True) + subprocess.run(command, check=True) + + +class RedisServer: + """The local Redis that the cache integration tests connect to.""" + + def is_listening(self): + with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as probe: + probe.settimeout(0.5) + return probe.connect_ex((REDIS_HOST, REDIS_PORT)) == 0 + + def ensure_listening(self): + if self.is_listening(): + print(f"Redis already listening on {REDIS_HOST}:{REDIS_PORT}.") + return + if shutil.which("redis-server") is None: + sys.exit( + "redis-server is required for the cache tests but is not installed " + "(try `brew install redis`)." + ) + print("Starting redis-server in the background...") + subprocess.run( + ["redis-server", "--daemonize", "yes", "--port", str(REDIS_PORT)], + check=True, + ) + for _ in range(50): + if self.is_listening(): + print("Redis is up.") + return + time.sleep(0.1) + sys.exit("redis-server was started but never began listening.") + + +def require_environment_variables(): + missing = [ + name + for name in REQUIRED_ENVIRONMENT_VARIABLES + if not os.environ.get(name) + ] + if missing: + sys.exit( + "the following environment variables must be set: " + + ", ".join(missing) + ) + + +def main(): + require_environment_variables() + os.environ.setdefault("RUST_LOG", "info") + + RedisServer().ensure_listening() + + print("\n=== Building workspace ===") + subprocess.run(["cargo", "build", "--workspace"], check=True) + + suites = [ + CargoTest( + description="Unit tests (binary + every crate library), including ignored", + cargo_arguments=["--workspace", "--lib", "--bins"], + test_harness_arguments=["--include-ignored"], + ), + CargoTest( + description="Doc tests", + cargo_arguments=["--workspace", "--doc"], + test_harness_arguments=[], + ), + CargoTest( + description="Integration: about", + cargo_arguments=["--test", "about"], + test_harness_arguments=["--include-ignored"], + ), + CargoTest( + description="Integration: duplicate_columns", + cargo_arguments=["--test", "duplicate_columns"], + test_harness_arguments=["--include-ignored"], + ), + CargoTest( + description="Integration: libpostal", + cargo_arguments=["--test", "libpostal"], + test_harness_arguments=["--include-ignored"], + ), + CargoTest( + description="Integration: specs (Smarty + Redis)", + cargo_arguments=["--test", "specs"], + test_harness_arguments=["--include-ignored"], + ), + CargoTest( + description="Integration: server", + cargo_arguments=["--test", "server"], + test_harness_arguments=["--include-ignored"], + ), + CargoTest( + # Serialized to one thread because every test in this file writes to + # the same shared BigTable table. + description="Integration: bigtable_refresh", + cargo_arguments=["--test", "bigtable_refresh"], + test_harness_arguments=["--include-ignored", "--test-threads=1"], + ), + ] + for suite in suites: + suite.run() + + print("\nAll tests passed.") + + +if __name__ == "__main__": + main() diff --git a/src/errors.rs b/src/errors.rs index 54a609f..610898f 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -7,15 +7,3 @@ use anyhow::Error; pub(crate) fn display_causes_and_backtrace(err: &Error) { eprintln!("{:?}", err); } - -/// Given a [`hyper::Error`], return a human-readable description. -/// -/// This description _should_ be "low-arity", i.e., limited to only a handful of -/// values. We use it when reporting error metrics. -pub(crate) fn hyper_error_description_for_metrics(err: &hyper::Error) -> String { - // HACK: We know that the current version of `hyper` puts a low-arity - // description before ":", but follows it up with variable text. - let display_err = err.to_string(); - let cut_at = display_err.find(':').unwrap_or(display_err.len()); - display_err[..cut_at].to_owned() -} diff --git a/src/geocoders/cache/compression.rs b/src/geocoders/cache/compression.rs deleted file mode 100644 index c4743d8..0000000 --- a/src/geocoders/cache/compression.rs +++ /dev/null @@ -1,86 +0,0 @@ -//! Basic compression and decompression for cached data, using a custom language -//! model to build a dictionary for `zstd`. - -use metrics::{counter, describe_counter, Unit}; - -use crate::Result; - -/// Interface for compressing and decompressing cache entries. -/// -/// We want to allow alternate implementations in the future. -pub struct CacheCompressor {} - -impl CacheCompressor { - /// Create a new cache compressor and initialize our dictionaries. - pub fn new() -> CacheCompressor { - describe_counter!( - "geocodecsv.compressor_input.bytes_total", - Unit::Bytes, - "Bytes input to compressor" - ); - describe_counter!( - "geocodecsv.compressor_output.bytes_total", - Unit::Bytes, - "Bytes output by compressor" - ); - describe_counter!( - "geocodecsv.decompressor_input.bytes_total", - Unit::Bytes, - "Bytes input to decompressor" - ); - describe_counter!( - "geocodecsv.decompressor_output.bytes_total", - Unit::Bytes, - "Bytes output by decompressor" - ); - - CacheCompressor {} - } - - /// The ID of this type of compression. Must be unique. - pub fn id(&self) -> u8 { - b'N' // "N" means "none". - } - - /// Compress `input` and append to `output`. - pub fn compress(&self, input: &[u8], output: &mut Vec) -> Result<()> { - counter!("geocodecsv.compressor_input.bytes_total", input.len() as u64, "compressor" => "none"); - output.extend_from_slice(input); - counter!("geocodecsv.compressor_output.bytes_total", output.len() as u64, "compressor" => "none"); - Ok(()) - } - - /// Decompress `input` and store in `output`. - pub fn decompress(&self, input: &[u8], output: &mut Vec) -> Result<()> { - counter!("geocodecsv.decompressor_input.bytes_total", input.len() as u64, "compressor" => "none"); - output.extend_from_slice(input); - counter!("geocodecsv.decompressor_output.bytes_total", output.len() as u64, "compressor" => "none"); - Ok(()) - } -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn round_trip_compression() { - let examples: &[&[u8]] = &[ - b"781 Franklin Ave Crown Heights Brooklyn NYC NY 11216 USA", - b"20 W 34th St, New York, NY 10001", - b"", - b"abc123", - ]; - - let cache_compressor = CacheCompressor::new(); - for &example in examples { - let mut compressed = vec![]; - cache_compressor.compress(example, &mut compressed).unwrap(); - let mut decompressed = vec![]; - cache_compressor - .decompress(&compressed, &mut decompressed) - .unwrap(); - assert_eq!(example, decompressed); - } - } -} diff --git a/src/geocoders/cache/entry.rs b/src/geocoders/cache/entry.rs new file mode 100644 index 0000000..43976d7 --- /dev/null +++ b/src/geocoders/cache/entry.rs @@ -0,0 +1,287 @@ +//! On-disk format for a cached geocoding result. +//! +//! The first byte is a format tag. We always write `N`, the legacy tag, so +//! older binaries can still read the `Option>` payload. Refresh +//! state is appended after that payload; old `decode_from_slice` callers ignore +//! the leftover bytes. +//! +//! - `N` plus only the option payload: a pre-refresh row (`refresh_attempts = 0`). +//! - `N` plus the option payload plus metadata: a current row. + +use anyhow::{format_err, Context}; +use metrics::{counter, describe_counter, Unit}; +use serde::{Deserialize, Serialize}; + +use crate::Result; + +use super::refresh::CachedOutcome; + +/// A cached geocoding result, plus how many times we have re-checked a failure. +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +pub struct CacheEntry { + /// Column values from a successful geocode, or `None` for a cached miss. + pub geocoded: Option>, + + /// How many times we have refreshed this entry and still got a failure. + /// Reset to 0 on a successful geocode. + pub refresh_attempts: u32, +} + +const FORMAT_LEGACY: u8 = b'N'; +const METADATA_VERSION: u8 = 1; + +fn bincode_config() -> impl bincode::config::Config { + bincode::config::standard() + .with_little_endian() + .with_variable_int_encoding() +} + +fn refresh_attempts_from_trailing_bytes(trailing: &[u8]) -> Result { + match trailing { + [] => Ok(0), + [METADATA_VERSION, rest @ ..] if rest.len() >= 4 => Ok(u32::from_le_bytes( + rest[..4].try_into().expect("slice is 4 bytes"), + )), + [METADATA_VERSION, ..] => Err(format_err!("truncated cache refresh metadata")), + [other, ..] => Err(format_err!( + "unknown cache refresh metadata version {other}" + )), + } +} + +impl CacheEntry { + /// Register the cache payload size counters (same names as the old + /// compressor, so existing dashboards keep working). + pub fn describe_metrics() { + describe_counter!( + "geocodecsv.compressor_input.bytes_total", + Unit::Bytes, + "Bytes input to compressor" + ); + describe_counter!( + "geocodecsv.compressor_output.bytes_total", + Unit::Bytes, + "Bytes output by compressor" + ); + describe_counter!( + "geocodecsv.decompressor_input.bytes_total", + Unit::Bytes, + "Bytes input to decompressor" + ); + describe_counter!( + "geocodecsv.decompressor_output.bytes_total", + Unit::Bytes, + "Bytes output by decompressor" + ); + } + + /// Build the entry we write after a geocode. + /// + /// A refreshed failure increments the prior attempt count. A success, or a + /// first-time miss, writes 0. If we refresh a success and the geocoder + /// returns no match, keep the prior success instead of replacing it. + pub fn for_write_back( + geocoded: Option>, + prior_entry: Option<&CacheEntry>, + ) -> CacheEntry { + match (geocoded, prior_entry) { + (None, Some(prior_entry)) if prior_entry.geocoded.is_some() => { + CacheEntry { + geocoded: prior_entry.geocoded.clone(), + refresh_attempts: 0, + } + } + (None, Some(prior_entry)) => CacheEntry { + geocoded: None, + refresh_attempts: prior_entry.refresh_attempts.saturating_add(1), + }, + (geocoded, _) => CacheEntry { + geocoded, + refresh_attempts: 0, + }, + } + } + + /// Whether this entry recorded a successful geocode or a failure to match. + pub fn outcome(&self) -> CachedOutcome { + if self.geocoded.is_some() { + CachedOutcome::Success + } else { + CachedOutcome::Failure + } + } + + /// Encode this entry as an `N`-tagged payload that older binaries can read. + pub fn encode(&self, output: &mut Vec) -> Result<()> { + let mut payload = Vec::with_capacity(256); + bincode::serde::encode_into_std_write( + &self.geocoded, + &mut payload, + bincode_config(), + ) + .context("could not encode value for caching")?; + payload.push(METADATA_VERSION); + payload.extend_from_slice(&self.refresh_attempts.to_le_bytes()); + counter!("geocodecsv.compressor_input.bytes_total", "compressor" => "none") + .increment(payload.len() as u64); + output.push(FORMAT_LEGACY); + output.extend_from_slice(&payload); + counter!("geocodecsv.compressor_output.bytes_total", "compressor" => "none") + .increment((1 + payload.len()) as u64); + Ok(()) + } + + /// Decode a tagged cache payload. + pub fn decode(bytes: &[u8]) -> Result { + let Some((format_tag, payload)) = bytes.split_first() else { + return Err(format_err!("cached value is empty")); + }; + counter!("geocodecsv.decompressor_input.bytes_total", "compressor" => "none") + .increment(payload.len() as u64); + let entry = match *format_tag { + FORMAT_LEGACY => { + let (geocoded, consumed) = bincode::serde::decode_from_slice::< + Option>, + _, + >(payload, bincode_config()) + .context("could not deserialize cached data")?; + CacheEntry { + geocoded, + refresh_attempts: refresh_attempts_from_trailing_bytes( + &payload[consumed..], + )?, + } + } + other => { + return Err(format_err!("unknown cache format {:?}", other)); + } + }; + counter!("geocodecsv.decompressor_output.bytes_total", "compressor" => "none") + .increment(payload.len() as u64); + Ok(entry) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + fn encode_legacy(geocoded: Option>) -> Vec { + let mut payload = Vec::new(); + bincode::serde::encode_into_std_write( + &geocoded, + &mut payload, + bincode_config(), + ) + .unwrap(); + let mut bytes = vec![FORMAT_LEGACY]; + bytes.extend_from_slice(&payload); + bytes + } + + #[test] + fn round_trip_entry() { + let original = CacheEntry { + geocoded: Some(vec!["a".to_owned(), "b".to_owned()]), + refresh_attempts: 3, + }; + let mut encoded = Vec::new(); + original.encode(&mut encoded).unwrap(); + assert_eq!(encoded[0], FORMAT_LEGACY); + assert_eq!(CacheEntry::decode(&encoded).unwrap(), original); + } + + #[test] + fn round_trip_failure() { + let original = CacheEntry { + geocoded: None, + refresh_attempts: 2, + }; + let mut encoded = Vec::new(); + original.encode(&mut encoded).unwrap(); + assert_eq!(CacheEntry::decode(&encoded).unwrap(), original); + } + + #[test] + fn new_rows_are_readable_by_the_legacy_option_decoder() { + let original = CacheEntry { + geocoded: Some(vec!["x".to_owned()]), + refresh_attempts: 4, + }; + let mut encoded = Vec::new(); + original.encode(&mut encoded).unwrap(); + let (geocoded, _consumed) = bincode::serde::decode_from_slice::< + Option>, + _, + >(&encoded[1..], bincode_config()) + .unwrap(); + assert_eq!(geocoded, Some(vec!["x".to_owned()])); + } + + #[test] + fn legacy_success_decodes_with_zero_attempts() { + let bytes = encode_legacy(Some(vec!["x".to_owned()])); + assert_eq!( + CacheEntry::decode(&bytes).unwrap(), + CacheEntry { + geocoded: Some(vec!["x".to_owned()]), + refresh_attempts: 0, + } + ); + } + + #[test] + fn legacy_failure_decodes_with_zero_attempts() { + let bytes = encode_legacy(None); + assert_eq!( + CacheEntry::decode(&bytes).unwrap(), + CacheEntry { + geocoded: None, + refresh_attempts: 0, + } + ); + } + + #[test] + fn write_back_increments_failure_attempts() { + let prior = CacheEntry { + geocoded: None, + refresh_attempts: 2, + }; + assert_eq!( + CacheEntry::for_write_back(None, Some(&prior)).refresh_attempts, + 3 + ); + assert_eq!( + CacheEntry::for_write_back(Some(vec!["ok".to_owned()]), Some(&prior)) + .refresh_attempts, + 0 + ); + assert_eq!(CacheEntry::for_write_back(None, None).refresh_attempts, 0); + } + + #[test] + fn write_back_keeps_a_success_if_refresh_fails() { + let prior = CacheEntry { + geocoded: Some(vec!["kept".to_owned()]), + refresh_attempts: 0, + }; + assert_eq!( + CacheEntry::for_write_back(None, Some(&prior)), + CacheEntry { + geocoded: Some(vec!["kept".to_owned()]), + refresh_attempts: 0, + } + ); + } + + #[test] + fn empty_payload_is_an_error() { + assert!(CacheEntry::decode(&[]).is_err()); + } + + #[test] + fn unknown_format_is_an_error() { + assert!(CacheEntry::decode(&[b'Z', 1, 2, 3]).is_err()); + } +} diff --git a/src/geocoders/cache/mod.rs b/src/geocoders/cache/mod.rs index a2af9a6..24edf4e 100644 --- a/src/geocoders/cache/mod.rs +++ b/src/geocoders/cache/mod.rs @@ -2,26 +2,30 @@ //! enough to handle a cluster of geocode-csv clients running at full speed). use std::fmt::{self, Write}; +use std::time::SystemTime; -use anyhow::{format_err, Context}; +use anyhow::format_err; use async_trait::async_trait; use metrics::{counter, describe_counter}; -use crate::{addresses::Address, key_value_stores::KeyValueStore, Result}; +use crate::{ + addresses::Address, + key_value_stores::{CachedValue, KeyValueStore}, + Result, +}; -use self::compression::CacheCompressor; +use self::entry::CacheEntry; +use self::refresh::RefreshPolicy; use super::{Geocoded, Geocoder}; -mod compression; +mod entry; +pub mod refresh; /// A Redis-based caching layer. /// /// This wraps another geocoder, and caches calls in Redis. pub struct Cache { - /// Compressor we use to compress cached data. - compressor: CacheCompressor, - /// Our key/value store. key_value_store: Box, @@ -37,10 +41,20 @@ pub struct Cache { /// Should we geocode cache misses? cache_hits_only: bool, + /// Optional policy for automatically refreshing stale cache entries. + refresh_policy: Option, + /// The column names we output. column_names: Vec, } +/// An address we need to send to the inner geocoder. +struct CacheMiss { + offset: usize, + address: Address, + prior_entry: Option, +} + impl Cache { /// Create a new cache wrapping `inner`, and storing values in /// `key_value_store`. @@ -49,12 +63,22 @@ impl Cache { inner: Box, output_keys: bool, cache_hits_only: bool, + refresh_policy: Option, ) -> Result { describe_counter!("geocodecsv.cache_hits.total", "Addresses found in cache"); describe_counter!( "geocodecsv.cache_misses.total", "Addresses not found in cache" ); + describe_counter!( + "geocodecsv.cache.refreshed.total", + "Cache entries refreshed (treated as a miss) by the refresh policy" + ); + describe_counter!( + "geocodecsv.cache.refresh_results.total", + "Outcomes of a refresh, labeled by the prior and new outcome" + ); + CacheEntry::describe_metrics(); let inner_cache_prefix = inner.cache_prefix(); let mut column_names = inner.column_names().to_owned(); @@ -63,13 +87,13 @@ impl Cache { } Ok(Cache { - compressor: CacheCompressor::new(), key_value_store, inner, inner_cache_prefix, output_keys, column_names, cache_hits_only, + refresh_policy, }) } } @@ -116,118 +140,111 @@ impl Geocoder for Cache { for key in &keys { pipelined_get.add_get(key.to_owned()); } - let cache_results: Vec>> = pipelined_get.execute().await?; - - // Our standard bincode configuration. - let bincode_config = bincode::config::standard() - .with_little_endian() - .with_variable_int_encoding(); + let cache_results: Vec> = pipelined_get.execute().await?; // Unpack our results, recording any cache hits, and building a list of // the misses to forward to our inner geocoder. let mut cache_misses = Vec::with_capacity(addresses.len()); - let mut cache_miss_offsets = Vec::with_capacity(addresses.len()); - let mut decompressed = Vec::with_capacity(256); + // Compute the current time once for the whole batch, so every entry's + // refresh decision is made against a single consistent `now`. + let now = SystemTime::now(); for (i, cached_value) in cache_results.iter().enumerate() { - if let Some(cache_hit) = cached_value { - // We found this result in the cache. - decompressed.clear(); - if cache_hit[0] != self.compressor.id() { + let Some(cached_value) = cached_value else { + cache_misses.push(CacheMiss { + offset: i, + address: addresses[i].clone(), + prior_entry: None, + }); + continue; + }; + + let entry = CacheEntry::decode(&cached_value.bytes)?; + + if let (Some(refresh_policy), Some(age), false) = + (&self.refresh_policy, cached_value.age, self.cache_hits_only) + { + if refresh_policy.should_refresh(&keys[i], &entry, age, now) { + counter!("geocodecsv.cache.refreshed.total", "outcome" => entry.outcome().as_metric_label()) + .increment(1); + cache_misses.push(CacheMiss { + offset: i, + address: addresses[i].clone(), + prior_entry: Some(entry), + }); + continue; + } + } + + if let Some(column_values) = entry.geocoded { + if column_values.len() != self.inner.column_names().len() { return Err(format_err!( - "unknown compression format {:?}", - cache_hit[0] + "cannot return {:?} for columns {:?} because it has the wrong number of values", + column_values, + self.column_names(), )); } - self.compressor - .decompress(&cache_hit[1..], &mut decompressed)?; - let (cache_hit, _) = bincode::serde::decode_from_slice::< - Option>, - _, - >(&decompressed, bincode_config) - .context("could not deserialize cached data")?; - - // Here, a `None` value represents a cached geocoding _failure_. - // If a previous attempt failed, we expect that more recent ones - // may fail, too. - // - // TODO: Explain this better. - if let Some(cache_hit) = cache_hit { - if cache_hit.len() != self.inner.column_names().len() { - return Err(format_err!( - "cannot return {:?} for columns {:?} because it has the wrong number of values", - cache_hit, - self.column_names(), - )); - } - let candidate = Geocoded { - column_values: cache_hit, - }; - if candidate.contains_null_bytes() { - // This result contains old buggy data. Treat as a cache - // miss. - cache_misses.push(addresses[i].clone()); - cache_miss_offsets.push(i); - counter!( - "geocodecsv.cache_hits.total", - 1, - "geocoding_result" => "invalid_data" - ); - } else { - geocoded[i] = Some(candidate); - counter!( - "geocodecsv.cache_hits.total", - 1, - "geocoding_result" => "found" - ); - } + let candidate = Geocoded { column_values }; + if candidate.contains_null_bytes() { + cache_misses.push(CacheMiss { + offset: i, + address: addresses[i].clone(), + prior_entry: None, + }); + counter!("geocodecsv.cache_hits.total", "geocoding_result" => "invalid_data") + .increment(1); } else { - counter!( - "geocodecsv.cache_hits.total", - 1, - "geocoding_result" => "unknown_address" - ); + geocoded[i] = Some(candidate); + counter!("geocodecsv.cache_hits.total", "geocoding_result" => "found") + .increment(1); } } else { - // We need to forward this result. - cache_misses.push(addresses[i].clone()); - cache_miss_offsets.push(i); + counter!("geocodecsv.cache_hits.total", "geocoding_result" => "unknown_address") + .increment(1); } } - counter!("geocodecsv.cache_misses.total", cache_misses.len() as u64); + counter!("geocodecsv.cache_misses.total").increment(cache_misses.len() as u64); drop(cache_results); // If we have any cache misses, deal with them. // Alternatively, if the caller specified --cache-hits-only, // we should avoid geocoding any remaining addresses. if !cache_misses.is_empty() && !self.cache_hits_only { - // Pass remainder through to our inner geocoder. + let cache_miss_addresses = cache_misses + .iter() + .map(|cache_miss| cache_miss.address.clone()) + .collect::>(); let cache_miss_retries = - self.inner.geocode_addresses(&cache_misses).await?; + self.inner.geocode_addresses(&cache_miss_addresses).await?; - // Record our successes (and build a Redis command to store them). let mut pipelined_set = self.key_value_store.new_pipelined_set(); let mut encoded = Vec::with_capacity(256); - for (i, retry) in cache_miss_offsets - .into_iter() - .zip(cache_miss_retries.into_iter()) + for (cache_miss, retry) in cache_misses.into_iter().zip(cache_miss_retries) { - // Encode our value for caching. - let value = retry.as_ref().map(|retry| &retry.column_values); - encoded.clear(); - bincode::encode_into_std_write(value, &mut encoded, bincode_config) - .context("could not encode value for caching")?; - - // Compress our encoded value and add it to our pipeline set. - let mut compressed = Vec::with_capacity(256); - compressed.push(self.compressor.id()); - self.compressor.compress(&encoded, &mut compressed)?; - pipelined_set.add_set(keys[i].clone(), compressed); + if let Some(prior_entry) = &cache_miss.prior_entry { + counter!( + "geocodecsv.cache.refresh_results.total", + "from" => prior_entry.outcome().as_metric_label(), + "to" => if retry.is_some() { "success" } else { "failure" } + ) + .increment(1); + } - // Add out geocoding result to our output. - geocoded[i] = retry; + let entry = CacheEntry::for_write_back( + retry.as_ref().map(|retry| retry.column_values.clone()), + cache_miss.prior_entry.as_ref(), + ); + encoded.clear(); + entry.encode(&mut encoded)?; + pipelined_set.add_set( + keys[cache_miss.offset].clone(), + std::mem::take(&mut encoded), + ); + + geocoded[cache_miss.offset] = entry + .geocoded + .map(|column_values| Geocoded { column_values }); } - // Write our new results back to our cache. pipelined_set.execute().await?; } diff --git a/src/geocoders/cache/refresh.rs b/src/geocoders/cache/refresh.rs new file mode 100644 index 0000000..e086934 --- /dev/null +++ b/src/geocoders/cache/refresh.rs @@ -0,0 +1,305 @@ +//! Policy for automatically refreshing stale cache entries. +//! +//! Each entry carries its own schedule (`refresh_attempts` plus its write age). +//! Failures back off exponentially and stop after `failure_max_attempts`. +//! Successes refresh only if `success_period` is set. A per-key-per-day rate +//! cap bounds spend so a bulk-loaded backlog does not all come due on day one. + +use std::time::{Duration, SystemTime, UNIX_EPOCH}; + +use super::entry::CacheEntry; + +/// Whether a cached entry recorded a successful geocode or a failure to match. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub enum CachedOutcome { + Success, + Failure, +} + +impl CachedOutcome { + /// A low-arity label for use with metrics. + pub fn as_metric_label(self) -> &'static str { + match self { + CachedOutcome::Success => "success", + CachedOutcome::Failure => "failure", + } + } +} + +/// Named arguments for [`RefreshPolicy::new`]. +pub struct RefreshPolicyConfig { + /// Base wait before the first refresh of a cached failure. + pub failure_period: Option, + + /// Stop re-checking a failure after this many refreshes. + pub failure_max_attempts: u32, + + /// If set, re-check a successful geocode after this age. + pub success_period: Option, + + /// Fraction of eligible keys to refresh on a given day, in `(0, 1]`. + pub rate: f64, +} + +/// Policy for automatically refreshing stale cache entries. +#[derive(Debug, Clone, Copy)] +pub struct RefreshPolicy { + failure_period: Option, + failure_max_attempts: u32, + success_period: Option, + rate: f64, +} + +impl RefreshPolicy { + /// Build a policy. `rate` must be in `(0, 1]`. + pub fn new(config: RefreshPolicyConfig) -> RefreshPolicy { + debug_assert!( + config.rate > 0.0 && config.rate <= 1.0, + "refresh rate must be in (0, 1], got {}", + config.rate + ); + RefreshPolicy { + failure_period: config.failure_period, + failure_max_attempts: config.failure_max_attempts, + success_period: config.success_period, + rate: config.rate, + } + } + + /// Should this cached `entry` be treated as a miss at wall-clock `now`? + pub fn should_refresh( + &self, + cache_key: &str, + entry: &CacheEntry, + age: Duration, + now: SystemTime, + ) -> bool { + if !self.is_eligible(entry, age) { + return false; + } + let day_number = now + .duration_since(UNIX_EPOCH) + .expect("now is after the UNIX epoch") + .as_secs() + / (24 * 60 * 60); + stable_fraction(&format!("{cache_key}:{day_number}")) < self.rate + } + + fn is_eligible(&self, entry: &CacheEntry, age: Duration) -> bool { + match entry.outcome() { + CachedOutcome::Success => self + .success_period + .map(|period| age >= period) + .unwrap_or(false), + CachedOutcome::Failure => { + let Some(period) = self.failure_period else { + return false; + }; + if entry.refresh_attempts >= self.failure_max_attempts { + return false; + } + age >= backoff_wait(period, entry.refresh_attempts) + } + } + } +} + +/// Wait before the next refresh: `period * 2^refresh_attempts`. +fn backoff_wait(period: Duration, refresh_attempts: u32) -> Duration { + period.saturating_mul(1u32 << refresh_attempts.min(31)) +} + +/// Map a string to a stable pseudo-random fraction in `[0.0, 1.0)`. +/// +/// Deriving the decision from the key (and, at the call site, the day) means +/// the same entry makes the same decision on every read that day. +fn stable_fraction(material: &str) -> f64 { + use sha2::{Digest, Sha256}; + let digest = Sha256::digest(material.as_bytes()); + let leading = + u64::from_be_bytes(digest[..8].try_into().expect("SHA-256 is 32 bytes")); + leading as f64 / 2f64.powi(64) +} + +#[cfg(test)] +mod tests { + use super::*; + + const DAY: Duration = Duration::from_secs(24 * 60 * 60); + + fn now() -> SystemTime { + UNIX_EPOCH + 20_000 * DAY + } + + fn failure(refresh_attempts: u32) -> CacheEntry { + CacheEntry { + geocoded: None, + refresh_attempts, + } + } + + fn success() -> CacheEntry { + CacheEntry { + geocoded: Some(vec!["ok".to_owned()]), + refresh_attempts: 0, + } + } + + fn policy(config: RefreshPolicyConfig) -> RefreshPolicy { + RefreshPolicy::new(config) + } + + fn failures_only(rate: f64) -> RefreshPolicy { + policy(RefreshPolicyConfig { + failure_period: Some(90 * DAY), + failure_max_attempts: 4, + success_period: None, + rate, + }) + } + + #[test] + fn failure_not_eligible_before_base_period() { + let refresh_policy = failures_only(1.0); + assert!(!refresh_policy.should_refresh("k", &failure(0), 89 * DAY, now(),)); + assert!(refresh_policy.should_refresh("k", &failure(0), 90 * DAY, now(),)); + } + + #[test] + fn failure_backoff_doubles_each_attempt() { + let refresh_policy = failures_only(1.0); + assert!(!refresh_policy.should_refresh("k", &failure(1), 179 * DAY, now(),)); + assert!(refresh_policy.should_refresh("k", &failure(1), 180 * DAY, now(),)); + assert!(!refresh_policy.should_refresh("k", &failure(2), 359 * DAY, now(),)); + assert!(refresh_policy.should_refresh("k", &failure(2), 360 * DAY, now(),)); + } + + #[test] + fn failure_stops_at_max_attempts() { + let refresh_policy = failures_only(1.0); + assert!(!refresh_policy.should_refresh("k", &failure(4), 10_000 * DAY, now(),)); + } + + #[test] + fn failures_ignored_when_period_is_none() { + let refresh_policy = policy(RefreshPolicyConfig { + failure_period: None, + failure_max_attempts: 4, + success_period: Some(365 * DAY), + rate: 1.0, + }); + assert!(!refresh_policy.should_refresh("k", &failure(0), 10_000 * DAY, now(),)); + } + + #[test] + fn successes_never_refresh_without_a_period() { + let refresh_policy = failures_only(1.0); + assert!(!refresh_policy.should_refresh("k", &success(), 10_000 * DAY, now(),)); + } + + #[test] + fn successes_refresh_after_period() { + let refresh_policy = policy(RefreshPolicyConfig { + failure_period: None, + failure_max_attempts: 0, + success_period: Some(365 * DAY), + rate: 1.0, + }); + assert!(!refresh_policy.should_refresh("k", &success(), 364 * DAY, now(),)); + assert!(refresh_policy.should_refresh("k", &success(), 365 * DAY, now(),)); + } + + #[test] + fn rate_one_refreshes_every_eligible_key() { + let refresh_policy = failures_only(1.0); + let released = (0..1000) + .filter(|i| { + refresh_policy.should_refresh( + &format!("key-{i}"), + &failure(0), + 10_000 * DAY, + now(), + ) + }) + .count(); + assert_eq!(released, 1000); + } + + #[test] + fn rate_cap_bounds_spend() { + let refresh_policy = failures_only(0.1); + let released = (0..1000) + .filter(|i| { + refresh_policy.should_refresh( + &format!("key-{i}"), + &failure(0), + 10_000 * DAY, + now(), + ) + }) + .count(); + assert!( + (50..150).contains(&released), + "expected ~100/1000 at rate 0.1, got {released}" + ); + } + + #[test] + fn decision_is_stable_for_a_key_on_the_same_day() { + let refresh_policy = failures_only(0.5); + let first = refresh_policy.should_refresh( + "123 main st", + &failure(0), + 10_000 * DAY, + now(), + ); + for _ in 0..100 { + assert_eq!( + refresh_policy.should_refresh( + "123 main st", + &failure(0), + 10_000 * DAY, + now(), + ), + first, + ); + } + } + + #[test] + fn decision_can_change_on_a_new_day() { + let refresh_policy = failures_only(0.5); + let mut saw_difference = false; + for i in 0..200 { + let cache_key = format!("key-{i}"); + let today = refresh_policy.should_refresh( + &cache_key, + &failure(0), + 10_000 * DAY, + now(), + ); + let tomorrow = refresh_policy.should_refresh( + &cache_key, + &failure(0), + 10_000 * DAY, + now() + DAY, + ); + if today != tomorrow { + saw_difference = true; + break; + } + } + assert!( + saw_difference, + "hashing the day into the key should reshuffle some decisions" + ); + } + + #[test] + fn stable_fraction_is_in_range() { + for i in 0..1000 { + let fraction = stable_fraction(&format!("key-{i}:100")); + assert!((0.0..1.0).contains(&fraction)); + } + } +} diff --git a/src/geocoders/invalid_record_skipper.rs b/src/geocoders/invalid_record_skipper.rs index 9cfd138..44dcf9a 100644 --- a/src/geocoders/invalid_record_skipper.rs +++ b/src/geocoders/invalid_record_skipper.rs @@ -54,7 +54,7 @@ impl Geocoder for InvalidRecordSkipper { valid_addresses.push(address.clone()); original_indices.push(i); } else { - counter!("geocodecsv.invalid_records.total", 1); + counter!("geocodecsv.invalid_records.total").increment(1); } } diff --git a/src/geocoders/libpostal.rs b/src/geocoders/libpostal.rs index fa998c5..a3516cf 100644 --- a/src/geocoders/libpostal.rs +++ b/src/geocoders/libpostal.rs @@ -10,36 +10,32 @@ use crate::{addresses::Address, Result}; use super::{Geocoded, Geocoder}; pub(crate) static COLUMN_NAMES: &[&str] = &[ - // From - // https://github.com/OpenCageData/address-formatting/blob/master/conf/components.yaml. - "archipelago", + // These are the address-component labels that libpostal's address parser can + // actually emit, as defined in + // `crates/libpostal-sys/libpostal/src/address_parser.h`. Earlier versions of + // this list were copied from OpenCage's address-_formatting_ vocabulary + // (components.yaml), which is a different vocabulary: it includes names like + // `county`, `neighbourhood`, and `hamlet` that libpostal's parser never + // produces (it aliases those to `state_district`, `suburb`, and `city` + // respectively before training). We omit the non-address parser labels + // `category`, `near`, `website`, and `phone`. + "building", "city", - "continent", - "country_code", - "country", - "county", - "hamlet", - "house_number", - "house", - "island", - "municipality", - "neighbourhood", - "postal_city", - "postcode", - "region", - "road", - "state_district", - "state", - "village", - // Additional fields from https://github.com/openvenues/libpostal. - "category", "city_district", + "country", "country_region", "entrance", + "house", + "house_number", + "island", "level", - "near", + "metro_station", "po_box", + "postcode", + "road", "staircase", + "state", + "state_district", "suburb", "unit", "world_region", @@ -127,7 +123,8 @@ impl Geocoder for LibPostal { debug_assert_eq!(geocoded.column_values.len(), self.column_names().len()); result.push(Some(geocoded)); } - counter!("geocodecsv.addresses_parsed.total", result.len() as u64, "parser" => "libpostal"); + counter!("geocodecsv.addresses_parsed.total", "parser" => "libpostal") + .increment(result.len() as u64); Ok(result) } } diff --git a/src/geocoders/mod.rs b/src/geocoders/mod.rs index 23540c0..b095de4 100644 --- a/src/geocoders/mod.rs +++ b/src/geocoders/mod.rs @@ -1,12 +1,10 @@ //! Geocoding backends. -use std::{fmt, iter::repeat, str::FromStr, sync::Arc}; +use std::{fmt, str::FromStr}; use anyhow::format_err; use async_trait::async_trait; use csv::StringRecord; -use hyper::{client::HttpConnector, Client}; -use hyper_rustls::{HttpsConnector, HttpsConnectorBuilder}; use serde::{Deserialize, Serialize}; use sha2::{Digest, Sha256}; @@ -22,21 +20,11 @@ pub mod normalizer; pub mod paired; pub mod smarty; -/// A `hyper` client shared between multiple workers. -pub type SharedHttpClient = Arc>>; - -pub fn shared_http_client(concurrency: usize) -> SharedHttpClient { - // Create a shared `hyper::Client` with a connection pool, so that we can - // use keep-alive. - Arc::new( - Client::builder().pool_max_idle_per_host(concurrency).build( - HttpsConnectorBuilder::new() - .with_native_roots() - .https_only() - .enable_http2() - .build(), - ), - ) +pub fn shared_http_client(concurrency: usize) -> reqwest::Client { + reqwest::Client::builder() + .pool_max_idle_per_host(concurrency) + .build() + .expect("failed to build HTTP client") } /// What match candidates should we output when geocoding? @@ -177,6 +165,6 @@ pub trait Geocoder: Send + Sync + 'static { /// Copy empty values into `geocoded`, one for each column that this /// geocoder would produce. fn add_empty_columns_to_row(&self, out_row: &mut StringRecord) { - out_row.extend(repeat("").take(self.column_names().len())); + out_row.extend(std::iter::repeat_n("", self.column_names().len())); } } diff --git a/src/geocoders/normalizer.rs b/src/geocoders/normalizer.rs index be6241e..2f79c29 100644 --- a/src/geocoders/normalizer.rs +++ b/src/geocoders/normalizer.rs @@ -84,11 +84,8 @@ impl Geocoder for Normalizer { if !normalized_address.eq_ignore_ascii_case(&addresses[i]) { // Only count addresses that we've actually changed in // some way. - counter!( - "geocodecsv.addresses_normalized.total", - 1, - "normalizer" => "libpostal" - ); + counter!("geocodecsv.addresses_normalized.total", "normalizer" => "libpostal") + .increment(1); trace!( "normalized {:?} to {:?}", &addresses[i], @@ -125,11 +122,19 @@ fn normalized_to_address( // PO boxes supposedly go before street addresses if both are present. append_component(component_indices, &mut street, normalized, "po_box"); append_component(component_indices, &mut street, normalized, "house_number"); - // "house" is supposedly things like "Empire State Building". + // "building" and "house" are both venue/building names like "Empire State + // Building". We keep them so we don't drop a meaningful part of the line. + append_component(component_indices, &mut street, normalized, "building"); append_component(component_indices, &mut street, normalized, "house"); append_component(component_indices, &mut street, normalized, "road"); - // "unit" is "appt A", or things like that. Lightly normalized. + // "unit", "level" (e.g. "3rd Floor"), "staircase", and "entrance" are all + // secondary-unit designators. libpostal parses them out, and we used to drop + // everything but "unit", which silently discarded floor/staircase/entrance + // information before it reached our downstream geocoder. append_component(component_indices, &mut street, normalized, "unit"); + append_component(component_indices, &mut street, normalized, "level"); + append_component(component_indices, &mut street, normalized, "staircase"); + append_component(component_indices, &mut street, normalized, "entrance"); // Handle our city. "city_district" may be something like // "Brooklyn", with "city" either empty, or containing something @@ -155,6 +160,9 @@ fn normalized_to_address( append_component(component_indices, &mut city, normalized, "suburb"); append_component(component_indices, &mut city, normalized, "city_district"); append_component(component_indices, &mut city, normalized, "city"); + // "island" (e.g. "Maui") is occasionally the most specific locality we have, + // so we keep it as part of the city rather than dropping it. + append_component(component_indices, &mut city, normalized, "island"); // Handle our state. let mut state = String::with_capacity(16); diff --git a/src/geocoders/smarty/client.rs b/src/geocoders/smarty/client.rs index ea00000..42110fb 100644 --- a/src/geocoders/smarty/client.rs +++ b/src/geocoders/smarty/client.rs @@ -4,16 +4,13 @@ use std::time::Instant; use std::{env, str}; use anyhow::{format_err, Context}; -use futures::stream::StreamExt; -use hyper::{Body, Request}; use metrics::{counter, describe_histogram, histogram, Unit}; use serde::{Deserialize, Serialize}; use tracing::{error, instrument}; use url::Url; use crate::addresses::Address; -use crate::errors::hyper_error_description_for_metrics; -use crate::geocoders::{MatchStrategy, SharedHttpClient}; +use crate::geocoders::MatchStrategy; use crate::unpack_vec::unpack_vec; use crate::Result; @@ -65,15 +62,13 @@ pub struct AddressResponse { pub fields: serde_json::Value, } -/// The real implementation of `S. pub struct SmartyClient { credentials: Credentials, - client: SharedHttpClient, + client: reqwest::Client, } impl SmartyClient { - /// Create a new Smarty client. - pub fn new(client: SharedHttpClient) -> Result { + pub fn new(client: reqwest::Client) -> Result { describe_histogram!( "geocodecsv.smart.geocode_request.duration_seconds", Unit::Seconds, @@ -86,7 +81,6 @@ impl SmartyClient { }) } - /// Geocode addresses using Smarty. #[instrument( name = "SmartyClient::street_addresses", level="debug", @@ -98,100 +92,74 @@ impl SmartyClient { requests: Vec, license: String, ) -> Result>> { - street_addresses_impl( - self.credentials.clone(), - self.client.clone(), - requests, - license, - ) - .await - } -} - -/// The real implementation of `street_addresses`. -async fn street_addresses_impl( - credentials: Credentials, - client: SharedHttpClient, - requests: Vec, - license: String, -) -> Result>> { - let start = Instant::now(); - - // Build our URL. - let mut url = Url::parse("https://api.smartystreets.com/street-address")?; - url.query_pairs_mut() - .append_pair("auth-id", &credentials.auth_id) - .append_pair("auth-token", &credentials.auth_token) - .append_pair("license", &license) - .finish(); - - // Make the geocoding request. - let req = Request::builder() - .method("POST") - .uri(url.as_str()) - .header("Content-Type", "application/json; charset=utf-8") - .body(Body::from(serde_json::to_string(&requests)?))?; - let res = match client.request(req).await { - Ok(res) => res, - Err(err) => { - // Errors that occur here are being reported by our local HTTP - // stack, not the remote server. - let desc = hyper_error_description_for_metrics(&err); - counter!("geocodecsv.selected_errors.count", 1, "component" => "smarty", "cause" => desc); - return Err(err.into()); - } - }; - let status = res.status(); - let mut body = res.into_body(); - let mut body_data = vec![]; - while let Some(chunk_result) = body.next().await { - let chunk = chunk_result?; - body_data.extend(&chunk[..]); - } - - histogram!( - "geocodecsv.smarty.geocode_request.duration_seconds", - (Instant::now() - start).as_secs_f64(), - ); - - // Check the request status. - if status.is_success() { - let resps: Vec = serde_json::from_slice(&body_data)?; - Ok(unpack_vec(resps, requests.len(), |resp| resp.input_index)?) - } else { - // This error was reported by the remote server. - - // Add error to metrics. - counter!("geocodecsv.selected_errors.count", 1, "component" => "smarty", "cause" => status.to_string()); - - // Log information about bad street fields, if we can. - if status == 422 { - if let Ok(error_response) = - serde_json::from_slice::(&body_data) - { - let mut missing_street = false; - for error in error_response.errors { - if error.name == "us-street-api:query-missing-street" { - missing_street = true; - break; - } - } - if missing_street { - let streets = requests + let start = Instant::now(); + + let mut url = Url::parse("https://api.smartystreets.com/street-address")?; + url.query_pairs_mut() + .append_pair("auth-id", &self.credentials.auth_id) + .append_pair("auth-token", &self.credentials.auth_token) + .append_pair("license", &license) + .finish(); + + let res = match self.client.post(url.as_str()).json(&requests).send().await { + Ok(res) => res, + Err(err) => { + let desc = reqwest_error_description_for_metrics(&err); + counter!("geocodecsv.selected_errors.count", "component" => "smarty", "cause" => desc).increment(1); + return Err(err).context("smarty request failed"); + } + }; + let status = res.status(); + let body_data = res + .bytes() + .await + .context("failed to read smarty response body")?; + + histogram!("geocodecsv.smarty.geocode_request.duration_seconds") + .record((Instant::now() - start).as_secs_f64()); + + if status.is_success() { + let resps: Vec = serde_json::from_slice(&body_data)?; + Ok(unpack_vec(resps, requests.len(), |resp| resp.input_index)?) + } else { + counter!("geocodecsv.selected_errors.count", "component" => "smarty", "cause" => status.to_string()).increment(1); + + if status == 422 { + if let Ok(error_response) = + serde_json::from_slice::(&body_data) + { + if error_response + .errors .iter() - .map(|req| req.address.street.to_owned()) - .collect::>(); - error!("At least one missing street in: {:?}", streets); + .any(|e| e.name == "us-street-api:query-missing-street") + { + let streets = requests + .iter() + .map(|req| req.address.street.to_owned()) + .collect::>(); + error!("At least one missing street in: {:?}", streets); + } } } + + Err(format_err!( + "geocoding error: {}\n{}", + status, + String::from_utf8_lossy(&body_data), + )) } + } +} - // Convert to a Rust error. - Err(format_err!( - "geocoding error: {}\n{}", - status, - String::from_utf8_lossy(&body_data), - )) +fn reqwest_error_description_for_metrics(err: &reqwest::Error) -> &'static str { + if err.is_timeout() { + "timeout" + } else if err.is_connect() { + "connect" + } else if err.is_request() { + "request" + } else { + "other" } } diff --git a/src/geocoders/smarty/mod.rs b/src/geocoders/smarty/mod.rs index 9f6c992..daef95f 100644 --- a/src/geocoders/smarty/mod.rs +++ b/src/geocoders/smarty/mod.rs @@ -13,7 +13,7 @@ use self::{ structure::Structure, }; -use super::{Geocoded, Geocoder, MatchStrategy, SharedHttpClient}; +use super::{Geocoded, Geocoder, MatchStrategy}; pub mod client; mod structure; @@ -47,7 +47,7 @@ impl Smarty { match_strategy: MatchStrategy, license: String, rate_limiter: Option>, - http_client: SharedHttpClient, + http_client: reqwest::Client, ) -> Result { describe_counter!("geocodecsv.addresses_geocoded.total", "Addresses geocoded"); @@ -117,8 +117,8 @@ impl Geocoder for Smarty { .await?; let hits = response.iter().filter(|g| g.is_some()).count(); - counter!("geocodecsv.addresses_geocoded.total", hits as u64, "geocoder" => "smarty", "geocode_result" => "found"); - counter!("geocodecsv.addresses_geocoded.total", (addresses.len() - hits) as u64, "geocoder" => "smarty", "geocode_result" => "unknown_address"); + counter!("geocodecsv.addresses_geocoded.total", "geocoder" => "smarty", "geocode_result" => "found").increment(hits as u64); + counter!("geocodecsv.addresses_geocoded.total", "geocoder" => "smarty", "geocode_result" => "unknown_address").increment((addresses.len() - hits) as u64); // Response with only the addresses that actually geocoded successfully. // We need make sure we map outputs back to their original positions. diff --git a/src/key_value_stores/bigtable.rs b/src/key_value_stores/bigtable.rs index 58639a4..2350e9e 100644 --- a/src/key_value_stores/bigtable.rs +++ b/src/key_value_stores/bigtable.rs @@ -3,30 +3,194 @@ use std::{ borrow::Cow, collections::HashMap, + fs, + path::{Path, PathBuf}, + sync::Arc, time::{Duration, Instant}, }; use anyhow::{format_err, Context}; use async_trait::async_trait; -use bigtable_rs::{ - bigtable::{self, BigTable as BigTableClient, BigTableConnection}, - google::bigtable::v2::{ - mutate_rows_request::Entry, - mutation::{self, SetCell}, - row_filter::{Chain, Filter}, - MutateRowsRequest, Mutation, ReadRowsRequest, RowFilter, RowSet, - }, +use bigtable_rs::bigtable::{self, BigTable as BigTableClient, BigTableConnection}; +use gcp_auth::TokenProvider; +use google_cloud_auth::credentials::{ + AccessTokenCredentials, Builder as ApplicationDefaultCredentialsBuilder, +}; +use googleapis_tonic_google_bigtable_v2::google::bigtable::v2::{ + mutate_rows_request::Entry, + mutation::{self, SetCell}, + row_filter::{Chain, Filter}, + MutateRowsRequest, Mutation, ReadRowsRequest, RowFilter, RowSet, }; use metrics::{counter, describe_histogram, histogram, Unit}; -use tracing::{instrument, trace}; +use tracing::{debug, instrument, trace}; use url::Url; use crate::{pipeline::CONCURRENCY, Result}; -use super::{KeyValueStore, KeyValueStoreNew, PipelinedGet, PipelinedSet}; +use super::{ + CachedValue, KeyValueStore, KeyValueStoreNew, PipelinedGet, PipelinedSet, +}; const GEOCODE_CSV_FAMILY_NAME: &str = "geocode_csv"; const GEOCODE_CSV_COLUMN_NAME: &[u8] = b"v"; +const BIGTABLE_DATA_SCOPE: &str = "https://www.googleapis.com/auth/bigtable.data"; + +/// Where Application Default Credentials will be loaded from. +#[derive(Debug)] +enum ApplicationDefaultCredentialSource { + GoogleApplicationCredentials { + path: PathBuf, + credential_type: Option, + }, + WellKnownApplicationDefault { + path: PathBuf, + credential_type: Option, + }, + MetadataServer, +} + +impl ApplicationDefaultCredentialSource { + fn detect() -> Self { + if let Some(path) = std::env::var_os("GOOGLE_APPLICATION_CREDENTIALS") { + let path = PathBuf::from(path); + return Self::GoogleApplicationCredentials { + credential_type: Self::json_type_field(&path), + path, + }; + } + if let Some(path) = Self::well_known_adc_path() { + if path.is_file() { + return Self::WellKnownApplicationDefault { + credential_type: Self::json_type_field(&path), + path, + }; + } + } + Self::MetadataServer + } + + fn log(&self) { + match self { + Self::GoogleApplicationCredentials { + path, + credential_type, + } => match credential_type { + Some(credential_type) => { + debug!( + path = %path.display(), + credential_type = %credential_type, + "using GOOGLE_APPLICATION_CREDENTIALS" + ); + } + None => { + debug!( + path = %path.display(), + "using GOOGLE_APPLICATION_CREDENTIALS" + ); + } + }, + Self::WellKnownApplicationDefault { + path, + credential_type, + } => match credential_type { + Some(credential_type) => { + debug!( + path = %path.display(), + credential_type = %credential_type, + "using well-known application-default credentials" + ); + } + None => { + debug!( + path = %path.display(), + "using well-known application-default credentials" + ); + } + }, + Self::MetadataServer => { + debug!( + "using GCE/GKE metadata server for application-default credentials" + ); + } + } + } + + fn json_type_field(path: &Path) -> Option { + let json: serde_json::Value = + serde_json::from_str(&fs::read_to_string(path).ok()?).ok()?; + json.get("type")?.as_str().map(str::to_owned) + } + + fn well_known_adc_path() -> Option { + #[cfg(target_os = "windows")] + { + std::env::var_os("APPDATA").map(|root| { + PathBuf::from(root).join("gcloud/application_default_credentials.json") + }) + } + #[cfg(not(target_os = "windows"))] + { + std::env::var_os("HOME").map(|root| { + PathBuf::from(root) + .join(".config/gcloud/application_default_credentials.json") + }) + } + } +} + +/// `google-cloud-auth` credentials exposed as the `gcp_auth::TokenProvider` +/// `bigtable_rs` expects. +#[derive(Debug)] +struct GoogleCloudAuthTokenProvider { + credentials: AccessTokenCredentials, + project_id: Arc, +} + +impl GoogleCloudAuthTokenProvider { + fn from_application_default_credentials(project_id: &str) -> Result { + ApplicationDefaultCredentialSource::detect().log(); + Ok(Self { + credentials: ApplicationDefaultCredentialsBuilder::default() + .with_scopes([BIGTABLE_DATA_SCOPE]) + .build_access_token_credentials() + .context("failed to load Google Application Default Credentials")?, + project_id: Arc::from(project_id), + }) + } +} + +#[async_trait] +impl TokenProvider for GoogleCloudAuthTokenProvider { + async fn token( + &self, + _scopes: &[&str], + ) -> std::result::Result, gcp_auth::Error> { + // gcp_auth::Token has no public constructor; it only implements Deserialize. + serde_json::from_value(serde_json::json!({ + "access_token": self + .credentials + .access_token() + .await + .map_err(|err| { + gcp_auth::Error::Other( + "failed to get Google Cloud access token", + Box::new(err), + ) + })? + .token, + "expires_in": 3600, + })) + .map(Arc::new) + .map_err(|err| { + gcp_auth::Error::Json("failed to construct gcp_auth token", err) + }) + } + + async fn project_id(&self) -> std::result::Result, gcp_auth::Error> { + Ok(self.project_id.clone()) + } +} /// BigTable configuration information. struct BigTableConfig { @@ -138,16 +302,30 @@ impl KeyValueStoreNew for BigTable { Unit::Seconds, "Time required for BigTable MutateRows requests" ); - let config = BigTableConfig::from_url(&url)?; - let connection = BigTableConnection::new( - &config.project_id, - &config.instance_id, - /* read_only */ false, - CONCURRENCY, - Some(Duration::from_secs(60)), - ) - .await + let timeout = Some(Duration::from_secs(60)); + let connection = match std::env::var("BIGTABLE_EMULATOR_HOST") { + Ok(emulator_endpoint) => BigTableConnection::new_with_emulator( + emulator_endpoint.as_str(), + &config.project_id, + &config.instance_id, + /* read_only */ false, + CONCURRENCY, + timeout, + ), + Err(_) => BigTableConnection::new_with_token_provider( + &config.project_id, + &config.instance_id, + /* read_only */ false, + CONCURRENCY, + timeout, + Arc::new( + GoogleCloudAuthTokenProvider::from_application_default_credentials( + &config.project_id, + )?, + ), + ), + } .context("could not connect to BigTable")?; Ok(BigTable { @@ -173,9 +351,15 @@ impl<'store> PipelinedGet<'store> for BigTablePipelinedGet<'store> { } #[instrument(name = "PipelinedGet::execute", level = "trace", skip_all, fields(row_keys.len = self.row_keys.len()))] - async fn execute(&self) -> Result>>> { + async fn execute(&self) -> Result>> { let start = Instant::now(); + // The current time, used to compute each entry's age once per batch. + let now_micros = std::time::SystemTime::now() + .duration_since(std::time::UNIX_EPOCH) + .unwrap() + .as_micros() as i64; + // Build and run our query. let mut client = self.bigtable.client(); let request = ReadRowsRequest { @@ -210,7 +394,7 @@ impl<'store> PipelinedGet<'store> for BigTablePipelinedGet<'store> { Ok(response) => response, Err(err) => { let cause = bigtable_error_cause_for_metrics(&err); - counter!("geocodecsv.selected_errors.count", 1, "component" => "bigtable", "cause" => cause); + counter!("geocodecsv.selected_errors.count", "component" => "bigtable", "cause" => cause).increment(1); return Err(err).context("error checking BigTable for cached values"); } }; @@ -227,16 +411,15 @@ impl<'store> PipelinedGet<'store> for BigTablePipelinedGet<'store> { ); } - histogram!( - "geocodecsv.bigtable.get_request.duration_seconds", - (Instant::now() - start).as_secs_f64(), - ); + histogram!("geocodecsv.bigtable.get_request.duration_seconds") + .record((Instant::now() - start).as_secs_f64()); // Build a vec to store our result, and a `HashMap` mapping keys to vec // indices. We have to be careful because keys might appear more than // once. Ideally our callers wouldn't do that, but if they do, we need // to handle it. - let mut result: Vec>> = vec![None; self.row_keys.len()]; + let mut result: Vec> = + (0..self.row_keys.len()).map(|_| None).collect(); let mut row_key_indices = HashMap::, Vec>::new(); for (idx, row_key) in self.row_keys.iter().enumerate() { row_key_indices @@ -272,12 +455,19 @@ impl<'store> PipelinedGet<'store> for BigTablePipelinedGet<'store> { )); } - // Write this match to our result array. + // Record the entry's age so the cache layer can decide whether + // it is stale enough to refresh. + let age = Duration::from_micros( + (now_micros - row_cell.timestamp_micros).max(0) as u64, + ); let indices = row_key_indices .get(&key) .expect("we should always have a known key"); for idx in indices { - result[*idx] = Some(row_cell.value.clone()); + result[*idx] = Some(CachedValue { + bytes: row_cell.value.clone(), + age: Some(age), + }); } } } @@ -306,6 +496,7 @@ impl<'store> PipelinedSet<'store> for BigTablePipelinedSet<'store> { value, })), }], + idempotency: None, }) } @@ -318,18 +509,17 @@ impl<'store> PipelinedSet<'store> for BigTablePipelinedSet<'store> { let request = MutateRowsRequest { table_name: client.get_full_table_name(&self.bigtable.table_name), app_profile_id: "".to_owned(), // Dave says this is what we want. + authorized_view_name: "".to_owned(), entries: self.entries.clone(), }; if let Err(err) = client.mutate_rows(request).await { let cause = bigtable_error_cause_for_metrics(&err); - counter!("geocodecsv.selected_errors.count", 1, "component" => "bigtable", "cause" => cause); + counter!("geocodecsv.selected_errors.count", "component" => "bigtable", "cause" => cause).increment(1); return Err(err).context("error writing cached values to BigTable"); } - histogram!( - "geocodecsv.bigtable.set_request.duration_seconds", - (Instant::now() - start).as_secs_f64(), - ); + histogram!("geocodecsv.bigtable.set_request.duration_seconds") + .record((Instant::now() - start).as_secs_f64()); Ok(()) } } @@ -354,5 +544,223 @@ fn bigtable_error_cause_for_metrics(err: &bigtable::Error) -> Cow<'static, str> bigtable::Error::TimeoutError(_) => Cow::Borrowed("timeout"), bigtable::Error::ChunkError(_) => Cow::Borrowed("chunk"), bigtable::Error::GCPAuthError(_) => Cow::Borrowed("gcp auth"), + bigtable::Error::MetadataError(_) => Cow::Borrowed("metadata error"), + bigtable::Error::InvalidArgument(_) => Cow::Borrowed("invalid argument"), + } +} + +#[cfg(test)] +mod application_default_credentials_tests { + use super::*; + use scoped_env::ScopedEnv; + use serial_test::serial; + use std::io::Write; + use tempfile::NamedTempFile; + + const SERVICE_ACCOUNT_JSON: &str = r#"{ + "type": "service_account", + "project_id": "test-project-id", + "private_key_id": "test-private-key-id", + "private_key": "-----BEGIN PRIVATE KEY-----\nBLAHBLAHBLAH\n-----END PRIVATE KEY-----\n", + "client_email": "test-client-email@test-project-id.iam.gserviceaccount.com", + "client_id": "1234567890", + "auth_uri": "https://accounts.google.com/o/oauth2/auth", + "token_uri": "https://oauth2.googleapis.com/token", + "universe_domain": "googleapis.com" + }"#; + + const AUTHORIZED_USER_JSON: &str = r#"{ + "type": "authorized_user", + "client_id": "test-client-id.apps.googleusercontent.com", + "client_secret": "test-client-secret", + "refresh_token": "test-refresh-token" + }"#; + + const IMPERSONATED_SERVICE_ACCOUNT_JSON: &str = r#"{ + "type": "impersonated_service_account", + "service_account_impersonation_url": "https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/test-principal@test-project-id.iam.gserviceaccount.com:generateAccessToken", + "delegates": [], + "source_credentials": { + "type": "authorized_user", + "client_id": "test-client-id.apps.googleusercontent.com", + "client_secret": "test-client-secret", + "refresh_token": "test-refresh-token" + } + }"#; + + const EXTERNAL_ACCOUNT_JSON: &str = r#"{ + "type": "external_account", + "audience": "//iam.googleapis.com/projects/123456789/locations/global/workloadIdentityPools/test-pool/providers/test-provider", + "subject_token_type": "urn:ietf:params:oauth:token-type:jwt", + "token_url": "https://sts.googleapis.com/v1/token", + "credential_source": { + "file": "/tmp/geocode-csv-external-account-subject-token.jwt" + } + }"#; + + fn write_fixture(contents: &str) -> NamedTempFile { + let mut file = NamedTempFile::new().expect("tempfile"); + file.write_all(contents.as_bytes()).expect("write fixture"); + file + } + + fn token_provider_from_google_application_credentials( + contents: &str, + ) -> Result { + let file = write_fixture(contents); + let _google_application_credentials = ScopedEnv::set( + "GOOGLE_APPLICATION_CREDENTIALS", + file.path().to_str().expect("utf-8 path"), + ); + GoogleCloudAuthTokenProvider::from_application_default_credentials( + "test-project", + ) + } + + fn credentials_debug_name( + token_provider: &GoogleCloudAuthTokenProvider, + ) -> String { + format!("{:?}", token_provider.credentials) + } + + #[tokio::test] + #[serial] + async fn constructs_service_account_from_google_application_credentials() { + let token_provider = + token_provider_from_google_application_credentials(SERVICE_ACCOUNT_JSON) + .expect("service_account credentials should construct"); + let debug = credentials_debug_name(&token_provider); + assert!(debug.contains("ServiceAccountCredentials"), "{debug}"); + } + + #[tokio::test] + #[serial] + async fn constructs_authorized_user_from_google_application_credentials() { + let token_provider = + token_provider_from_google_application_credentials(AUTHORIZED_USER_JSON) + .expect("authorized_user credentials should construct"); + let debug = credentials_debug_name(&token_provider); + assert!(debug.contains("UserCredentials"), "{debug}"); + } + + #[tokio::test] + #[serial] + async fn constructs_impersonated_service_account_from_google_application_credentials( + ) { + let token_provider = token_provider_from_google_application_credentials( + IMPERSONATED_SERVICE_ACCOUNT_JSON, + ) + .expect("impersonated_service_account credentials should construct"); + let debug = credentials_debug_name(&token_provider); + assert!(debug.contains("ImpersonatedServiceAccount"), "{debug}"); + } + + #[tokio::test] + #[serial] + async fn constructs_external_account_from_google_application_credentials() { + let token_provider = + token_provider_from_google_application_credentials(EXTERNAL_ACCOUNT_JSON) + .expect("external_account credentials should construct"); + let debug = credentials_debug_name(&token_provider); + assert!( + debug.contains("FileSourcedCredentials") + || debug.contains("ExternalAccount"), + "{debug}" + ); + } + + #[test] + #[serial] + fn malformed_google_application_credentials_is_error() { + let err = token_provider_from_google_application_credentials("{ not json") + .expect_err("malformed credentials file should be an error"); + let message = format!("{err:#}"); + assert!( + message.contains("GOOGLE_APPLICATION_CREDENTIALS") + || message.contains("parse") + || message.contains("type") + || message.contains("expected"), + "{message}" + ); + } + + #[test] + #[serial] + fn missing_google_application_credentials_file_names_the_path() { + let missing_path = + "/tmp/geocode-csv-missing-adc-credentials-do-not-create.json"; + let _google_application_credentials = + ScopedEnv::set("GOOGLE_APPLICATION_CREDENTIALS", missing_path); + let err = GoogleCloudAuthTokenProvider::from_application_default_credentials( + "test-project", + ) + .expect_err("missing GOOGLE_APPLICATION_CREDENTIALS file should be an error"); + let message = format!("{err:#}"); + assert!( + message.contains("geocode-csv-missing-adc-credentials-do-not-create.json"), + "{message}" + ); + } + + #[test] + #[serial] + fn application_default_source_names_google_application_credentials_type() { + let file = write_fixture(IMPERSONATED_SERVICE_ACCOUNT_JSON); + let _google_application_credentials = ScopedEnv::set( + "GOOGLE_APPLICATION_CREDENTIALS", + file.path().to_str().expect("utf-8 path"), + ); + match ApplicationDefaultCredentialSource::detect() { + ApplicationDefaultCredentialSource::GoogleApplicationCredentials { + path, + credential_type, + } => { + assert_eq!(path, file.path()); + assert_eq!( + credential_type.as_deref(), + Some("impersonated_service_account") + ); + } + other => panic!("unexpected source: {other:?}"), + } + } + + #[test] + #[serial] + fn application_default_source_names_well_known_file_type() { + let home = tempfile::tempdir().expect("temp home"); + let well_known_path = home + .path() + .join(".config/gcloud/application_default_credentials.json"); + fs::create_dir_all(well_known_path.parent().expect("parent")) + .expect("gcloud config dir"); + fs::write(&well_known_path, EXTERNAL_ACCOUNT_JSON) + .expect("write well-known adc"); + let _home = ScopedEnv::set("HOME", home.path().to_str().expect("utf-8 path")); + let _google_application_credentials = + ScopedEnv::remove("GOOGLE_APPLICATION_CREDENTIALS"); + match ApplicationDefaultCredentialSource::detect() { + ApplicationDefaultCredentialSource::WellKnownApplicationDefault { + path, + credential_type, + } => { + assert_eq!(path, well_known_path); + assert_eq!(credential_type.as_deref(), Some("external_account")); + } + other => panic!("unexpected source: {other:?}"), + } + } + + #[test] + #[serial] + fn application_default_source_falls_back_to_metadata_server() { + let home = tempfile::tempdir().expect("temp home"); + let _home = ScopedEnv::set("HOME", home.path().to_str().expect("utf-8 path")); + let _google_application_credentials = + ScopedEnv::remove("GOOGLE_APPLICATION_CREDENTIALS"); + match ApplicationDefaultCredentialSource::detect() { + ApplicationDefaultCredentialSource::MetadataServer => {} + other => panic!("unexpected source: {other:?}"), + } } } diff --git a/src/key_value_stores/mod.rs b/src/key_value_stores/mod.rs index df37869..7a954df 100644 --- a/src/key_value_stores/mod.rs +++ b/src/key_value_stores/mod.rs @@ -1,14 +1,28 @@ //! Common interface to key/value stores used for caching. +use std::time::Duration; + use anyhow::format_err; use async_trait::async_trait; use url::Url; use crate::Result; -mod bigtable; +pub mod bigtable; mod redis; +/// A value retrieved from a key/value store, with whatever freshness metadata +/// the backend can provide. +pub struct CachedValue { + /// The stored bytes. + pub bytes: Vec, + + /// How long ago this entry was written, if the backend records write times. + /// `None` means the backend cannot tell us (e.g. Redis), in which case the + /// entry can never be considered stale for auto-refresh. + pub age: Option, +} + /// A key/value store, like Redis or BigTable. /// /// We focus only on "pipelined" operations, where many requests are sent at @@ -71,7 +85,7 @@ pub trait PipelinedGet<'store>: Send + Sync { /// Execute all our requests and return the results in order. We return /// `None` when a value can't be found. - async fn execute(&self) -> Result>>>; + async fn execute(&self) -> Result>>; } /// A series of "set" requests that we'll send in a single batch. diff --git a/src/key_value_stores/redis.rs b/src/key_value_stores/redis.rs index ffd9855..8dc06a6 100644 --- a/src/key_value_stores/redis.rs +++ b/src/key_value_stores/redis.rs @@ -13,7 +13,9 @@ use url::Url; use crate::Result; -use super::{KeyValueStore, KeyValueStoreNew, PipelinedGet, PipelinedSet}; +use super::{ + CachedValue, KeyValueStore, KeyValueStoreNew, PipelinedGet, PipelinedSet, +}; /// A simple Redis client. pub struct Redis { @@ -94,22 +96,25 @@ impl<'store> PipelinedGet<'store> for RedisPipelinedGet<'store> { } #[instrument(name = "PipelinedGet::execute", level = "trace", skip_all)] - async fn execute(&self) -> Result>>> { + async fn execute(&self) -> Result>> { let start = Instant::now(); let mut client = self.redis.client().await?; - let result = self + let result: Vec>> = self .pipeline .query_async(&mut *client) .await .context("could not fetch keys from Redis")?; - histogram!( - "geocodecsv.redis.get_request.duration_seconds", - (Instant::now() - start).as_secs_f64(), - ); + histogram!("geocodecsv.redis.get_request.duration_seconds") + .record((Instant::now() - start).as_secs_f64()); - Ok(result) + // Redis does not give us a usable per-entry write time, so we can't + // support age-based auto-refresh on this backend. + Ok(result + .into_iter() + .map(|found| found.map(|bytes| CachedValue { bytes, age: None })) + .collect()) } } @@ -137,10 +142,8 @@ impl<'store> PipelinedSet<'store> for RedisPipelinedSet<'store> { .await .context("could not fetch keys from Redis")?; - histogram!( - "geocodecsv.redis.set_request.duration_seconds", - (Instant::now() - start).as_secs_f64(), - ); + histogram!("geocodecsv.redis.set_request.duration_seconds") + .record((Instant::now() - start).as_secs_f64()); Ok(result) } diff --git a/src/main.rs b/src/main.rs index 5266784..b1e2834 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,3 @@ -// Async HTTP boilerplate based on -// https://github.com/daboross/futures-example-2019/ - #![recursion_limit = "128"] pub use anyhow::Result; @@ -9,6 +6,7 @@ use clap::{Parser, Subcommand, ValueEnum}; use leaky_bucket::RateLimiter; use metrics::describe_counter; use opinionated_metrics::Mode; + use std::cmp::max; use std::path::PathBuf; use std::str::FromStr; @@ -33,6 +31,7 @@ mod pipeline; mod server; mod unpack_vec; +use crate::geocoders::cache::refresh::{RefreshPolicy, RefreshPolicyConfig}; use crate::geocoders::{ cache::Cache, invalid_record_skipper::InvalidRecordSkipper, libpostal::LibPostal, normalizer::Normalizer, shared_http_client, smarty::Smarty, Geocoder, @@ -43,9 +42,9 @@ use crate::pipeline::{geocode_stdio, OnDuplicateColumns, CONCURRENCY, GEOCODE_SI use crate::server::run_server; use crate::{addresses::AddressColumnSpec, geocoders::paired::Paired}; -#[cfg(all(feature = "jemallocator", not(target_env = "msvc")))] +#[cfg(all(feature = "tikv-jemallocator", not(target_env = "msvc")))] #[global_allocator] -static GLOBAL: jemallocator::Jemalloc = jemallocator::Jemalloc; +static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc; /// Underlying geocoders we can use. (Helper struct for argument parsing.) #[derive(Clone, Copy, Debug, ValueEnum)] @@ -91,6 +90,15 @@ impl FromStr for MetricsLabel { } } +/// Convert a whole-day count from a CLI flag into a `Duration`. +fn duration_from_days(days: u64) -> Result { + Ok(Duration::from_secs( + days.checked_mul(24 * 60 * 60).ok_or_else(|| { + format_err!("day count {days} is too large to convert to a duration") + })?, + )) +} + /// Our command-line arguments. #[derive(Debug, Parser)] #[command(author, version, about = "geocode CSV files passed on standard input")] @@ -139,6 +147,35 @@ struct Opt { #[arg(long = "cache-key-prefix", requires = "cache_url")] cache_key_prefix: Option, + /// Re-geocode a cached failure after this many days (then 2x, 4x, …). + /// Requires `--refresh-failures-max-attempts`, `--refresh-rate`, and + /// `--cache=bigtable://`. + #[arg( + long = "refresh-failures-after-days", + value_name = "N", + requires = "refresh_failures_max_attempts" + )] + refresh_failures_after_days: Option, + + /// Stop re-checking a cached failure after this many refreshes. Requires + /// `--refresh-failures-after-days`. + #[arg( + long = "refresh-failures-max-attempts", + value_name = "N", + requires = "refresh_failures_after_days" + )] + refresh_failures_max_attempts: Option, + + /// Re-geocode a cached success after this many days. Requires + /// `--refresh-rate` and `--cache=bigtable://`. + #[arg(long = "refresh-successes-after-days", value_name = "N")] + refresh_successes_after_days: Option, + + /// Fraction of eligible cache keys to refresh on a given day, in (0, 1]. + /// Required whenever any `--refresh-*` period is set. + #[arg(long = "refresh-rate", value_name = "F")] + refresh_rate: Option, + /// Before processing addresses, normalize them using libpostal. #[arg(long = "normalize")] normalize: bool, @@ -183,6 +220,11 @@ enum Command { // with an error. #[tokio::main] async fn main() -> Result<()> { + // Initialize rustls crypto provider before any TLS operations. + rustls::crypto::aws_lc_rs::default_provider() + .install_default() + .map_err(|_| anyhow::anyhow!("Failed to install rustls crypto provider"))?; + // Configure tracing. let filter = EnvFilter::from_default_env(); Subscriber::builder() @@ -238,6 +280,73 @@ async fn main() -> Result<()> { ) }); + // Build our cache refresh policy, if requested. Refresh is only supported + // by the BigTable cache, which records a write time per entry. + let wants_refresh = opt.refresh_failures_after_days.is_some() + || opt.refresh_successes_after_days.is_some(); + let refresh_policy = if wants_refresh { + let Some(rate) = opt.refresh_rate else { + return Err(format_err!( + "--refresh-rate is required whenever a --refresh-* period is set" + )); + }; + if !(rate > 0.0 && rate <= 1.0) { + return Err(format_err!("--refresh-rate must be in (0, 1], got {rate}")); + } + if let Some(days) = opt.refresh_failures_after_days { + if days == 0 { + return Err(format_err!( + "--refresh-failures-after-days must be greater than 0" + )); + } + } + if let Some(max_attempts) = opt.refresh_failures_max_attempts { + if max_attempts == 0 { + return Err(format_err!( + "--refresh-failures-max-attempts must be greater than 0" + )); + } + } + if let Some(days) = opt.refresh_successes_after_days { + if days == 0 { + return Err(format_err!( + "--refresh-successes-after-days must be greater than 0" + )); + } + } + match &opt.cache_url { + Some(cache_url) if cache_url.scheme() == "bigtable" => {} + Some(_) => { + return Err(format_err!( + "--refresh-* flags are only supported with --cache=bigtable://" + )) + } + None => { + return Err(format_err!( + "--refresh-* flags require --cache=bigtable://" + )) + } + } + Some(RefreshPolicy::new(RefreshPolicyConfig { + failure_period: opt + .refresh_failures_after_days + .map(duration_from_days) + .transpose()?, + failure_max_attempts: opt.refresh_failures_max_attempts.unwrap_or(0), + success_period: opt + .refresh_successes_after_days + .map(duration_from_days) + .transpose()?, + rate, + })) + } else if opt.refresh_rate.is_some() { + return Err(format_err!( + "--refresh-rate requires --refresh-failures-after-days or --refresh-successes-after-days" + )); + } else { + None + }; + // Choose our main geocoding client. let mut geocoder: Box = match opt.geocoder { GeocoderName::Smarty => Box::new(Smarty::new( @@ -265,6 +374,7 @@ async fn main() -> Result<()> { geocoder, opt.cache_output_keys, opt.cache_hits_only, + refresh_policy, ) .await?, ); diff --git a/src/pipeline.rs b/src/pipeline.rs index e614bee..5190895 100644 --- a/src/pipeline.rs +++ b/src/pipeline.rs @@ -8,7 +8,7 @@ use std::sync::atomic::AtomicI64; use std::{ cmp::max, io, iter::FromIterator, sync::Arc, thread::sleep, time::Duration, }; -use strum_macros::EnumString; +use strum::EnumString; use tokio::sync::mpsc::{self, Receiver, Sender}; use tokio_stream::wrappers::ReceiverStream; use tracing::{debug, error, instrument, trace, warn}; @@ -447,21 +447,21 @@ pub async fn geocode_chunk( retry_wait.as_secs(), err ); - counter!("geocodecsv.chunks_retried.total", 1); + counter!("geocodecsv.chunks_retried.total").increment(1); sleep(retry_wait); retry_wait *= 2; } Err(err) => { - counter!("geocodecsv.chunks_failed.total", 1); + counter!("geocodecsv.chunks_failed.total").increment(1); return Err(err).context("geocoder error"); } Ok(geocoded) => { - counter!("geocodecsv.chunks.total", 1); + counter!("geocodecsv.chunks.total").increment(1); break geocoded; } } }; - counter!("geocodecsv.addresses.total", addresses_len as u64); + counter!("geocodecsv.addresses.total").increment(addresses_len as u64); trace!("geocoded {} addresses", addresses_len); // Add address information to our output rows. diff --git a/src/server.rs b/src/server.rs index 632daea..93ad528 100644 --- a/src/server.rs +++ b/src/server.rs @@ -10,9 +10,7 @@ use crate::geocoders::Geocoder; use anyhow::{format_err, Context, Result}; use axum::{ extract::DefaultBodyLimit, - headers::{HeaderMap, HeaderName}, - http::header::CONTENT_TYPE, - http::StatusCode, + http::{header::CONTENT_TYPE, HeaderMap, HeaderName, StatusCode}, routing::post, Extension, Json, Router, }; @@ -52,13 +50,14 @@ pub async fn run_server(listen_addr: &str, geocoder: Box) -> Resul // rough size of `[crate::pipeline::GEOCODE_SIZE]`. .layer(DefaultBodyLimit::max(16384)); - let listen_addr = listen_addr.parse().with_context(|| { - format!("could not parse listen address: {:?}", listen_addr) - })?; + let listener = tokio::net::TcpListener::bind(listen_addr) + .await + .with_context(|| { + format!("could not bind to listen address: {:?}", listen_addr) + })?; // Run it with axum on the given listen address. - axum::Server::bind(&listen_addr) - .serve(app.into_make_service()) + axum::serve(listener, app) .await .context("web server failed to start") } diff --git a/tests/bigtable_refresh.rs b/tests/bigtable_refresh.rs new file mode 100644 index 0000000..2b6afb7 --- /dev/null +++ b/tests/bigtable_refresh.rs @@ -0,0 +1,86 @@ +//! Integration tests for BigTable cache refresh. +//! +//! These require a real BigTable cache (`BIGTABLE_CACHE_URL`) and a Smarty +//! license, so they are `#[ignore]`d by default. The refresh decision itself +//! is unit-tested in `src/geocoders/cache/refresh.rs`. + +use cli_test_dir::*; + +const SIMPLE_CSV: &str = "address_1,address_2,city,state,zip_code +20 W 34th St,,New York,NY,10118 +1 Infinite Loop,,Cupertino,CA,95014 +"; + +const SPEC: &str = r#"{ + "gc": { + "house_number_and_street": ["address_1", "address_2"], + "city": "city", + "state": "state", + "postcode": "zip_code" + } +}"#; + +/// Fresh successes are younger than `--refresh-successes-after-days` (and +/// successes are not refreshed at all unless that flag is set). A second run +/// with refresh enabled should still return geocoded results from the cache. +#[test] +#[ignore] +fn fresh_entries_are_served_from_cache() { + let testdir = TestDir::new("geocode-csv", "fresh_entries_are_served_from_cache"); + testdir.create_file("spec.json", SPEC); + let bigtable_cache_url = std::env::var("BIGTABLE_CACHE_URL") + .expect("BIGTABLE_CACHE_URL environment variable must be set"); + + testdir + .cmd() + .arg("--license=us-core-enterprise-cloud") + .arg("--spec=spec.json") + .arg(format!("--cache={}", bigtable_cache_url)) + .output_with_stdin(SIMPLE_CSV) + .expect_success(); + + let output = testdir + .cmd() + .arg("--license=us-core-enterprise-cloud") + .arg("--spec=spec.json") + .arg(format!("--cache={}", bigtable_cache_url)) + .arg("--refresh-failures-after-days=90") + .arg("--refresh-failures-max-attempts=4") + .arg("--refresh-rate=1") + .output_with_stdin(SIMPLE_CSV) + .expect_success(); + + assert!(output.stdout_str().contains("gc_addressee")); +} + +/// Refresh only makes sense for the BigTable cache. +#[test] +fn refresh_requires_bigtable_cache() { + let testdir = TestDir::new("geocode-csv", "refresh_requires_bigtable_cache"); + testdir.create_file("spec.json", SPEC); + + testdir + .cmd() + .arg("--spec=spec.json") + .arg("--refresh-failures-after-days=90") + .arg("--refresh-failures-max-attempts=4") + .arg("--refresh-rate=1") + .output_with_stdin(SIMPLE_CSV) + .expect_failure(); +} + +#[test] +fn refresh_rate_nan_is_rejected() { + let testdir = TestDir::new("geocode-csv", "refresh_rate_nan_is_rejected"); + testdir.create_file("spec.json", SPEC); + + testdir + .cmd() + .arg("--spec=spec.json") + .arg("--cache=bigtable://project/instance/table") + .arg("--refresh-failures-after-days=90") + .arg("--refresh-failures-max-attempts=4") + .arg("--refresh-rate=nan") + .output_with_stdin(SIMPLE_CSV) + .expect_failure(); +} diff --git a/tests/libpostal.rs b/tests/libpostal.rs index 00baca0..9cbcf9a 100644 --- a/tests/libpostal.rs +++ b/tests/libpostal.rs @@ -7,6 +7,7 @@ const SIMPLE_CSV: &str = "address_1,address_2,city,state,zip_code 20 W 34th St,,New York,NY,10118 1224 S 760 W,,Provo,UT, 104 16th st,,Belleair Bch,FL, +1600 Pennsylvania Ave NW,2nd Floor,Washington,DC,20500 "; #[test] @@ -34,7 +35,39 @@ fn libpostal() { .arg("--spec=spec.json") .output_with_stdin(SIMPLE_CSV) .expect_success(); - assert!(output.stdout_str().contains("gc_city")); - assert!(output.stdout_str().contains("new york")); - assert!(output.stdout_str().contains("belleair")); + let stdout = output.stdout_str(); + assert!(stdout.contains("gc_city")); + assert!(stdout.contains("new york")); + assert!(stdout.contains("belleair")); + + // A secondary-unit designator like "2nd Floor" (a libpostal `level`) must + // survive into our output instead of being silently dropped. + assert!(stdout.contains("gc_level")); + assert!(stdout.contains("floor")); + + // We should emit columns for the labels libpostal's parser can actually + // produce, including ones we previously discarded. + assert!(stdout.contains("gc_building")); + assert!(stdout.contains("gc_metro_station")); + + // We should NOT emit columns for OpenCage formatting labels that libpostal's + // parser never produces (it aliases these to canonical labels before + // training). + for dead_column in &[ + "gc_archipelago", + "gc_continent", + "gc_country_code", + "gc_county", + "gc_hamlet", + "gc_municipality", + "gc_neighbourhood", + "gc_postal_city", + "gc_region", + "gc_village", + ] { + assert!( + !stdout.contains(dead_column), + "output should not contain dead column {dead_column}" + ); + } } diff --git a/tests/server.rs b/tests/server.rs index 19dd18a..1ed3972 100644 --- a/tests/server.rs +++ b/tests/server.rs @@ -5,8 +5,8 @@ use std::time::{Duration, Instant}; use anyhow::{Context, Result}; use cli_test_dir::*; -use hyper::header::CONTENT_TYPE; use reqwest::blocking::{Client, Response}; +use reqwest::header::CONTENT_TYPE; use serde::Serialize; #[derive(Serialize)] @@ -109,8 +109,10 @@ fn server_helper() -> Result { .context("HTTP request failed") }; - // Post a request with JSON content. - let deadline = Instant::now() + Duration::from_secs(5); + // Post a request with JSON content. In server mode we prime libpostal + // before binding the listener, which can take 5-10 seconds, so we give the + // server plenty of time to start accepting connections. + let deadline = Instant::now() + Duration::from_secs(30); loop { match connect() { Ok(res) => break Ok(res), diff --git a/tests/specs.rs b/tests/specs.rs index 838f1f4..b1880e2 100644 --- a/tests/specs.rs +++ b/tests/specs.rs @@ -27,10 +27,16 @@ fn all_fields() { } }"#, ); + let bigtable_cache_url = std::env::var("BIGTABLE_CACHE_URL") + .expect("BIGTABLE_CACHE_URL environment variable must be set"); let output = testdir .cmd() .arg("--license=us-core-enterprise-cloud") .arg("--spec=spec.json") + .arg(format!("--cache={}", bigtable_cache_url)) + .arg("--refresh-failures-after-days=90") + .arg("--refresh-failures-max-attempts=4") + .arg("--refresh-rate=1") .output_with_stdin(SIMPLE_CSV) .expect_success(); assert!(output.stdout_str().contains("gc_addressee")); @@ -289,3 +295,123 @@ fn append_libpostal() { assert!(output.stdout_str().contains("40.21")); assert!(output.stdout_str().contains("gc_libpostal_city")); } + +#[test] +#[ignore] +fn redis_cache_hit_test() { + let testdir = TestDir::new("geocode-csv", "redis_cache_hit_test"); + + testdir.create_file( + "spec.json", + r#"{ + "gc": { + "house_number_and_street": [ + "address_1", + "address_2" + ], + "city": "city", + "state": "state", + "postcode": "zip_code" + } +}"#, + ); + + // First run - should call Smarty API and cache the result + let output1 = testdir + .cmd() + .arg("--license=us-core-enterprise-cloud") + .arg("--spec=spec.json") + .arg("--cache=redis://localhost:6379") + .output_with_stdin(SIMPLE_CSV) + .expect_success(); + + // Verify first run has correct data + assert!(output1.stdout_str().contains("gc_addressee")); + assert!(output1.stdout_str().contains("Commercial")); + + // Second run - should use cache, not call Smarty API + let output2 = testdir + .cmd() + .arg("--license=us-core-enterprise-cloud") + .arg("--spec=spec.json") + .arg("--cache=redis://localhost:6379") + .output_with_stdin(SIMPLE_CSV) + .expect_success(); + + // Verify second run has identical data (from cache) + assert_eq!(output1.stdout_str(), output2.stdout_str()); + + // Test cache-hits-only mode - should work without calling Smarty + let output3 = testdir + .cmd() + .arg("--license=us-core-enterprise-cloud") + .arg("--spec=spec.json") + .arg("--cache=redis://localhost:6379") + .arg("--cache-hits-only") + .output_with_stdin(SIMPLE_CSV) + .expect_success(); + + // Should get the same cached data + assert_eq!(output1.stdout_str(), output3.stdout_str()); +} + +#[test] +#[ignore] +fn bigtable_cache_hit_test() { + let testdir = TestDir::new("geocode-csv", "bigtable_cache_hit_test"); + + testdir.create_file( + "spec.json", + r#"{ + "gc": { + "house_number_and_street": [ + "address_1", + "address_2" + ], + "city": "city", + "state": "state", + "postcode": "zip_code" + } +}"#, + ); + + // First run - should call Smarty API and cache the result + let bigtable_cache_url = std::env::var("BIGTABLE_CACHE_URL") + .expect("BIGTABLE_CACHE_URL environment variable must be set"); + let output1 = testdir + .cmd() + .arg("--license=us-core-enterprise-cloud") + .arg("--spec=spec.json") + .arg(format!("--cache={}", bigtable_cache_url)) + .output_with_stdin(SIMPLE_CSV) + .expect_success(); + + // Verify first run has correct data + assert!(output1.stdout_str().contains("gc_addressee")); + assert!(output1.stdout_str().contains("Commercial")); + + // Second run - should use cache, not call Smarty API + let output2 = testdir + .cmd() + .arg("--license=us-core-enterprise-cloud") + .arg("--spec=spec.json") + .arg(format!("--cache={}", bigtable_cache_url)) + .output_with_stdin(SIMPLE_CSV) + .expect_success(); + + // Verify second run has identical data (from cache) + assert_eq!(output1.stdout_str(), output2.stdout_str()); + + // Test cache-hits-only mode - should work without calling Smarty + let output3 = testdir + .cmd() + .arg("--license=us-core-enterprise-cloud") + .arg("--spec=spec.json") + .arg(format!("--cache={}", bigtable_cache_url)) + .arg("--cache-hits-only") + .output_with_stdin(SIMPLE_CSV) + .expect_success(); + + // Should get the same cached data + assert_eq!(output1.stdout_str(), output3.stdout_str()); +}