Skip to main content

Module prelude

Module prelude 

Source
Expand description

Everything a component needs, in one use.

Re-exports§

pub use crate::layout::Align;
pub use crate::layout::AlignSelf;
pub use crate::layout::ContainerStyle;
pub use crate::layout::Direction;
pub use crate::layout::Display;
pub use crate::layout::Gap;
pub use crate::layout::ItemStyle;
pub use crate::layout::Justify;
pub use crate::layout::Length;
pub use crate::layout::PaintStyle;

Macros§

rsx
Build a View from JSX-like syntax.

Structs§

Collision
A hook id that was requested twice within one pass.
Cx
The context passed to components and hooks.
Dispatch
A Clone + Send sender into one use_reducer’s message queue.
Emitter
A child-side handle that fires one event kind.
Handle
A Copy accessor to one hook slot.
State
A guard over one use_state slot.
Store
Owns every hook’s state, keyed by [egui::Id].

Enums§

Poll
What use_future returns. Re-exported so a component file needs no use std::task::Poll of its own. Indicates whether a value is available or if the current task has been scheduled to receive a wakeup instead.

Traits§

Handler
A callback prop that may or may not take the event payload.
View
Something that can draw itself into a Cx.

Functions§

provide_context
Make value visible to use_context::<T> inside children.
spawn
Run a future to completion and throw its result away.
use_animate
egui’s animate_bool_with_time_and_easing behind a hook: 0 while on is false, 1 while it is true, and in between for time seconds after on flips, eased with cubic_out.
use_animate_with
use_animate with an easing of the caller’s choosing (egui::emath::easing).
use_context
Read the innermost Handle provided for T, if any.
use_effect
Run f on the first visit and whenever the hash of deps changes.
use_future
Run the future f builds, and report where it has got to.
use_handle
Like use_state, but returns a Copy Handle instead of a guard.
use_memo
Compute f on the first visit and whenever the hash of deps changes.
use_persisted
Hold T in the store and in the app’s storage, keyed by key.
use_reducer
Hold S in the store and fold queued messages into it with reducer.
use_state
Hold T in the store, initialising it on the first visit.
view
Wrap a closure as a View, fixing the closure’s argument type.

Type Aliases§

EventSink
The fused event closure a parent hands to a child, shared by every emitter.

Attribute Macros§

component
Turn a function into a egui-reactor component.
hook
Turn a function into a custom hook.