Skip to main content

Crate taim

Crate taim 

Source
Expand description

§TAIM

TAIM is a Rust GUI framework built around views that own their state. There is no message type and no update function: a view reads state handles, and changing a handle repaints exactly the views that read it.

use taim::prelude::*;

fn main() -> taim::Result {
    taim::launch("Counter", |cx| {
        let count = cx.signal(0);

        column(views![
            text(move || format!("Count: {}", count.get())).size(24),
            row(views![
                button("-1").on_press(move || count.update(|n| *n -= 1)),
                button("+1").on_press(move || count.update(|n| *n += 1)),
            ])
            .gap(8.0),
        ])
        .gap(12.0)
        .padding(24.0)
    })
}

The view module holds the view API and every built-in view; the prelude imports what an application needs. The runtime owns frame scheduling, accessibility and renderer recovery.

TAIM is under active development. Consult docs/release/production-gates.md before depending on a platform or performance property.

Re-exports§

pub use taim_view as view;
pub use taim_highlighter as highlighter;highlighter
pub use taim_renderer::wgpu::wgpu;wgpu-bare

Modules§

alignment
Align and position widgets.
backend
Renderer backend selection and preferences.
border
Borders and independently configurable corner radii.
color
Color values, transfer functions, display transforms, and color spaces.
font
Load and use fonts.
gradient
Colors that transition progressively.
keyboard
Listen to keyboard events.
mouse
Handle mouse events.
padding
Space stuff around the perimeter.
platform
What an application asks of the operating system: open a link, share text, vibrate, and where to keep its files.
platform_vyomvyom
The VYOM backend for TAIM applications.
prelude
Everything an application written against the view API needs.
semantics
Platform-neutral semantic tree types.
signal
Fine-grained reactive state primitives.
storage
Small, persistent key-value settings, like Flutter’s shared_preferences: a theme choice, a signed-in user’s name, the last tab opened.
theme
Use the built-in theme and styles.
time
TAIM clock units for desktop and browser runtimes.
touch
Listen and react to touch events.
widget
Widget identity, for custom views that describe themselves to assistive technology through semantics::Node.
window
Window configuration.

Macros§

color
Creates a Color from byte channels or a packed hexadecimal literal.

Structs§

App
An application ready to run. Made by app.
Border
A border around a graphics primitive.
Color
An sRGB color with straight alpha.
Degrees
An angle measured in degrees.
Font
A font.
Memo
A lazily-computed reactive value with automatically tracked dependencies.
Padding
An amount of space to pad for each side of a box
Pixels
An amount of logical pixels.
Point
A 2D point.
Radians
An angle measured in radians.
Rectangle
An axis-aligned rectangle.
Settings
The settings of an taim program.
Shadow
Shadows are paint effects, not layout extents.
Signal
A cloneable, thread-safe reactive value.
Size
An amount of space in 2 dimensions.
Transformation
A compact 2D affine transform stored in a GPU-compatible 4x4 matrix.
Vector
A 2D vector.

Enums§

Backend
A graphical backend.
Background
One TAIM surface fill, carrying solid color or multi-stop gradient.
ContentFit
The strategy used to fit the contents of a widget to its bounding box.
Error
Why an application could not run.
Gradient
A fill which transitions colors progressively along a direction, either linearly, radially (TBD), or conically (TBD).
PowerPreference
Adapter power policy.
Theme
A theme: one of the built-in palettes or a Custom one.

Functions§

app
Describes an application before running it; see App::run.
launch
Opens a window titled title and shows the view build returns.

Type Aliases§

Renderer
The renderer views draw with, chosen when TAIM is compiled.
Result
What running an application returns.