Skip to main content

Crate yse

Crate yse 

Source
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 a move closure), avoiding let 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.
ButtonView
A push-button description.
CancellationToken
Cooperative cancellation token shared with a running Task.
CheckBox
A retained two-state checkbox widget.
CheckBoxView
A checkbox description.
Column
A vertical column of widgets.
ComboBox
A retained drop-down selection widget.
ComboBoxView
A combo-box description.
DateEdit
A Qt calendar date editor with a popup calendar.
DateTimeEdit
A retained local date-and-time editor.
Diagnostics
Installed diagnostics for the current thread.
DiskMap
A painted proportional disk-usage overview.
EventStream
A stream of discrete events. It has no current value.
FileDialog
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 given Scheduler; subscribe with Interval::results.
Label
A retained text label widget.
LabelView
A declarative label description.
LayoutView
A row or column whose children are mounted in tuple order.
LineChart
A lightweight painted chart for one or more line series.
LineEdit
A retained single-line text editor.
LineEditView
A single-line text input description.
ListModel
An incremental list model.
ListView
A retained list view backed by a StringListModel.
LogRecord
A structured log record.
Logger
A leveled logger whose records are observable as a stream.
ManualTimer
A test Timer that queues tasks until the test fires them.
Menu
A menu of actions.
MenuBar
A menu bar attached to a window.
MessageBox
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.
ProgressBar
A retained progress indicator widget.
ProgressBarView
A progress-bar description.
QtGuiScheduler
A Scheduler that runs tasks on the Qt event loop, i.e. the GUI thread. Use this as the delivery target for yse_model::spawn_task.
QtTimer
A yse_model::Timer backed by Qt’s event loop, so delayed tasks run on the GUI thread. Use it to drive debounce/throttle/delay operators in a live application; yse_model::ManualTimer is the deterministic equivalent for tests.
QueueScheduler
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.
SliderView
A horizontal slider description.
SpacerView
A stretchable empty item that consumes spare layout space.
SpinBox
A retained integer spin-box widget.
SpinBoxView
A numeric spinner description.
StackedWidget
A stack of pages where exactly one is visible at a time; pages are built with crate::Ui.
StringListModel
A string list model that drives a Qt QListView incrementally.
StringTableModel
A string table model that drives a Qt QTableView incrementally.
Subscription
Handle to an active observation. Dropping it unsubscribes.
SyncScheduler
A scheduler that runs tasks immediately on the current thread.
TabWidget
A retained container that switches between labelled pages.
TableView
A QTableView bound to a StringTableModel.
Task
Handle to a background task. The result is delivered to the thread that spawned the task through the given Scheduler; subscribe with Task::results.
TimeEdit
A Qt time editor with dedicated hour and minute spin controls.
ToolBar
A toolbar attached to a window.
TreeModel
A tree model whose rows are supplied as flat (parent, cells, icon) rows; group/root rows use parent == -1, children point at their parent’s flat row.
TreeView
A QTreeView bound to a TreeModel.
Ui
A scoped builder for a retained Qt widget tree.
UndoStack
A stack of reversible commands with reactive can_undo/can_redo state and a change stream.
Var
A writable source of signal state.
Window
A top-level Qt Widgets window and root ownership scope.

Enums§

DiagnosticEvent
A transactional graph event.
ListChange
A structural change to a ListModel.
LogLevel
Severity of a log record.
MessageBoxButtons
Standard button combinations for a MessageBox.
MessageBoxResult
The button a MessageBox was closed with.
TextAlign
Horizontal text alignment for a model column.

Traits§

Command
A reversible operation managed by an UndoStack.
IntoBoolValue
Convert a boolean or Signal<bool> into a reactive property.
IntoIntValue
Convert an i32, Signal<i32>, or Var<i32> into a reactive property.
IntoTextValue
Convert a static string or a Signal<String> into a reactive property.
IntoWidget
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 f on a background thread every interval, delivering each sample onto the thread that owns the reactive graph via scheduler.
spawn_task
Run f on a background thread and deliver its result onto the thread that owns the reactive graph via scheduler.
spin_box
Describe a numeric spinner (default range 0..=100).
transaction
Run f inside a single transaction. Nested calls join the outer transaction.