Skip to main content

Module prelude

Module prelude 

Source
Expand description

The GPUI prelude is a collection of traits and types that are widely used throughout the library. It is recommended to import this prelude into your application to avoid having to import each trait individually.

Re-exports§

pub use crate::AppContext as _;
pub use crate::AppContext as _;
pub use crate::BorrowAppContext;
pub use crate::Context;
pub use crate::Element;
pub use crate::InteractiveElement;
pub use crate::IntoElement;
pub use crate::ParentElement;
pub use crate::Render;
pub use crate::RenderOnce;
pub use crate::StatefulInteractiveElement;
pub use crate::Styled;
pub use crate::StyledImage;
pub use crate::TaskExt as _;
pub use crate::VisualContext;

Traits§

FluentBuilder
A helper trait for building complex objects with imperative conditionals in a fluent style.
Refineable
A trait for types that can be refined with partial updates.

Derive Macros§

IntoElement
#[derive(IntoElement)] is used to create a Component out of anything that implements the RenderOnce trait.
Refineable
VisualContext
#[derive(VisualContext)] is used to create a visual context out of anything that holds a &mut Window and implements AppContext Note that a #[app] and a #[window] attribute are required to identify the variables holding the &mut App, and &mut Window respectively.