├── .github ├── release-drafter.yml └── workflows │ ├── ci.yml │ ├── publish.yml │ └── release-drafter.yml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE-APACHE ├── LICENSE-MIT ├── README.md ├── examples ├── async_list.rs ├── list.rs └── use_list.rs └── src ├── factory.rs ├── lazy.rs ├── lib.rs ├── list.rs ├── use_lazy.rs ├── use_lazy_async.rs ├── use_list.rs └── use_scroll_range.rs /.github/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name-template: "Release v$RESOLVED_VERSION 🦀" 2 | tag-template: "v$RESOLVED_VERSION" 3 | categories: 4 | - title: "🚀 Features" 5 | label: "feature" 6 | - title: "🐛 Bug Fixes" 7 | label: "bug" 8 | - title: "♻️ Refactor" 9 | label: "refactor" 10 | - title: "📝 Documentation" 11 | label: "documentation" 12 | - title: "🧰 Maintenance" 13 | labels: 14 | - "chore" 15 | - "dependencies" 16 | change-template: "- $TITLE @$AUTHOR (#$NUMBER)" 17 | change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. 18 | version-resolver: 19 | major: 20 | labels: 21 | - "major" 22 | minor: 23 | labels: 24 | - "minor" 25 | patch: 26 | labels: 27 | - "patch" 28 | default: patch 29 | template: | 30 | ## Changes 31 | 32 | $CHANGES 33 | autolabeler: 34 | - label: feature 35 | branch: 36 | - "/^feat(ure)?[/-].+/" 37 | - label: bug 38 | branch: 39 | - "/^fix[/-].+/" 40 | - label: refactor 41 | branch: 42 | - "/(refactor|refactoring)[/-].+/" 43 | - label: documentation 44 | branch: 45 | - "/doc(s|umentation)[/-].+/" 46 | - label: chore 47 | branch: 48 | - "/^chore[/-].+/" 49 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | workflow_dispatch: 5 | push: 6 | branches: [ "main" ] 7 | pull_request: 8 | 9 | env: 10 | CARGO_TERM_COLOR: always 11 | 12 | jobs: 13 | build_and_test: 14 | name: Rust project - latest 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/checkout@v3 18 | - name: Install the nightly toolchain 19 | uses: dtolnay/rust-toolchain@nightly 20 | - name: Install linux dependencies 21 | if: runner.os == 'Linux' 22 | run: | 23 | sudo apt update && sudo apt install build-essential libssl-dev pkg-config libglib2.0-dev libgtk-3-dev 24 | - run: cargo build --verbose 25 | - run: cargo test --verbose -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Cargo Publish 2 | 3 | on: 4 | release: 5 | types: [published] 6 | 7 | env: 8 | CARGO_TERM_COLOR: always 9 | 10 | jobs: 11 | publish: 12 | name: Publish to crate.io 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v3 16 | - run: cargo publish 17 | env: 18 | CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} 19 | -------------------------------------------------------------------------------- /.github/workflows/release-drafter.yml: -------------------------------------------------------------------------------- 1 | name: Release Drafter 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | # pull_request event is required only for autolabeler 8 | pull_request: 9 | # Only following types are handled by the action, but one can default to all as well 10 | types: [opened, reopened, synchronize] 11 | # pull_request_target event is required for autolabeler to support PRs from forks 12 | # pull_request_target: 13 | # types: [opened, reopened, synchronize] 14 | 15 | jobs: 16 | update_release_draft: 17 | permissions: 18 | contents: write 19 | runs-on: ubuntu-latest 20 | steps: 21 | - uses: release-drafter/release-drafter@v5 22 | env: 23 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /dist 3 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 4 4 | 5 | [[package]] 6 | name = "async-trait" 7 | version = "0.1.80" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" 10 | dependencies = [ 11 | "proc-macro2", 12 | "quote", 13 | "syn", 14 | ] 15 | 16 | [[package]] 17 | name = "autocfg" 18 | version = "1.3.0" 19 | source = "registry+https://github.com/rust-lang/crates.io-index" 20 | checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" 21 | 22 | [[package]] 23 | name = "base64" 24 | version = "0.22.1" 25 | source = "registry+https://github.com/rust-lang/crates.io-index" 26 | checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" 27 | 28 | [[package]] 29 | name = "bitflags" 30 | version = "2.5.0" 31 | source = "registry+https://github.com/rust-lang/crates.io-index" 32 | checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" 33 | 34 | [[package]] 35 | name = "block-buffer" 36 | version = "0.10.4" 37 | source = "registry+https://github.com/rust-lang/crates.io-index" 38 | checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" 39 | dependencies = [ 40 | "generic-array", 41 | ] 42 | 43 | [[package]] 44 | name = "bumpalo" 45 | version = "3.16.0" 46 | source = "registry+https://github.com/rust-lang/crates.io-index" 47 | checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" 48 | 49 | [[package]] 50 | name = "byteorder" 51 | version = "1.5.0" 52 | source = "registry+https://github.com/rust-lang/crates.io-index" 53 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 54 | 55 | [[package]] 56 | name = "bytes" 57 | version = "1.6.0" 58 | source = "registry+https://github.com/rust-lang/crates.io-index" 59 | checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" 60 | 61 | [[package]] 62 | name = "cfg-if" 63 | version = "1.0.0" 64 | source = "registry+https://github.com/rust-lang/crates.io-index" 65 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 66 | 67 | [[package]] 68 | name = "ciborium" 69 | version = "0.2.2" 70 | source = "registry+https://github.com/rust-lang/crates.io-index" 71 | checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" 72 | dependencies = [ 73 | "ciborium-io", 74 | "ciborium-ll", 75 | "serde", 76 | ] 77 | 78 | [[package]] 79 | name = "ciborium-io" 80 | version = "0.2.2" 81 | source = "registry+https://github.com/rust-lang/crates.io-index" 82 | checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" 83 | 84 | [[package]] 85 | name = "ciborium-ll" 86 | version = "0.2.2" 87 | source = "registry+https://github.com/rust-lang/crates.io-index" 88 | checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" 89 | dependencies = [ 90 | "ciborium-io", 91 | "half", 92 | ] 93 | 94 | [[package]] 95 | name = "console_error_panic_hook" 96 | version = "0.1.7" 97 | source = "registry+https://github.com/rust-lang/crates.io-index" 98 | checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" 99 | dependencies = [ 100 | "cfg-if", 101 | "wasm-bindgen", 102 | ] 103 | 104 | [[package]] 105 | name = "const-serialize" 106 | version = "0.6.0" 107 | source = "registry+https://github.com/rust-lang/crates.io-index" 108 | checksum = "d08edfb80c2a97c985743a0a3ca8f9fa330354681e2fe4f1c6027ee1222b34dc" 109 | dependencies = [ 110 | "const-serialize-macro", 111 | "serde", 112 | ] 113 | 114 | [[package]] 115 | name = "const-serialize-macro" 116 | version = "0.6.0" 117 | source = "registry+https://github.com/rust-lang/crates.io-index" 118 | checksum = "1cc9be2fb280bda7c4c2d8dda905f38ec64ec85436fd11a42dc67fdbd2f7bf4c" 119 | dependencies = [ 120 | "proc-macro2", 121 | "quote", 122 | "syn", 123 | ] 124 | 125 | [[package]] 126 | name = "const_format" 127 | version = "0.2.32" 128 | source = "registry+https://github.com/rust-lang/crates.io-index" 129 | checksum = "e3a214c7af3d04997541b18d432afaff4c455e79e2029079647e72fc2bd27673" 130 | dependencies = [ 131 | "const_format_proc_macros", 132 | ] 133 | 134 | [[package]] 135 | name = "const_format_proc_macros" 136 | version = "0.2.32" 137 | source = "registry+https://github.com/rust-lang/crates.io-index" 138 | checksum = "c7f6ff08fd20f4f299298a28e2dfa8a8ba1036e6cd2460ac1de7b425d76f2500" 139 | dependencies = [ 140 | "proc-macro2", 141 | "quote", 142 | "unicode-xid", 143 | ] 144 | 145 | [[package]] 146 | name = "convert_case" 147 | version = "0.6.0" 148 | source = "registry+https://github.com/rust-lang/crates.io-index" 149 | checksum = "ec182b0ca2f35d8fc196cf3404988fd8b8c739a4d270ff118a398feb0cbec1ca" 150 | dependencies = [ 151 | "unicode-segmentation", 152 | ] 153 | 154 | [[package]] 155 | name = "cpufeatures" 156 | version = "0.2.13" 157 | source = "registry+https://github.com/rust-lang/crates.io-index" 158 | checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" 159 | dependencies = [ 160 | "libc", 161 | ] 162 | 163 | [[package]] 164 | name = "crunchy" 165 | version = "0.2.2" 166 | source = "registry+https://github.com/rust-lang/crates.io-index" 167 | checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" 168 | 169 | [[package]] 170 | name = "crypto-common" 171 | version = "0.1.6" 172 | source = "registry+https://github.com/rust-lang/crates.io-index" 173 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 174 | dependencies = [ 175 | "generic-array", 176 | "typenum", 177 | ] 178 | 179 | [[package]] 180 | name = "darling" 181 | version = "0.20.9" 182 | source = "registry+https://github.com/rust-lang/crates.io-index" 183 | checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" 184 | dependencies = [ 185 | "darling_core", 186 | "darling_macro", 187 | ] 188 | 189 | [[package]] 190 | name = "darling_core" 191 | version = "0.20.9" 192 | source = "registry+https://github.com/rust-lang/crates.io-index" 193 | checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" 194 | dependencies = [ 195 | "fnv", 196 | "ident_case", 197 | "proc-macro2", 198 | "quote", 199 | "syn", 200 | ] 201 | 202 | [[package]] 203 | name = "darling_macro" 204 | version = "0.20.9" 205 | source = "registry+https://github.com/rust-lang/crates.io-index" 206 | checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" 207 | dependencies = [ 208 | "darling_core", 209 | "quote", 210 | "syn", 211 | ] 212 | 213 | [[package]] 214 | name = "dashmap" 215 | version = "5.5.3" 216 | source = "registry+https://github.com/rust-lang/crates.io-index" 217 | checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" 218 | dependencies = [ 219 | "cfg-if", 220 | "hashbrown", 221 | "lock_api", 222 | "once_cell", 223 | "parking_lot_core", 224 | ] 225 | 226 | [[package]] 227 | name = "data-encoding" 228 | version = "2.6.0" 229 | source = "registry+https://github.com/rust-lang/crates.io-index" 230 | checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" 231 | 232 | [[package]] 233 | name = "digest" 234 | version = "0.10.7" 235 | source = "registry+https://github.com/rust-lang/crates.io-index" 236 | checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" 237 | dependencies = [ 238 | "block-buffer", 239 | "crypto-common", 240 | ] 241 | 242 | [[package]] 243 | name = "dioxus" 244 | version = "0.6.0" 245 | source = "registry+https://github.com/rust-lang/crates.io-index" 246 | checksum = "16c89dda102f1ff3bbe54a8d3daa4cf5cae17595f54b6338e2c42593a994303a" 247 | dependencies = [ 248 | "dioxus-cli-config", 249 | "dioxus-config-macro", 250 | "dioxus-core", 251 | "dioxus-core-macro", 252 | "dioxus-devtools", 253 | "dioxus-document", 254 | "dioxus-fullstack", 255 | "dioxus-history", 256 | "dioxus-hooks", 257 | "dioxus-html", 258 | "dioxus-logger", 259 | "dioxus-signals", 260 | "dioxus-web", 261 | "manganis", 262 | ] 263 | 264 | [[package]] 265 | name = "dioxus-cli-config" 266 | version = "0.6.0" 267 | source = "registry+https://github.com/rust-lang/crates.io-index" 268 | checksum = "27a7caafe149ef8b1bb526ac7dfc6687a6b610a91a7fa8b9f9c2f64825538462" 269 | dependencies = [ 270 | "wasm-bindgen", 271 | ] 272 | 273 | [[package]] 274 | name = "dioxus-config-macro" 275 | version = "0.6.0" 276 | source = "registry+https://github.com/rust-lang/crates.io-index" 277 | checksum = "bfcfe6920e96c7f3aeb946479d49b46d253683aa05495c1c291891861e5a7978" 278 | dependencies = [ 279 | "proc-macro2", 280 | "quote", 281 | ] 282 | 283 | [[package]] 284 | name = "dioxus-core" 285 | version = "0.6.0" 286 | source = "registry+https://github.com/rust-lang/crates.io-index" 287 | checksum = "39093c4358bc8b6c80728f9cdc7e8854cdd8ecf8b932fa2864817f6df0103ff0" 288 | dependencies = [ 289 | "const_format", 290 | "dioxus-core-types", 291 | "futures-channel", 292 | "futures-util", 293 | "generational-box", 294 | "longest-increasing-subsequence", 295 | "rustc-hash", 296 | "rustversion", 297 | "serde", 298 | "slab", 299 | "slotmap", 300 | "tracing", 301 | "warnings", 302 | ] 303 | 304 | [[package]] 305 | name = "dioxus-core-macro" 306 | version = "0.6.0" 307 | source = "registry+https://github.com/rust-lang/crates.io-index" 308 | checksum = "59cb17b8f2cea9a43b34f70412b7d77ca4c78f696546cfa717837d98c7be4117" 309 | dependencies = [ 310 | "convert_case", 311 | "dioxus-rsx", 312 | "proc-macro2", 313 | "quote", 314 | "syn", 315 | ] 316 | 317 | [[package]] 318 | name = "dioxus-core-types" 319 | version = "0.6.0" 320 | source = "registry+https://github.com/rust-lang/crates.io-index" 321 | checksum = "5a6f64e5d70de1e1492bc845c1f99e3687195a6134598437be6186b768315aa0" 322 | dependencies = [ 323 | "once_cell", 324 | ] 325 | 326 | [[package]] 327 | name = "dioxus-devtools" 328 | version = "0.6.0" 329 | source = "registry+https://github.com/rust-lang/crates.io-index" 330 | checksum = "961ce08b113c43b0797ef61fb63f358c7303581dd2bf77521a540f361f253911" 331 | dependencies = [ 332 | "dioxus-core", 333 | "dioxus-devtools-types", 334 | "dioxus-signals", 335 | "serde", 336 | "serde_json", 337 | "tracing", 338 | "tungstenite", 339 | "warnings", 340 | ] 341 | 342 | [[package]] 343 | name = "dioxus-devtools-types" 344 | version = "0.6.0" 345 | source = "registry+https://github.com/rust-lang/crates.io-index" 346 | checksum = "97f6e0ad1964805c50eff72436be938f2c4b9cdc707d51b5548d4766ec2e2beb" 347 | dependencies = [ 348 | "dioxus-core", 349 | "serde", 350 | ] 351 | 352 | [[package]] 353 | name = "dioxus-document" 354 | version = "0.6.0" 355 | source = "registry+https://github.com/rust-lang/crates.io-index" 356 | checksum = "3543ab4217947ee27b86826d486e8e2889c6d271fb3ebe886b9c67081893951d" 357 | dependencies = [ 358 | "dioxus-core", 359 | "dioxus-core-macro", 360 | "dioxus-core-types", 361 | "dioxus-html", 362 | "futures-channel", 363 | "futures-util", 364 | "generational-box", 365 | "lazy-js-bundle", 366 | "serde", 367 | "serde_json", 368 | "tracing", 369 | ] 370 | 371 | [[package]] 372 | name = "dioxus-fullstack" 373 | version = "0.6.0" 374 | source = "registry+https://github.com/rust-lang/crates.io-index" 375 | checksum = "ffe83189fc0139a34a4cc195aa3eb917f5b6a3317bf3f4183d9e8f1e110a9bab" 376 | dependencies = [ 377 | "base64", 378 | "bytes", 379 | "ciborium", 380 | "dioxus-devtools", 381 | "dioxus-history", 382 | "dioxus-lib", 383 | "dioxus-web", 384 | "dioxus_server_macro", 385 | "futures-channel", 386 | "futures-util", 387 | "generational-box", 388 | "once_cell", 389 | "serde", 390 | "server_fn", 391 | "tracing", 392 | "web-sys", 393 | ] 394 | 395 | [[package]] 396 | name = "dioxus-history" 397 | version = "0.6.0" 398 | source = "registry+https://github.com/rust-lang/crates.io-index" 399 | checksum = "718e5bb9dfbdaef69f34a631b503c059594ed4d990225576c127d95ff43850ee" 400 | dependencies = [ 401 | "dioxus-core", 402 | "tracing", 403 | ] 404 | 405 | [[package]] 406 | name = "dioxus-hooks" 407 | version = "0.6.0" 408 | source = "registry+https://github.com/rust-lang/crates.io-index" 409 | checksum = "28dc7127b10fd8e50cec15510674c7852cfa44069cc3771ccace8130a29714b2" 410 | dependencies = [ 411 | "dioxus-core", 412 | "dioxus-signals", 413 | "futures-channel", 414 | "futures-util", 415 | "generational-box", 416 | "rustversion", 417 | "slab", 418 | "tracing", 419 | "warnings", 420 | ] 421 | 422 | [[package]] 423 | name = "dioxus-html" 424 | version = "0.6.0" 425 | source = "registry+https://github.com/rust-lang/crates.io-index" 426 | checksum = "e6464a7b8da0f7c63778ddb96c2a55c5e159c58aed07c582991654ba12356eb1" 427 | dependencies = [ 428 | "async-trait", 429 | "dioxus-core", 430 | "dioxus-core-macro", 431 | "dioxus-core-types", 432 | "dioxus-hooks", 433 | "dioxus-html-internal-macro", 434 | "enumset", 435 | "euclid", 436 | "futures-channel", 437 | "generational-box", 438 | "keyboard-types", 439 | "lazy-js-bundle", 440 | "rustversion", 441 | "tracing", 442 | ] 443 | 444 | [[package]] 445 | name = "dioxus-html-internal-macro" 446 | version = "0.6.0" 447 | source = "registry+https://github.com/rust-lang/crates.io-index" 448 | checksum = "7d6921c8f0374c8d2fc9024db455f9e1a71ba1b723d80c60ea5d575aea3de163" 449 | dependencies = [ 450 | "convert_case", 451 | "proc-macro2", 452 | "quote", 453 | "syn", 454 | ] 455 | 456 | [[package]] 457 | name = "dioxus-interpreter-js" 458 | version = "0.6.0" 459 | source = "registry+https://github.com/rust-lang/crates.io-index" 460 | checksum = "e9d9d868af71da85d1c1014ca254afd8b6cf2201f660581d3510517adbde5571" 461 | dependencies = [ 462 | "js-sys", 463 | "lazy-js-bundle", 464 | "rustc-hash", 465 | "sledgehammer_bindgen", 466 | "sledgehammer_utils", 467 | "wasm-bindgen", 468 | "wasm-bindgen-futures", 469 | "web-sys", 470 | ] 471 | 472 | [[package]] 473 | name = "dioxus-lazy" 474 | version = "0.3.0" 475 | dependencies = [ 476 | "console_error_panic_hook", 477 | "dioxus", 478 | "dioxus-logger", 479 | "dioxus-resize-observer", 480 | "dioxus-use-mounted", 481 | "futures", 482 | "log", 483 | "web-sys", 484 | ] 485 | 486 | [[package]] 487 | name = "dioxus-lib" 488 | version = "0.6.0" 489 | source = "registry+https://github.com/rust-lang/crates.io-index" 490 | checksum = "500725dbb131d35567a0e79a650644aea6e9b317206927507b77798578190b55" 491 | dependencies = [ 492 | "dioxus-config-macro", 493 | "dioxus-core", 494 | "dioxus-core-macro", 495 | "dioxus-document", 496 | "dioxus-history", 497 | "dioxus-hooks", 498 | "dioxus-html", 499 | "dioxus-rsx", 500 | "dioxus-signals", 501 | ] 502 | 503 | [[package]] 504 | name = "dioxus-logger" 505 | version = "0.6.0" 506 | source = "registry+https://github.com/rust-lang/crates.io-index" 507 | checksum = "86c9db554355b5418ce754c9a98482862f6f71ea1d87f00ee027cd081ad282e6" 508 | dependencies = [ 509 | "console_error_panic_hook", 510 | "dioxus-cli-config", 511 | "tracing", 512 | "tracing-subscriber", 513 | "tracing-wasm", 514 | ] 515 | 516 | [[package]] 517 | name = "dioxus-resize-observer" 518 | version = "0.3.0" 519 | source = "registry+https://github.com/rust-lang/crates.io-index" 520 | checksum = "3e53618d802425520849a0103dc09694899fbba71f214bab000bfa0e68db0d35" 521 | dependencies = [ 522 | "dioxus", 523 | "dioxus-use-mounted", 524 | "dioxus-web", 525 | "js-sys", 526 | "wasm-bindgen", 527 | "web-sys", 528 | ] 529 | 530 | [[package]] 531 | name = "dioxus-rsx" 532 | version = "0.6.0" 533 | source = "registry+https://github.com/rust-lang/crates.io-index" 534 | checksum = "f37fa830dd01a3b727fa145f5c10f45e0972434ee4d64270a3abb46da3dc78c4" 535 | dependencies = [ 536 | "proc-macro2", 537 | "proc-macro2-diagnostics", 538 | "quote", 539 | "syn", 540 | ] 541 | 542 | [[package]] 543 | name = "dioxus-signals" 544 | version = "0.6.0" 545 | source = "registry+https://github.com/rust-lang/crates.io-index" 546 | checksum = "1a8e2ac4e906dd26b25f7a9a7c7146cc27e670c793d5c34ef2b64b55f0135cd6" 547 | dependencies = [ 548 | "dioxus-core", 549 | "futures-channel", 550 | "futures-util", 551 | "generational-box", 552 | "once_cell", 553 | "parking_lot", 554 | "rustc-hash", 555 | "tracing", 556 | "warnings", 557 | ] 558 | 559 | [[package]] 560 | name = "dioxus-use-mounted" 561 | version = "0.3.0" 562 | source = "registry+https://github.com/rust-lang/crates.io-index" 563 | checksum = "4e9e2d11831ef5ce71cb3a86314863aeaf59e6949206363ef54f6754cee7c0d2" 564 | dependencies = [ 565 | "dioxus", 566 | ] 567 | 568 | [[package]] 569 | name = "dioxus-web" 570 | version = "0.6.0" 571 | source = "registry+https://github.com/rust-lang/crates.io-index" 572 | checksum = "57f6760fc88bd79c79eb2467b0661449dff5968320c3c6886c35c861ba05c695" 573 | dependencies = [ 574 | "async-trait", 575 | "ciborium", 576 | "dioxus-cli-config", 577 | "dioxus-core", 578 | "dioxus-core-types", 579 | "dioxus-devtools", 580 | "dioxus-document", 581 | "dioxus-history", 582 | "dioxus-html", 583 | "dioxus-interpreter-js", 584 | "dioxus-signals", 585 | "futures-channel", 586 | "futures-util", 587 | "generational-box", 588 | "js-sys", 589 | "lazy-js-bundle", 590 | "rustc-hash", 591 | "serde", 592 | "serde-wasm-bindgen", 593 | "serde_json", 594 | "tracing", 595 | "wasm-bindgen", 596 | "wasm-bindgen-futures", 597 | "web-sys", 598 | ] 599 | 600 | [[package]] 601 | name = "dioxus_server_macro" 602 | version = "0.6.0" 603 | source = "registry+https://github.com/rust-lang/crates.io-index" 604 | checksum = "1d63d9edbc70dc06393f0e23efff095fe4025010437648a048fa6208e1a6cdb1" 605 | dependencies = [ 606 | "proc-macro2", 607 | "quote", 608 | "server_fn_macro", 609 | "syn", 610 | ] 611 | 612 | [[package]] 613 | name = "enumset" 614 | version = "1.1.3" 615 | source = "registry+https://github.com/rust-lang/crates.io-index" 616 | checksum = "226c0da7462c13fb57e5cc9e0dc8f0635e7d27f276a3a7fd30054647f669007d" 617 | dependencies = [ 618 | "enumset_derive", 619 | ] 620 | 621 | [[package]] 622 | name = "enumset_derive" 623 | version = "0.8.1" 624 | source = "registry+https://github.com/rust-lang/crates.io-index" 625 | checksum = "e08b6c6ab82d70f08844964ba10c7babb716de2ecaeab9be5717918a5177d3af" 626 | dependencies = [ 627 | "darling", 628 | "proc-macro2", 629 | "quote", 630 | "syn", 631 | ] 632 | 633 | [[package]] 634 | name = "euclid" 635 | version = "0.22.10" 636 | source = "registry+https://github.com/rust-lang/crates.io-index" 637 | checksum = "e0f0eb73b934648cd7a4a61f1b15391cd95dab0b4da6e2e66c2a072c144b4a20" 638 | dependencies = [ 639 | "num-traits", 640 | ] 641 | 642 | [[package]] 643 | name = "fnv" 644 | version = "1.0.7" 645 | source = "registry+https://github.com/rust-lang/crates.io-index" 646 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 647 | 648 | [[package]] 649 | name = "form_urlencoded" 650 | version = "1.2.1" 651 | source = "registry+https://github.com/rust-lang/crates.io-index" 652 | checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" 653 | dependencies = [ 654 | "percent-encoding", 655 | ] 656 | 657 | [[package]] 658 | name = "futures" 659 | version = "0.3.31" 660 | source = "registry+https://github.com/rust-lang/crates.io-index" 661 | checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" 662 | dependencies = [ 663 | "futures-channel", 664 | "futures-core", 665 | "futures-executor", 666 | "futures-io", 667 | "futures-sink", 668 | "futures-task", 669 | "futures-util", 670 | ] 671 | 672 | [[package]] 673 | name = "futures-channel" 674 | version = "0.3.31" 675 | source = "registry+https://github.com/rust-lang/crates.io-index" 676 | checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" 677 | dependencies = [ 678 | "futures-core", 679 | "futures-sink", 680 | ] 681 | 682 | [[package]] 683 | name = "futures-core" 684 | version = "0.3.31" 685 | source = "registry+https://github.com/rust-lang/crates.io-index" 686 | checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" 687 | 688 | [[package]] 689 | name = "futures-executor" 690 | version = "0.3.31" 691 | source = "registry+https://github.com/rust-lang/crates.io-index" 692 | checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" 693 | dependencies = [ 694 | "futures-core", 695 | "futures-task", 696 | "futures-util", 697 | ] 698 | 699 | [[package]] 700 | name = "futures-io" 701 | version = "0.3.31" 702 | source = "registry+https://github.com/rust-lang/crates.io-index" 703 | checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" 704 | 705 | [[package]] 706 | name = "futures-macro" 707 | version = "0.3.31" 708 | source = "registry+https://github.com/rust-lang/crates.io-index" 709 | checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" 710 | dependencies = [ 711 | "proc-macro2", 712 | "quote", 713 | "syn", 714 | ] 715 | 716 | [[package]] 717 | name = "futures-sink" 718 | version = "0.3.31" 719 | source = "registry+https://github.com/rust-lang/crates.io-index" 720 | checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" 721 | 722 | [[package]] 723 | name = "futures-task" 724 | version = "0.3.31" 725 | source = "registry+https://github.com/rust-lang/crates.io-index" 726 | checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" 727 | 728 | [[package]] 729 | name = "futures-util" 730 | version = "0.3.31" 731 | source = "registry+https://github.com/rust-lang/crates.io-index" 732 | checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" 733 | dependencies = [ 734 | "futures-channel", 735 | "futures-core", 736 | "futures-io", 737 | "futures-macro", 738 | "futures-sink", 739 | "futures-task", 740 | "memchr", 741 | "pin-project-lite", 742 | "pin-utils", 743 | "slab", 744 | ] 745 | 746 | [[package]] 747 | name = "generational-box" 748 | version = "0.6.0" 749 | source = "registry+https://github.com/rust-lang/crates.io-index" 750 | checksum = "bbef36525d55a549ea17c1a33ddbd0dcfd153029e640c9eef845b24ae053dbed" 751 | dependencies = [ 752 | "parking_lot", 753 | "tracing", 754 | ] 755 | 756 | [[package]] 757 | name = "generic-array" 758 | version = "0.14.7" 759 | source = "registry+https://github.com/rust-lang/crates.io-index" 760 | checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" 761 | dependencies = [ 762 | "typenum", 763 | "version_check", 764 | ] 765 | 766 | [[package]] 767 | name = "getrandom" 768 | version = "0.2.15" 769 | source = "registry+https://github.com/rust-lang/crates.io-index" 770 | checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" 771 | dependencies = [ 772 | "cfg-if", 773 | "libc", 774 | "wasi", 775 | ] 776 | 777 | [[package]] 778 | name = "gloo-net" 779 | version = "0.5.0" 780 | source = "registry+https://github.com/rust-lang/crates.io-index" 781 | checksum = "43aaa242d1239a8822c15c645f02166398da4f8b5c4bae795c1f5b44e9eee173" 782 | dependencies = [ 783 | "futures-channel", 784 | "futures-core", 785 | "futures-sink", 786 | "gloo-utils", 787 | "http 0.2.12", 788 | "js-sys", 789 | "pin-project", 790 | "serde", 791 | "serde_json", 792 | "thiserror", 793 | "wasm-bindgen", 794 | "wasm-bindgen-futures", 795 | "web-sys", 796 | ] 797 | 798 | [[package]] 799 | name = "gloo-utils" 800 | version = "0.2.0" 801 | source = "registry+https://github.com/rust-lang/crates.io-index" 802 | checksum = "0b5555354113b18c547c1d3a98fbf7fb32a9ff4f6fa112ce823a21641a0ba3aa" 803 | dependencies = [ 804 | "js-sys", 805 | "serde", 806 | "serde_json", 807 | "wasm-bindgen", 808 | "web-sys", 809 | ] 810 | 811 | [[package]] 812 | name = "half" 813 | version = "2.4.1" 814 | source = "registry+https://github.com/rust-lang/crates.io-index" 815 | checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" 816 | dependencies = [ 817 | "cfg-if", 818 | "crunchy", 819 | ] 820 | 821 | [[package]] 822 | name = "hashbrown" 823 | version = "0.14.5" 824 | source = "registry+https://github.com/rust-lang/crates.io-index" 825 | checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" 826 | 827 | [[package]] 828 | name = "http" 829 | version = "0.2.12" 830 | source = "registry+https://github.com/rust-lang/crates.io-index" 831 | checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" 832 | dependencies = [ 833 | "bytes", 834 | "fnv", 835 | "itoa", 836 | ] 837 | 838 | [[package]] 839 | name = "http" 840 | version = "1.1.0" 841 | source = "registry+https://github.com/rust-lang/crates.io-index" 842 | checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" 843 | dependencies = [ 844 | "bytes", 845 | "fnv", 846 | "itoa", 847 | ] 848 | 849 | [[package]] 850 | name = "httparse" 851 | version = "1.9.4" 852 | source = "registry+https://github.com/rust-lang/crates.io-index" 853 | checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" 854 | 855 | [[package]] 856 | name = "ident_case" 857 | version = "1.0.1" 858 | source = "registry+https://github.com/rust-lang/crates.io-index" 859 | checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" 860 | 861 | [[package]] 862 | name = "idna" 863 | version = "0.5.0" 864 | source = "registry+https://github.com/rust-lang/crates.io-index" 865 | checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" 866 | dependencies = [ 867 | "unicode-bidi", 868 | "unicode-normalization", 869 | ] 870 | 871 | [[package]] 872 | name = "itoa" 873 | version = "1.0.11" 874 | source = "registry+https://github.com/rust-lang/crates.io-index" 875 | checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" 876 | 877 | [[package]] 878 | name = "js-sys" 879 | version = "0.3.72" 880 | source = "registry+https://github.com/rust-lang/crates.io-index" 881 | checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" 882 | dependencies = [ 883 | "wasm-bindgen", 884 | ] 885 | 886 | [[package]] 887 | name = "keyboard-types" 888 | version = "0.7.0" 889 | source = "registry+https://github.com/rust-lang/crates.io-index" 890 | checksum = "b750dcadc39a09dbadd74e118f6dd6598df77fa01df0cfcdc52c28dece74528a" 891 | dependencies = [ 892 | "bitflags", 893 | ] 894 | 895 | [[package]] 896 | name = "lazy-js-bundle" 897 | version = "0.6.0" 898 | source = "registry+https://github.com/rust-lang/crates.io-index" 899 | checksum = "703fcd40f2de720718e8b45a68bab510a4a8ee22484f75d0874b202f1eed5aa8" 900 | 901 | [[package]] 902 | name = "lazy_static" 903 | version = "1.4.0" 904 | source = "registry+https://github.com/rust-lang/crates.io-index" 905 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 906 | 907 | [[package]] 908 | name = "libc" 909 | version = "0.2.155" 910 | source = "registry+https://github.com/rust-lang/crates.io-index" 911 | checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" 912 | 913 | [[package]] 914 | name = "lock_api" 915 | version = "0.4.12" 916 | source = "registry+https://github.com/rust-lang/crates.io-index" 917 | checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" 918 | dependencies = [ 919 | "autocfg", 920 | "scopeguard", 921 | ] 922 | 923 | [[package]] 924 | name = "log" 925 | version = "0.4.22" 926 | source = "registry+https://github.com/rust-lang/crates.io-index" 927 | checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" 928 | 929 | [[package]] 930 | name = "longest-increasing-subsequence" 931 | version = "0.1.0" 932 | source = "registry+https://github.com/rust-lang/crates.io-index" 933 | checksum = "b3bd0dd2cd90571056fdb71f6275fada10131182f84899f4b2a916e565d81d86" 934 | 935 | [[package]] 936 | name = "manganis" 937 | version = "0.6.0" 938 | source = "registry+https://github.com/rust-lang/crates.io-index" 939 | checksum = "287c60ae66fb8a089e4c2c256079dd76e4f9cb147d352b3278ca352e8ed0bf02" 940 | dependencies = [ 941 | "const-serialize", 942 | "manganis-core", 943 | "manganis-macro", 944 | ] 945 | 946 | [[package]] 947 | name = "manganis-core" 948 | version = "0.6.0" 949 | source = "registry+https://github.com/rust-lang/crates.io-index" 950 | checksum = "c7b349d520edba475a760112e6105c55125d8ab1e94147b219fb2f2e3303fad9" 951 | dependencies = [ 952 | "const-serialize", 953 | "dioxus-cli-config", 954 | "dioxus-core-types", 955 | "serde", 956 | ] 957 | 958 | [[package]] 959 | name = "manganis-macro" 960 | version = "0.6.0" 961 | source = "registry+https://github.com/rust-lang/crates.io-index" 962 | checksum = "d7024fc969bf2f2fd874bcd0a5d6ae8f85a2853ba86773a024a744b32f716426" 963 | dependencies = [ 964 | "manganis-core", 965 | "proc-macro2", 966 | "quote", 967 | "syn", 968 | ] 969 | 970 | [[package]] 971 | name = "memchr" 972 | version = "2.7.2" 973 | source = "registry+https://github.com/rust-lang/crates.io-index" 974 | checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" 975 | 976 | [[package]] 977 | name = "num-traits" 978 | version = "0.2.19" 979 | source = "registry+https://github.com/rust-lang/crates.io-index" 980 | checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" 981 | dependencies = [ 982 | "autocfg", 983 | ] 984 | 985 | [[package]] 986 | name = "once_cell" 987 | version = "1.19.0" 988 | source = "registry+https://github.com/rust-lang/crates.io-index" 989 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 990 | 991 | [[package]] 992 | name = "parking_lot" 993 | version = "0.12.3" 994 | source = "registry+https://github.com/rust-lang/crates.io-index" 995 | checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" 996 | dependencies = [ 997 | "lock_api", 998 | "parking_lot_core", 999 | ] 1000 | 1001 | [[package]] 1002 | name = "parking_lot_core" 1003 | version = "0.9.10" 1004 | source = "registry+https://github.com/rust-lang/crates.io-index" 1005 | checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" 1006 | dependencies = [ 1007 | "cfg-if", 1008 | "libc", 1009 | "redox_syscall", 1010 | "smallvec", 1011 | "windows-targets", 1012 | ] 1013 | 1014 | [[package]] 1015 | name = "percent-encoding" 1016 | version = "2.3.1" 1017 | source = "registry+https://github.com/rust-lang/crates.io-index" 1018 | checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" 1019 | 1020 | [[package]] 1021 | name = "pin-project" 1022 | version = "1.1.5" 1023 | source = "registry+https://github.com/rust-lang/crates.io-index" 1024 | checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" 1025 | dependencies = [ 1026 | "pin-project-internal", 1027 | ] 1028 | 1029 | [[package]] 1030 | name = "pin-project-internal" 1031 | version = "1.1.5" 1032 | source = "registry+https://github.com/rust-lang/crates.io-index" 1033 | checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" 1034 | dependencies = [ 1035 | "proc-macro2", 1036 | "quote", 1037 | "syn", 1038 | ] 1039 | 1040 | [[package]] 1041 | name = "pin-project-lite" 1042 | version = "0.2.14" 1043 | source = "registry+https://github.com/rust-lang/crates.io-index" 1044 | checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" 1045 | 1046 | [[package]] 1047 | name = "pin-utils" 1048 | version = "0.1.0" 1049 | source = "registry+https://github.com/rust-lang/crates.io-index" 1050 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 1051 | 1052 | [[package]] 1053 | name = "ppv-lite86" 1054 | version = "0.2.20" 1055 | source = "registry+https://github.com/rust-lang/crates.io-index" 1056 | checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" 1057 | dependencies = [ 1058 | "zerocopy", 1059 | ] 1060 | 1061 | [[package]] 1062 | name = "proc-macro2" 1063 | version = "1.0.85" 1064 | source = "registry+https://github.com/rust-lang/crates.io-index" 1065 | checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" 1066 | dependencies = [ 1067 | "unicode-ident", 1068 | ] 1069 | 1070 | [[package]] 1071 | name = "proc-macro2-diagnostics" 1072 | version = "0.10.1" 1073 | source = "registry+https://github.com/rust-lang/crates.io-index" 1074 | checksum = "af066a9c399a26e020ada66a034357a868728e72cd426f3adcd35f80d88d88c8" 1075 | dependencies = [ 1076 | "proc-macro2", 1077 | "quote", 1078 | "syn", 1079 | "version_check", 1080 | ] 1081 | 1082 | [[package]] 1083 | name = "quote" 1084 | version = "1.0.36" 1085 | source = "registry+https://github.com/rust-lang/crates.io-index" 1086 | checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" 1087 | dependencies = [ 1088 | "proc-macro2", 1089 | ] 1090 | 1091 | [[package]] 1092 | name = "rand" 1093 | version = "0.8.5" 1094 | source = "registry+https://github.com/rust-lang/crates.io-index" 1095 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1096 | dependencies = [ 1097 | "libc", 1098 | "rand_chacha", 1099 | "rand_core", 1100 | ] 1101 | 1102 | [[package]] 1103 | name = "rand_chacha" 1104 | version = "0.3.1" 1105 | source = "registry+https://github.com/rust-lang/crates.io-index" 1106 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 1107 | dependencies = [ 1108 | "ppv-lite86", 1109 | "rand_core", 1110 | ] 1111 | 1112 | [[package]] 1113 | name = "rand_core" 1114 | version = "0.6.4" 1115 | source = "registry+https://github.com/rust-lang/crates.io-index" 1116 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 1117 | dependencies = [ 1118 | "getrandom", 1119 | ] 1120 | 1121 | [[package]] 1122 | name = "redox_syscall" 1123 | version = "0.5.1" 1124 | source = "registry+https://github.com/rust-lang/crates.io-index" 1125 | checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" 1126 | dependencies = [ 1127 | "bitflags", 1128 | ] 1129 | 1130 | [[package]] 1131 | name = "rustc-hash" 1132 | version = "1.1.0" 1133 | source = "registry+https://github.com/rust-lang/crates.io-index" 1134 | checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" 1135 | 1136 | [[package]] 1137 | name = "rustversion" 1138 | version = "1.0.17" 1139 | source = "registry+https://github.com/rust-lang/crates.io-index" 1140 | checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" 1141 | 1142 | [[package]] 1143 | name = "ryu" 1144 | version = "1.0.18" 1145 | source = "registry+https://github.com/rust-lang/crates.io-index" 1146 | checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" 1147 | 1148 | [[package]] 1149 | name = "scopeguard" 1150 | version = "1.2.0" 1151 | source = "registry+https://github.com/rust-lang/crates.io-index" 1152 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 1153 | 1154 | [[package]] 1155 | name = "send_wrapper" 1156 | version = "0.6.0" 1157 | source = "registry+https://github.com/rust-lang/crates.io-index" 1158 | checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" 1159 | dependencies = [ 1160 | "futures-core", 1161 | ] 1162 | 1163 | [[package]] 1164 | name = "serde" 1165 | version = "1.0.203" 1166 | source = "registry+https://github.com/rust-lang/crates.io-index" 1167 | checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" 1168 | dependencies = [ 1169 | "serde_derive", 1170 | ] 1171 | 1172 | [[package]] 1173 | name = "serde-wasm-bindgen" 1174 | version = "0.5.0" 1175 | source = "registry+https://github.com/rust-lang/crates.io-index" 1176 | checksum = "f3b143e2833c57ab9ad3ea280d21fd34e285a42837aeb0ee301f4f41890fa00e" 1177 | dependencies = [ 1178 | "js-sys", 1179 | "serde", 1180 | "wasm-bindgen", 1181 | ] 1182 | 1183 | [[package]] 1184 | name = "serde_derive" 1185 | version = "1.0.203" 1186 | source = "registry+https://github.com/rust-lang/crates.io-index" 1187 | checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" 1188 | dependencies = [ 1189 | "proc-macro2", 1190 | "quote", 1191 | "syn", 1192 | ] 1193 | 1194 | [[package]] 1195 | name = "serde_json" 1196 | version = "1.0.117" 1197 | source = "registry+https://github.com/rust-lang/crates.io-index" 1198 | checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" 1199 | dependencies = [ 1200 | "itoa", 1201 | "ryu", 1202 | "serde", 1203 | ] 1204 | 1205 | [[package]] 1206 | name = "serde_qs" 1207 | version = "0.12.0" 1208 | source = "registry+https://github.com/rust-lang/crates.io-index" 1209 | checksum = "0431a35568651e363364210c91983c1da5eb29404d9f0928b67d4ebcfa7d330c" 1210 | dependencies = [ 1211 | "percent-encoding", 1212 | "serde", 1213 | "thiserror", 1214 | ] 1215 | 1216 | [[package]] 1217 | name = "server_fn" 1218 | version = "0.6.12" 1219 | source = "registry+https://github.com/rust-lang/crates.io-index" 1220 | checksum = "b06e6e5467a2cd93ce1accfdfd8b859404f0b3b2041131ffd774fabf666b8219" 1221 | dependencies = [ 1222 | "bytes", 1223 | "const_format", 1224 | "dashmap", 1225 | "futures", 1226 | "gloo-net", 1227 | "http 1.1.0", 1228 | "js-sys", 1229 | "once_cell", 1230 | "send_wrapper", 1231 | "serde", 1232 | "serde_json", 1233 | "serde_qs", 1234 | "server_fn_macro_default", 1235 | "thiserror", 1236 | "url", 1237 | "wasm-bindgen", 1238 | "wasm-bindgen-futures", 1239 | "wasm-streams", 1240 | "web-sys", 1241 | "xxhash-rust", 1242 | ] 1243 | 1244 | [[package]] 1245 | name = "server_fn_macro" 1246 | version = "0.6.12" 1247 | source = "registry+https://github.com/rust-lang/crates.io-index" 1248 | checksum = "09c216bb1c1ac890151397643c663c875a1836adf0b269be4e389cb1b48c173c" 1249 | dependencies = [ 1250 | "const_format", 1251 | "convert_case", 1252 | "proc-macro2", 1253 | "quote", 1254 | "syn", 1255 | "xxhash-rust", 1256 | ] 1257 | 1258 | [[package]] 1259 | name = "server_fn_macro_default" 1260 | version = "0.6.12" 1261 | source = "registry+https://github.com/rust-lang/crates.io-index" 1262 | checksum = "00783df297ec85ea605779f2fef9cbec98981dffe2e01e1a9845c102ee1f1ae6" 1263 | dependencies = [ 1264 | "server_fn_macro", 1265 | "syn", 1266 | ] 1267 | 1268 | [[package]] 1269 | name = "sha1" 1270 | version = "0.10.6" 1271 | source = "registry+https://github.com/rust-lang/crates.io-index" 1272 | checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" 1273 | dependencies = [ 1274 | "cfg-if", 1275 | "cpufeatures", 1276 | "digest", 1277 | ] 1278 | 1279 | [[package]] 1280 | name = "sharded-slab" 1281 | version = "0.1.7" 1282 | source = "registry+https://github.com/rust-lang/crates.io-index" 1283 | checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" 1284 | dependencies = [ 1285 | "lazy_static", 1286 | ] 1287 | 1288 | [[package]] 1289 | name = "slab" 1290 | version = "0.4.9" 1291 | source = "registry+https://github.com/rust-lang/crates.io-index" 1292 | checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" 1293 | dependencies = [ 1294 | "autocfg", 1295 | ] 1296 | 1297 | [[package]] 1298 | name = "sledgehammer_bindgen" 1299 | version = "0.6.0" 1300 | source = "registry+https://github.com/rust-lang/crates.io-index" 1301 | checksum = "49e83e178d176459c92bc129cfd0958afac3ced925471b889b3a75546cfc4133" 1302 | dependencies = [ 1303 | "sledgehammer_bindgen_macro", 1304 | "wasm-bindgen", 1305 | ] 1306 | 1307 | [[package]] 1308 | name = "sledgehammer_bindgen_macro" 1309 | version = "0.6.0" 1310 | source = "registry+https://github.com/rust-lang/crates.io-index" 1311 | checksum = "33a1b4f13e2bbf2f5b29d09dfebc9de69229ffee245aed80e3b70f9b5fd28c06" 1312 | dependencies = [ 1313 | "quote", 1314 | "syn", 1315 | ] 1316 | 1317 | [[package]] 1318 | name = "sledgehammer_utils" 1319 | version = "0.3.1" 1320 | source = "registry+https://github.com/rust-lang/crates.io-index" 1321 | checksum = "debdd4b83524961983cea3c55383b3910fd2f24fd13a188f5b091d2d504a61ae" 1322 | dependencies = [ 1323 | "rustc-hash", 1324 | ] 1325 | 1326 | [[package]] 1327 | name = "slotmap" 1328 | version = "1.0.7" 1329 | source = "registry+https://github.com/rust-lang/crates.io-index" 1330 | checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" 1331 | dependencies = [ 1332 | "serde", 1333 | "version_check", 1334 | ] 1335 | 1336 | [[package]] 1337 | name = "smallvec" 1338 | version = "1.13.2" 1339 | source = "registry+https://github.com/rust-lang/crates.io-index" 1340 | checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" 1341 | 1342 | [[package]] 1343 | name = "syn" 1344 | version = "2.0.76" 1345 | source = "registry+https://github.com/rust-lang/crates.io-index" 1346 | checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" 1347 | dependencies = [ 1348 | "proc-macro2", 1349 | "quote", 1350 | "unicode-ident", 1351 | ] 1352 | 1353 | [[package]] 1354 | name = "thiserror" 1355 | version = "1.0.61" 1356 | source = "registry+https://github.com/rust-lang/crates.io-index" 1357 | checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" 1358 | dependencies = [ 1359 | "thiserror-impl", 1360 | ] 1361 | 1362 | [[package]] 1363 | name = "thiserror-impl" 1364 | version = "1.0.61" 1365 | source = "registry+https://github.com/rust-lang/crates.io-index" 1366 | checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" 1367 | dependencies = [ 1368 | "proc-macro2", 1369 | "quote", 1370 | "syn", 1371 | ] 1372 | 1373 | [[package]] 1374 | name = "thread_local" 1375 | version = "1.1.8" 1376 | source = "registry+https://github.com/rust-lang/crates.io-index" 1377 | checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" 1378 | dependencies = [ 1379 | "cfg-if", 1380 | "once_cell", 1381 | ] 1382 | 1383 | [[package]] 1384 | name = "tinyvec" 1385 | version = "1.6.0" 1386 | source = "registry+https://github.com/rust-lang/crates.io-index" 1387 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 1388 | dependencies = [ 1389 | "tinyvec_macros", 1390 | ] 1391 | 1392 | [[package]] 1393 | name = "tinyvec_macros" 1394 | version = "0.1.1" 1395 | source = "registry+https://github.com/rust-lang/crates.io-index" 1396 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 1397 | 1398 | [[package]] 1399 | name = "tracing" 1400 | version = "0.1.40" 1401 | source = "registry+https://github.com/rust-lang/crates.io-index" 1402 | checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" 1403 | dependencies = [ 1404 | "pin-project-lite", 1405 | "tracing-attributes", 1406 | "tracing-core", 1407 | ] 1408 | 1409 | [[package]] 1410 | name = "tracing-attributes" 1411 | version = "0.1.27" 1412 | source = "registry+https://github.com/rust-lang/crates.io-index" 1413 | checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" 1414 | dependencies = [ 1415 | "proc-macro2", 1416 | "quote", 1417 | "syn", 1418 | ] 1419 | 1420 | [[package]] 1421 | name = "tracing-core" 1422 | version = "0.1.32" 1423 | source = "registry+https://github.com/rust-lang/crates.io-index" 1424 | checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" 1425 | dependencies = [ 1426 | "once_cell", 1427 | ] 1428 | 1429 | [[package]] 1430 | name = "tracing-subscriber" 1431 | version = "0.3.18" 1432 | source = "registry+https://github.com/rust-lang/crates.io-index" 1433 | checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" 1434 | dependencies = [ 1435 | "sharded-slab", 1436 | "thread_local", 1437 | "tracing-core", 1438 | ] 1439 | 1440 | [[package]] 1441 | name = "tracing-wasm" 1442 | version = "0.2.1" 1443 | source = "registry+https://github.com/rust-lang/crates.io-index" 1444 | checksum = "4575c663a174420fa2d78f4108ff68f65bf2fbb7dd89f33749b6e826b3626e07" 1445 | dependencies = [ 1446 | "tracing", 1447 | "tracing-subscriber", 1448 | "wasm-bindgen", 1449 | ] 1450 | 1451 | [[package]] 1452 | name = "tungstenite" 1453 | version = "0.23.0" 1454 | source = "registry+https://github.com/rust-lang/crates.io-index" 1455 | checksum = "6e2e2ce1e47ed2994fd43b04c8f618008d4cabdd5ee34027cf14f9d918edd9c8" 1456 | dependencies = [ 1457 | "byteorder", 1458 | "bytes", 1459 | "data-encoding", 1460 | "http 1.1.0", 1461 | "httparse", 1462 | "log", 1463 | "rand", 1464 | "sha1", 1465 | "thiserror", 1466 | "utf-8", 1467 | ] 1468 | 1469 | [[package]] 1470 | name = "typenum" 1471 | version = "1.17.0" 1472 | source = "registry+https://github.com/rust-lang/crates.io-index" 1473 | checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" 1474 | 1475 | [[package]] 1476 | name = "unicode-bidi" 1477 | version = "0.3.15" 1478 | source = "registry+https://github.com/rust-lang/crates.io-index" 1479 | checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" 1480 | 1481 | [[package]] 1482 | name = "unicode-ident" 1483 | version = "1.0.12" 1484 | source = "registry+https://github.com/rust-lang/crates.io-index" 1485 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 1486 | 1487 | [[package]] 1488 | name = "unicode-normalization" 1489 | version = "0.1.23" 1490 | source = "registry+https://github.com/rust-lang/crates.io-index" 1491 | checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" 1492 | dependencies = [ 1493 | "tinyvec", 1494 | ] 1495 | 1496 | [[package]] 1497 | name = "unicode-segmentation" 1498 | version = "1.11.0" 1499 | source = "registry+https://github.com/rust-lang/crates.io-index" 1500 | checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" 1501 | 1502 | [[package]] 1503 | name = "unicode-xid" 1504 | version = "0.2.4" 1505 | source = "registry+https://github.com/rust-lang/crates.io-index" 1506 | checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" 1507 | 1508 | [[package]] 1509 | name = "url" 1510 | version = "2.5.0" 1511 | source = "registry+https://github.com/rust-lang/crates.io-index" 1512 | checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" 1513 | dependencies = [ 1514 | "form_urlencoded", 1515 | "idna", 1516 | "percent-encoding", 1517 | ] 1518 | 1519 | [[package]] 1520 | name = "utf-8" 1521 | version = "0.7.6" 1522 | source = "registry+https://github.com/rust-lang/crates.io-index" 1523 | checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" 1524 | 1525 | [[package]] 1526 | name = "version_check" 1527 | version = "0.9.4" 1528 | source = "registry+https://github.com/rust-lang/crates.io-index" 1529 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1530 | 1531 | [[package]] 1532 | name = "warnings" 1533 | version = "0.2.1" 1534 | source = "registry+https://github.com/rust-lang/crates.io-index" 1535 | checksum = "64f68998838dab65727c9b30465595c6f7c953313559371ca8bf31759b3680ad" 1536 | dependencies = [ 1537 | "pin-project", 1538 | "tracing", 1539 | "warnings-macro", 1540 | ] 1541 | 1542 | [[package]] 1543 | name = "warnings-macro" 1544 | version = "0.2.0" 1545 | source = "registry+https://github.com/rust-lang/crates.io-index" 1546 | checksum = "59195a1db0e95b920366d949ba5e0d3fc0e70b67c09be15ce5abb790106b0571" 1547 | dependencies = [ 1548 | "proc-macro2", 1549 | "quote", 1550 | "syn", 1551 | ] 1552 | 1553 | [[package]] 1554 | name = "wasi" 1555 | version = "0.11.0+wasi-snapshot-preview1" 1556 | source = "registry+https://github.com/rust-lang/crates.io-index" 1557 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1558 | 1559 | [[package]] 1560 | name = "wasm-bindgen" 1561 | version = "0.2.95" 1562 | source = "registry+https://github.com/rust-lang/crates.io-index" 1563 | checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" 1564 | dependencies = [ 1565 | "cfg-if", 1566 | "once_cell", 1567 | "wasm-bindgen-macro", 1568 | ] 1569 | 1570 | [[package]] 1571 | name = "wasm-bindgen-backend" 1572 | version = "0.2.95" 1573 | source = "registry+https://github.com/rust-lang/crates.io-index" 1574 | checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" 1575 | dependencies = [ 1576 | "bumpalo", 1577 | "log", 1578 | "once_cell", 1579 | "proc-macro2", 1580 | "quote", 1581 | "syn", 1582 | "wasm-bindgen-shared", 1583 | ] 1584 | 1585 | [[package]] 1586 | name = "wasm-bindgen-futures" 1587 | version = "0.4.42" 1588 | source = "registry+https://github.com/rust-lang/crates.io-index" 1589 | checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" 1590 | dependencies = [ 1591 | "cfg-if", 1592 | "js-sys", 1593 | "wasm-bindgen", 1594 | "web-sys", 1595 | ] 1596 | 1597 | [[package]] 1598 | name = "wasm-bindgen-macro" 1599 | version = "0.2.95" 1600 | source = "registry+https://github.com/rust-lang/crates.io-index" 1601 | checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" 1602 | dependencies = [ 1603 | "quote", 1604 | "wasm-bindgen-macro-support", 1605 | ] 1606 | 1607 | [[package]] 1608 | name = "wasm-bindgen-macro-support" 1609 | version = "0.2.95" 1610 | source = "registry+https://github.com/rust-lang/crates.io-index" 1611 | checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" 1612 | dependencies = [ 1613 | "proc-macro2", 1614 | "quote", 1615 | "syn", 1616 | "wasm-bindgen-backend", 1617 | "wasm-bindgen-shared", 1618 | ] 1619 | 1620 | [[package]] 1621 | name = "wasm-bindgen-shared" 1622 | version = "0.2.95" 1623 | source = "registry+https://github.com/rust-lang/crates.io-index" 1624 | checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" 1625 | 1626 | [[package]] 1627 | name = "wasm-streams" 1628 | version = "0.4.0" 1629 | source = "registry+https://github.com/rust-lang/crates.io-index" 1630 | checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" 1631 | dependencies = [ 1632 | "futures-util", 1633 | "js-sys", 1634 | "wasm-bindgen", 1635 | "wasm-bindgen-futures", 1636 | "web-sys", 1637 | ] 1638 | 1639 | [[package]] 1640 | name = "web-sys" 1641 | version = "0.3.72" 1642 | source = "registry+https://github.com/rust-lang/crates.io-index" 1643 | checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" 1644 | dependencies = [ 1645 | "js-sys", 1646 | "wasm-bindgen", 1647 | ] 1648 | 1649 | [[package]] 1650 | name = "windows-targets" 1651 | version = "0.52.6" 1652 | source = "registry+https://github.com/rust-lang/crates.io-index" 1653 | checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" 1654 | dependencies = [ 1655 | "windows_aarch64_gnullvm", 1656 | "windows_aarch64_msvc", 1657 | "windows_i686_gnu", 1658 | "windows_i686_gnullvm", 1659 | "windows_i686_msvc", 1660 | "windows_x86_64_gnu", 1661 | "windows_x86_64_gnullvm", 1662 | "windows_x86_64_msvc", 1663 | ] 1664 | 1665 | [[package]] 1666 | name = "windows_aarch64_gnullvm" 1667 | version = "0.52.6" 1668 | source = "registry+https://github.com/rust-lang/crates.io-index" 1669 | checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" 1670 | 1671 | [[package]] 1672 | name = "windows_aarch64_msvc" 1673 | version = "0.52.6" 1674 | source = "registry+https://github.com/rust-lang/crates.io-index" 1675 | checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" 1676 | 1677 | [[package]] 1678 | name = "windows_i686_gnu" 1679 | version = "0.52.6" 1680 | source = "registry+https://github.com/rust-lang/crates.io-index" 1681 | checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" 1682 | 1683 | [[package]] 1684 | name = "windows_i686_gnullvm" 1685 | version = "0.52.6" 1686 | source = "registry+https://github.com/rust-lang/crates.io-index" 1687 | checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" 1688 | 1689 | [[package]] 1690 | name = "windows_i686_msvc" 1691 | version = "0.52.6" 1692 | source = "registry+https://github.com/rust-lang/crates.io-index" 1693 | checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" 1694 | 1695 | [[package]] 1696 | name = "windows_x86_64_gnu" 1697 | version = "0.52.6" 1698 | source = "registry+https://github.com/rust-lang/crates.io-index" 1699 | checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" 1700 | 1701 | [[package]] 1702 | name = "windows_x86_64_gnullvm" 1703 | version = "0.52.6" 1704 | source = "registry+https://github.com/rust-lang/crates.io-index" 1705 | checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" 1706 | 1707 | [[package]] 1708 | name = "windows_x86_64_msvc" 1709 | version = "0.52.6" 1710 | source = "registry+https://github.com/rust-lang/crates.io-index" 1711 | checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" 1712 | 1713 | [[package]] 1714 | name = "xxhash-rust" 1715 | version = "0.8.10" 1716 | source = "registry+https://github.com/rust-lang/crates.io-index" 1717 | checksum = "927da81e25be1e1a2901d59b81b37dd2efd1fc9c9345a55007f09bf5a2d3ee03" 1718 | 1719 | [[package]] 1720 | name = "zerocopy" 1721 | version = "0.7.34" 1722 | source = "registry+https://github.com/rust-lang/crates.io-index" 1723 | checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" 1724 | dependencies = [ 1725 | "byteorder", 1726 | "zerocopy-derive", 1727 | ] 1728 | 1729 | [[package]] 1730 | name = "zerocopy-derive" 1731 | version = "0.7.34" 1732 | source = "registry+https://github.com/rust-lang/crates.io-index" 1733 | checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" 1734 | dependencies = [ 1735 | "proc-macro2", 1736 | "quote", 1737 | "syn", 1738 | ] 1739 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "dioxus-lazy" 3 | version = "0.3.0" 4 | edition = "2021" 5 | license = "MIT OR Apache-2.0" 6 | description = "Async list components for Dioxus" 7 | repository = "https://github.com/dioxus-community/dioxus-lazy" 8 | 9 | [dependencies] 10 | dioxus = { version = "0.6.0", features = ["web"] } 11 | dioxus-resize-observer = "0.3.0" 12 | dioxus-use-mounted = "0.3.0" 13 | log = "0.4.22" 14 | dioxus-logger = "0.6.0" 15 | web-sys = { version = "0.3.72", features = ["HtmlElement"] } 16 | futures = "0.3.31" 17 | 18 | [dev-dependencies] 19 | console_error_panic_hook = "0.1.7" 20 | -------------------------------------------------------------------------------- /LICENSE-APACHE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /LICENSE-MIT: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Matt Hunzinger 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dioxus-lazy 2 | 3 | [![License](https://img.shields.io/badge/license-MIT%2FApache-blue.svg)](https://github.com/dioxus-community/dioxus-lazy#license) 4 | [![Crates.io](https://img.shields.io/crates/v/dioxus-lazy.svg)](https://crates.io/crates/dioxus-lazy) 5 | [![Docs](https://docs.rs/dioxus-lazy/badge.svg)](https://docs.rs/cdk-builder/latest/dioxus-lazy) 6 | [![CI](https://github.com/dioxus-community/dioxus-lazy/workflows/CI/badge.svg)](https://github.com/dioxus-community/dioxus-lazy/actions) 7 | 8 | 9 | Virtualized components for dioxus 10 | 11 | ```rust 12 | use dioxus::prelude::*; 13 | use dioxus_lazy::{lazy, List}; 14 | 15 | fn app() -> Element { 16 | rsx! { 17 | List { 18 | len: 100, 19 | size: 400., 20 | item_size: 20., 21 | make_item: move |idx: &usize| rsx!("Item {*idx}"), 22 | make_value: lazy::from_fn(|idx| { idx }) 23 | } 24 | 25 | // Or with async! 26 | 27 | List { 28 | len: 100, 29 | size: 400., 30 | item_size: 20., 31 | make_item: move |idx: &usize| rsx!("Async item {*idx}"), 32 | make_value: lazy::from_async_fn(|idx| async move { idx }) 33 | } 34 | } 35 | } 36 | ``` 37 | 38 | ```rust 39 | use dioxus::prelude::*; 40 | use dioxus_lazy::{factory, Direction, UseList}; 41 | 42 | fn app() -> Element { 43 | let list = UseList::builder() 44 | .direction(Direction::Row) 45 | .size(500.) 46 | .use_list(cx, factory::from_fn(|idx| async move { idx })); 47 | 48 | rsx!(div { 49 | onmounted: move |event| list.mounted.onmounted(event) 50 | }) 51 | } 52 | ``` 53 | -------------------------------------------------------------------------------- /examples/async_list.rs: -------------------------------------------------------------------------------- 1 | use dioxus::prelude::*; 2 | use dioxus_lazy::{lazy, List}; 3 | use dioxus_logger::tracing::Level; 4 | 5 | fn app() -> Element { 6 | rsx! { 7 | List { 8 | len: 100, 9 | size: 400., 10 | item_size: 20., 11 | make_item: move |idx: &usize| rsx! { "Async item {*idx}" }, 12 | make_value: lazy::from_async_fn(|idx| async move { idx }) 13 | } 14 | } 15 | } 16 | 17 | fn main() { 18 | dioxus_logger::init(Level::INFO).unwrap(); 19 | console_error_panic_hook::set_once(); 20 | 21 | dioxus::launch(app); 22 | } 23 | -------------------------------------------------------------------------------- /examples/list.rs: -------------------------------------------------------------------------------- 1 | use dioxus::prelude::*; 2 | use dioxus_lazy::{lazy, List}; 3 | use dioxus_logger::tracing::Level; 4 | 5 | fn app() -> Element { 6 | rsx! { 7 | List { 8 | len: 100, 9 | size: 400., 10 | item_size: 20., 11 | make_item: move |idx: &usize| rsx! { "Item {*idx}" }, 12 | make_value: lazy::from_fn(|idx| { idx }) 13 | } 14 | } 15 | } 16 | 17 | fn main() { 18 | dioxus_logger::init(Level::INFO).unwrap(); 19 | console_error_panic_hook::set_once(); 20 | 21 | dioxus::launch(app); 22 | } 23 | -------------------------------------------------------------------------------- /examples/use_list.rs: -------------------------------------------------------------------------------- 1 | use dioxus::prelude::*; 2 | use dioxus_lazy::{lazy, Direction, UseList}; 3 | use dioxus_logger::tracing::Level; 4 | 5 | fn app() -> Element { 6 | let list = UseList::builder() 7 | .direction(Direction::Row) 8 | .size(500.) 9 | .use_list(lazy::from_async_fn(|idx| async move { idx })); 10 | 11 | rsx!(div { 12 | onmounted: move |event| list.mounted.onmounted(event) 13 | }) 14 | } 15 | 16 | fn main() { 17 | dioxus_logger::init(Level::INFO).unwrap(); 18 | console_error_panic_hook::set_once(); 19 | 20 | dioxus::launch(app); 21 | } 22 | -------------------------------------------------------------------------------- /src/factory.rs: -------------------------------------------------------------------------------- 1 | use futures::Future; 2 | use std::{ops::Range, pin::Pin}; 3 | 4 | pub trait Factory { 5 | type Item; 6 | type Output: IntoIterator; 7 | type Future: Future; 8 | 9 | fn make(&self, range: Range, is_rev: bool) -> Self::Future; 10 | } 11 | 12 | pub fn from_fn(f: F) -> FromFn 13 | where 14 | F: Fn(usize) -> Fut + Clone + 'static, 15 | Fut: Future + 'static, 16 | V: 'static, 17 | { 18 | FromFn { f } 19 | } 20 | 21 | #[derive(Clone, Copy)] 22 | pub struct FromFn { 23 | f: F, 24 | } 25 | 26 | impl Factory for FromFn 27 | where 28 | F: Fn(usize) -> Fut + Clone + 'static, 29 | Fut: Future + 'static, 30 | V: 'static, 31 | { 32 | type Item = V; 33 | type Output = std::vec::IntoIter; 34 | type Future = Pin>>; 35 | 36 | fn make(&self, range: Range, is_rev: bool) -> Self::Future { 37 | let f = self.f.clone(); 38 | Box::pin(async move { 39 | let mut values = Vec::new(); 40 | 41 | if is_rev { 42 | for idx in range.rev() { 43 | values.push(f(idx).await) 44 | } 45 | } else { 46 | for idx in range { 47 | values.push(f(idx).await) 48 | } 49 | } 50 | 51 | values.into_iter() 52 | }) 53 | } 54 | } 55 | 56 | pub fn from_range_fn(f: F) -> FromRangeFn 57 | where 58 | F: Fn(Range, bool) -> Fut + Clone + 'static, 59 | Fut: Future + 'static, 60 | I: IntoIterator, 61 | V: 'static, 62 | { 63 | FromRangeFn { f } 64 | } 65 | 66 | #[derive(Clone, Copy)] 67 | pub struct FromRangeFn { 68 | f: F, 69 | } 70 | 71 | impl Factory for FromRangeFn 72 | where 73 | F: Fn(Range, bool) -> Fut + Clone + 'static, 74 | Fut: Future + 'static, 75 | I: IntoIterator, 76 | V: 'static, 77 | { 78 | type Item = V; 79 | type Output = I; 80 | type Future = Pin>>; 81 | 82 | fn make(&self, input: Range, is_rev: bool) -> Self::Future { 83 | Box::pin((self.f)(input, is_rev)) 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /src/lazy.rs: -------------------------------------------------------------------------------- 1 | use crate::{factory, use_lazy, use_lazy_async, UseLazy, UseLazyAsync}; 2 | use dioxus::prelude::*; 3 | use futures::Future; 4 | use std::{collections::VecDeque, ops::Range}; 5 | 6 | pub trait Values: Clone { 7 | type Value; 8 | 9 | fn values(&self) -> Signal>; 10 | 11 | fn set(&mut self, range: Range); 12 | 13 | fn refresh(&mut self); 14 | } 15 | 16 | pub trait Lazy { 17 | type Value; 18 | type Values: Values; 19 | 20 | fn values(self) -> Self::Values; 21 | } 22 | 23 | pub fn from_fn(f: F) -> FromFn 24 | where 25 | F: FnMut(usize) -> V + 'static, 26 | V: 'static, 27 | { 28 | FromFn { f } 29 | } 30 | 31 | #[derive(Clone)] 32 | pub struct FromFn { 33 | f: F, 34 | } 35 | 36 | impl Lazy for FromFn 37 | where 38 | F: FnMut(usize) -> V + 'static, 39 | V: 'static, 40 | { 41 | type Value = V; 42 | type Values = UseLazy, bool) -> std::vec::IntoIter>, V>; 43 | 44 | fn values(mut self) -> Self::Values { 45 | use_lazy(Box::new(move |range, is_rev| { 46 | let mut values = Vec::new(); 47 | if is_rev { 48 | for idx in range.rev() { 49 | values.push((self.f)(idx)) 50 | } 51 | } else { 52 | for idx in range { 53 | values.push((self.f)(idx)) 54 | } 55 | } 56 | 57 | values.into_iter() 58 | })) 59 | } 60 | } 61 | 62 | pub struct FromRangeFn { 63 | f: F, 64 | } 65 | 66 | impl Lazy for FromRangeFn 67 | where 68 | F: FnMut(Range, bool) -> I + 'static, 69 | I: IntoIterator, 70 | V: 'static, 71 | { 72 | type Value = V; 73 | type Values = UseLazy; 74 | 75 | fn values(self) -> Self::Values { 76 | use_lazy(self.f) 77 | } 78 | } 79 | 80 | pub fn from_async_fn(f: F) -> FromAsyncFn 81 | where 82 | F: Fn(usize) -> Fut + Clone + 'static, 83 | Fut: Future + 'static, 84 | V: 'static, 85 | { 86 | FromAsyncFn { f } 87 | } 88 | 89 | #[derive(Clone, Copy)] 90 | pub struct FromAsyncFn { 91 | f: F, 92 | } 93 | 94 | impl Lazy for FromAsyncFn 95 | where 96 | F: Fn(usize) -> Fut + Clone + 'static, 97 | Fut: Future + 'static, 98 | V: 'static, 99 | { 100 | type Value = V; 101 | type Values = UseLazyAsync; 102 | 103 | fn values(self) -> Self::Values { 104 | use_lazy_async(factory::from_fn(self.f)) 105 | } 106 | } 107 | 108 | pub fn from_async_range_fn(f: F) -> FromAsyncRangeFn 109 | where 110 | F: Fn(Range, bool) -> Fut + Clone + 'static, 111 | Fut: Future + 'static, 112 | I: IntoIterator, 113 | V: 'static, 114 | { 115 | FromAsyncRangeFn { f } 116 | } 117 | 118 | #[derive(Clone, Copy)] 119 | pub struct FromAsyncRangeFn { 120 | f: F, 121 | } 122 | 123 | impl Lazy for FromAsyncRangeFn 124 | where 125 | F: Fn(Range, bool) -> Fut + Clone + 'static, 126 | Fut: Future + 'static, 127 | I: IntoIterator, 128 | V: 'static, 129 | { 130 | type Value = V; 131 | type Values = UseLazyAsync; 132 | 133 | fn values(self) -> Self::Values { 134 | use_lazy_async(factory::from_range_fn(self.f)) 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod factory; 2 | pub use factory::Factory; 3 | 4 | pub mod lazy; 5 | 6 | mod list; 7 | pub use list::{List, ListProps}; 8 | 9 | mod use_lazy; 10 | pub use use_lazy::{use_lazy, UseLazy}; 11 | 12 | mod use_lazy_async; 13 | pub use use_lazy_async::{use_lazy_async, UseLazyAsync}; 14 | 15 | pub mod use_list; 16 | pub use use_list::UseList; 17 | 18 | pub mod use_scroll_range; 19 | pub use use_scroll_range::UseScrollRange; 20 | 21 | #[derive(Clone, Copy, Debug, PartialEq, Eq)] 22 | pub enum Direction { 23 | Row, 24 | Column, 25 | } 26 | -------------------------------------------------------------------------------- /src/list.rs: -------------------------------------------------------------------------------- 1 | use crate::{ 2 | lazy::{Lazy, Values}, 3 | use_list::UseList, 4 | }; 5 | use dioxus::prelude::*; 6 | 7 | #[derive(Props, Clone)] 8 | pub struct ListProps 9 | where 10 | F: Clone, 11 | G: Clone, 12 | { 13 | /// Length of the list. 14 | pub len: usize, 15 | 16 | /// Size of the container. 17 | pub size: f64, 18 | 19 | /// Size of each item. 20 | pub item_size: f64, 21 | 22 | /// Function to create a new item. 23 | pub make_item: F, 24 | 25 | /// Function to create a new value. 26 | pub make_value: G, 27 | 28 | /// Event handler for scroll events. 29 | pub onscroll: Option, 30 | } 31 | 32 | impl PartialEq for ListProps 33 | where 34 | F: Clone, 35 | G: Clone, 36 | { 37 | fn eq(&self, other: &Self) -> bool { 38 | self.len == other.len 39 | && self.size == other.size 40 | && self.item_size == other.item_size 41 | && self.onscroll == other.onscroll 42 | } 43 | } 44 | 45 | /// Virtualized list component. 46 | #[allow(non_snake_case)] 47 | pub fn List(props: ListProps) -> Element 48 | where 49 | T: 'static, 50 | F: Clone + 'static + Fn(&T) -> Element, 51 | G: Clone + Lazy + Clone + 'static, 52 | { 53 | let mut list = UseList::builder() 54 | .len(props.len) 55 | .size(props.size) 56 | .item_size(props.item_size) 57 | .use_list(props.make_value.clone()); 58 | 59 | let values_signal = list.lazy.values(); 60 | let values_ref = values_signal.read(); 61 | let rows = values_ref.iter().enumerate().map(move |(idx, value)| { 62 | let top = (list.scroll_range.start() + idx) as f64 * *list.scroll_range.item_size.read(); 63 | rsx!( 64 | div { 65 | key: "{top}", 66 | position: "absolute", 67 | top: "{top}px", 68 | left: 0, 69 | width: "100%", 70 | height: "{list.scroll_range.item_size}px", 71 | overflow: "hidden", 72 | {(props.make_item)(value)} 73 | } 74 | ) 75 | }); 76 | 77 | let size = *list.scroll_range.size.read(); 78 | let inner_size = list.scroll_range.item_size * props.len as f64; 79 | rsx!( 80 | div { 81 | height: "{size}px", 82 | overflow: "scroll", 83 | onmounted: move |event| list.mounted.onmounted(event), 84 | onscroll: move |_| { 85 | list.scroll(); 86 | if let Some(handler) = &props.onscroll { 87 | handler.call(()) 88 | } 89 | }, 90 | div { 91 | position: "relative", 92 | height: "{inner_size}px", 93 | overflow: "hidden", 94 | {rows} 95 | } 96 | } 97 | ) 98 | } 99 | -------------------------------------------------------------------------------- /src/use_lazy.rs: -------------------------------------------------------------------------------- 1 | use crate::lazy::Values; 2 | use dioxus::prelude::*; 3 | use std::{cmp::Ordering, collections::VecDeque, ops::Range}; 4 | 5 | pub fn use_lazy(make_value: F) -> UseLazy 6 | where 7 | F: FnMut(Range, bool) -> I + 'static, 8 | I: IntoIterator, 9 | { 10 | let values = use_signal(|| VecDeque::new()); 11 | let range = use_signal(|| 0..0); 12 | 13 | UseLazy { 14 | make_value: CopyValue::new(make_value), 15 | values, 16 | range, 17 | } 18 | } 19 | 20 | pub struct UseLazy { 21 | pub values: Signal>, 22 | make_value: CopyValue, 23 | range: Signal>, 24 | } 25 | 26 | impl Values for UseLazy 27 | where 28 | F: FnMut(Range, bool) -> I + 'static, 29 | I: IntoIterator, 30 | { 31 | type Value = V; 32 | 33 | fn values(&self) -> Signal> { 34 | self.values 35 | } 36 | 37 | fn set(&mut self, range: Range) { 38 | let mut last = self.range.write(); 39 | let mut values = self.values; 40 | 41 | match range.start.cmp(&last.start) { 42 | Ordering::Less => { 43 | let mut rows_ref = values.write(); 44 | let values = (self.make_value).write()(range.start..last.start, true); 45 | for value in values.into_iter() { 46 | rows_ref.push_front(value); 47 | } 48 | } 49 | Ordering::Greater => { 50 | let mut rows_ref = values.write(); 51 | for _ in 0..range.start - last.start { 52 | rows_ref.pop_front(); 53 | } 54 | } 55 | Ordering::Equal => {} 56 | } 57 | 58 | if range.start != range.end { 59 | match range.end.cmp(&last.end) { 60 | Ordering::Greater => { 61 | let mut rows_ref = values.write(); 62 | let values = (self.make_value).write()(last.end..range.end, false); 63 | for value in values.into_iter() { 64 | rows_ref.push_back(value); 65 | } 66 | } 67 | Ordering::Less => { 68 | let mut rows_ref = values.write(); 69 | for _ in 0..last.end - range.end { 70 | rows_ref.pop_back(); 71 | } 72 | } 73 | Ordering::Equal => {} 74 | } 75 | } 76 | 77 | *last = range; 78 | } 79 | 80 | fn refresh(&mut self) { 81 | let last = self.range.read(); 82 | let mut values_ref = self.values.write(); 83 | values_ref.clear(); 84 | 85 | let values = (self.make_value).write()(last.start..last.end, false); 86 | for value in values.into_iter() { 87 | values_ref.push_back(value); 88 | } 89 | } 90 | } 91 | 92 | impl Clone for UseLazy { 93 | fn clone(&self) -> Self { 94 | *self 95 | } 96 | } 97 | 98 | impl Copy for UseLazy {} 99 | 100 | impl PartialEq for UseLazy { 101 | fn eq(&self, other: &Self) -> bool { 102 | self.values == other.values 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /src/use_lazy_async.rs: -------------------------------------------------------------------------------- 1 | use crate::{lazy::Values, Factory}; 2 | use dioxus::prelude::*; 3 | use futures::StreamExt; 4 | use std::{cmp::Ordering, collections::VecDeque, ops::Range, rc::Rc}; 5 | 6 | enum Message { 7 | Range(Range), 8 | Refresh, 9 | } 10 | 11 | pub fn use_lazy_async(make_value: F) -> UseLazyAsync 12 | where 13 | F: Factory + 'static, 14 | { 15 | let mut values = use_signal(VecDeque::new); 16 | 17 | let last = 0..0; 18 | let make_value = Rc::new(make_value); 19 | 20 | let task = use_coroutine(move |mut rx| { 21 | let mut last = last.clone(); 22 | let make_value = make_value.clone(); 23 | 24 | async move { 25 | while let Some(msg) = rx.next().await { 26 | match msg { 27 | Message::Range(range) => { 28 | match range.start.cmp(&last.start) { 29 | Ordering::Less => { 30 | let mut rows_ref = values.write(); 31 | let values = make_value.make(range.start..last.start, true).await; 32 | for value in values.into_iter() { 33 | rows_ref.push_front(value); 34 | } 35 | } 36 | Ordering::Greater => { 37 | let mut rows_ref = values.write(); 38 | for _ in 0..range.start - last.start { 39 | rows_ref.pop_front(); 40 | } 41 | } 42 | Ordering::Equal => {} 43 | } 44 | 45 | if range.start != range.end { 46 | match range.end.cmp(&last.end) { 47 | Ordering::Greater => { 48 | let mut rows_ref = values.write(); 49 | let values = make_value.make(last.end..range.end, false).await; 50 | for value in values.into_iter() { 51 | rows_ref.push_back(value); 52 | } 53 | } 54 | Ordering::Less => { 55 | let mut rows_ref = values.write(); 56 | for _ in 0..last.end - range.end { 57 | rows_ref.pop_back(); 58 | } 59 | } 60 | Ordering::Equal => {} 61 | } 62 | } 63 | 64 | last = range; 65 | } 66 | Message::Refresh => { 67 | let mut rows_ref = values.write(); 68 | rows_ref.clear(); 69 | 70 | let values = make_value.make(last.clone(), false).await; 71 | for value in values.into_iter() { 72 | rows_ref.push_back(value); 73 | } 74 | } 75 | } 76 | } 77 | } 78 | }); 79 | 80 | UseLazyAsync { 81 | task: CopyValue::new(task), 82 | values, 83 | } 84 | } 85 | 86 | pub struct UseLazyAsync { 87 | pub values: Signal>, 88 | task: CopyValue>, 89 | } 90 | 91 | impl Values for UseLazyAsync { 92 | type Value = V; 93 | 94 | fn values(&self) -> Signal> { 95 | self.values 96 | } 97 | 98 | fn set(&mut self, range: Range) { 99 | self.task.read().send(Message::Range(range)) 100 | } 101 | 102 | fn refresh(&mut self) { 103 | self.task.read().send(Message::Refresh) 104 | } 105 | } 106 | 107 | impl Clone for UseLazyAsync { 108 | fn clone(&self) -> Self { 109 | *self 110 | } 111 | } 112 | 113 | impl Copy for UseLazyAsync {} 114 | 115 | impl PartialEq for UseLazyAsync { 116 | fn eq(&self, other: &Self) -> bool { 117 | self.values == other.values && self.task == other.task 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /src/use_list.rs: -------------------------------------------------------------------------------- 1 | use crate::{ 2 | lazy::{Lazy, Values}, 3 | Direction, UseScrollRange, 4 | }; 5 | use dioxus::{prelude::*, web::WebEventExt}; 6 | use dioxus_use_mounted::{use_mounted, UseMounted}; 7 | use std::marker::PhantomData; 8 | 9 | struct Inner { 10 | direction: Direction, 11 | len: usize, 12 | size: f64, 13 | item_size: f64, 14 | } 15 | 16 | pub struct Builder { 17 | inner: Option, 18 | _marker: PhantomData, 19 | } 20 | 21 | impl Builder { 22 | pub fn direction(&mut self, direction: Direction) -> &mut Self { 23 | self.inner.as_mut().unwrap().direction = direction; 24 | self 25 | } 26 | 27 | pub fn len(&mut self, len: usize) -> &mut Self { 28 | self.inner.as_mut().unwrap().len = len; 29 | self 30 | } 31 | 32 | pub fn size(&mut self, size: f64) -> &mut Self { 33 | self.inner.as_mut().unwrap().size = size; 34 | self 35 | } 36 | 37 | pub fn item_size(&mut self, item_size: f64) -> &mut Self { 38 | self.inner.as_mut().unwrap().item_size = item_size; 39 | self 40 | } 41 | 42 | pub fn use_list(&mut self, make_value: F) -> UseList 43 | where 44 | F: Lazy, 45 | { 46 | let mounted = use_mounted(); 47 | let lazy = make_value.values(); 48 | 49 | let inner = self.inner.take().unwrap(); 50 | let mut lazy_clone = lazy.clone(); 51 | let scroll_range = UseScrollRange::builder() 52 | .size(inner.size) 53 | .item_size(inner.item_size) 54 | .len(inner.len) 55 | .use_scroll_range(move |range| lazy_clone.set(range)); 56 | 57 | UseList { 58 | mounted, 59 | scroll_range, 60 | lazy, 61 | } 62 | } 63 | } 64 | 65 | pub struct UseList { 66 | pub mounted: UseMounted, 67 | pub scroll_range: UseScrollRange, 68 | pub lazy: T, 69 | } 70 | 71 | impl UseList { 72 | pub fn builder() -> Builder { 73 | Builder { 74 | inner: Some(Inner { 75 | direction: Direction::Row, 76 | len: 0, 77 | size: 400., 78 | item_size: 20., 79 | }), 80 | _marker: PhantomData, 81 | } 82 | } 83 | 84 | pub fn scroll(&mut self) { 85 | if let Some(mounted) = self.mounted.signal.read().as_deref() { 86 | let elem = mounted.try_as_web_event().unwrap(); 87 | self.scroll_range.scroll.set(elem.scroll_top()); 88 | } 89 | } 90 | } 91 | 92 | impl Clone for UseList { 93 | fn clone(&self) -> Self { 94 | Self { 95 | mounted: self.mounted, 96 | scroll_range: self.scroll_range, 97 | lazy: self.lazy.clone(), 98 | } 99 | } 100 | } 101 | 102 | impl Copy for UseList {} 103 | 104 | impl PartialEq for UseList { 105 | fn eq(&self, other: &Self) -> bool { 106 | self.mounted == other.mounted 107 | && self.scroll_range == other.scroll_range 108 | && self.lazy == other.lazy 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /src/use_scroll_range.rs: -------------------------------------------------------------------------------- 1 | use crate::Direction; 2 | use dioxus::prelude::*; 3 | use std::ops::Range; 4 | 5 | struct Inner { 6 | direction: Direction, 7 | len: usize, 8 | size: f64, 9 | item_size: f64, 10 | } 11 | 12 | pub struct Builder { 13 | inner: Option, 14 | } 15 | 16 | impl Builder { 17 | pub fn direction(&mut self, direction: Direction) -> &mut Self { 18 | self.inner.as_mut().unwrap().direction = direction; 19 | self 20 | } 21 | 22 | pub fn len(&mut self, len: usize) -> &mut Self { 23 | self.inner.as_mut().unwrap().len = len; 24 | self 25 | } 26 | 27 | pub fn size(&mut self, size: f64) -> &mut Self { 28 | self.inner.as_mut().unwrap().size = size; 29 | self 30 | } 31 | 32 | pub fn item_size(&mut self, item_size: f64) -> &mut Self { 33 | self.inner.as_mut().unwrap().item_size = item_size; 34 | self 35 | } 36 | 37 | pub fn use_scroll_range( 38 | &mut self, 39 | mut onscroll: impl FnMut(Range) + 'static, 40 | ) -> UseScrollRange { 41 | let inner = self.inner.take().unwrap(); 42 | let len = inner.len; 43 | let size = use_effect_signal(inner.size); 44 | let item_size = use_effect_signal(inner.item_size); 45 | let scroll = use_signal(|| 0); 46 | 47 | use_effect(move || { 48 | let item_height = item_size(); 49 | let top_row = (scroll() as f64 / item_height).floor() as usize; 50 | let total_rows = (size() / item_height).floor() as usize + 1; 51 | let bottom_row = (top_row + total_rows).min(len); 52 | onscroll(top_row..bottom_row) 53 | }); 54 | 55 | UseScrollRange { 56 | scroll, 57 | size, 58 | item_size, 59 | len, 60 | } 61 | } 62 | } 63 | 64 | fn use_effect_signal(value: V) -> Signal 65 | where 66 | V: PartialEq + Clone + 'static, 67 | { 68 | let mut signal = use_signal(|| value.clone()); 69 | use_effect(use_reactive(&value, move |val| { 70 | signal.set(val); 71 | })); 72 | signal 73 | } 74 | 75 | #[derive(Clone, Copy, PartialEq)] 76 | pub struct UseScrollRange { 77 | pub scroll: Signal, 78 | pub size: Signal, 79 | pub item_size: Signal, 80 | pub len: usize, 81 | } 82 | 83 | impl UseScrollRange { 84 | pub fn builder() -> Builder { 85 | Builder { 86 | inner: Some(Inner { 87 | direction: Direction::Row, 88 | len: 0, 89 | size: 400., 90 | item_size: 20., 91 | }), 92 | } 93 | } 94 | 95 | /// Get the current start index. 96 | pub fn start(&self) -> usize { 97 | (*self.scroll.read() as f64 / *self.item_size.read()).floor() as usize 98 | } 99 | 100 | /// Get the current range of item indices. 101 | pub fn range(&self) -> Range { 102 | let start = self.start(); 103 | let total = (*self.size.read() / *self.item_size.read()).floor() as usize + 1; 104 | let end = (start + total).min(self.len); 105 | start..end 106 | } 107 | } 108 | --------------------------------------------------------------------------------