Skip to main content

Module prelude

Module prelude 

Source
Expand description

The usual imports for application code.

Re-exports§

pub use crate::framework::run;
pub use crate::framework::testing::HeadlessApp;
pub use crate::framework::testing::HostedApp;
pub use crate::framework::testing::TestApp;
pub use crate::framework::ActionControl;
pub use crate::framework::Actions;
pub use crate::framework::Bindable;
pub use crate::framework::Command;
pub use crate::framework::Dispatcher;
pub use crate::framework::Each;
pub use crate::framework::EditsText;
pub use crate::framework::EffectCx;
pub use crate::framework::EffectStatus;
pub use crate::framework::Effected;
pub use crate::framework::Fixture;
pub use crate::framework::Form;
pub use crate::framework::Jobs;
pub use crate::framework::LaunchInput;
pub use crate::framework::Live;
pub use crate::framework::LiveRow;
pub use crate::framework::PersonKind;
pub use crate::framework::PersonRecord;
pub use crate::framework::Query;
pub use crate::framework::ReadFailure;
pub use crate::framework::Records;
pub use crate::framework::ResourceApp;
pub use crate::framework::ResourceSelection;
pub use crate::framework::ResourceSurface;
pub use crate::framework::RunMode;
pub use crate::framework::SeedCx;
pub use crate::framework::Setting;
pub use crate::framework::Submit;
pub use crate::framework::SurfaceCx;
pub use crate::framework::TextControl;
pub use crate::framework::ViewCx;
pub use crate::framework::WorkspaceRecord;
pub use tilo_resource;
pub use ui_core::tilo_actions;

Modules§

collaboration
Toolkit-side collab client. The broker client (routes, transport, committed reads, signing, invocation updates, presence transport) is the collaboration crate, which a process that commits to a workspace links without the toolkit; it keeps its path here. What stays is the widget side: who is in the workspace as the toolkit shows them, and the content a view reads.
history_source
Turning a live CRDT document into the rows the history widgets render.
presence
resource
The resource contract: what any resource type provides so that it gets history, undo, collaboration, permissions, palette/agent/script exposure, search and replay without writing any of them.
resource_actions
Toolkit-owned host for a small app’s typed resource/action surface.
search
Search as a platform service: apps never draw a search field or a result list, they declare what they can find and the platform presents it.

Macros§

column
Build a retained Column from concrete child widgets without repeating push(Box::new(...)).
row
Build a retained Row from concrete child widgets.
stack
Build a retained Stack from overlapping concrete child widgets.

Structs§

