Expand description
Yse: build and ship reactive Qt desktop applications from Rust.
This is the convenience facade; it re-exports the public API of
yse_model (the pure-Rust reactive runtime) and yse_ui (the Qt
Widgets layer).
use yse::{transaction, ListModel, Var};
let value = Var::new(0);
let doubled = value.signal().map(|v| v * 2);
transaction(|| value.set(21));
assert_eq!(*doubled.value(), 42);
let list = ListModel::from(vec![1, 2, 3]);
assert_eq!(list.len(), 3);Modules§
- prelude
- Common application types and functions.
Macros§
- clone
- Clone each named binding and move the clones into
body(typically amoveclosure), avoidinglet x = x.clone();boilerplate.
Structs§
- Action
- A retained command that can appear in menus or toolbars.
- Application
- The Qt application object. Must be created before any window.
- Button
- A retained push-button widget.
- Button
View - A push-button description.
- Cancellation
Token - Cooperative cancellation token shared with a running
Task. - Check
Box - A retained two-state checkbox widget.
- Check
BoxView - A checkbox description.
- Column
- A vertical column of widgets.
- Combo
Box - A retained drop-down selection widget.
- Combo
BoxView - A combo-box description.
- Date
Edit - A Qt calendar date editor with a popup calendar.
- Date
Time Edit - A retained local date-and-time editor.
- Diagnostics
- Installed diagnostics for the current thread.
- DiskMap
- A painted proportional disk-usage overview.
- Event
Stream - A stream of discrete events. It has no current value.
- File
Dialog - A non-modal “open file” dialog whose selection arrives on a stream.
- Grid
- A grid layout.
- Interval
- Handle to a repeating background sampler started by
spawn_interval. Each sample is delivered to the thread that spawned it through the givenScheduler; subscribe withInterval::results. - Label
- A retained text label widget.
- Label
View - A declarative label description.
- Layout
View - A row or column whose children are mounted in tuple order.
- Line
Chart - A lightweight painted chart for one or more line series.
- Line
Edit - A retained single-line text editor.
- Line
Edit View - A single-line text input description.
- List
Model - An incremental list model.
- List
View - A retained list view backed by a
StringListModel. - LogRecord
- A structured log record.
- Logger
- A leveled logger whose records are observable as a stream.
- Manual
Timer - A test
Timerthat queues tasks until the test fires them. - Menu
- A menu of actions.
- MenuBar
- A menu bar attached to a window.
- Message
Box - A non-modal message box whose result arrives on a stream.
- Observer
- A reusable callback handle that can observe several observables at once.
- Owner
- Owns a set of subscriptions and unsubscribes all of them when dropped.
- Progress
Bar - A retained progress indicator widget.
- Progress
BarView - A progress-bar description.
- QtGui
Scheduler - A
Schedulerthat runs tasks on the Qt event loop, i.e. the GUI thread. Use this as the delivery target foryse_model::spawn_task. - QtTimer
- A
yse_model::Timerbacked by Qt’s event loop, so delayed tasks run on the GUI thread. Use it to drivedebounce/throttle/delayoperators in a live application;yse_model::ManualTimeris the deterministic equivalent for tests. - Queue
Scheduler - A scheduler that queues tasks and runs them on demand on the calling thread. Useful for deterministic tests and for wiring background results into the reactive graph.
- Row
- A retained horizontal box layout.
- Settings
- A cloneable handle to an application-scoped Qt settings store.
- Signal
- A read-only signal with a current value.
- Sink
- A writable source of stream events.
- Slider
- A retained integer slider widget.
- Slider
View - A horizontal slider description.
- Spacer
View - A stretchable empty item that consumes spare layout space.
- SpinBox
- A retained integer spin-box widget.
- Spin
BoxView - A numeric spinner description.
- Stacked
Widget - A stack of pages where exactly one is visible at a time; pages are built
with
crate::Ui. - String
List Model - A string list model that drives a Qt
QListViewincrementally. - String
Table Model - A string table model that drives a Qt
QTableViewincrementally. - Subscription
- Handle to an active observation. Dropping it unsubscribes.
- Sync
Scheduler - A scheduler that runs tasks immediately on the current thread.
- TabWidget
- A retained container that switches between labelled pages.
- Table
View - A
QTableViewbound to aStringTableModel. - Task
- Handle to a background task. The result is delivered to the thread that
spawned the task through the given
Scheduler; subscribe withTask::results. - Time
Edit - A Qt time editor with dedicated hour and minute spin controls.
- ToolBar
- A toolbar attached to a window.
- Tree
Model - A tree model whose rows are supplied as flat
(parent, cells, icon)rows; group/root rows useparent == -1, children point at their parent’s flat row. - Tree
View - A
QTreeViewbound to aTreeModel. - Ui
- A scoped builder for a retained Qt widget tree.
- Undo
Stack - A stack of reversible commands with reactive
can_undo/can_redostate and a change stream. - Var
- A writable source of signal state.
- Window
- A top-level Qt Widgets window and root ownership scope.
Enums§
- Diagnostic
Event - A transactional graph event.
- List
Change - A structural change to a
ListModel. - LogLevel
- Severity of a log record.
- Message
BoxButtons - Standard button combinations for a
MessageBox. - Message
BoxResult - The button a
MessageBoxwas closed with. - Text
Align - Horizontal text alignment for a model column.
Traits§
- Command
- A reversible operation managed by an
UndoStack. - Into
Bool Value - Convert a boolean or
Signal<bool>into a reactive property. - Into
IntValue - Convert an
i32,Signal<i32>, orVar<i32>into a reactive property. - Into
Text Value - Convert a static string or a
Signal<String>into a reactive property. - Into
Widget - Common access implemented by every retained widget wrapper.
- Scheduler
- Executes deferred work. Yse’s reactive graph is synchronous and single-threaded; this trait is the boundary where background work returns to the UI thread. A scheduler must run scheduled tasks on the thread that owns the reactive graph (the UI thread in a Qt application).
- Timer
- A source of one-shot delayed tasks. Tasks must run on the thread that owns the reactive graph.
- View
- A retained widget description that can be mounted into a window.
Functions§
- button
- Describe a push button.
- checkbox
- Describe a checkbox.
- column
- Describe a vertical layout.
- combo_
box - Describe a combo box with the given item labels.
- label
- Describe a label. A
Signal<String>binds reactively. - line_
edit - Describe an uncontrolled text input with an initial value.
- log
- Log through the thread’s installed logger; no-op when none is installed.
- log_
debug - Emit a debug record through the thread’s installed logger.
- log_
error - Emit an error record through the thread’s installed logger.
- log_
info - Emit an informational record through the thread’s installed logger.
- log_
warn - Emit a warning record through the thread’s installed logger.
- progress_
bar - Describe a progress bar (default range
0..=100). - row
- Describe a horizontal layout.
- slider
- Describe a horizontal slider (default range
0..=100). - spacer
- Describe a stretch spacer.
- spawn_
interval - Run
fon a background thread everyinterval, delivering each sample onto the thread that owns the reactive graph viascheduler. - spawn_
task - Run
fon a background thread and deliver its result onto the thread that owns the reactive graph viascheduler. - spin_
box - Describe a numeric spinner (default range
0..=100). - transaction
- Run
finside a single transaction. Nested calls join the outer transaction.