Skip to main content

Crate corundum_framework

Crate corundum_framework 

Source
Expand description

corundum-framework — a single-dependency facade over the crates the sapphire apps and asteria share.

Depend on this one crate and turn on the features you need; each feature re-exports a corundum-framework-* crate as a module, the same way sapphire-framework’s facade does. The default is the part without egui, for the crates without a window (a server, a CLI); an app turns on gui.

# A desktop app:
corundum-framework = { version = "0.1", features = ["eframe", "serde"] }
# The same app on an Android phone:
corundum-framework = { version = "0.1", features = ["android", "serde"] }

§Modules (feature-gated)

featuremodulecrate
platform (default)platformcorundum-framework-platform: the app’s directories, the system’s languages, the JNI / Objective-C bridging
gui[gui]corundum-framework-gui: the shell, theme, fonts, icons and translations (brings platform)
update[update]corundum-framework-update: finding newer GitHub releases of an app’s binary, and replacing it with one
self-updateupdateupdate with the download and the replacement; a store build leaves it off, as the store updates the app
package[package]corundum-framework-package: the app as a Velopack package on the desktops: its start and install hooks, its updates, its command line on PATH and the Windows console shim (brings platform)
service[service]corundum-framework-service: the app’s background service registered with systemd, launchd or Task Scheduler at user level (brings platform)
keys[keys]corundum-framework-keys: API keys for an app’s server — a store of named keys, one file each, in a directory the app chooses, and their verification
keys-axumkeys::require_keythe layer that checks a router’s requests and resolves each key’s profile with the app’s function (brings keys)
keys-clapkeys::KeyCommandthe subcommand that manages a store; add --profile takes one of the app’s profiles (brings keys)
image[image]corundum-framework-image: a picture decoded to an sRGB RGBA8 thumbnail with its size limits checked from the header, without egui
image-rawimagecamera RAW files too; rawler is LGPL-2.1, so an app turning this on takes on its terms (brings image)
image-webpimage::encode_webplossy WebP encoding, through libwebp; WebP decodes without it (brings image)
image-previewgui::preview::ImagePreviewan image the app hands in, drawn in the detail pane and decoded on a worker thread (brings gui and image)
pdf[pdf]corundum-framework-pdf: a PDF’s pages counted and one drawn to sRGB RGBA8, in pure Rust (hayro), without egui
pdf-previewgui::preview::PdfPreviewa PDF the app hands in, drawn a page at a time in the detail pane and rendered on a worker thread; FilePreview shows .pdf files with it (brings gui and pdf)
audio[audio]corundum-framework-audio: audio files (FLAC, MP3, AAC, ALAC, Vorbis, WAV, Ogg Opus) decoded, resampled and played from a queue by audio::Player, without egui
audio-cpalaudio::CpalOutputsthe real sound device, cpal’s default output (brings audio)
audio-previewgui::preview::AudioPreviewa sound the app hands in, played in the detail pane through a Player<Content>, its tags read on a worker thread (brings gui, audio and audio-cpal)
fs-api[fs_api]corundum-framework-fs-api: the fs.* methods of an app’s server (fs.list, fs.stat, fs.read), their types and error codes, for a client
fs[fs]corundum-framework-fs: the engine that serves them over the server’s workspace folder, hiding the app’s own files (brings fs-api)
journal[journal]corundum-framework-journal: an undo log for an app server’s changes: batches of the app’s operations run on one writer thread and recorded, undone and redone per UI session, over a JournalStore (an in-memory one is included); no file system, no tokio
code-editorgui::codealumina-code’s CodeEditor, whose colours follow the visuals; the app brings its own Highlighter (brings gui)
text-previewgui::preview::TextPreviewa text file the app hands in, read-only in the detail pane; read as UTF-8 or UTF-16 and decoded on a worker thread (brings gui and code-editor)
markdown-editorgui::markdownalumina-markdown’s MarkdownEditor, with markdown::toolbar in corundum’s Lucide icons and words (brings gui)
markdown-previewgui::preview::MarkdownPreviewa Markdown file the app hands in, formatted and read-only in the detail pane; a link clicked is reported in PreviewResponse::link (brings gui, markdown-editor and text-preview)
datetimegui::datetimealumina-datetime’s date, period, time and timestamp pickers, with datetime::config in corundum’s Lucide icons and words, weeks from Monday (brings gui)
gui-keysgui::keysthe API keys page in Settings, over a store on this machine or the app’s own backend; each key is added with one of the app’s profiles (brings gui and keys)
gui-updategui::updatethe gui crate’s update panel: the Settings → About rows that look for a newer release (brings gui and update)
gui-self-updategui::updatethe panel also downloads the release and replaces the running binary (brings gui-update and self-update)
gui-packagegui::updatethe panel’s row for the app’s own Velopack package, Target::Package (brings gui-update and package)
gui-servicegui::first_run::ServicePage, gui::settings::ServiceRowthe gui crate’s service: the first-run question whether to keep the app’s services running, and an About-page row per service (brings gui, service and serde; desktops only)
eframegui::window::run, [eframe]corundum-framework-gui with its eframe feature: a desktop window started the same way for every app
androidgui::window::run_android, [eframe]corundum-framework-gui with its android feature: the window on an Android phone (brings eframe)
media-sessionplatform::media_session, gui::media_sessionthe OS’s media keys and its “now playing”, for a music player; gui::media_session::start makes one for an eframe window (brings platform). An iOS app adds UIBackgroundModes audio to its Info.plist
single-instanceplatform::instance, gui::window::WindowOptions::single_instancea desktop app run once: a second start brings the first’s window to the front and exits (brings platform)
consoleplatform::consolea Windows GUI-subsystem binary that also answers in a terminal without the package’s console shim: attach_parent on a command-line start, not the window’s (brings platform)
serdegui::look, gui::store, gui::first_runSerialize / Deserialize on the gui’s theme and language settings, and store: the look in effect and the rail’s order, kept on the device in a TOML file and put back before the first frame; first_run, the first-run pages, which remember there that they were done

Re-exports§

pub use corundum_framework_platform as platform;