Skip to main content

Crate cranpose_capabilities

Crate cranpose_capabilities 

Source
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(),
])
.emit();

From that one list the build writes the Android permissions and feature declarations, 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::emit writes 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.