Skip to main content

Crate faststep

Crate faststep 

Source
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:

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 main thin
  • 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 state
  • UiView: trait implemented by the root or custom views in your app
  • ViewRegistration: setup object used during configure(...)
  • run_ui_system: framework-owned event loop
  • FsTheme: semantic palette configured once at startup
  • I18n: lightweight localization helper

§Widget and Container Surface

The first public release already includes the main widget families:

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:

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.rs
  • examples/text_and_image.rs
  • examples/scroll_and_list.rs
  • examples/containers.rs
  • examples/alerts.rs
  • examples/runtime_shell.rs
  • examples/uikit_root.rs
  • examples/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:

§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§

AlertAction
One alert action definition.
AlertConfiguration
Lightweight alert presentation configuration.
AlertHost
High-level modal alert presenter owned by the framework.
AlertHostResponse
Response returned by AlertHost::handle_touch.
AlertSpec
Complete alert specification for a fixed number of actions.
AlertView
Drawable alert widget for one AlertSpec.
Animation
Small time-based animation helper.
AppTouchResult
Result of handling one touch event through the compatibility layer.
Button
Reusable button view that owns its highlight state.
ButtonSpec
Immutable button configuration.
ButtonTouchResponse
Result returned by shared multi-button touch tracking.
ButtonTouchState
Shared touch tracker for a set of buttons.
ChildView
A child view registered by a parent crate::UiView.
EdgeInsets
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.
ImageView
Reusable bitmap view similar to UIKit’s UIImageView.
ImageViewStyle
Visual configuration for an ImageView.
Layer
One render layer used by stack-style presentation.
ListEvent
Result of a list interaction.
ListItem
One item currently visible in a list.
ListRow
Row payload passed to list delegates for drawing.
ListRowState
Visual row state supplied to ListDelegate::draw_row.
ListSelection
Lightweight row selection payload.
ListView
Scrollable data-driven list view.
LocaleTable
Translation table for one locale identifier.
Localized
A localizable label with a stable lookup key and fallback text.
ModalHost
Generic modal transition state machine used by higher-level hosts.
ModalLayer
Render layer for a modal presentation.
NavView
Navigation chrome plus stack body geometry.
RichTextView
Rich text view built from multiple styled spans.
ScrollBar
Geometry and opacity for a transient scrollbar thumb.
ScrollView
Scroll container state with UIKit-style indicator behavior.
ScrollViewState
Shared inertial scrolling state used by crate::ScrollView and crate::ListView.
SplitLayout
Output rectangles produced by SplitView::layout.
SplitView
Simple proportional split container.
StackLayers
Base and overlay layers used during stack presentation.
StackMotion
Geometry used during stack-motion presentation.
StackNav
Stack-based navigation state machine.
StackView
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.
TextRunStyle
Style for one text run.
TextSpan
One styled segment of rich text.
TextView
Simple text view that renders one string with one style.
TextViewStyle
Shared container style for crate::TextView and crate::RichTextView.
TouchEvent
One touch sample routed through the UI framework.
Translation
One translated string in a locale table.
UiApp
Compatibility app wrapper retained for pre-UiSystem consumers.
UiSystem
Owns the root view, display, theme, localization, and registration state.
ViewEnvironment
Immutable environment passed to drawing and event callbacks.
ViewEvent
Result of a view update or touch event.
ViewProperties
Common properties attached to a registered view.
ViewRegistration
Mutable registration object passed to crate::UiView::configure.
ViewResponse
Delegate response returned by compatibility views.

Enums§

AlertButtonRole
Semantic role for one alert action button.
AlertHostError
Error returned when an alert cannot be accepted by the host.
AlertKind
Semantic alert kind.
AppNavigation
Navigation action requested by the compatibility delegate API.
AppRedraw
Redraw classes used by the compatibility crate::UiApp layer.
ButtonKind
Semantic role for a button.
Curve
Easing curve used by Animation.
ImageAlignment
Alignment used when placing an image inside its frame.
ListActivity
Interaction mode returned by crate::ListView::handle_touch.
NavHeaderAction
Action emitted by navigation chrome.
SplitAxis
Axis used by SplitView.
StackError
Error returned by stack navigation operations.
TextAlignment
Horizontal text alignment.
TextFont
Supported bundled mono font roles for text views.
TextVerticalAlignment
Vertical text alignment.
TextWrap
Wrapping mode for text layout.
TouchPhase
Phase of a touch interaction.
UiRuntimeError
Error returned by run_ui_system.
ViewKind
Semantic classification for a registered child view.
ViewRedraw
Redraw request emitted by a view update or interaction.

Traits§

DisplayPort
Drawing backend provided by an OEM target or simulator.
FrameClock
Monotonic clock abstraction.
ListDataSource
Data source used by crate::ListView.
ListDelegate
Delegate responsible for drawing list rows and reacting to row changes.
TouchPort
Low-level touch polling source.
UiCanvas
Drawing surface used by faststep widgets and overlays.
UiRuntimeDriver
OEM-owned timing and touch adapter used by run_ui_system.
UiRuntimePresenter
Presentation policy used by run_ui_system to batch redraw requests.
UiView
Root contract implemented by application-defined views.
ViewDelegate
Compatibility delegate API retained for older UiApp consumers.

Functions§

draw_text_view
Shared renderer used by TextView and RichTextView.
lerp_i32
Linearly interpolates between two i32 values using permille progress.
lerp_u8
Linearly interpolates between two u8 values using permille progress.
run_ui_system
Runs the framework-owned update, input, and presentation loop forever.

Type Aliases§

ScrollListState
Backwards-compatible alias for list scrolling state.