Expand description
Website | GitHub | Changelog | Tutorials
§Getting Started
Each module needs to be enabled with a feature. For example, if you want to
use the task
module, put this in your Cargo.toml:
[dependencies.cala]
version = "0.8"
features = ["task"]
Here’s the boilerplate for your main.rs:
use cala::task::{exec, wait, never};
/// The program's shared state.
struct State {}
/// Event handled by the event loop.
enum Event {
Never(()),
}
impl State {
/// Event loop.
fn event(&mut self, event: Event) {
match event {
Event::Never(_) => unreachable!(),
}
}
}
/// Start the async executor.
fn main() {
let mut state = State {};
let mut never = never();
exec!(state.event(wait! {
Event::Never((&mut never).await),
}));
}
Module documentation may include simple tutorials. More in depth tutorials may be found here.
§A Tour of Cala
The rest of this crate documentation is dedicated to pointing out notable features of the Cala crate.
§Containers and Collections
The audio
and video
modules contain
multimedia types for working with sounds and graphics.
§Platform Abstractions
The task
module contains abstractions for dealing with
asynchronous code.
The gui
module contains abstractions for making a GUI
(Graphical User Interface).
§I/O
Cala’s main purpose is to abstract over differences in common platforms, notably Windows, Web, and Unix derivatives (including mobile) for things that the standard library does not. This is mostly with multi-media I/O, defined in these modules:
bluetooth
- bluetoothcamera
- webcam, phone cameraclient
- client network communicationdatabase
- database for persistent storagegraphics
- hardware-accelerated graphics renderinghaptic
- haptic force feedbackinfo
- system environment informationinput
- user input.log
- message loggingmicrophone
- microphone inputport
- general purpose I/O portsrandom
- random number generatorsserver
- server network communicationspeakers
- speaker outputtimer
- using timersusb
- universal serial bus communcationswhen
- getting the current timewindow
- display graphics in an area on a screen.
Modules§
- Audio types.
- Bluetooth and Bluetooth Low Energy communication. (WIP)
- Acess to webcam, selfie-camera, front-facing camera, etc. (WIP)
- Client fetch API. (WIP)
- Save and load data to persistent storage.
- Render (draw) graphics using the GPU and/or SIMD.
- Create, layout and draw widgets (WIP)
- Haptic force feedback.
- Retrieve environment information.
- User Input.
- Text output through some medium (stdout, web console, serial, etc.)
- Audio capture (recording) device
- General purpose I/O (WIP)
- Generate random numbers.
- Server API. (WIP)
- Audio playback device
- Execution of asynchronous tasks.
- Asynchronous timers (WIP)
- Serial communication.
- Video types.
- API for getting the date and time of day.
- Display graphics onto the screen, usually via a window.
Macros§
- Insert glue code so that your application can run on WASM and Android.