Skip to main content

Crate fission_core

Crate fission_core 

Source
Expand description

§fission-core

The runtime, widget system, and action/reducer architecture for the Fission UI framework.

fission-core provides:

§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
AdvanceTo
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.
LayoutEngine
The constraint-based layout solver.
LayoutPoint
A 2D point in layout coordinate space.
LayoutRect
An axis-aligned rectangle: an origin point plus a size.
LayoutSize
A 2D size in layout coordinate space.
LayoutSnapshot
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.
WidgetNodeId
A 128-bit identity for a widget.

Enums§

EmbedKind
The kind of platform-native surface embedded in the UI.
FlexDirection
The primary axis direction for a flex or scroll container.
LayoutOp
A layout operation that sizes and positions a node and its children.
Op
The operation a node performs.

Traits§

TextMeasurer
A platform-provided text measurement backend.

Type Aliases§

BoxedReducer
A type-erased reducer function stored in the Runtime.
LayoutUnit
The scalar type used for all layout measurements.