Expand description
What an application asks of the device it runs on, written once in Rust.
An application declares this in its build script:
use cranpose_capabilities::{Use, declare};
declare(&[
Use::camera("Reads a receipt with the camera. Nothing leaves this device."),
Use::notifications(),
])
.opening(&["image/*", "application/pdf"])
.emit();From that one list the build writes the Android permissions and feature declarations, the Android intent filters that offer the application for the files it opens, the Apple usage descriptions, and a constant the application itself reads at run time. A service is a function, so a name cannot be misspelled, and a service Apple wants a sentence for takes that sentence as an argument, so it cannot be forgotten.
Structs§
- Capabilities
- Everything one application asks of a device.
- Declaration
- What a build script declares, before
Declaration::emitwrites it out. - Use
- One service an application uses, with the sentence it shows if it needs one.
Enums§
- Demand
- Hardware an application cannot run without.
- Service
- Something an application uses that the device has to allow.
Functions§
- android_
manifest - The Android manifest fragment the declaration becomes.
- android_
permissions - Every Android permission the declared services need, in order and without repeats.
- apple_
usage - The Apple usage descriptions the declaration becomes, as a property list
to merge into an
Info.plist. - declare
- Starts a declaration with the services an application uses.
- json
- The declaration as the platform builds read it.