| Crates.io | blinc_core |
| lib.rs | blinc_core |
| version | 0.1.12 |
| created_at | 2026-01-14 17:19:56.167328+00 |
| updated_at | 2026-01-19 01:05:00.567843+00 |
| description | Blinc core runtime - reactive signals, state machines, and event dispatch |
| homepage | |
| repository | https://github.com/project-blinc/Blinc |
| max_upload_size | |
| id | 2043279 |
| size | 315,610 |
Part of the Blinc UI Framework
This crate is a component of Blinc, a GPU-accelerated UI framework for Rust. For full documentation and guides, visit the Blinc documentation.
Core runtime for the Blinc UI framework - reactive signals, state machines, and event dispatch.
blinc_core provides the foundational building blocks for the Blinc UI framework:
use blinc_core::{Signal, Derived, Effect};
// Create a signal
let count = Signal::new(0);
// Derive a computed value
let doubled = Derived::new(|| count.get() * 2);
// Create an effect that runs when dependencies change
Effect::new(|| {
println!("Count is now: {}", count.get());
});
// Update the signal
count.set(5); // Effect runs, prints "Count is now: 5"
use blinc_core::{StateMachine, FsmRuntime};
// Define states and transitions for interactive widgets
let fsm = StateMachine::new()
.state("idle")
.state("hover")
.state("pressed")
.transition("idle", "mouseenter", "hover")
.transition("hover", "mouseleave", "idle")
.transition("hover", "mousedown", "pressed")
.build();
use blinc_core::{DrawContext, Color, Rect, CornerRadius, Brush};
fn render(ctx: &mut dyn DrawContext) {
// Fill a rounded rectangle
ctx.fill_rect(
Rect::new(0.0, 0.0, 100.0, 50.0),
CornerRadius::uniform(8.0),
Brush::Solid(Color::BLUE),
);
}
| Type | Description |
|---|---|
Signal<T> |
Reactive state container |
Derived<T> |
Computed value that auto-updates |
Effect |
Side effect that runs on dependency changes |
StateMachine |
FSM for interaction states |
DrawContext |
Trait for 2D drawing operations |
Color |
RGBA color type |
Brush |
Fill type (solid, gradient, glass) |
Rect |
Rectangle geometry |
CornerRadius |
Per-corner border radius |
Shadow |
Drop shadow configuration |
Transform |
2D transformation matrix |
blinc_core
├── signals/ # Reactive primitives (Signal, Derived, Effect)
├── fsm/ # State machine infrastructure
├── events/ # Event types and dispatch
├── draw/ # Drawing context and primitives
├── geometry/ # Rect, Point, Size, Transform
├── color/ # Color and brush types
└── store/ # Key-value state persistence
MIT OR Apache-2.0