Draft experimental hotpatching support 🎉
Thanks to `subsecond` by the Dioxus folks!
This commit is contained in:
parent
5ca5000cdc
commit
10bbe44c30
10 changed files with 212 additions and 35 deletions
|
|
@ -38,6 +38,8 @@ use crate::{
|
|||
Element, Executor, Font, Result, Settings, Size, Subscription, Task,
|
||||
};
|
||||
|
||||
use iced_debug as debug;
|
||||
|
||||
use std::borrow::Cow;
|
||||
|
||||
pub mod timed;
|
||||
|
|
@ -126,7 +128,7 @@ where
|
|||
state: &mut Self::State,
|
||||
message: Self::Message,
|
||||
) -> Task<Self::Message> {
|
||||
self.update.update(state, message)
|
||||
debug::hot(|| self.update.update(state, message))
|
||||
}
|
||||
|
||||
fn view<'a>(
|
||||
|
|
@ -134,7 +136,7 @@ where
|
|||
state: &'a Self::State,
|
||||
_window: window::Id,
|
||||
) -> Element<'a, Self::Message, Self::Theme, Self::Renderer> {
|
||||
self.view.view(state)
|
||||
debug::hot(|| self.view.view(state))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -327,7 +329,7 @@ impl<P: Program> Application<P> {
|
|||
> {
|
||||
Application {
|
||||
raw: program::with_title(self.raw, move |state, _window| {
|
||||
title.title(state)
|
||||
debug::hot(|| title.title(state))
|
||||
}),
|
||||
settings: self.settings,
|
||||
window: self.window,
|
||||
|
|
@ -342,7 +344,9 @@ impl<P: Program> Application<P> {
|
|||
impl Program<State = P::State, Message = P::Message, Theme = P::Theme>,
|
||||
> {
|
||||
Application {
|
||||
raw: program::with_subscription(self.raw, f),
|
||||
raw: program::with_subscription(self.raw, move |state| {
|
||||
debug::hot(|| f(state))
|
||||
}),
|
||||
settings: self.settings,
|
||||
window: self.window,
|
||||
}
|
||||
|
|
@ -356,7 +360,9 @@ impl<P: Program> Application<P> {
|
|||
impl Program<State = P::State, Message = P::Message, Theme = P::Theme>,
|
||||
> {
|
||||
Application {
|
||||
raw: program::with_theme(self.raw, move |state, _window| f(state)),
|
||||
raw: program::with_theme(self.raw, move |state, _window| {
|
||||
debug::hot(|| f(state))
|
||||
}),
|
||||
settings: self.settings,
|
||||
window: self.window,
|
||||
}
|
||||
|
|
@ -370,7 +376,9 @@ impl<P: Program> Application<P> {
|
|||
impl Program<State = P::State, Message = P::Message, Theme = P::Theme>,
|
||||
> {
|
||||
Application {
|
||||
raw: program::with_style(self.raw, f),
|
||||
raw: program::with_style(self.raw, move |state, theme| {
|
||||
debug::hot(|| f(state, theme))
|
||||
}),
|
||||
settings: self.settings,
|
||||
window: self.window,
|
||||
}
|
||||
|
|
@ -385,7 +393,7 @@ impl<P: Program> Application<P> {
|
|||
> {
|
||||
Application {
|
||||
raw: program::with_scale_factor(self.raw, move |state, _window| {
|
||||
f(state)
|
||||
debug::hot(|| f(state))
|
||||
}),
|
||||
settings: self.settings,
|
||||
window: self.window,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue