Expand description
§fission-core
The runtime, widget system, and action/reducer architecture for the Fission UI framework.
fission-core provides:
- A declarative widget tree built from composable primitives (
Node,Widget). - A unidirectional data-flow pipeline:
Action->Runtime::dispatch-> reducer -> mutatedAppState. - An effect system for async side-effects (
Effect,SystemEffect). - Built-in widgets:
Button,Text, [TextInput], [Container],Row,Column, [Scroll], [ZStack], [Grid], [LazyColumn], and more.
§Getting started
ⓘ
use fission_core::*;
use fission_core::ui::*;
// Define application state
#[derive(Debug, Default)]
struct MyState { value: String }
impl AppState for MyState {}
// Build a widget
struct MyWidget;
impl Widget<MyState> for MyWidget {
fn build(&self, ctx: &mut BuildCtx<MyState>, view: &View<MyState>) -> Node {
Text::new(&*view.state.value).into_node()
}
}Re-exports§
pub use action::Action;pub use action::ActionEnvelope;pub use action::ActionId;pub use action::AppState;pub use context::ReducerContext;pub use context::Effects;pub use effect::Effect;pub use effect::EffectEnvelope;pub use effect::EffectPayload;pub use effect::ActionInput;pub use effect::SystemEffect;pub use env::Env;pub use env::InteractionStateMap;pub use env::RuntimeState;pub use env::ScrollStateMap;pub use env::Clipboard;pub use env::ImeHandler;pub use runtime::Runtime;pub use event::InputEvent;pub use event::KeyCode;pub use event::KeyEvent;pub use event::LifecycleEvent;pub use event::PointerButton;pub use event::PointerEvent;pub use lowering::LoweringContext;pub use lowering::NodeBuilder;pub use registry::ActionRegistry;pub use registry::AnimationPropertyId;pub use registry::AnimationRequest;pub use registry::AnimationStartValue;pub use registry::BuildCtx;pub use registry::Handler;pub use registry::PortalLayer;pub use registry::VideoRegistration;pub use time::Clock;pub use time::CurrentTime;pub use ui::Builder;pub use ui::Button;pub use ui::Column;pub use ui::CustomNode;pub use ui::LayoutBuilder;pub use ui::Lower;pub use ui::LowerDyn;pub use ui::Node;pub use ui::Row;pub use ui::Text;pub use view::Selector;pub use view::View;pub use view::Widget;
Modules§
- action
- Actions, envelopes, and application state traits.
- context
- Reducer context and effect builder.
- diff
- effect
- Side-effect primitives for async operations.
- env
- event
- Input events consumed by the
Runtime. - hit_
test - input
- lowering
- media
- op
- Operations that IR nodes can perform.
- registry
- runtime
- time
- ui
- view
- Read-only view, widget trait, and selector pattern.
Structs§
- ADVANCE_
TO_ ACTION_ ID - Advance
To - An action that sets the runtime clock to an absolute timestamp.
- BoxConstraints
- Minimum and maximum width/height bounds passed from parent to child during layout.
- Layout
Engine - The constraint-based layout solver.
- Layout
Point - A 2D point in layout coordinate space.
- Layout
Rect - An axis-aligned rectangle: an origin point plus a size.
- Layout
Size - A 2D size in layout coordinate space.
- Layout
Snapshot - The complete output of a layout pass.
- NodeId
- A content-addressed 128-bit node identity.
- TICK_
ACTION_ ID - Tick
- A frame-tick action that advances the runtime clock by a delta.
- Widget
Node Id - A 128-bit identity for a widget.
Enums§
- Embed
Kind - The kind of platform-native surface embedded in the UI.
- Flex
Direction - The primary axis direction for a flex or scroll container.
- Layout
Op - A layout operation that sizes and positions a node and its children.
- Op
- The operation a node performs.
Traits§
- Text
Measurer - A platform-provided text measurement backend.
Type Aliases§
- Boxed
Reducer - A type-erased reducer function stored in the
Runtime. - Layout
Unit - The scalar type used for all layout measurements.