Skip to content

fix: Use wasmtimer in wasm#41

Merged
marc2332 merged 7 commits into
mainfrom
fix/use-wasmtimer-in-wasm
Jun 14, 2025
Merged

fix: Use wasmtimer in wasm#41
marc2332 merged 7 commits into
mainfrom
fix/use-wasmtimer-in-wasm

Conversation

@marc2332

Copy link
Copy Markdown
Owner

No description provided.

@wheregmis

Copy link
Copy Markdown
 --> src/mutation.rs:26:5
   |
26 | use webtime::Instant;
   |     ^^^^^^^ use of unresolved module or unlinked crate `webtime`
   |
help: there is a crate or module with a similar name
   |
26 | use web_time::Instant;
   |        +

12:23:34 [cargo] error[E0432]: unresolved import `webtime`
  --> src/query.rs:30:5
   |
30 | use webtime::Instant;
   |     ^^^^^^^ use of unresolved module or unlinked crate `webtime`
   |
help: there is a crate or module with a similar name
   |
30 | use web_time::Instant;
   |        +

12:23:34 [cargo] error[E0433]: failed to resolve: could not find `time` in `tokio`
   --> src/query.rs:233:28
    |
233 |                     tokio::time::sleep(interval).await;
    |                            ^^^^ could not find `time` in `tokio`
    |
note: found an item that was configured out
   --> /Users/wheregmis/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.45.1/src/lib.rs:555:13
    |
555 |     pub mod time;
    |             ^^^^
note: the item is gated behind the `time` feature
   --> /Users/wheregmis/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.45.1/src/lib.rs:554:1
    |
554 | / cfg_time! {
555 | |     pub mod time;
556 | | }
    | |_^
    = note: this error originates in the macro `cfg_time` (in Nightly builds, run with -Z macro-backtrace for more info)

12:23:34 [cargo] error[E0433]: failed to resolve: could not find `time` in `tokio`
   --> src/query.rs:261:24
    |
261 |                 tokio::time::sleep(query.clean_time).await;
    |                        ^^^^ could not find `time` in `tokio`
    |
note: found an item that was configured out
   --> /Users/wheregmis/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.45.1/src/lib.rs:555:13
    |
555 |     pub mod time;
    |             ^^^^
note: the item is gated behind the `time` feature
   --> /Users/wheregmis/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.45.1/src/lib.rs:554:1
    |
554 | / cfg_time! {
555 | |     pub mod time;
556 | | }
    | |_^
    = note: this error originates in the macro `cfg_time` (in Nightly builds, run with -Z macro-backtrace for more info)

12:23:34 [cargo] error[E0433]: failed to resolve: could not find `time` in `tokio`
   --> src/query.rs:323:24
    |
323 |                 tokio::time::sleep(query.clean_time).await;
    |                        ^^^^ could not find `time` in `tokio`
    |
note: found an item that was configured out
   --> /Users/wheregmis/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.45.1/src/lib.rs:555:13
    |
555 |     pub mod time;
    |             ^^^^
note: the item is gated behind the `time` feature
   --> /Users/wheregmis/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.45.1/src/lib.rs:554:1
    |
554 | / cfg_time! {
555 | |     pub mod time;
556 | | }
    | |_^
    = note: this error originates in the macro `cfg_time` (in Nightly builds, run with -Z macro-backtrace for more info)

12:23:34 [cargo] error[E0433]: failed to resolve: could not find `Instant` in `time`
   --> src/query.rs:116:24
    |
116 |             } => time::Instant::now().duration_since(*settlement_instant) >= query.stale_time,
    |                        ^^^^^^^ could not find `Instant` in `time`
    |
help: consider importing one of these structs
    |
1   + use std::time::Instant;
    |
1   + use wasmtimer::std::Instant;
    |
1   + use web_time::Instant;
    |
help: if you import `Instant`, refer to it directly
    |
116 -             } => time::Instant::now().duration_since(*settlement_instant) >= query.stale_time,
116 +             } => Instant::now().duration_since(*settlement_instant) >= query.stale_time,
    |

12:23:34 [cargo] error[E0308]: mismatched types
   --> src/query.rs:116:78
    |
88  | impl<Q: QueryCapability> QueryStateData<Q> {
    |      - expected this type parameter
...
116 |             } => time::Instant::now().duration_since(*settlement_instant) >= query.stale_time,
    |                                                                              ^^^^^^^^^^^^^^^^ expected type parameter `Q`, found `Duration`
    |
    = note: expected type parameter `Q`
                       found struct `Duration`

@wheregmis

Copy link
Copy Markdown
12:27:51 [cargo] error[E0433]: failed to resolve: could not find `Instant` in `time`
   --> src/query.rs:116:24
    |
116 |             } => time::Instant::now().duration_since(*settlement_instant) >= query.stale_time,
    |                        ^^^^^^^ could not find `Instant` in `time`
    |
help: consider importing one of these structs
    |
1   + use std::time::Instant;
    |
1   + use wasmtimer::std::Instant;
    |
1   + use web_time::Instant;
    |
help: if you import `Instant`, refer to it directly
    |
116 -             } => time::Instant::now().duration_since(*settlement_instant) >= query.stale_time,
116 +             } => Instant::now().duration_since(*settlement_instant) >= query.stale_time,
    |

12:27:51 [cargo] error[E0308]: mismatched types
   --> src/query.rs:116:78
    |
88  | impl<Q: QueryCapability> QueryStateData<Q> {
    |      - expected this type parameter
...
116 |             } => time::Instant::now().duration_since(*settlement_instant) >= query.stale_time,
    |                                                                              ^^^^^^^^^^^^^^^^ expected type parameter `Q`, found `Duration`
    |
    = note: expected type parameter `Q`

@marc2332
marc2332 marked this pull request as ready for review June 14, 2025 16:38
@marc2332
marc2332 merged commit 8c6b951 into main Jun 14, 2025
1 check passed
@marc2332
marc2332 deleted the fix/use-wasmtimer-in-wasm branch June 14, 2025 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants