Trait Application

Source
pub trait Application: Sized {
    type Theme: Theme;

    // Required methods
    fn build(context: AppContext) -> impl Widget;
    fn config(&self) -> MayConfig<Self::Theme>;

    // Provided methods
    fn plugins(&self) -> PluginManager<Self::Theme> { ... }
    fn run(self) { ... }
}
Expand description

The main application interface.

Contains basic functions for the MayRunner to create and run an application.

Required Associated Types§

Source

type Theme: Theme

The theme of the application and its widgets.

See maycoon_theme::theme for built-in themes.

Required Methods§

Source

fn build(context: AppContext) -> impl Widget

Renders/builds the application’s widgets.

This function will be passed to the MayRunner to create and run the application.

Source

fn config(&self) -> MayConfig<Self::Theme>

Returns the MayConfig for the application.

Provided Methods§

Source

fn plugins(&self) -> PluginManager<Self::Theme>

Builds and returns the PluginManager for the application.

Source

fn run(self)

Runs the application using the MayRunner.

Override this method if you want to use a custom event loop.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§