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§
Sourcefn reload_style(&self) -> Result<Css, String>
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).
Sourcefn get_reload_interval(&self) -> Duration
fn get_reload_interval(&self) -> Duration
Returns how quickly the hot-reloader should reload the source format.