Expand description
Core of egui-reactor: View, Cx, Store, State, Handle, Dispatch,
the hooks and the layout and paint attribute types.
rsx!, #[component] and #[hook] come from egui-reactor-macros and are
re-exported here, so use egui_reactor::prelude::* is the only import a
component file needs.
Re-exports§
pub use layout::Align;pub use layout::AlignSelf;pub use layout::ContainerStyle;pub use layout::Direction;pub use layout::Display;pub use layout::Gap;pub use layout::ItemStyle;pub use layout::Justify;pub use layout::Length;pub use layout::PaintStyle;pub use taffy;
Modules§
- layout
- Layout attributes:
Length,ItemStyleandContainerStyle. - paint
- Paint attributes:
PaintStyle, the look of a box. - prelude
- Everything a component needs, in one
use.
Macros§
- rsx
- Build a
Viewfrom JSX-like syntax.
Structs§
- Arity0
- Marker: the handler ignores the payload (
|| ..). - Arity1
- Marker: the handler takes the payload (
|payload| ..). - Collision
- A hook id that was requested twice within one pass.
- Cx
- The context passed to components and hooks.
- Dispatch
- A
Clone + Sendsender into oneuse_reducer’s message queue. - Emitter
- A child-side handle that fires one event kind.
- FnCleanup
- Marker for an effect body that returns a cleanup closure.
- Handle
- A
Copyaccessor to one hook slot. - NoCleanup
- Marker for an effect body that returns no cleanup.
- State
- A guard over one
use_stateslot. - Store
- Owns every hook’s state, keyed by [
egui::Id].
Traits§
- Handler
- A callback prop that may or may not take the event payload.
- Into
Cleanup - What an effect body may return.
- Props
- Implemented by every
#[component]props struct. - Spawn
Future - A future
use_futureandspawncan run. - View
- Something that can draw itself into a
Cx.
Functions§
- props_
builder - Get the props builder for a component function.
- provide_
context - Make
valuevisible touse_context::<T>insidechildren. - spawn
- Run a future to completion and throw its result away.
- use_
animate - egui’s
animate_bool_with_time_and_easingbehind a hook: 0 whileonis false, 1 while it is true, and in between fortimeseconds afteronflips, eased withcubic_out. - use_
animate_ with use_animatewith an easing of the caller’s choosing (egui::emath::easing).- use_
context - Read the innermost
Handleprovided forT, if any. - use_
effect - Run
fon the first visit and whenever the hash ofdepschanges. - use_
future - Run the future
fbuilds, and report where it has got to. - use_
handle - Like
use_state, but returns aCopyHandleinstead of a guard. - use_
memo - Compute
fon the first visit and whenever the hash ofdepschanges. - use_
persisted - Hold
Tin the store and in the app’s storage, keyed bykey. - use_
reducer - Hold
Sin the store and fold queued messages into it withreducer. - use_
state - Hold
Tin the store, initialising it on the first visit. - view
- Wrap a closure as a
View, fixing the closure’s argument type.
Type Aliases§
- Event
Sink - The fused event closure a parent hands to a child, shared by every emitter.