14 unstable releases (3 breaking)
new 0.4.0 | May 17, 2024 |
---|---|
0.2.0 | May 14, 2024 |
0.1.10 | Mar 24, 2024 |
0.1.6 | Dec 3, 2023 |
0.1.0 | Dec 15, 2022 |
#4 in #crux
246 downloads per month
270KB
2.5K
SLoC
Crux Key-Value Store capability
This crate contains the KeyValue
capability, which can be used to ask the Shell to read from, and write to, a key-value store.
Currently it provides an interface for getting, setting, and deleting keys, checking if keys exists in the store, and listing keys that start with a prefix.
About Crux Capabilities
Crux capabilities teach Crux how to interact with the shell when performing side effects. They do the following:
- define a
Request
struct to instruct the Shell how to perform the side effect on behalf of the Core - define a
Response
struct 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
Request
andResponse
are unambiguously named (e.g.HttpRequest
andHttpResponse
).
Dependencies
~2.8–4MB
~82K SLoC