ActionCx
Deterministic services available while an action applies.
ActionDecl
One mutation offered by name: a [Declaration] of the resource R, whose fields it derefs to.
ActionEmitter
A reusable action-intent queue for controls, including custom widgets. Widgets call emit from any interaction path. Mounted shared controls install independent host custody; custom producers should use new_in with their actual owner domain. The private take path remains only as explicitly unqualified migration compatibility.
ActionForm
One action whose arguments and live UI state are declared together.
ActionNeed
What one invocation of an action is, for the grants deciding it: its kind, the one field of its resource it writes when it writes only one (a reply writes the comments), which places it below that field in the tree, and whether it is privileged (RiskLevel::Privileged): it exercises authority over the workspace or others in it, so the person’s own grants must allow it (tilo_action_policy::Verdict::privileged).
ActionRegistry
Maps a stable type_id to the decoder that reconstructs its action from a payload — cheap to share behind an Arc/& at dispatch time.
AppComponent
Real app content and its lifetime; hosts cannot extract an unbound root.
ApplicationCatalog
ApplicationDefinition
Arriving
A read whose answer arrives later. Clones share one read.
Atom
A string written whole: last writer wins. For identifiers, enum-like codes and short values where character merging would be wrong.
Banner
An inline semantic alert with a title, an optional message, up to two actions and an optional dismiss control.
Button
Card
A retained card. See the module docs.
Checkbox
Collection
An ordered collection of items addressed by Id.
Column
ColumnDef
ComponentBehaviour
How the window hosting a component treats its tree. Part of the component, so every host that runs it applies the same behaviour.
ComponentRunnerInputs
Presentation owned by a runner. Authority comes only from the component context.
Container
Each bool below is an independent builder toggle (background, height fill, padding, grow behaviour) set at construction time, not a state machine with meaningful combinations to enumerate — a bitflags/enum refactor would ripple across every one of Container’s call sites in the crate for no behavioural gain.
ControlBindingMetadata
Counter
A number whose concurrent changes add up: two people each adding one make two. Change it with Self::add; writing it back records the difference as an increment rather than a new value.
DataTable
A table of Rows: the DataTableCore that does the work (everything a table does, compiled once into the toolkit for rows of any type) and the row type its callers read and write.
Delta
The parts of a document some set of changes touched. See the module docs.
Demand
The parts of a large resource that views are looking at, in terms any resource can interpret: positions in its primary order (the paragraphs of a document, the rows of a sheet) and keyed parts (a comment thread, a clip). See Resource::load.
Dropdown
Edit
A field edit of the record R: a path and an operation. See the module docs.
EmptyState
A centered empty-state placeholder: hero icon + title + message + action.
EventCtx
Host services associated with one retained widget event dispatch.
FilterCount
How many rows a filtered view shows out of how many it has.
Filtered
Content with a filter: a SearchField::filter in a band above the content, narrowing the first Filterable inside it. Ctrl+F (⌘F) focuses the field. A navigation shell’s filter slot is the same field wired with sync_filter.
FindBar
The find bar: a query field with a match counter, option chips, previous/next and close, and an optional replace row.
FindMatch
One match, as a span of the findable’s own content (a byte range of its text, or of its bytes in hex mode). The findable interprets it.
FindOptions
The options a find runs under: the bar’s chips, the window search’s options.
FindScope
Content with find: a FindBar that Ctrl+F (⌘F) opens as a band at the top of the content, driving the first Findable inside it.
HostContext
Explicit identity, authority and storage. Apps receive no ambient profile resolver.
HostContextInputs
Host-supplied storage, identity and authority for one instance, checked by HostContext::prepare before any factory runs.
Id
A stable identity for an item in a resource. Minted deterministically by ActionCx::id, so replaying an action on another replica mints the same id.
InstanceViewStore
Exact explicit namespace retained across construction, close and save retry.
Invoke
One fully specified invocation of a declared action, or of one of the app’s effects (Invoke::effect).
LabelKey
The Fluent message a label, placeholder or button shows: looked up in the active locale when drawn, shown verbatim when no catalog has it.
LatestRequest
UI-thread inbox for worker results where only the newest request may win.
LatestTask
Typed state for restartable background work where only the latest run may publish a result. Starting or cancelling a run invalidates every older TaskCompletion.
LocalState
A cloneable handle to typed, process-local application state.
ModelView
A retained subtree selected by a value projected from application state.
NavItem
One destination. Every part but the label is optional.
NavList
The navigation list. See the module docs.
NavSection
A group of destinations under a sentence-case title.
NavShell
The one window shell. See the module docs.
NumberInput
OpenFile
One file to open: its name, media type and bytes.
Outbox
Outside consequences of the record’s actions, queued in the document: a mail to send, an event to upload, a file to move. A verb that takes &mut Outbox<T, O> pushes entries and is an Outside action.
Path
The location of a T inside the record R. See the module docs.
PlainText
Plain text, edited a splice at a time.
PlaybackHandoff
Where playback stood on the device or app that handed the launch’s media over: the launch continues it from there. The media itself is what the launch names (its argument or file); this is the transport and the name it played under.
Point
A 2D point.
PreparedComponentInputs
Explicit host preparation completed before invoking the application factory.
PresenceCtx
QrWidget
Holds the source bytes plus the cached encoded matrix. Re-encodes when the payload changes via set_payload — the pairing-channel screen calls it every few seconds as the broker rotates the nonce.
RecordCheckout
A record named together with its type — what a widget declares it is working on, and what a workspace index holds.
RecordId
The stable identity of a record. Encoded by prefix: file-record:<uuid> (a file, by the durable id its filesystem record carries — see RecordId::identify_file), file:<absolute path> (a file known only by where it is: a not-yet-written Save As target, or a filesystem that can’t hold the durable id), uuid:<uuid> (minted, for a record with no natural name), tab:<tab id> (a window’s scratch document until a file names it, see RecordId::for_tab) and derived:<role>@<id> (see RecordId::derived).
RecordKind
What kind of thing a record is — document, annotation-set, book, playlist. App-owned rather than system-registered, so an app can add a kind without coordinating; the cost is no cross-app library view yet (needs a system-owned type registry, not built here).
Rect
A rectangle.
Refusal
Why an action declined to run, in the user’s words.
Replica
One replica of an R resource. See the module docs.
Row
SavedInstanceView
Scrollable
SearchEntry
A search index entry. anchor addresses what a hit opens (an item id); action, when set, is the published action a hit invokes, so choosing it goes through the same door, permissions and history as the palette.
SearchField
A search-styled input: magnifier + editable text + count slot + clear.
SearchRegistry
The set of providers a search surface draws from. One registry can back a single app (its own providers) or, in the shell, every app’s providers at once for a global Ctrl+K.
SearchResultsView
The results overlay. Populate it with set_groups each time the query changes, drive selection with the keyboard or pointer, and drain activations with take_activated.
Set
A set whose concurrent adds and removes merge per element. Stored as a map keyed by each element’s JSON form.
Size
A 2D size.
Slider
Spacer
Spinner
Stack
Children painted on top of one another, each position: Absolute and anchored at the stack’s top-left. There is deliberately no alignment option: a child that wants a corner or the centre positions itself (a Column/Row with its own insets and justify, or a Container with with_centered_max_width), so the stack stays a pure z-order primitive and the layer’s geometry is owned by the layer. If a caller needs the stack itself to anchor, add an opt-in that maps to inset on the child node rather than changing this default.
State
The unified state object that holds our CRDT document.
Text
TextInput
TextRenderer
Theme
Toggle
A switch: a BoolControl drawn as a pill whose knob slides to the checked side.
UndoAccess
The undo half of a widget, as one embeddable field: the last UndoStatus the host published, plus at most one pending UndoRequest.
UndoStatus
What the live undo history can do right now, as a widget sees it.
Undoing
What a verb’s declared undo (#[action(undo = path)]) is computed from: the record before and after the verb ran, the ids it minted (the outbox entry it queued) and its parameters. The undo returns the verb that compensates, which undo applies like any action, so its own outbox entries are queued and drained the same way, and which reads at that time how the original entry settled (where the trashed file went).
VirtualList

Enums§

ActionError
Errors from encoding, decoding, or applying an action.
ActionKind
What an action is able to do, derived by the framework from the action’s code and never declared by an app.
Arrival
Where one read stands.
ColumnWidth
Auto is sized to content at build time (treated as Flex(1.0) until the layout pass can measure it).
ContentKind
What the shell’s content is, so it knows the narrowest the content still works at; below that the window shows one column at a time. Apps say what their content is, never how wide it is.
ControlBindingKind
Machine-readable classification of a control’s activation path.
DeviceClass
The kinds of device a setting’s default may differ on.
ExecutionLocus
Where an action executes, declared on the action type and carried on every envelope. ServerPreferred retains its historical wire spelling, but is an authoritative-host requirement: absence of a host is a refusal, never permission for the client to perform the operation.
LaunchTarget
ListModelChange
One already-applied change to a ListModel. Structural variants retain mounted delegates by stable key; Self::RowsChanged rebuilds only the named rows.
NavMode
What the sidebar becomes when the window is too narrow to dock it.
NavPane
A screen of the narrow push stack.
RecordSaveStatus
Whether a record’s changes are stored.
RestoreInput
Scope
Where an app’s typed settings live and how far they travel. Settings follow a person or a device, never a workspace’s members; they are never visible to collaborators. Content shared with a workspace is a record instead.
Settled
How the owning device settled an Outbox entry, with what its handler reports back (O): where a trashed file went, the name a copy got, the id a server gave the upload.
TextEdit
One edit of plain text. Positions count characters (Unicode scalar values), whatever the document’s own text encoding.
TextRole
What a piece of text is. Pick the role; never a pixel size.
UndoRequest
A widget’s request that the host drive the history. The host performs it through the one undo implementation; a widget never touches the stacks.

Constants§

ANY_MEDIA_TYPE
The entry of ApplicationDefinition::opens that opens files of every type.

Traits§

ActionValue
A value that can connect a LocalState field directly to a typed resource action.
AudiencePresentationProvider
Optional second-output presentation capability for app roots.
Collaborative
Optional session collaboration capability for widgets that own live broker-backed activity.
CompleteContentProvider
Optional full-document/canvas capture capability.
Continuable
Optional cross-device continuation capability for an app root, deliberately separate from Widget: ordinary controls have no resumable app state, while roots that do expose it through Widget::provide without weakening their UI integration.
Effect
A typed vocabulary of effects. Derive it (#[derive(Effect)]); see the module docs.
Filterable
A view a SearchField can narrow: a list, a table, a grid of cards.
Findable
A view whose content can be searched in place.
FloatingSurfaceProvider
Optional capture and detachable-surface capability.
FullscreenProvider
Optional OS-fullscreen capability for roots and forwarding containers.
ListModel
Random-access collection contract for VirtualList. Keys must be unique and stable while an item represents the same logical entity.
Model
A typed value stored in a CRDT document. See the module docs.
NativeViewLifecycle
Optional lifecycle for widgets backed by a platform-native child view.
Params
A verb’s generated parameter struct, linked to the verb it is the input of. A form is a local value of it; submitting the form invokes Self::ACTION with it.
Resource
A resource type. #[resource] implements it for a #[derive(Model)] record, which is how every app declares its own. The SDK implements it by hand for the shared types with a storage layout of their own (a rich-text document, plain text), which apps hold as fields; an app never does (docs/architecture/resources.md §8).
SettingsSchema
A typed settings value with a declared Scope.
TableModel
Unopinionated backing model for very large or asynchronously populated tables. Implementations need not keep all rows resident: DataTable queries only the visible range plus overscan.
Widget

Functions§

labeled_check
Compose a checkbox or toggle with one inline visible and accessible label.
labeled_field
Compose a visible semantic label with the control it names.

Type Aliases§

ComponentHostPreparer
Explicit runner authority/presentation preparation; application metadata is never authority.
Element
TableModelChange
One model notification batch consumed after the backing data has changed: a list’s change ([crate::widget::ListModelChange]) over the table’s row keys. Structural variants preserve mounted controls by stable row key; RowsChanged rebuilds controls only for the named rows.

Attribute Macros§

resource
Turn a record’s #[action] methods into its replayable, published action vocabulary, and implement Resource for it.

Derive Macros§

Effect
Derive Effect: an enum’s variants become the app’s published effects — work with no document delta, invoked by buttons, the palette, agents and scripts alike. See tilo_resource::effect.
Model