azul_css

Trait HotReloadHandler

Source
pub trait HotReloadHandler {
    // Required methods
    fn reload_style(&self) -> Result<Css, String>;
    fn get_reload_interval(&self) -> Duration;
}
Expand description

Interface that can be used to reload a stylesheet while an application is running. Initialize the Window::new with a Box<HotReloadHandle> - this allows the hot-reloading to be independent of the source format, making CSS only one frontend format.

You can, for example, parse and load styles directly from a SASS, LESS or JSON parser. The default parser is azul-css-parser.

Required Methods§

Source

fn reload_style(&self) -> Result<Css, String>

Reloads the style from the source format. Should return Ok() when the CSS has be correctly reloaded, and an human-readable error string otherwise (since the error needs to be printed to stdout when hot-reloading).

Source

fn get_reload_interval(&self) -> Duration

Returns how quickly the hot-reloader should reload the source format.

Implementors§