24 releases (5 breaking)

0.6.0 Oct 23, 2024
0.5.0 Sep 16, 2024
0.4.3 May 23, 2024
0.3.1 Mar 24, 2024
0.1.0 Dec 15, 2022

#72 in WebAssembly

Download history 146/week @ 2024-07-29 327/week @ 2024-08-05 450/week @ 2024-08-12 251/week @ 2024-08-19 336/week @ 2024-08-26 588/week @ 2024-09-02 218/week @ 2024-09-09 446/week @ 2024-09-16 454/week @ 2024-09-23 669/week @ 2024-09-30 706/week @ 2024-10-07 1214/week @ 2024-10-14 1317/week @ 2024-10-21 536/week @ 2024-10-28 493/week @ 2024-11-04 275/week @ 2024-11-11

2,623 downloads per month

Apache-2.0

265KB
2.5K SLoC

Rust 2K SLoC // 0.1% comments TypeScript 337 SLoC // 0.1% comments Swift 35 SLoC // 0.1% comments Java 18 SLoC

Crux Time capability

This crate contains the Time capability, which can be used to ask the current time from the Shell.

For an example of how to use the capability, see the integration test.

About Crux Capabilities

Crux capabilities teach Crux how to interact with the shell when performing side effects. They do the following:

  1. define a Request struct to instruct the Shell how to perform the side effect on behalf of the Core
  2. define a Response struct to hold the data returned by the Shell after the side effect has completed
  3. declare one or more convenience methods for invoking the Shell's capability, each of which creates a Command (describing the effect and its continuation) that Crux can "execute"

Note that because Swift has no namespacing, there is currently a requirement to ensure that Request and Response are unambiguously named (e.g. HttpRequest and HttpResponse).


lib.rs:

Current time access for Crux apps

Current time (on a wall clock) is considered a side-effect (although if we were to get pedantic, it's more of a side-cause) by Crux, and has to be obtained externally. This capability provides a simple interface to do so.

Dependencies

~2.6–4.5MB
~86K SLoC