saturnus_objects/lib.rs
1#![cfg_attr(test, allow(clippy::unwrap_used, clippy::expect_used))]
2//! HP 48/49 RPL objects for saturnus hosts (the app in the browser and on
3//! the desktop, the Kermit test host), without any I/O or protocol stack: builds for
4//! `wasm32` like the core.
5//!
6//! - [`object`]: the typed object model ([`Object`], JSON through serde)
7//! and the exact decoder of the calculator's nibble format.
8//! - [`ram`]: a read-only view of a paused machine's user memory: the
9//! HOME tree with each variable's type, size and checksum, the current
10//! directory, the data stack and the flags, straight from RAM (no Kermit
11//! server, no mode switch), plus a change counter for cheap polling.
12//! - [`names`]: command names read at run time from the loaded ROM's own
13//! library tables ([`NameTable`], built once per ROM).
14//! - [`decompile`]: the calculator's text for programs, algebraics, units
15//! and data objects in the display mode the flags select.
16//! - [`prolog`]: object types by prolog and the size walk.
17//! - [`cmdline`]: the command line being edited (text, cursor, open or
18//! not) and the editor's entry mode, alpha and shifts, from RAM.
19//! - [`screen`]: what has the keyboard (the stack, a command line, a
20//! halted program, an input form, a choose or message box, the
21//! graphics screen), from RAM.
22//! - [`error`]: [`DecodeError`] (nibbles that are not an object, and
23//! where) and [`Error`] (everything else, such as memory the ROM has not
24//! set up yet).
25//! - [`transfer`]: the objects of Kermit transfers: binary transfer files
26//! decoded and encoded, sources from ASCII transfers, RPL source text
27//! for host commands (the protocol itself is the host's).
28
29pub mod charset;
30pub mod cmdline;
31pub mod decompile;
32pub mod error;
33pub mod menus;
34pub mod names;
35pub mod object;
36pub mod prolog;
37pub mod ram;
38pub mod screen;
39pub mod softkeys;
40pub mod transfer;
41
42pub use cmdline::{CommandLine, Editor, EditorLayout, command_line};
43pub use decompile::{NumberFormat, Settings, described, display, has_text, text};
44pub use error::{DecodeError, Error, Reason};
45pub use names::{CommandInfo, NameStats, NameTable, Syntax, UnitMarkers};
46pub use object::{
47 ArrayItem, Base, Graphic, Integer, MAX_CLONED_NIBBLES, MAX_DECODED_NIBBLES,
48 MAX_DECODED_OBJECTS, Memory, NoMemory, Object, Reader, Real, decode, decode_at, graphic,
49};
50pub use prolog::ObjectType;
51pub use ram::{
52 Flags, Layout, UserMemory, Variable, change_counter, current_path, flags, memory_tree,
53 stack_objects,
54};
55
56// The README (the crate's page on crates.io) compiles as a doctest.
57#[cfg(doctest)]
58#[doc = include_str!("../README.md")]
59struct ReadmeDoctests;