From 179e8863b3c7a1f056eef5e06fbf4f3796a641ba Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 17 Mar 2024 13:55:15 +0100 Subject: Fix broken intra-doc links to `Sandbox` --- src/application.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/application.rs') diff --git a/src/application.rs b/src/application.rs index be0fa0de..48fc672a 100644 --- a/src/application.rs +++ b/src/application.rs @@ -15,9 +15,7 @@ pub use application::{default, Appearance, DefaultStyle}; /// document. /// /// An [`Application`] can execute asynchronous actions by returning a -/// [`Command`] in some of its methods. If you do not intend to perform any -/// background work in your program, the [`Sandbox`] trait offers a simplified -/// interface. +/// [`Command`] in some of its methods. /// /// When using an [`Application`] with the `debug` feature enabled, a debug view /// can be toggled by pressing `F12`. -- cgit From 54f44754eb216d4b2c08cd2a7c3582f1dc295205 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 17 Mar 2024 14:16:38 +0100 Subject: Move `Program` to `application` module --- src/application.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/application.rs') diff --git a/src/application.rs b/src/application.rs index 48fc672a..ba60db67 100644 --- a/src/application.rs +++ b/src/application.rs @@ -1,7 +1,10 @@ //! Build interactive cross-platform applications. -use crate::{Command, Element, Executor, Settings, Subscription}; +mod program; + +pub use program::{program, Definition, Program, Title, Update, View}; use crate::shell::application; +use crate::{Command, Element, Executor, Settings, Subscription}; pub use application::{default, Appearance, DefaultStyle}; -- cgit From cdb18e610a72b4a025d7e1890140393adee5b087 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 17 Mar 2024 19:38:42 +0100 Subject: Move `Application` trait to `advanced` module --- src/application.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/application.rs') diff --git a/src/application.rs b/src/application.rs index ba60db67..8317abcb 100644 --- a/src/application.rs +++ b/src/application.rs @@ -1,12 +1,8 @@ //! Build interactive cross-platform applications. -mod program; - -pub use program::{program, Definition, Program, Title, Update, View}; - use crate::shell::application; use crate::{Command, Element, Executor, Settings, Subscription}; -pub use application::{default, Appearance, DefaultStyle}; +pub use application::{Appearance, DefaultStyle}; /// An interactive cross-platform application. /// @@ -62,8 +58,9 @@ pub use application::{default, Appearance, DefaultStyle}; /// says "Hello, world!": /// /// ```no_run +/// use iced::advanced::Application; /// use iced::executor; -/// use iced::{Application, Command, Element, Settings, Theme}; +/// use iced::{Command, Element, Settings, Theme}; /// /// pub fn main() -> iced::Result { /// Hello::run(Settings::default()) -- cgit From cab9dec6267f3e38b2dee2a0262cd04e21a7519e Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 17 Mar 2024 19:42:43 +0100 Subject: Remove `'static'` bound for `P::State` in `Program::run_with` --- src/application.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/application.rs') diff --git a/src/application.rs b/src/application.rs index 8317abcb..a44d6342 100644 --- a/src/application.rs +++ b/src/application.rs @@ -192,7 +192,8 @@ where /// [`Error`]: crate::Error fn run(settings: Settings) -> crate::Result where - Self: 'static, + Self::Message: 'static, + Self::Executor: 'static, { #[allow(clippy::needless_update)] let renderer_settings = crate::renderer::Settings { -- cgit From eb67aa5d71172569e3d404107a1a449998d98d42 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 17 Mar 2024 19:53:02 +0100 Subject: Revert "Remove `'static'` bound for `P::State` in `Program::run_with`" This reverts commit cab9dec6267f3e38b2dee2a0262cd04e21a7519e. Wasm needs the `'static'` bound since the runtime will run in a background task. --- src/application.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/application.rs') diff --git a/src/application.rs b/src/application.rs index a44d6342..8317abcb 100644 --- a/src/application.rs +++ b/src/application.rs @@ -192,8 +192,7 @@ where /// [`Error`]: crate::Error fn run(settings: Settings) -> crate::Result where - Self::Message: 'static, - Self::Executor: 'static, + Self: 'static, { #[allow(clippy::needless_update)] let renderer_settings = crate::renderer::Settings { -- cgit