From fd96e584696c9f911cfecd9597878c6914420ae3 Mon Sep 17 00:00:00 2001 From: FL03 Date: Tue, 20 Jan 2026 14:59:18 -0600 Subject: [PATCH 1/2] v0.2.5 Signed-off-by: FL03 --- Cargo.lock | 8 ++++---- Cargo.toml | 10 +++++----- SECURITY.md | 10 +++++----- default.nix | 2 +- flake.nix | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 05de701..6f02dc1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -153,7 +153,7 @@ checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32" [[package]] name = "contained" -version = "0.2.4" +version = "0.2.5" dependencies = [ "contained-core", "contained-derive", @@ -163,7 +163,7 @@ dependencies = [ [[package]] name = "contained-core" -version = "0.2.4" +version = "0.2.5" dependencies = [ "getrandom", "hashbrown 0.16.1", @@ -181,7 +181,7 @@ dependencies = [ [[package]] name = "contained-derive" -version = "0.2.4" +version = "0.2.5" dependencies = [ "proc-macro2", "quote", @@ -190,7 +190,7 @@ dependencies = [ [[package]] name = "contained-macros" -version = "0.2.4" +version = "0.2.5" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index f137e09..bd7ab90 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,13 +21,13 @@ license = "Apache-2.0" readme = "README.md" repository = "https://github.com/FL03/contained.git" rust-version = "1.85.0" -version = "0.2.4" +version = "0.2.5" [workspace.dependencies] -contained = { default-features = false, path = "contained", version = "0.2.4" } -contained-core = { default-features = false, path = "core", version = "0.2.4" } -contained-derive = { default-features = false, path = "derive", version = "0.2.4" } -contained-macros = { default-features = false, path = "macros", version = "0.2.4" } +contained = { default-features = false, path = "contained", version = "0.2.5" } +contained-core = { default-features = false, path = "core", version = "0.2.5" } +contained-derive = { default-features = false, path = "derive", version = "0.2.5" } +contained-macros = { default-features = false, path = "macros", version = "0.2.5" } # development criterion = { version = "0.8" } # concurrency & parallelism diff --git a/SECURITY.md b/SECURITY.md index 716a729..91dd99d 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,11 +4,11 @@ This namespace has been repurposed since `v0.2.0`. For security reasons, we only support the latest patch version of the current minor version. -| semver | supported | -|:----------------|:-------------------| -| 0.2.1 | :white_check_mark: | -| < 0.2.1,>=0.2.0 | :white_check_mark: | -| < 0.2.0 | :x: | +| Version | Supported | +|:------------------|:-------------------| +| 0.2.5 (latest) | :white_check_mark: | +| <0.2.1,>=0.2.4 | :white_check_mark: | +| <0.2.0 | :x: | ## Reporting a Vulnerability diff --git a/default.nix b/default.nix index 2d57048..3cb2d2c 100644 --- a/default.nix +++ b/default.nix @@ -26,7 +26,7 @@ let }; common = { - version = "0.2.4"; + version = "0.2.5"; src = self; cargoLock = { diff --git a/flake.nix b/flake.nix index d9ff292..008a008 100644 --- a/flake.nix +++ b/flake.nix @@ -19,7 +19,7 @@ in rec { packages.default = pkgs.rustPlatform.buildRustPackage { pname = "contained"; - version = "0.2.4"; + version = "0.2.5"; src = self; # ./. cargoLock = { lockFile = ./Cargo.lock; From e71f7e1aeca02e7cf61b612641a3905a2bc504e4 Mon Sep 17 00:00:00 2001 From: FL03 Date: Thu, 5 Mar 2026 17:02:10 -0600 Subject: [PATCH 2/2] update Signed-off-by: FL03 --- .editorconfig | 91 ++-- .github/dependabot.yml | 5 +- .github/workflows/cargo-bench.yml | 3 - .github/workflows/cargo-clippy.yml | 20 +- .github/workflows/cargo-publish.yml | 107 ++-- .github/workflows/cargo-test.yml | 72 +++ .github/workflows/cleanup.yml | 12 +- .github/workflows/nix.yml | 8 +- .github/workflows/release.yml | 9 +- .github/workflows/rust.yml | 274 +++++----- .gitignore | 150 +++--- .vscode/settings.json | 1 + Cargo.lock | 477 +++++++++++++----- Cargo.toml | 158 +++--- clippy.toml | 2 +- {contained => crates/contained}/Cargo.toml | 0 .../contained}/benches/default.rs | 0 {contained => crates/contained}/build.rs | 0 .../contained}/examples/derive.rs | 0 .../contained}/examples/macros.rs | 0 {contained => crates/contained}/lib.rs | 0 .../contained}/tests/default.rs | 0 .../contained}/tests/format.rs | 0 {core => crates/core}/Cargo.toml | 288 +++++------ {core => crates/core}/build.rs | 0 {core => crates/core}/src/error.rs | 0 {core => crates/core}/src/lib.rs | 0 {core => crates/core}/src/macros/format.rs | 0 {core => crates/core}/src/macros/seal.rs | 0 {core => crates/core}/src/macros/wrapper.rs | 0 {core => crates/core}/src/traits/get.rs | 0 {core => crates/core}/src/traits/wrapper.rs | 0 {core => crates/core}/tests/default.rs | 0 {derive => crates/derive}/Cargo.toml | 0 {derive => crates/derive}/build.rs | 0 {derive => crates/derive}/src/attrs.rs | 0 {derive => crates/derive}/src/attrs/gsw.rs | 0 .../derive}/src/attrs/gsw/impl_getter_attr.rs | 0 .../derive}/src/attrs/gsw/impl_gsw_attr.rs | 0 .../src/attrs/gsw/impl_nested_gsw_attr.rs | 0 .../derive}/src/attrs/wrapper.rs | 0 .../src/attrs/wrapper/impl_display_attr.rs | 0 .../src/attrs/wrapper/impl_nested_attr.rs | 0 .../src/attrs/wrapper/impl_wrapper_attr.rs | 0 {derive => crates/derive}/src/impls/gsw.rs | 0 .../derive}/src/impls/wrapper.rs | 0 {derive => crates/derive}/src/lib.rs | 0 {derive => crates/derive}/tests/default.rs | 0 {derive => crates/derive}/tests/wrapper.rs | 0 {macros => crates/macros}/Cargo.toml | 0 {macros => crates/macros}/build.rs | 0 .../macros}/src/ast/wrapper_impl_ast.rs | 0 {macros => crates/macros}/src/impls/binary.rs | 0 {macros => crates/macros}/src/impls/unary.rs | 0 {macros => crates/macros}/src/lib.rs | 0 {macros => crates/macros}/tests/default.rs | 0 {macros => crates/macros}/tests/ops.rs | 0 default.nix | 88 ++-- flake.nix | 19 +- scripts/cmp.sh | 3 + scripts/nix.sh | 24 +- 61 files changed, 1122 insertions(+), 689 deletions(-) create mode 100644 .github/workflows/cargo-test.yml rename {contained => crates/contained}/Cargo.toml (100%) rename {contained => crates/contained}/benches/default.rs (100%) rename {contained => crates/contained}/build.rs (100%) rename {contained => crates/contained}/examples/derive.rs (100%) rename {contained => crates/contained}/examples/macros.rs (100%) rename {contained => crates/contained}/lib.rs (100%) rename {contained => crates/contained}/tests/default.rs (100%) rename {contained => crates/contained}/tests/format.rs (100%) rename {core => crates/core}/Cargo.toml (90%) rename {core => crates/core}/build.rs (100%) rename {core => crates/core}/src/error.rs (100%) rename {core => crates/core}/src/lib.rs (100%) rename {core => crates/core}/src/macros/format.rs (100%) rename {core => crates/core}/src/macros/seal.rs (100%) rename {core => crates/core}/src/macros/wrapper.rs (100%) rename {core => crates/core}/src/traits/get.rs (100%) rename {core => crates/core}/src/traits/wrapper.rs (100%) rename {core => crates/core}/tests/default.rs (100%) rename {derive => crates/derive}/Cargo.toml (100%) rename {derive => crates/derive}/build.rs (100%) rename {derive => crates/derive}/src/attrs.rs (100%) rename {derive => crates/derive}/src/attrs/gsw.rs (100%) rename {derive => crates/derive}/src/attrs/gsw/impl_getter_attr.rs (100%) rename {derive => crates/derive}/src/attrs/gsw/impl_gsw_attr.rs (100%) rename {derive => crates/derive}/src/attrs/gsw/impl_nested_gsw_attr.rs (100%) rename {derive => crates/derive}/src/attrs/wrapper.rs (100%) rename {derive => crates/derive}/src/attrs/wrapper/impl_display_attr.rs (100%) rename {derive => crates/derive}/src/attrs/wrapper/impl_nested_attr.rs (100%) rename {derive => crates/derive}/src/attrs/wrapper/impl_wrapper_attr.rs (100%) rename {derive => crates/derive}/src/impls/gsw.rs (100%) rename {derive => crates/derive}/src/impls/wrapper.rs (100%) rename {derive => crates/derive}/src/lib.rs (100%) rename {derive => crates/derive}/tests/default.rs (100%) rename {derive => crates/derive}/tests/wrapper.rs (100%) rename {macros => crates/macros}/Cargo.toml (100%) rename {macros => crates/macros}/build.rs (100%) rename {macros => crates/macros}/src/ast/wrapper_impl_ast.rs (100%) rename {macros => crates/macros}/src/impls/binary.rs (100%) rename {macros => crates/macros}/src/impls/unary.rs (100%) rename {macros => crates/macros}/src/lib.rs (100%) rename {macros => crates/macros}/tests/default.rs (100%) rename {macros => crates/macros}/tests/ops.rs (100%) create mode 100755 scripts/cmp.sh diff --git a/.editorconfig b/.editorconfig index e62c742..6579243 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,36 +1,55 @@ -# EditorConfig is awesome: https://EditorConfig.org - -# top-most EditorConfig file -root = true - -[*] -charset = utf-8 -end_of_line = crlf -indent_style = space -indent_size = 4 -insert_final_newline = false -quote_type = double -trim_trailing_whitespace = false - -[*.{ts,tsx,js,jsx,cjs,mjs}] -indent_size = 2 -quote_type = single - -[*.{json,yaml,yml,toml}] -indent_size = 2 - -[*.md] -insert_final_newline = true -trim_trailing_whitespace = true - -[*.rs] -indent_size = 4 - -[*.{html,htm,xml}] -indent_size = 2 - -[*.{css,scss,sass,less}] -indent_size = 2 -trim_trailing_whitespace = true -insert_final_newline = true - +# EditorConfig is awesome: https://EditorConfig.org + +# top-most EditorConfig file +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = space +indent_size = 4 +insert_final_newline = true +quote_type = double +trim_trailing_whitespace = true + +# Common config files +[*.{json,yaml,yml,toml}] +indent_size = 2 + +# scripts +[*.{sh,bat}] +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = false + +# Rust files +[*.rs] +indent_size = 4 + +# Python files +[*.py] +indent_size = 4 + +# WebAssembly files +[*.{wat,wit}] +indent_size = 4 +insert_final_newline = false + +# Markdown files +[*.{md,mdx}] +indent_size = 2 + +# WebDev + +## JavaScript / TypeScript +[*.{ts,tsx,js,jsx,cjs,mjs}] +indent_size = 2 + +## HTML / XML +[*.{html,htm,xml}] +indent_size = 2 + +## Stylesheets +[*.{css,scss,sass,less}] +indent_size = 2 + diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 9d2264e..ef1928f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -14,7 +14,4 @@ updates: interval: monthly directories: - / - - /contained - - /core - - /derive - - /macros + - /crates/* diff --git a/.github/workflows/cargo-bench.yml b/.github/workflows/cargo-bench.yml index 1d5cc20..1faa134 100644 --- a/.github/workflows/cargo-bench.yml +++ b/.github/workflows/cargo-bench.yml @@ -10,9 +10,6 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} on: - push: - branches: [main, master] - tags: [latest, v*.*.*, "*-nightly"] repository_dispatch: types: [cargo-bench] workflow_dispatch: diff --git a/.github/workflows/cargo-clippy.yml b/.github/workflows/cargo-clippy.yml index 0f6e694..81bb36f 100644 --- a/.github/workflows/cargo-clippy.yml +++ b/.github/workflows/cargo-clippy.yml @@ -14,32 +14,34 @@ on: types: [clippy, cargo-clippy] workflow_dispatch: -permissions: - actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status - contents: read - security-events: write - statuses: write - jobs: clippy: runs-on: ubuntu-latest + permissions: + actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status + contents: read + security-events: write + statuses: write steps: - name: Checkout uses: actions/checkout@v6 + with: + fetch-depth: 0 - name: Setup Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} components: clippy,rustfmt - - uses: taiki-e/install-action@v2 + - name: Install SARIF tools + uses: taiki-e/install-action@v2 with: tool: clippy-sarif sarif-fmt - - name: Run Clippy + - name: Run cargo clippy run: | cargo clippy \ --features full \ --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt - - name: Upload analysis + - name: Upload the results uses: github/codeql-action/upload-sarif@v4 with: sarif_file: rust-clippy-results.sarif diff --git a/.github/workflows/cargo-publish.yml b/.github/workflows/cargo-publish.yml index dc6b66b..ebadbb7 100644 --- a/.github/workflows/cargo-publish.yml +++ b/.github/workflows/cargo-publish.yml @@ -1,52 +1,55 @@ -name: cargo-publish -# A custom GitHub Actions workflow used to automatically publish Rust crates to crates.io -# whenever a new release is published. - -concurrency: - cancel-in-progress: false - group: ${{ github.workflow }}-${{ github.ref }} - -env: - CARGO_TERM_COLOR: always - RUST_BACKTRACE: full - -on: - release: - types: [published] - repository_dispatch: - types: [crates-io, cargo-publish] - workflow_dispatch: - -permissions: - contents: read - deployments: write - -jobs: - crates-io: - runs-on: ubuntu-latest - environment: crates-io - env: - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - strategy: - fail-fast: false - max-parallel: 1 - matrix: - package: - - contained-core - - contained-derive - - contained-macros - - contained - steps: - - name: Checkoout - uses: actions/checkout@v6 - with: - fetch-depth: 0 - ref: ${{ github.event.client_payload.ref || github.ref }} - repository: ${{ github.repository }} - token: ${{ github.token }} - - name: Setup Rust - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: Publish (${{ matrix.package }}) - run: cargo publish --locked --package ${{ matrix.package }} +name: cargo-publish + +concurrency: + cancel-in-progress: false + group: ${{ github.workflow }}-${{ github.ref }} + +on: + release: + types: [published] + repository_dispatch: + types: [crates-io, cargo-publish] + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always + RUST_BACKTRACE: full + +permissions: + contents: read + deployments: write + +jobs: + crates-io: + runs-on: ubuntu-latest + environment: + name: crates-io + url: https://crates.io/crates/${{ matrix.package }} + strategy: + fail-fast: false + max-parallel: 1 + matrix: + package: + # sdk + - rstm-traits + - rstm-state + - rstm-tape + - rstm-core + - rstm-macros + - rstm + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + ref: ${{ github.event.client_payload.ref || github.ref }} + repository: ${{ github.repository }} + token: ${{ github.token }} + - name: Setup Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Publish (${{ matrix.package }}) + run: cargo publish --locked --package ${{ matrix.package }} + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/cargo-test.yml b/.github/workflows/cargo-test.yml new file mode 100644 index 0000000..f81ca91 --- /dev/null +++ b/.github/workflows/cargo-test.yml @@ -0,0 +1,72 @@ +# This workflow is used to benchmark a Rust project +name: cargo-test +# The workflow may be manually triggered and is run automatically when: +# - a pull request is closed on the default branch (main/master) +# - a release is published +# - a repository_dispatch event with the type "cargo-test" is received + +concurrency: + cancel-in-progress: false + group: ${{ github.workflow }}-${{ github.ref }} + +on: + repository_dispatch: + types: [cargo-test] + workflow_dispatch: + inputs: + toolchain: + description: 'Rust toolchain to use (stable, beta, nightly, or a specific version)' + required: false + default: 'stable' + type: choice + options: [ stable, nightly, beta] + + +env: + CARGO_TERM_COLOR: always + RUST_BACKTRACE: full + +permissions: + actions: read + contents: read + +jobs: + test: + name: Cargo Test + runs-on: ubuntu-latest + env: + RUST_TOOLCHAIN: ${{ github.event.inputs.toolchain || 'stable' }} + outputs: + status: ${{ steps.test.outputs.status }} + strategy: + fail-fast: false + matrix: + features: [full] + packages: [workspace] + target: [x86_64-unknown-linux-gnu] + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + ref: ${{ github.event.client_payload.ref || github.ref }} + repository: ${{ github.repository }} + token: ${{ secrets.GITHUB_TOKEN }} + - name: Setup Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + toolchain: ${{ env.RUST_TOOLCHAIN }} + override: true + - name: Test workspace (${{ matrix.target }}) + id: test + if: matrix.packages == 'workspace' || matrix.packages == 'all' + run: cargo test --locked --verbose --workspace \ + --features ${{ matrix.features }} \ + --target ${{ matrix.target }} + - name: "Test ${{ matrix.packages }}:${{ matrix.target }}" + id: test-package + if: matrix.packages != 'workspace' + run: cargo test --locked --verbose -p ${{ matrix.packages }} \ + --features ${{ matrix.features }} \ + --target ${{ matrix.target }} \ No newline at end of file diff --git a/.github/workflows/cleanup.yml b/.github/workflows/cleanup.yml index 58ac448..e740442 100644 --- a/.github/workflows/cleanup.yml +++ b/.github/workflows/cleanup.yml @@ -5,8 +5,14 @@ on: types: [closed] jobs: - cache_cleanup: + pr_cache_cleanup: + if: github.event.pull_request.merged == true + name: Cleanup Pull Request Caches runs-on: ubuntu-latest + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge permissions: actions: write steps: @@ -23,7 +29,3 @@ jobs: gh cache delete $cacheKey done echo "Done" - env: - GH_TOKEN: ${{ github.token }} - GH_REPO: ${{ github.repository }} - BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 0dab97c..7149082 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -20,12 +20,14 @@ jobs: continue-on-error: true runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v6 + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} - name: Setup Nix uses: cachix/install-nix-action@v31 with: - github_access_token: ${{ github.token}} + github_access_token: ${{ secrets.GITHUB_TOKEN }} - name: Build run: nix build - name: Check the flake diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 32c390d..3177d51 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,13 +24,16 @@ permissions: jobs: release: - runs-on: ubuntu-latest env: IS_PRERELEASE: ${{ github.event.inputs.prerelease || false }} IS_DRAFT: ${{ github.event.inputs.draft || false }} + runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v6 + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + ref: ${{ github.ref }} - name: Create release uses: softprops/action-gh-release@v2 continue-on-error: true diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e6226a1..b7c8d8a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,113 +1,161 @@ -name: rust - -concurrency: - cancel-in-progress: false - group: ${{ github.workflow }}-${{ github.ref }} - -on: - pull_request: - branches: [main, master] - types: [synchronize] - paths: - - ".github/workflows/rust.yml" - - "Cargo.toml" - - "Cargo.lock" - - "**/*.rs" - push: - branches: [main, master] - tags: [latest, v*, "*-nightly"] - repository_dispatch: - types: [rust, rust-ci] - release: - types: [created] - workflow_dispatch: - inputs: - toolchain: - default: stable - description: "Choose which toolchain to test (stable, nightly)" - required: true - type: choice - options: [stable, nightly] - -env: - CARGO_TERM_COLOR: always - RUST_BACKTRACE: full - -jobs: - build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - target: [x86_64-unknown-linux-gnu] - steps: - - name: Checkout - uses: actions/checkout@v6 - - name: Setup Rust - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - target: ${{ matrix.target }} - toolchain: ${{ github.event.inputs.toolchain || 'stable' }} - override: true - - name: Build the workspace - run: cargo build -r --locked --workspace --features full --target ${{ matrix.target }} - test: - if: github.event_name != 'workflow_dispatch' || github.event.inputs.toolchain == 'stable' - needs: build - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - features: [full, default] - target: [x86_64-unknown-linux-gnu] - steps: - - name: Checkout - uses: actions/checkout@v6 - - name: Setup Rust - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - target: ${{ matrix.target }} - toolchain: stable - override: true - - name: Test (${{ matrix.features }}) - run: cargo test -r --locked --workspace --target ${{ matrix.target}} -F ${{ matrix.features }} - test_nightly: - if: github.event_name != 'workflow_dispatch' || github.event.inputs.toolchain == 'nightly' - needs: build - runs-on: ubuntu-latest - env: - RUSTFLAGS: "-C panic=abort -Z panic_abort_tests" - strategy: - fail-fast: false - matrix: - target: [x86_64-unknown-linux-gnu] - package: [contained-core, contained] - features: - - all - - no_std - - "alloc,nightly" - - steps: - - name: Checkout - uses: actions/checkout@v6 - - name: Setup Rust - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - target: ${{ matrix.target }} - toolchain: nightly - override: true - - name: Test (all-features) - if: matrix.features == 'all' - run: cargo test -r --locked --all-features --target ${{ matrix.target }} -p ${{ matrix.package }} - - name: Test (no_std) - continue-on-error: true - if: matrix.features == 'no_std' - run: cargo test -r --locked --no-default-features --target ${{ matrix.target }} -p ${{ matrix.package }} - - name: Test (${{ matrix.features }}) - continue-on-error: true - if: matrix.features != 'all' && matrix.features != 'no_std' - run: cargo test -r --locked --no-default-features --target ${{ matrix.target }} -p ${{ matrix.package }} -F ${{ matrix.features }} - +name: rust + +concurrency: + cancel-in-progress: false + group: ${{ github.workflow }}-${{ github.ref }} + +on: + pull_request: + branches: [main, master] + types: [synchronize] + push: + branches: [main, master] + tags: [latest, v*, "*-nightly"] + repository_dispatch: + types: [rust, rust-ci] + workflow_dispatch: + inputs: + benchmark: + description: "Run benchmarks (requires cargo-criterion)" + required: false + type: boolean + toolchain: + default: stable + description: "Select a toolchain to test (stable, nightly)" + required: true + type: choice + options: [stable, nightly] + +env: + CARGO_TERM_COLOR: always + RUST_BACKTRACE: full + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + target: [x86_64-unknown-linux-gnu] + toolchain: [stable] + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + - name: Setup Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + target: ${{ matrix.target }} + toolchain: ${{ matrix.toolchain }} + override: true + - name: Build the workspace + run: cargo build -r --locked --workspace --features full --target ${{ matrix.target }} + benchmark: + if: github.event_name == 'workflow_dispatch' && github.event.inputs.benchmark || github.event_name == 'release' || false + needs: build + runs-on: ubuntu-latest + outputs: + id: ${{ steps.artifacts.outputs.artifact-id }} + digest: ${{ steps.artifacts.outputs.artifact-digest }} + url: ${{ steps.artifacts.outputs.artifact-url }} + strategy: + fail-fast: false + matrix: + features: [full] + target: [x86_64-unknown-linux-gnu] + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + ref: ${{ github.event.client_payload.ref || github.ref }} + repository: ${{ github.repository }} + token: ${{ secrets.GITHUB_TOKEN }} + - name: Setup Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + - name: Install cargo-criterion + uses: taiki-e/install-action@v2 + with: + tool: cargo-criterion + - name: Benchmark (${{ matrix.target }}) + run: cargo criterion --benches --locked --verbose --workspace --features ${{ matrix.features }} --target ${{ matrix.target }} + - name: Upload the benchmarks + id: artifacts + uses: actions/upload-artifact@v7 + with: + name: Benchmark Report (${{ github.run_id }}) + if-no-files-found: error + overwrite: true + path: target/criterion/ + test: + if: github.event_name != 'workflow_dispatch' || github.event.inputs.toolchain != 'nightly' + needs: build + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + features: [full, default] + target: [x86_64-unknown-linux-gnu] + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + - name: Setup Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + target: ${{ matrix.target }} + toolchain: stable + override: true + - name: Test (default) + if: matrix.features == 'default' + run: cargo test -r --locked --workspace --target ${{ matrix.target}} + - name: Test (${{ matrix.features }}) + if: matrix.features != 'default' + run: cargo test -r --locked --workspace --target ${{ matrix.target}} --features ${{ matrix.features }} + test_nightly: + if: github.event_name == 'workflow_dispatch' && github.event.inputs.toolchain == 'nightly' || false + continue-on-error: true + needs: build + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + target: [x86_64-unknown-linux-gnu] + features: + - all + - no_std + - "alloc,nightly" + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + - name: Setup Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + cache-key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + toolchain: nightly + override: true + - name: Test (all-features) + if: matrix.features == 'all' + run: cargo test -r --locked --all-features --workspace --target ${{ matrix.target }} + - name: Test (no_std) + continue-on-error: true + if: matrix.features == 'no_std' + run: cargo test -r --locked --no-default-features --workspace --target ${{ matrix.target }} + env: + RUSTFLAGS: "-C panic=abort -Z panic_abort_tests" + - name: Test (${{ matrix.features }}) + continue-on-error: true + if: matrix.features != 'all' && matrix.features != 'no_std' + run: cargo test -r --locked --no-default-features --workspace \ + --features ${{ matrix.features }} \ + --target ${{ matrix.target }} + env: + RUSTFLAGS: "-C panic=abort -Z panic_abort_tests" diff --git a/.gitignore b/.gitignore index 669643f..9de4cd7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,118 +1,140 @@ # General - -**/.artifacts/data -**/.cache -**/.docker/data - -*.csv -*.csv.* +*.bk +*.bk.* *.db *.db.* -*.db-*.* +*.log +*.log.* -*.lock -*.lock.* +*.pem +*.pem.* -*-lock.* +*.gz +*.gz.* -*.log -*.log.* +*.sqlite +*.sqlite.* + +*.sqlite3 +*.sqlite3.* *.zip *.zip.* -## Operating Systems +## Directories +**/.artifacts/cache/ +**/.artifacts/temp/ +**/.artifacts/uploads/ -### NixOS -!flake.lock +!**/.artifacts/docs +!**/.artifacts/.gitkeep -### Windows (WSL2) -**/*:Zone.Identifier +**/.cache/ +**/coverage/ +**/build/ +**/coverage/ +**/dist/ +**/out/ +**/logs/ +**/tmp/ -# Configuration Files +## Development +### Config Files **/.config/*.config.* -!**/default.config.* +!**/.config/default.config.* +!**/.config/docker.config.* +!**/.config/xtask.config.* + +### dotenv *.env *.env.* -!**/default.env -!**/example.env +!*default.env* +!*.env.default -## Development Environments -**/.direnv/ +!*example.env* +!*.env.example -### JetBrains IDEs +### IDEs + +#### Atom +**/.atom + +#### JetBrains **/.idea/ *.iml -*.iml.* +*.ipr +*.iws -### Visual Studio Code -**/.vscode/* +#### Visual Studio Code +**/.vscode/ !**/.vscode/settings.json -# Language Specific +## Operating Systems -## Rust -**/debug/ -**/target/ +### Linux -*.bk -*.bk.* +#### NixOS +!**/flake.lock -!**/Cargo.lock +**/.nix-channels +**/.nix + +### Windows + +#### Windows Subsystem for Linux (WSL) +*:Zone.Identifier + +# Language Specific ## Python **/__pycache__/ -**/.pytest_cache/ **/venv/ -*.egg -*.egg.* - -*.egg-info - *.pyc *.pyc.* *.pyo -*.pyo.* +*.pyd -*.pyz -*.pyz.* +## Rust +**/target -*.pyzw -*.pyzw.* +!.cargo/config.toml +!**/Cargo.lock -*.whl -*.whl.* +*.rs.bk +# *.lock +*-lock.json -## Node -**/build/ -**/debug/ -**/dist/ -**/node_modules/ +## Node.JS +**/.DS_STORE +**/build +**/node_modules + +*.tsbuildinfo + +**/.pnp +**/.pnp.* + +**/.yarn/install-state.gz ### Frameworks #### Next.js -**/.next/ +**/.next +**/out -#### SvelteKit -**/__sapper__/ -**/.DS_STORE/ -**/.svelte-kit/ +**/next-env.d.ts -#### Supabase -**/.supabase/ -**/supabase/tmp/ +# Services -#### Vercel -**/.vercel/ -**/.vercel_build_output/ +## Vercel +**/.vercel diff --git a/.vscode/settings.json b/.vscode/settings.json index 51060ba..327dac8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,6 +3,7 @@ "default", "full" ], + "rust-analyzer.cargo.buildScripts.enable": true, "github-actions.workflows.pinned.workflows": [ ".github/workflows/rust.yml" ] diff --git a/Cargo.lock b/Cargo.lock index 6f02dc1..c23bff6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -47,6 +47,12 @@ version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + [[package]] name = "autocfg" version = "1.5.0" @@ -59,11 +65,17 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "bitflags" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" + [[package]] name = "bumpalo" -version = "3.19.1" +version = "3.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" [[package]] name = "cast" @@ -73,9 +85,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.2.53" +version = "1.2.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "755d2fce177175ffca841e9a06afdb2c4ab0f593d53b4dee48147dfaade85932" +checksum = "aebf35691d1bfb0ac386a69bac2fde4dd276fb618cf8bf4f5318fe285e821bb2" dependencies = [ "find-msvc-tools", "shlex", @@ -87,11 +99,22 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" +[[package]] +name = "chacha20" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f8d983286843e49675a4b7a2d174efe136dc93a18d69130dd18198a6c167601" +dependencies = [ + "cfg-if", + "cpufeatures", + "rand_core 0.10.0", +] + [[package]] name = "chrono" -version = "0.4.43" +version = "0.4.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fac4744fb15ae8337dc853fee7fb3f4e48c0fbaa23d0afe49c447b4fab126118" +checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" dependencies = [ "iana-time-zone", "num-traits", @@ -128,18 +151,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.54" +version = "4.5.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6e6ff9dcd79cff5cd969a17a545d79e84ab086e444102a591e288a8aa3ce394" +checksum = "2797f34da339ce31042b27d23607e051786132987f595b02ba4f6a6dffb7030a" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.54" +version = "4.5.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa42cf4d2b7a41bc8f663a7cab4031ebafa1bf3875705bfaf8466dc60ab52c00" +checksum = "24a241312cea5059b13574bb9b3861cabf758b879c15190b37b6d6fd63ab6876" dependencies = [ "anstyle", "clap_lex", @@ -147,9 +170,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.7" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e64b0cc0439b12df2fa678eae89a1c56a529fd067a9115f7827f1fffd22b32" +checksum = "3a822ea5bc7590f9d40f1ba12c0dc3c2760f3482c6984db1573ad11031420831" [[package]] name = "contained" @@ -169,7 +192,7 @@ dependencies = [ "hashbrown 0.16.1", "num-complex", "num-traits", - "rand 0.9.2", + "rand 0.10.0", "rand_distr", "rayon-core", "serde", @@ -203,11 +226,20 @@ version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" +[[package]] +name = "cpufeatures" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" +dependencies = [ + "libc", +] + [[package]] name = "criterion" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d883447757bb0ee46f233e9dc22eb84d93a9508c9b868687b274fc431d886bf" +checksum = "950046b2aa2492f9a536f5f4f9a3de7b9e2476e575e05bd6c333371add4d98f3" dependencies = [ "alloca", "anes", @@ -230,9 +262,9 @@ dependencies = [ [[package]] name = "criterion-plot" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed943f81ea2faa8dcecbbfa50164acf95d555afec96a27871663b300e387b2e4" +checksum = "d8d80a2f4f5b554395e47b5d8305bc3d27813bacb73493eb1001e8f76dae29ea" dependencies = [ "cast", "itertools", @@ -271,9 +303,9 @@ checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] name = "darling" -version = "0.20.11" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +checksum = "9cdf337090841a411e2a7f3deb9187445851f91b309c0c0a29e05f74a00a48c0" dependencies = [ "darling_core", "darling_macro", @@ -281,9 +313,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.11" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +checksum = "1247195ecd7e3c85f83c8d2a366e4210d588e802133e1e355180a9870b517ea4" dependencies = [ "fnv", "ident_case", @@ -295,9 +327,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.11" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +checksum = "d38308df82d1080de0afee5d069fa14b0326a88c14f15c5ccda35b4a6c414c81" dependencies = [ "darling_core", "quote", @@ -306,14 +338,20 @@ dependencies = [ [[package]] name = "deranged" -version = "0.5.5" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" dependencies = [ "powerfmt", "serde_core", ] +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + [[package]] name = "either" version = "1.15.0" @@ -328,9 +366,9 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "find-msvc-tools" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8591b0bcc8a98a64310a2fae1bb3e9b8564dd10e381e6e28010fde8e8e8568db" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" [[package]] name = "fnv" @@ -338,6 +376,12 @@ 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" @@ -346,15 +390,17 @@ checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" [[package]] name = "getrandom" -version = "0.3.4" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" dependencies = [ "cfg-if", "js-sys", "libc", "r-efi", + "rand_core 0.10.0", "wasip2", + "wasip3", "wasm-bindgen", ] @@ -375,6 +421,15 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash 0.1.5", +] + [[package]] name = "hashbrown" version = "0.16.1" @@ -383,13 +438,19 @@ checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" dependencies = [ "allocator-api2", "equivalent", - "foldhash", + "foldhash 0.2.0", "rayon", "rustc-std-workspace-alloc", "serde", "serde_core", ] +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hex" version = "0.4.3" @@ -398,9 +459,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "iana-time-zone" -version = "0.1.64" +version = "0.1.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -420,6 +481,12 @@ dependencies = [ "cc", ] +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + [[package]] name = "ident_case" version = "1.0.1" @@ -466,25 +533,31 @@ checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2" [[package]] name = "js-sys" -version = "0.3.85" +version = "0.3.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3" +checksum = "b49715b7073f385ba4bc528e5747d02e66cb39c6146efb66b781f131f0fb399c" dependencies = [ "once_cell", "wasm-bindgen", ] +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + [[package]] name = "libc" -version = "0.2.180" +version = "0.2.182" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc" +checksum = "6800badb6cb2082ffd7b6a67e6125bb39f18782f793520caee8cb8846be06112" [[package]] name = "libm" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" [[package]] name = "log" @@ -494,9 +567,9 @@ checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" [[package]] name = "memchr" -version = "2.7.6" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" [[package]] name = "num-complex" @@ -511,9 +584,9 @@ dependencies = [ [[package]] name = "num-conv" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050" [[package]] name = "num-traits" @@ -582,37 +655,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] -name = "ppv-lite86" -version = "0.2.21" +name = "prettyplease" +version = "0.2.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" dependencies = [ - "zerocopy", + "proc-macro2", + "syn", ] [[package]] name = "proc-macro2" -version = "1.0.105" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "535d180e0ecab6268a3e718bb9fd44db66bbbc256257165fc699dadf70d16fe7" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.43" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc74d9a594b72ae6656596548f56f667211f8a97b3d4c3d467150794690dc40a" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" dependencies = [ "proc-macro2", ] [[package]] name = "r-efi" -version = "5.3.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" [[package]] name = "rand" @@ -625,25 +699,16 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.2" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db2770f06117d490610c7488547d543617b21bfa07796d7a12f6f1bd53850d1" +checksum = "bc266eb313df6c5c09c1c7b1fbe2510961e5bcd3add930c1e31f7ed9da0feff8" dependencies = [ - "rand_chacha", - "rand_core 0.9.5", + "chacha20", + "getrandom", + "rand_core 0.10.0", "serde", ] -[[package]] -name = "rand_chacha" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" -dependencies = [ - "ppv-lite86", - "rand_core 0.9.5", -] - [[package]] name = "rand_core" version = "0.6.4" @@ -652,22 +717,18 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" [[package]] name = "rand_core" -version = "0.9.5" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" -dependencies = [ - "getrandom", - "serde", -] +checksum = "0c8d0fd677905edcbeedbf2edb6494d676f0e98d54d5cf9bda0b061cb8fb8aba" [[package]] name = "rand_distr" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8615d50dcf34fa31f7ab52692afec947c4dd0ab803cc87cb3b0b4570ff7463" +checksum = "4d431c2703ccf129de4d45253c03f49ebb22b97d6ad79ee3ecfc7e3f4862c1d8" dependencies = [ "num-traits", - "rand 0.9.2", + "rand 0.10.0", "serde", "serde_with", ] @@ -693,11 +754,31 @@ dependencies = [ "wasm_sync", ] +[[package]] +name = "ref-cast" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f354300ae66f76f1c85c5f84693f0ce81d747e2c3f21a45fef496d89c960bf7d" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7186006dcb21920990093f30e3dea63b7d6e977bf1256be20c3563a5db070da" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "regex" -version = "1.12.2" +version = "1.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" dependencies = [ "aho-corasick", "memchr", @@ -707,9 +788,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" dependencies = [ "aho-corasick", "memchr", @@ -718,9 +799,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" [[package]] name = "rustc-std-workspace-alloc" @@ -743,6 +824,36 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "schemars" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2b42f36aa1cd011945615b92222f6bf73c599a102a300334cd7f8dbeec726cc" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "semver" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" + [[package]] name = "serde" version = "1.0.228" @@ -788,17 +899,18 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.11.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" +checksum = "381b283ce7bc6b476d903296fb59d0d36633652b633b27f64db4fb46dcbfc3b9" dependencies = [ "base64", "chrono", "hex", "indexmap 1.9.3", "indexmap 2.13.0", - "serde", - "serde_derive", + "schemars 0.9.0", + "schemars 1.2.1", + "serde_core", "serde_json", "serde_with_macros", "time", @@ -806,9 +918,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.11.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" +checksum = "a6d4e30573c8cb306ed6ab1dca8423eec9a463ea0e155f45399455e0368b27e0" dependencies = [ "darling", "proc-macro2", @@ -830,9 +942,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "syn" -version = "2.0.114" +version = "2.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" dependencies = [ "proc-macro2", "quote", @@ -861,9 +973,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.45" +version = "0.3.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9e442fc33d7fdb45aa9bfeb312c095964abdf596f7567261062b2a7107aaabd" +checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" dependencies = [ "deranged", "itoa", @@ -876,15 +988,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b36ee98fd31ec7426d599183e8fe26932a8dc1fb76ddb6214d05493377d34ca" +checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" [[package]] name = "time-macros" -version = "0.2.25" +version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71e552d1249bf61ac2a52db88179fd0673def1e1ad8243a00d9ec9ed71fee3dd" +checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" dependencies = [ "num-conv", "time-core", @@ -902,9 +1014,15 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.22" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "walkdir" @@ -918,18 +1036,27 @@ dependencies = [ [[package]] name = "wasip2" -version = "1.0.1+wasi-0.2.4" +version = "1.0.2+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" dependencies = [ "wit-bindgen", ] [[package]] name = "wasm-bindgen" -version = "0.2.108" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566" +checksum = "6532f9a5c1ece3798cb1c2cfdba640b9b3ba884f5db45973a6f442510a87d38e" dependencies = [ "cfg-if", "once_cell", @@ -940,9 +1067,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.108" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608" +checksum = "18a2d50fcf105fb33bb15f00e7a77b772945a2ee45dcf454961fd843e74c18e6" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -950,9 +1077,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.108" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55" +checksum = "03ce4caeaac547cdf713d280eda22a730824dd11e6b8c3ca9e42247b25c631e3" dependencies = [ "bumpalo", "proc-macro2", @@ -963,13 +1090,35 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.108" +version = "0.2.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12" +checksum = "75a326b8c223ee17883a4251907455a2431acc2791c98c26279376490c378c16" dependencies = [ "unicode-ident", ] +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap 2.13.0", + "wasm-encoder", + "wasmparser", +] + [[package]] name = "wasm_sync" version = "0.1.2" @@ -981,11 +1130,23 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags", + "hashbrown 0.15.5", + "indexmap 2.13.0", + "semver", +] + [[package]] name = "web-sys" -version = "0.3.85" +version = "0.3.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598" +checksum = "854ba17bb104abfb26ba36da9729addc7ce7f06f5c0f90f3c391f8461cca21f9" dependencies = [ "js-sys", "wasm-bindgen", @@ -1092,24 +1253,106 @@ dependencies = [ [[package]] name = "wit-bindgen" -version = "0.46.0" +version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap 2.13.0", + "prettyplease", + "syn", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags", + "indexmap 2.13.0", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap 2.13.0", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] [[package]] name = "zerocopy" -version = "0.8.33" +version = "0.8.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668f5168d10b9ee831de31933dc111a459c97ec93225beb307aed970d1372dfd" +checksum = "a789c6e490b576db9f7e6b6d661bcc9799f7c0ac8352f56ea20193b2681532e5" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.33" +version = "0.8.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c7962b26b0a8685668b671ee4b54d007a67d4eaf05fda79ac0ecf41e32270f1" +checksum = "f65c489a7071a749c849713807783f70672b28094011623e200cb86dcb835953" dependencies = [ "proc-macro2", "quote", @@ -1118,6 +1361,6 @@ dependencies = [ [[package]] name = "zmij" -version = "1.0.16" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfcd145825aace48cff44a8844de64bf75feec3080e0aa5cdbde72961ae51a65" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/Cargo.toml b/Cargo.toml index bd7ab90..2118d60 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,81 +1,77 @@ -[workspace] -default-members = ["contained"] -members = [ - "contained", - "core", - "derive", - "macros", -] -resolver = "3" - -[workspace.package] -authors = [ - "FL03 (https://github.com/FL03)", -] -categories = [] -description = "contained works to provide several macros and interface for transparent wrapper types in Rust." -edition = "2024" -homepage = "https://github.com/FL03/contained/wiki" -keywords = ["macros", "transparent", "wrapper"] -license = "Apache-2.0" -readme = "README.md" -repository = "https://github.com/FL03/contained.git" -rust-version = "1.85.0" -version = "0.2.5" - -[workspace.dependencies] -contained = { default-features = false, path = "contained", version = "0.2.5" } -contained-core = { default-features = false, path = "core", version = "0.2.5" } -contained-derive = { default-features = false, path = "derive", version = "0.2.5" } -contained-macros = { default-features = false, path = "macros", version = "0.2.5" } -# development -criterion = { version = "0.8" } -# concurrency & parallelism -rayon-core = { default-features = false, version = "1" } -# data structures -hashbrown = { default-features = false, version = "0.16" } -# error handling -anyhow = { default-features = false, version = "1" } -thiserror = { default-features = false, version = "2" } -# math -num-complex = { default-features = false, version = "0.4" } -num-traits = { default-features = false, version = "0.2" } -# random -getrandom = { default-features = false, version = "0.3" } -rand = { default-features = false, version = "0.9" } -rand_core = { default-features = false, version = "0.9" } -rand_distr = { default-features = false, version = "0.5" } -# serialization -serde = { default-features = false, features = ["derive"], version = "1" } -serde_derive = { default-features = false, version = "1" } -serde_json = { default-features = false, version = "1" } -# macros & utilities -paste = { version = "1" } -strum = { default-features = false, features = ["derive"], version = "0.27" } -# WebAssembly -wasm-bindgen = { default-features = false, version = "0.2" } - -# ********* Profiles ********* -[profile.dev] -codegen-units = 256 -debug = true -debug-assertions = true -incremental = true -lto = "thin" -opt-level = 2 -overflow-checks = true -panic = "abort" -rpath = false -strip = false - -[profile.release] -codegen-units = 16 -debug = false -debug-assertions = false -incremental = false -lto = "fat" -opt-level = "z" -overflow-checks = false -panic = "abort" -rpath = false -strip = "debuginfo" +[workspace] +default-members = ["crates/contained"] +members = [ + "crates/*", +] +resolver = "3" + +[workspace.package] +authors = [ + "FL03 (https://github.com/FL03)", +] +categories = [] +description = "contained works to provide several macros and interface for transparent wrapper types in Rust." +edition = "2024" +homepage = "https://github.com/FL03/contained/wiki" +keywords = ["macros", "transparent", "wrapper"] +license = "Apache-2.0" +readme = "README.md" +repository = "https://github.com/FL03/contained.git" +rust-version = "1.91.0" +version = "0.2.5" + +[workspace.dependencies] +contained = { default-features = false, path = "crates/contained", version = "0.2.5" } +contained-core = { default-features = false, path = "crates/core", version = "0.2.5" } +contained-derive = { default-features = false, path = "crates/derive", version = "0.2.5" } +contained-macros = { default-features = false, path = "crates/macros", version = "0.2.5" } +# development +criterion = { version = "0.8" } +# concurrency & parallelism +rayon-core = { default-features = false, version = "1" } +# data structures +hashbrown = { default-features = false, version = "0.16" } +# error handling +anyhow = { default-features = false, version = "1" } +thiserror = { default-features = false, version = "2" } +# math +num-complex = { default-features = false, version = "0.4" } +num-traits = { default-features = false, version = "0.2" } +# random +getrandom = { default-features = false, version = "0.4" } +rand = { default-features = false, version = "0.10" } +rand_distr = { default-features = false, version = "0.6" } +# serialization +serde = { default-features = false, features = ["derive"], version = "1" } +serde_derive = { default-features = false, version = "1" } +serde_json = { default-features = false, version = "1" } +# macros & utilities +paste = { version = "1" } +strum = { default-features = false, features = ["derive"], version = "0.28" } +# WebAssembly +wasm-bindgen = { default-features = false, version = "0.2" } + +# ********* Profiles ********* +[profile.dev] +codegen-units = 256 +debug = true +debug-assertions = true +incremental = true +lto = "thin" +opt-level = 2 +overflow-checks = true +panic = "abort" +rpath = false +strip = false + +[profile.release] +codegen-units = 16 +debug = false +debug-assertions = false +incremental = false +lto = "fat" +opt-level = "z" +overflow-checks = false +panic = "abort" +rpath = false +strip = "debuginfo" diff --git a/clippy.toml b/clippy.toml index 57a4982..b76dea1 100644 --- a/clippy.toml +++ b/clippy.toml @@ -1 +1 @@ -msrv = "1.85.0" \ No newline at end of file +msrv = "1.91.0" \ No newline at end of file diff --git a/contained/Cargo.toml b/crates/contained/Cargo.toml similarity index 100% rename from contained/Cargo.toml rename to crates/contained/Cargo.toml diff --git a/contained/benches/default.rs b/crates/contained/benches/default.rs similarity index 100% rename from contained/benches/default.rs rename to crates/contained/benches/default.rs diff --git a/contained/build.rs b/crates/contained/build.rs similarity index 100% rename from contained/build.rs rename to crates/contained/build.rs diff --git a/contained/examples/derive.rs b/crates/contained/examples/derive.rs similarity index 100% rename from contained/examples/derive.rs rename to crates/contained/examples/derive.rs diff --git a/contained/examples/macros.rs b/crates/contained/examples/macros.rs similarity index 100% rename from contained/examples/macros.rs rename to crates/contained/examples/macros.rs diff --git a/contained/lib.rs b/crates/contained/lib.rs similarity index 100% rename from contained/lib.rs rename to crates/contained/lib.rs diff --git a/contained/tests/default.rs b/crates/contained/tests/default.rs similarity index 100% rename from contained/tests/default.rs rename to crates/contained/tests/default.rs diff --git a/contained/tests/format.rs b/crates/contained/tests/format.rs similarity index 100% rename from contained/tests/format.rs rename to crates/contained/tests/format.rs diff --git a/core/Cargo.toml b/crates/core/Cargo.toml similarity index 90% rename from core/Cargo.toml rename to crates/core/Cargo.toml index e6a3837..9488b29 100644 --- a/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -1,144 +1,144 @@ -[package] -build = "build.rs" -description = "The core crate for the contained project, providing essential abstractions and utilities." -name = "contained-core" - -authors.workspace = true -categories.workspace = true -edition.workspace = true -homepage.workspace = true -keywords.workspace = true -license.workspace = true -readme.workspace = true -repository.workspace = true -rust-version.workspace = true -version.workspace = true - -[package.metadata.docs.rs] -all-features = false -features = ["default"] -rustc-args = ["--cfg", "docsrs"] -version = "v{{version}}" - -[package.metadata.release] -no-dev-version = true -tag-name = "{{version}}" - -[lib] -bench = false - -[dependencies] -# concurrency & parallelism -rayon-core = { optional = true, workspace = true } -# data structures -hashbrown = { optional = true, workspace = true } -# mathematics -num-complex = { optional = true, workspace = true } -num-traits = { workspace = true } -# error handling -thiserror = { workspace = true } -# random -getrandom = { optional = true, workspace = true } -rand = { optional = true, workspace = true } -rand_distr = { optional = true, workspace = true } -# serialization -serde = { optional = true, features = ["derive"], workspace = true } -serde_derive = { optional = true, workspace = true } -serde_json = { optional = true, workspace = true } -# WebAssembly -wasm-bindgen = { optional = true, workspace = true } - -[features] -default = ["std"] - -full = [ - "default", - "complex", - "hashbrown", - "json", - "rand", - "serde", -] - -# ********* [FF] Features ********* -json = [ - "alloc", - "serde", - "serde_json", -] - -macros = [] - -nightly = [ - "hashbrown?/nightly", - "rand?/nightly", -] - -# ********* [FF] Environments ********* -std = [ - "alloc", - "getrandom?/std", - "hashbrown?/default", - "num-complex?/std", - "num-traits/std", - "rand?/std", - "rand?/std_rng", - "rand?/thread_rng", - "rand_distr?/std", - "serde?/std", - "serde_json?/std", - "thiserror/std", -] - -wasi = [] - -wasm = [ - "wasm_bindgen", - "getrandom?/wasm_js", - "rayon-core?/web_spin_lock", -] - -# ********* [FF] Dependencies ********* -alloc = [ - "hashbrown?/alloc", - "rand?/alloc", - "rand_distr?/alloc", - "serde?/alloc", - "serde_json?/alloc", -] - -complex = ["dep:num-complex"] - -hashbrown = ["dep:hashbrown"] - -rand = [ - "rng", - "dep:rand", - "dep:rand_distr", - "num-complex?/rand", -] - -rayon = [ - "dep:rayon-core", - "hashbrown?/rayon", -] - -rng = [ - "dep:getrandom", - "rand?/os_rng", - "rand?/small_rng", -] - -serde = [ - "dep:serde", - "dep:serde_derive", - "serde?/derive", - "hashbrown?/serde", - "num-complex?/serde", - "rand?/serde", - "rand_distr?/serde", -] - -serde_json = ["dep:serde_json"] - -wasm_bindgen = ["dep:wasm-bindgen"] +[package] +build = "build.rs" +description = "The core crate for the contained project, providing essential abstractions and utilities." +name = "contained-core" + +authors.workspace = true +categories.workspace = true +edition.workspace = true +homepage.workspace = true +keywords.workspace = true +license.workspace = true +readme.workspace = true +repository.workspace = true +rust-version.workspace = true +version.workspace = true + +[package.metadata.docs.rs] +all-features = false +features = ["default"] +rustc-args = ["--cfg", "docsrs"] +version = "v{{version}}" + +[package.metadata.release] +no-dev-version = true +tag-name = "{{version}}" + +[lib] +bench = false + +[dependencies] +# concurrency & parallelism +rayon-core = { optional = true, workspace = true } +# data structures +hashbrown = { optional = true, workspace = true } +# mathematics +num-complex = { optional = true, workspace = true } +num-traits = { workspace = true } +# error handling +thiserror = { workspace = true } +# random +getrandom = { optional = true, workspace = true } +rand = { optional = true, workspace = true } +rand_distr = { optional = true, workspace = true } +# serialization +serde = { optional = true, features = ["derive"], workspace = true } +serde_derive = { optional = true, workspace = true } +serde_json = { optional = true, workspace = true } +# WebAssembly +wasm-bindgen = { optional = true, workspace = true } + +[features] +default = ["std"] + +full = [ + "default", + "complex", + "hashbrown", + "json", + "rand", + "serde", +] + +# ********* [FF] Features ********* +json = [ + "alloc", + "serde", + "serde_json", +] + +macros = [] + +nightly = [ + "hashbrown?/nightly", +] + +# ********* [FF] Environments ********* +std = [ + "alloc", + "getrandom?/std", + "hashbrown?/default", + "num-complex?/std", + "num-traits/std", + "rand?/default", + "rand_distr?/std", + "serde?/std", + "serde_json?/std", + "thiserror/std", +] + +wasi = [ + "alloc", +] + +wasm = [ + "alloc", + "wasm_bindgen", + "getrandom?/wasm_js", + "rayon-core?/web_spin_lock", +] + +# ********* [FF] Dependencies ********* +alloc = [ + "hashbrown?/alloc", + "rand?/alloc", + "rand_distr?/alloc", + "serde?/alloc", + "serde_json?/alloc", +] + +complex = ["dep:num-complex"] + +hashbrown = ["dep:hashbrown"] + +rand = [ + "rng", + "dep:rand", + "dep:rand_distr", + "num-complex?/rand", +] + +rayon = [ + "dep:rayon-core", + "hashbrown?/rayon", +] + +rng = [ + "dep:getrandom", + "getrandom?/sys_rng", + "rand?/sys_rng", +] + +serde = [ + "dep:serde", + "dep:serde_derive", + "serde?/derive", + "hashbrown?/serde", + "num-complex?/serde", + "rand?/serde", + "rand_distr?/serde", +] + +serde_json = ["dep:serde_json"] + +wasm_bindgen = ["dep:wasm-bindgen"] diff --git a/core/build.rs b/crates/core/build.rs similarity index 100% rename from core/build.rs rename to crates/core/build.rs diff --git a/core/src/error.rs b/crates/core/src/error.rs similarity index 100% rename from core/src/error.rs rename to crates/core/src/error.rs diff --git a/core/src/lib.rs b/crates/core/src/lib.rs similarity index 100% rename from core/src/lib.rs rename to crates/core/src/lib.rs diff --git a/core/src/macros/format.rs b/crates/core/src/macros/format.rs similarity index 100% rename from core/src/macros/format.rs rename to crates/core/src/macros/format.rs diff --git a/core/src/macros/seal.rs b/crates/core/src/macros/seal.rs similarity index 100% rename from core/src/macros/seal.rs rename to crates/core/src/macros/seal.rs diff --git a/core/src/macros/wrapper.rs b/crates/core/src/macros/wrapper.rs similarity index 100% rename from core/src/macros/wrapper.rs rename to crates/core/src/macros/wrapper.rs diff --git a/core/src/traits/get.rs b/crates/core/src/traits/get.rs similarity index 100% rename from core/src/traits/get.rs rename to crates/core/src/traits/get.rs diff --git a/core/src/traits/wrapper.rs b/crates/core/src/traits/wrapper.rs similarity index 100% rename from core/src/traits/wrapper.rs rename to crates/core/src/traits/wrapper.rs diff --git a/core/tests/default.rs b/crates/core/tests/default.rs similarity index 100% rename from core/tests/default.rs rename to crates/core/tests/default.rs diff --git a/derive/Cargo.toml b/crates/derive/Cargo.toml similarity index 100% rename from derive/Cargo.toml rename to crates/derive/Cargo.toml diff --git a/derive/build.rs b/crates/derive/build.rs similarity index 100% rename from derive/build.rs rename to crates/derive/build.rs diff --git a/derive/src/attrs.rs b/crates/derive/src/attrs.rs similarity index 100% rename from derive/src/attrs.rs rename to crates/derive/src/attrs.rs diff --git a/derive/src/attrs/gsw.rs b/crates/derive/src/attrs/gsw.rs similarity index 100% rename from derive/src/attrs/gsw.rs rename to crates/derive/src/attrs/gsw.rs diff --git a/derive/src/attrs/gsw/impl_getter_attr.rs b/crates/derive/src/attrs/gsw/impl_getter_attr.rs similarity index 100% rename from derive/src/attrs/gsw/impl_getter_attr.rs rename to crates/derive/src/attrs/gsw/impl_getter_attr.rs diff --git a/derive/src/attrs/gsw/impl_gsw_attr.rs b/crates/derive/src/attrs/gsw/impl_gsw_attr.rs similarity index 100% rename from derive/src/attrs/gsw/impl_gsw_attr.rs rename to crates/derive/src/attrs/gsw/impl_gsw_attr.rs diff --git a/derive/src/attrs/gsw/impl_nested_gsw_attr.rs b/crates/derive/src/attrs/gsw/impl_nested_gsw_attr.rs similarity index 100% rename from derive/src/attrs/gsw/impl_nested_gsw_attr.rs rename to crates/derive/src/attrs/gsw/impl_nested_gsw_attr.rs diff --git a/derive/src/attrs/wrapper.rs b/crates/derive/src/attrs/wrapper.rs similarity index 100% rename from derive/src/attrs/wrapper.rs rename to crates/derive/src/attrs/wrapper.rs diff --git a/derive/src/attrs/wrapper/impl_display_attr.rs b/crates/derive/src/attrs/wrapper/impl_display_attr.rs similarity index 100% rename from derive/src/attrs/wrapper/impl_display_attr.rs rename to crates/derive/src/attrs/wrapper/impl_display_attr.rs diff --git a/derive/src/attrs/wrapper/impl_nested_attr.rs b/crates/derive/src/attrs/wrapper/impl_nested_attr.rs similarity index 100% rename from derive/src/attrs/wrapper/impl_nested_attr.rs rename to crates/derive/src/attrs/wrapper/impl_nested_attr.rs diff --git a/derive/src/attrs/wrapper/impl_wrapper_attr.rs b/crates/derive/src/attrs/wrapper/impl_wrapper_attr.rs similarity index 100% rename from derive/src/attrs/wrapper/impl_wrapper_attr.rs rename to crates/derive/src/attrs/wrapper/impl_wrapper_attr.rs diff --git a/derive/src/impls/gsw.rs b/crates/derive/src/impls/gsw.rs similarity index 100% rename from derive/src/impls/gsw.rs rename to crates/derive/src/impls/gsw.rs diff --git a/derive/src/impls/wrapper.rs b/crates/derive/src/impls/wrapper.rs similarity index 100% rename from derive/src/impls/wrapper.rs rename to crates/derive/src/impls/wrapper.rs diff --git a/derive/src/lib.rs b/crates/derive/src/lib.rs similarity index 100% rename from derive/src/lib.rs rename to crates/derive/src/lib.rs diff --git a/derive/tests/default.rs b/crates/derive/tests/default.rs similarity index 100% rename from derive/tests/default.rs rename to crates/derive/tests/default.rs diff --git a/derive/tests/wrapper.rs b/crates/derive/tests/wrapper.rs similarity index 100% rename from derive/tests/wrapper.rs rename to crates/derive/tests/wrapper.rs diff --git a/macros/Cargo.toml b/crates/macros/Cargo.toml similarity index 100% rename from macros/Cargo.toml rename to crates/macros/Cargo.toml diff --git a/macros/build.rs b/crates/macros/build.rs similarity index 100% rename from macros/build.rs rename to crates/macros/build.rs diff --git a/macros/src/ast/wrapper_impl_ast.rs b/crates/macros/src/ast/wrapper_impl_ast.rs similarity index 100% rename from macros/src/ast/wrapper_impl_ast.rs rename to crates/macros/src/ast/wrapper_impl_ast.rs diff --git a/macros/src/impls/binary.rs b/crates/macros/src/impls/binary.rs similarity index 100% rename from macros/src/impls/binary.rs rename to crates/macros/src/impls/binary.rs diff --git a/macros/src/impls/unary.rs b/crates/macros/src/impls/unary.rs similarity index 100% rename from macros/src/impls/unary.rs rename to crates/macros/src/impls/unary.rs diff --git a/macros/src/lib.rs b/crates/macros/src/lib.rs similarity index 100% rename from macros/src/lib.rs rename to crates/macros/src/lib.rs diff --git a/macros/tests/default.rs b/crates/macros/tests/default.rs similarity index 100% rename from macros/tests/default.rs rename to crates/macros/tests/default.rs diff --git a/macros/tests/ops.rs b/crates/macros/tests/ops.rs similarity index 100% rename from macros/tests/ops.rs rename to crates/macros/tests/ops.rs diff --git a/default.nix b/default.nix index 3cb2d2c..7a121f6 100644 --- a/default.nix +++ b/default.nix @@ -1,43 +1,47 @@ -{ pkgs, nixpkgs, system, makeRustPlatform, rust-overlay }: -let - rustPkgs = import nixpkgs { - inherit system; - overlays = [ (import rust-overlay) ]; - }; - - rustVersion = "1.85.0"; - wasmUnknownUknown = "wasm32-unknown-unknown"; - wasm32Wasi = "wasm32-wasi"; - - rustDefaultTarget = rustPkgs.rust-bin.stable.${rustVersion}.default; - - rustWithWasmTarget = rustPkgs.rust-bin.nightly.${rustVersion}.default.override { - targets = [ wasmUnknownUknown ]; - }; - - rustPlatform = makeRustPlatform { - cargo = rustDefaultTarget; - rustc = rustDefaultTarget; - }; - - rustPlatformWasm = makeRustPlatform { - cargo = rustWithWasmTarget; - rustc = rustWithWasmTarget; - }; - - common = { - version = "0.2.5"; - src = self; - - cargoLock = { - lockFile = ./Cargo.lock; - }; - - nativeBuildInputs = [ pkgs.pkg-config ]; - PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig"; - }; -in { - workspace = pkgs.rustPlatformWasm.buildRustPackage (common // { - cargoBuildFlags = "--release --workspace"; - }); +{ pkgs, nixpkgs, system, makeRustPlatform, rust-overlay }: +let + rustPkgs = import nixpkgs { + inherit system; + overlays = [ (import rust-overlay) ]; + }; + + rustVersion = "1.93.0"; + wasmUnknownUknown = "wasm32-unknown-unknown"; + wasm32Wasi = "wasm32-wasip2"; + + rustDefaultTarget = rustPkgs.rust-bin.stable.${rustVersion}.default; + + rustWithWasiTarget = rustPkgs.rust-bin.stable.${rustVersion}.default.override { + targets = [ wasm32Wasi ]; + }; + + rustWithWasmTarget = rustPkgs.rust-bin.stable.${rustVersion}.default.override { + targets = [ wasmUnknownUknown ]; + }; + + rustPlatform = makeRustPlatform { + cargo = rustDefaultTarget; + rustc = rustDefaultTarget; + }; + + rustPlatformWasm = makeRustPlatform { + cargo = rustWithWasmTarget; + rustc = rustWithWasmTarget; + }; + + common = { + version = "0.2.5"; + src = self; + + cargoLock = { + lockFile = ./Cargo.lock; + }; + + nativeBuildInputs = [ pkgs.pkg-config ]; + PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig"; + }; +in { + workspace = pkgs.rustPlatform.buildRustPackage (common // { + cargoBuildFlags = "--release --workspace --features full"; + }); } \ No newline at end of file diff --git a/flake.nix b/flake.nix index 008a008..10cf00d 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,6 @@ { - description = "A developmental environment for a Rust project using Nix flakes with direnv"; + description = + "A developmental environment for a Rust project using Nix flakes with direnv"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; @@ -20,24 +21,22 @@ packages.default = pkgs.rustPlatform.buildRustPackage { pname = "contained"; version = "0.2.5"; - src = self; # ./. - cargoLock = { - lockFile = ./Cargo.lock; - }; + src = self; # ./.; + cargoLock = { lockFile = ./Cargo.lock; }; }; devShells.default = pkgs.mkShell { buildInputs = [ rustToolchain - pkgs.cargo - pkgs.rust-analyzer pkgs.pkg-config pkgs.openssl + pkgs.cargo + pkgs.rust-analyzer + pkgs.aarch64-darwin.rstm ]; shellHook = '' export CARGO_HOME=$PWD/.cargo ''; }; - } - ); -} \ No newline at end of file + }); +} diff --git a/scripts/cmp.sh b/scripts/cmp.sh new file mode 100755 index 0000000..5aa7066 --- /dev/null +++ b/scripts/cmp.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +cargo component build --exclude pzzld-node --exclude pzzld-ppm "$@" diff --git a/scripts/nix.sh b/scripts/nix.sh index 0933d25..3feb896 100755 --- a/scripts/nix.sh +++ b/scripts/nix.sh @@ -1,3 +1,23 @@ -#! /usr/bin/bash +#!/bin/bash + +# flags for the script: +# --no-link: don't create a symlink to the result in the current directory +# -b or --build: build the package and create a symlink to the result in the current directory (default) + +[ "$1" = "--no-link" ] && no_link=true && shift +[ "$1" = "-b" ] && build_flag=true && shift +[ "$1" = "--build" ] && build_flag=true && shift + +if [ -n "$build_flag" ]; then + echo "Building the package and creating a symlink to the result in the current directory..." +else + echo "Building the package without creating a symlink to the result in the current directory..." +fi + +if [ -n "$build_flag" ]; then + nix --extra-experimental-features 'nix-command flakes' build --allow-dirty "$@" +else + nix --extra-experimental-features 'nix-command flakes' "$@" +fi + -nix --extra-experimental-features nix-command --extra-experimental-features flakes "$@" \ No newline at end of file