Expand description
Blinc Core Runtime
This crate provides the foundational primitives for the Blinc UI framework:
- Reactive Signals: Fine-grained reactivity without VDOM overhead
- State Machines: Harel statecharts for widget interaction states
- Event Dispatch: Unified event handling across platforms
- Layer Model: Unified visual content representation (2D, 3D, composition)
- Draw Context: Unified rendering API for 2D/3D content
§Example
use blinc_core::reactive::ReactiveGraph;
let mut graph = ReactiveGraph::new();
// Create a signal
let count = graph.create_signal(0i32);
// Create a derived value
let doubled = graph.create_derived(move |g| {
g.get(count).unwrap_or(0) * 2
});
// Create an effect
let _effect = graph.create_effect(move |g| {
println!("Count is now: {:?}", g.get(count));
});
// Update the signal
graph.set(count, 5);
assert_eq!(graph.get_derived(doubled), Some(10));Re-exports§
pub use draw::BlurQuality;pub use draw::DrawCommand;pub use draw::DrawContext;pub use draw::DrawContextExt;pub use draw::FontWeight;pub use draw::ImageId;pub use draw::ImageOptions;pub use draw::LayerConfig;pub use draw::LayerEffect;pub use draw::LineCap;pub use draw::LineJoin;pub use draw::MaskImage;pub use draw::MaskMode;pub use draw::MaterialId;pub use draw::MeshId;pub use draw::MeshInstance;pub use draw::Path;pub use draw::PathCommand;pub use draw::RecordingContext;pub use draw::SdfBuilder;pub use draw::ShapeId;pub use draw::Stroke;pub use draw::TextAlign;pub use draw::TextBaseline;pub use draw::TextStyle;pub use draw::Transform;pub use draw::Transform3DParams;pub use events::Event;pub use events::EventData;pub use events::EventDispatcher;pub use events::EventType;pub use events::KeyCode;pub use events::Modifiers;pub use fsm::FsmId;pub use fsm::FsmRuntime;pub use fsm::StateId;pub use fsm::StateMachine;pub use fsm::Transition;pub use layer::Affine2D;pub use layer::BillboardFacing;pub use layer::BlendMode;pub use layer::BlurStyle;pub use layer::Brush;pub use layer::CachePolicy;pub use layer::Camera;pub use layer::CameraProjection;pub use layer::Canvas2DCommand;pub use layer::Canvas2DCommands;pub use layer::ClipLength;pub use layer::ClipPath;pub use layer::ClipShape;pub use layer::Color;pub use layer::CornerRadius;pub use layer::CornerShape;pub use layer::Environment;pub use layer::GlassStyle;pub use layer::Gradient;pub use layer::GradientSpace;pub use layer::GradientSpread;pub use layer::GradientStop;pub use layer::ImageBrush;pub use layer::ImageFit;pub use layer::ImagePosition;pub use layer::Layer;pub use layer::LayerId;pub use layer::LayerIdGenerator;pub use layer::LayerProperties;pub use layer::Light;pub use layer::Mat4;pub use layer::OverflowFade;pub use layer::ParticleBlendMode;pub use layer::ParticleEmitterShape;pub use layer::ParticleForce;pub use layer::ParticleRenderMode;pub use layer::ParticleSystemData;pub use layer::Point;pub use layer::PointerEvents;pub use layer::PostEffect;pub use layer::Rect;pub use layer::Scene3DCommand;pub use layer::Scene3DCommands;pub use layer::SceneGraph;pub use layer::Sdf3DViewport;pub use layer::Shadow;pub use layer::Size;pub use layer::TextureFormat;pub use layer::UiNode;pub use layer::Vec2;pub use layer::Vec3;pub use reactive::Derived;pub use reactive::DerivedId;pub use reactive::DirtyFlag;pub use reactive::Effect;pub use reactive::EffectId;pub use reactive::ReactiveGraph;pub use reactive::Signal;pub use reactive::SignalId;pub use reactive::State;pub use reactive::StatefulDepsCallback;pub use runtime::BlincReactiveRuntime;pub use value::AnimationAccess;pub use value::BoxedValue;pub use value::DynFloat;pub use value::DynValue;pub use value::ReactiveAccess;pub use value::SpringValue;pub use value::Static;pub use value::Value;pub use value::ValueContext;pub use context::BlincContext;pub use context::BlincContextExt;pub use context_state::query;pub use context_state::query_motion;pub use context_state::request_rebuild;pub use context_state::use_signal_keyed;pub use context_state::use_state_keyed;pub use context_state::AnyElementRegistry;pub use context_state::BlincContextState;pub use context_state::Bounds;pub use context_state::BoundsCallback;pub use context_state::FocusCallback;pub use context_state::HookState;pub use context_state::MotionAnimationState;pub use context_state::MotionStateCallback;pub use context_state::QueryCallback;pub use context_state::RecordedEventAny;pub use context_state::RecorderEventCallback;pub use context_state::RecorderSnapshotCallback;pub use context_state::RecorderUpdateCallback;pub use context_state::ScrollCallback;pub use context_state::StateKey;pub use context_state::TreeSnapshotAny;pub use context_state::UpdateCategory;pub use flow::BuiltinVar;pub use flow::ChainLink;pub use flow::FlowChain;pub use flow::FlowError;pub use flow::FlowExpr;pub use flow::FlowFunc;pub use flow::FlowGraph;pub use flow::FlowInput;pub use flow::FlowInputSource;pub use flow::FlowNode;pub use flow::FlowOutput;pub use flow::FlowOutputTarget;pub use flow::FlowStep;pub use flow::FlowTarget;pub use flow::FlowType;pub use flow::FlowUse;pub use flow::StepParam;pub use flow::StepType;pub use store::clear_all_stores;pub use store::create_store;pub use store::create_store_with;pub use store::get_store_state;pub use store::kv_delete;pub use store::kv_get;pub use store::kv_set;pub use store::remove_store;pub use store::set_store_state;pub use store::update_store_state;pub use store::KVStore;pub use store::Store;pub use store::SubscriptionHandle;pub use native_bridge::native_call;pub use native_bridge::native_register;pub use native_bridge::set_platform_adapter;pub use native_bridge::FromNativeValue;pub use native_bridge::IntoNativeArgs;pub use native_bridge::NativeBridgeError;pub use native_bridge::NativeBridgeState;pub use native_bridge::NativeHandler;pub use native_bridge::NativeResult;pub use native_bridge::NativeValue;pub use native_bridge::PlatformAdapter;
Modules§
- context
- Platform-agnostic context trait for Blinc applications
- context_
state - Global context state singleton
- draw
- Draw Context - Unified Rendering API
- events
- Event dispatch system
- flow
- DAG-based flow language for declarative shader composition
- fsm
- State Machine Runtime
- layer
- Layer Model for BLINC Canvas Architecture
- native_
bridge - Native Bridge for Rust ↔ Platform FFI
- reactive
- Fine-grained reactive signal system
- runtime
- Blinc Runtime
- store
- Blinc Store - Zustand-inspired centralized state management
- value
- Dynamic value system for reactive rendering