azul_css

Struct HotReloadOverrideHandler

Source
pub struct HotReloadOverrideHandler {
    pub base_style: Css,
    pub hot_reloader: Box<dyn HotReloadHandler>,
}
Expand description

Custom hot-reloader combinator that can be used to merge hot-reloaded styles onto a base style. Can be useful when working from a base configuration, such as the OS-native styles.

Fields§

§base_style: Css

The base style, usually provided by azul-native-style.

§hot_reloader: Box<dyn HotReloadHandler>

The style that will be added on top of the base_style.

Implementations§

Source§

impl HotReloadOverrideHandler

Source

pub fn new(base_style: Css, hot_reloader: Box<dyn HotReloadHandler>) -> Self

Creates a new HotReloadHandler that merges styles onto the given base style (usually the system-native style, in order to let the user override properties).

Trait Implementations§

Source§

impl HotReloadHandler for HotReloadOverrideHandler

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.