Expand description
§faststep
faststep is a UIKit-inspired UI framework for embedded targets built on
embedded-graphics.
The crate is aimed at projects where application code should describe views and behavior, while the framework owns widget state, scrolling, modal transitions, and the main update or present loop.
§What 0.1.x Is
The 0.1.x line is the first public foundation release for the library.
It is intended to be:
- usable for real embedded UI work
- explicit about the preferred architecture
- broad enough to cover the main widget families already needed by
bazcon - conservative about compatibility by still exporting
UiApp
It is not intended to be the final shape of a full retained-mode framework.
The point of 0.1.0 is to publish a coherent, documented base that can be
iterated on without hiding the architectural direction.
§Core Model
faststep is organized around three layers:
UiViewandUiSystemdefine the application-facing view tree and root runtime state.StackView,TabView,SplitView,AlertHost,ScrollView, andListViewprovide reusable container and interaction behavior.DisplayPort,UiRuntimeDriver, andUiRuntimePresenteradapt the framework to concrete devices or future simulator backends.
The preferred entry point for new applications is run_ui_system. It keeps
main thin while letting faststep own the update, touch, and presentation
loop.
§Design Goals
The intended authoring model is:
- keep
mainthin - point the system at a root view implementation
- let views configure their children and metadata
- keep button, list, and alert interaction state inside the framework
- push device-specific concerns behind runtime and display traits
- make new device targets and simulators plug into the same UI layer
§Main Entry Points
If you are new to the crate, start here:
UiSystem: root owner for display, root view, theme, i18n, and registration stateUiView: trait implemented by the root or custom views in your appViewRegistration: setup object used duringconfigure(...)run_ui_system: framework-owned event loopFsTheme: semantic palette configured once at startupI18n: lightweight localization helper
§Widget and Container Surface
The first public release already includes the main widget families:
Button,ButtonSpec,ButtonKindImageView,ImageViewStyle,ImageAlignmentTextView,RichTextView,TextSpan,TextViewStyleScrollView,ScrollViewState,ScrollBarListView,ListDataSource,ListDelegate,ListRowStateStackView,TabView,SplitViewAlertSpec,AlertView,AlertHost,ModalHost
This gives the crate enough breadth for a first public cut without pretending the framework is already feature-complete.
§Runtime and OEM Boundary
faststep does not hardcode one board implementation.
The adapter boundary is:
DisplayPortfor frame drawing and optional dirty-rect presentationUiCanvasfor draw surfaces that also support dimmed overlaysUiRuntimeDriverfor timing, sleep, and touch pollingUiRuntimePresenterfor redraw batching and panel-specific present policy
That same seam is intended to support:
- ESP-IDF targets
- alternate boards and displays
- future desktop or simulator backends
§Typical Startup Shape
A minimal application looks like this conceptually:
let display = MyDisplayPort::new();
let theme = FsTheme::default();
let i18n = I18n::new("en", "en", LOCALES);
let root = RootView::new();
let driver = MyRuntimeDriver::new();
let presenter = MyPresenter::new();
run_ui_system(display, root, theme, i18n, driver, presenter)?;The important boundary is:
- the application owns the root view and behavior
- the framework owns the UI runtime loop
- the OEM adapter owns the hardware and present policy
§View Authoring Shape
Views are expected to register their own structure during configure(...).
That includes:
- frame
- title
- alpha
- hidden state
- clipping
- child views and their kinds
Conceptually:
fn configure(&mut self, registration: &mut ViewRegistration<'static, ViewId, 4>) {
registration.set_title(Localized::new("root.title", "Devices"));
registration.set_clips_to_bounds(true);
registration.add_child(
ChildView::new(ViewId::Devices, registration.frame())
.with_kind(ViewKind::List)
)?;
}§Scrolling and Lists
The crate treats scrolling as a first-class behavior instead of something each screen hand-rolls.
ScrollView owns:
- drag tracking
- inertial scrolling
- overscroll and snap-back behavior
- transient scroll indicator behavior
ListView builds on that and adds:
- datasource-driven row identity and sizing
- delegate-driven row drawing
- row highlight state
- row selection state
This is the first public step toward UIKit-like list behavior with clearer row state and reusable interaction rules.
§Included Examples
The crate includes compile-checked examples for the major API families, and the manifest enables docs.rs example scraping:
examples/buttons.rsexamples/text_and_image.rsexamples/scroll_and_list.rsexamples/containers.rsexamples/alerts.rsexamples/runtime_shell.rsexamples/uikit_root.rsexamples/root_delegate.rs
These examples are part of the packaged crate and are intended to be the fastest way to see how a widget family is supposed to be wired up.
§Compatibility
UiApp is still exported because existing code depends on it, but it should
be treated as a compatibility layer.
For new work, prefer:
UiSystemUiViewViewRegistration- the container and datasource APIs
§no_std
The crate is #![no_std] and keeps its dependencies intentionally small. It is
intended for embedded usage first, with runtime and presentation traits used to
bridge into real hardware or simulator environments.
Structs§
- Alert
Action - One alert action definition.
- Alert
Configuration - Lightweight alert presentation configuration.
- Alert
Host - High-level modal alert presenter owned by the framework.
- Alert
Host Response - Response returned by
AlertHost::handle_touch. - Alert
Spec - Complete alert specification for a fixed number of actions.
- Alert
View - Drawable alert widget for one
AlertSpec. - Animation
- Small time-based animation helper.
- AppTouch
Result - Result of handling one touch event through the compatibility layer.
- Button
- Reusable button view that owns its highlight state.
- Button
Spec - Immutable button configuration.
- Button
Touch Response - Result returned by shared multi-button touch tracking.
- Button
Touch State - Shared touch tracker for a set of buttons.
- Child
View - A child view registered by a parent
crate::UiView. - Edge
Insets - Padding values applied around a view’s content area.
- FsTheme
- Global semantic palette and sizing metrics used across widgets.
- I18n
- Small runtime localizer used by widgets and views.
- Image
View - Reusable bitmap view similar to UIKit’s
UIImageView. - Image
View Style - Visual configuration for an
ImageView. - Layer
- One render layer used by stack-style presentation.
- List
Event - Result of a list interaction.
- List
Item - One item currently visible in a list.
- ListRow
- Row payload passed to list delegates for drawing.
- List
RowState - Visual row state supplied to
ListDelegate::draw_row. - List
Selection - Lightweight row selection payload.
- List
View - Scrollable data-driven list view.
- Locale
Table - Translation table for one locale identifier.
- Localized
- A localizable label with a stable lookup key and fallback text.
- Modal
Host - Generic modal transition state machine used by higher-level hosts.
- Modal
Layer - Render layer for a modal presentation.
- NavView
- Navigation chrome plus stack body geometry.
- Rich
Text View - Rich text view built from multiple styled spans.
- Scroll
Bar - Geometry and opacity for a transient scrollbar thumb.
- Scroll
View - Scroll container state with UIKit-style indicator behavior.
- Scroll
View State - Shared inertial scrolling state used by
crate::ScrollViewandcrate::ListView. - Split
Layout - Output rectangles produced by
SplitView::layout. - Split
View - Simple proportional split container.
- Stack
Layers - Base and overlay layers used during stack presentation.
- Stack
Motion - Geometry used during stack-motion presentation.
- Stack
Nav - Stack-based navigation state machine.
- Stack
View - Stack navigation container built on
StackNav. - TabBar
- Low-level tab bar renderer and interaction helper.
- TabSpec
- One tab definition used by
TabBar. - TabView
- Tab container built on
TabBar. - Text
RunStyle - Style for one text run.
- Text
Span - One styled segment of rich text.
- Text
View - Simple text view that renders one string with one style.
- Text
View Style - Shared container style for
crate::TextViewandcrate::RichTextView. - Touch
Event - One touch sample routed through the UI framework.
- Translation
- One translated string in a locale table.
- UiApp
- Compatibility app wrapper retained for pre-
UiSystemconsumers. - UiSystem
- Owns the root view, display, theme, localization, and registration state.
- View
Environment - Immutable environment passed to drawing and event callbacks.
- View
Event - Result of a view update or touch event.
- View
Properties - Common properties attached to a registered view.
- View
Registration - Mutable registration object passed to
crate::UiView::configure. - View
Response - Delegate response returned by compatibility views.
Enums§
- Alert
Button Role - Semantic role for one alert action button.
- Alert
Host Error - Error returned when an alert cannot be accepted by the host.
- Alert
Kind - Semantic alert kind.
- AppNavigation
- Navigation action requested by the compatibility delegate API.
- AppRedraw
- Redraw classes used by the compatibility
crate::UiApplayer. - Button
Kind - Semantic role for a button.
- Curve
- Easing curve used by
Animation. - Image
Alignment - Alignment used when placing an image inside its frame.
- List
Activity - Interaction mode returned by
crate::ListView::handle_touch. - NavHeader
Action - Action emitted by navigation chrome.
- Split
Axis - Axis used by
SplitView. - Stack
Error - Error returned by stack navigation operations.
- Text
Alignment - Horizontal text alignment.
- Text
Font - Supported bundled mono font roles for text views.
- Text
Vertical Alignment - Vertical text alignment.
- Text
Wrap - Wrapping mode for text layout.
- Touch
Phase - Phase of a touch interaction.
- UiRuntime
Error - Error returned by
run_ui_system. - View
Kind - Semantic classification for a registered child view.
- View
Redraw - Redraw request emitted by a view update or interaction.
Traits§
- Display
Port - Drawing backend provided by an OEM target or simulator.
- Frame
Clock - Monotonic clock abstraction.
- List
Data Source - Data source used by
crate::ListView. - List
Delegate - Delegate responsible for drawing list rows and reacting to row changes.
- Touch
Port - Low-level touch polling source.
- UiCanvas
- Drawing surface used by
faststepwidgets and overlays. - UiRuntime
Driver - OEM-owned timing and touch adapter used by
run_ui_system. - UiRuntime
Presenter - Presentation policy used by
run_ui_systemto batch redraw requests. - UiView
- Root contract implemented by application-defined views.
- View
Delegate - Compatibility delegate API retained for older
UiAppconsumers.
Functions§
- draw_
text_ view - Shared renderer used by
TextViewandRichTextView. - lerp_
i32 - Linearly interpolates between two
i32values using permille progress. - lerp_u8
- Linearly interpolates between two
u8values using permille progress. - run_
ui_ system - Runs the framework-owned update, input, and presentation loop forever.
Type Aliases§
- Scroll
List State - Backwards-compatible alias for list scrolling state.