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 web page, a desktop shell,
3//! 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//! - [`error`]: [`DecodeError`] (nibbles that are not an object, and
20//! where) and [`Error`] (everything else, such as memory the ROM has not
21//! set up yet).
22//! - [`transfer`]: the objects of Kermit transfers: binary transfer files
23//! decoded and encoded, sources from ASCII transfers, RPL source text
24//! for host commands (the protocol itself is the host's).
25
26pub mod charset;
27pub mod cmdline;
28pub mod decompile;
29pub mod error;
30pub mod menus;
31pub mod names;
32pub mod object;
33pub mod prolog;
34pub mod ram;
35pub mod transfer;
36
37pub use cmdline::{CommandLine, Editor, EditorLayout, command_line};
38pub use decompile::{NumberFormat, Settings, described, display, has_text, text};
39pub use error::{DecodeError, Error, Reason};
40pub use names::{CommandInfo, NameStats, NameTable, UnitMarkers};
41pub use object::{
42 ArrayItem, Base, Graphic, Integer, MAX_CLONED_NIBBLES, MAX_DECODED_NIBBLES,
43 MAX_DECODED_OBJECTS, Memory, NoMemory, Object, Reader, Real, decode, decode_at, graphic,
44};
45pub use prolog::ObjectType;
46pub use ram::{
47 Flags, Layout, UserMemory, Variable, change_counter, current_path, flags, memory_tree,
48 stack_objects,
49};
50
51// The README (the crate's page on crates.io) compiles as a doctest.
52#[cfg(doctest)]
53#[doc = include_str!("../README.md")]
54struct ReadmeDoctests;