[][src]Trait azul_css::HotReloadHandler

pub trait HotReloadHandler {
    fn reload_style(&self) -> Result<Css, String>;
fn get_reload_interval(&self) -> Duration; }

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

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).

fn get_reload_interval(&self) -> Duration

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

Loading content...

Implementors

Loading content...