|0.1.1||Feb 15, 2023|
|0.1.0||Dec 15, 2022|
#782 in WebAssembly
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:
- define a
Requeststruct to instruct the Shell how to perform the side effect on behalf of the Core
- define a
Responsestruct to hold the data returned by the Shell after the side effect has completed
- 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
Responseare unambiguously named (e.g.
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.
This is still work in progress and as such very basic. It returns time as an IS08601 string.