Skip to main content

Crate frust_core

Crate frust_core 

Source
Expand description

Layer 1+2 of Frust: the declarative view API, the retained widget tree, box-constraint layout, and the rebuild/layout/paint pass skeleton. Modelled on xilem/Masonry, depending on neither, with no unsafe.

Re-exports§

pub use anim::AnimationController;
pub use anim::AnimationStatus;
pub use anim::Curve;
pub use anim::FrameTime;
pub use anim::Lerp;
pub use anim::Spring;
pub use anim::SpringDesc;
pub use anim::Tween;
pub use app::FocusRingPolicy;
pub use app::Orientation;
pub use app::RenderRoot;
pub use app::WindowMetrics;
pub use component::Component;
pub use component::ComponentView;
pub use component::ComponentWidget;
pub use component::component;
pub use event::CursorIcon;
pub use event::EditCommand;
pub use event::EditingState;
pub use event::EventCtx;
pub use event::EventOutcome;
pub use event::EventResult;
pub use event::ImeContentType;
pub use event::ImeEvent;
pub use event::ImeState;
pub use event::InputEvent;
pub use event::Key;
pub use event::KeyEvent;
pub use event::Modifiers;
pub use event::NamedKey;
pub use event::OverlayEvent;
pub use event::OverlayEventKind;
pub use event::PointerButton;
pub use event::PointerEvent;
pub use event::PointerPhase;
pub use event::ScrollDelta;
pub use event::has_pending_result_flush;
pub use event::mark_focus_orphaned;
pub use event::mark_pending_result_flush;
pub use event::take_focus_orphaned;
pub use event::take_pending_result_flush;
pub use input::FLING_DECAY;
pub use input::FLING_STOP;
pub use input::MOUSE_SLOP;
pub use input::TOUCH_SLOP;
pub use input::VELOCITY_WINDOW_MS;
pub use input::VelocityTracker;
pub use input::WHEEL_LINE_PX;
pub use input::fling_decay;
pub use input::fling_displacement;
pub use insets::CornerInset;
pub use insets::CornerInsets;
pub use insets::EdgeInsets as WindowEdgeInsets;
pub use insets::WindowInsets;
pub use layout::BoxConstraints;
pub use overlay::OutsideTap;
pub use overlay::OverlayBand;
pub use overlay::OverlayEntry;
pub use overlay::OverlayHit;
pub use overlay::OverlayInput;
pub use overlay::OverlayKey;
pub use overlay::OverlayKeys;
pub use overlay::OverlayPod;
pub use retained::RetainedEntry;
pub use retained::RetainedKey;
pub use retained::RetainedLedger;
pub use selection_toolbar::SelectionToolbarActions;
pub use selection_toolbar::SelectionToolbarBuilder;
pub use selection_toolbar::SelectionToolbarPolicy;
pub use selection_toolbar::SelectionToolbarRequest;
pub use selection_toolbar::install_selection_toolbar_builder_if_unset;
pub use selection_toolbar::lock_selection_toolbar_policy;
pub use selection_toolbar::selection_toolbar_builder;
pub use selection_toolbar::selection_toolbar_policy;
pub use selection_toolbar::set_selection_toolbar_builder;
pub use selection_toolbar::set_selection_toolbar_policy;
pub use semantics::SemanticsCtx;
pub use semantics::SemanticsUpdate;
pub use shortcuts::Chord;
pub use shortcuts::ChordParseError;
pub use shortcuts::ShortcutDecl;
pub use shortcuts::ShortcutHint;
pub use shortcuts::ShortcutId;
pub use shortcuts::ShortcutScope;
pub use sliver::GrowthDirection;
pub use sliver::ScrollAxis;
pub use sliver::ScrollDirection;
pub use sliver::SliverConstraints;
pub use sliver::SliverGeometry;
pub use sliver::SliverWidget;
pub use tree::InspectNode;
pub use tree::WidgetPod;
pub use tree::WidgetTree;
pub use view::AnyView;
pub use view::BuildCtx;
pub use view::ChangeFlags;
pub use view::View;
pub use view::ViewSeq;
pub use view::WidgetId;
pub use view::any;
pub use view::views;
pub use widget::ChildPod;
pub use widget::DiscardScene;
pub use widget::HeroDirective;
pub use widget::HeroFrames;
pub use widget::LayoutCtx;
pub use widget::PaintCtx;
pub use widget::PaintOutcome;
pub use widget::PaintScene;
pub use widget::TickClass;
pub use widget::Widget;
pub use accesskit;

Modules§

anim
Animation vocabulary: the shared frame clock (FrameTime) plus the pure math widgets consume it through: easing Curves, Tween interpolation, analytic Spring dynamics, and the AnimationController.
app
The render root: the object each platform shell drives each frame.
component
Component: Flutter’s StatefulWidget analog.
event
Layer 2 input: the InputEvent vocabulary and the EventCtx a widget mutates handling it.
hit
Hit-testing under an arbitrary kurbo::Affine: the helpers a transformed ChildPod uses, for canvas hit closures and pan/zoom containers.
input
Pure, deterministic gesture helpers: slop/wheel constants, a trailing-window VelocityTracker and fling-decay math (cross-checked against masonry’s). Times are logical ms; positions and velocities are logical px and px/s.
insets
Window insets: Flutter’s ViewportMetrics inset model in the framework core.
layout
Box-constraint layout, the Flutter/Masonry box model (not CSS): a parent hands each child BoxConstraints and the child returns a Size within them.
overlay
The overlay portal: how a widget anywhere in the tree floats a pod above the whole app (menus, popovers, tooltips, selection toolbars).
retained
Retained-page keys and the resident-key ledger.
selection_toolbar
The selection-toolbar seam: what a focused text field publishes about its selection, and who draws the copy/cut/paste/select-all bar over it.
semantics
The semantics seam: a pull-based accessibility tree pass.
shortcuts
Keyboard shortcuts: the Chord spec and the per-paint declaration table behind PaintCtx::register_shortcut.
sliver
The sliver layout protocol for a scrolling viewport’s children, mirroring Flutter’s RenderSliver (rendering/sliver.dart).
tree
The retained widget tree, backed by tree_arena.
view
Layer 1: the declarative View trait.
widget
Layer 2: the retained Widget trait and its layout/paint contexts.

Structs§

CornerRadii
Re-exported so widgets can name PaintScene’s argument types. Per-corner radii for a rounded rectangle, in the pre-transform coordinate space.
DashPattern
Re-exported so widgets can name PaintScene’s argument types. A stroke’s dash pattern: an on run, an off gap, and a phase offset into that repeating cycle — all lengths in the pre-transform coordinate space.