summaryrefslogtreecommitdiffstats
path: root/src/application.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/application.rs')
-rw-r--r--src/application.rs20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/application.rs b/src/application.rs
index d0f77304..2ba764be 100644
--- a/src/application.rs
+++ b/src/application.rs
@@ -32,7 +32,9 @@
//! ```
use crate::program::{self, Program};
use crate::window;
-use crate::{Element, Font, Result, Settings, Size, Subscription, Task};
+use crate::{
+ Element, Executor, Font, Result, Settings, Size, Subscription, Task,
+};
use std::borrow::Cow;
@@ -376,6 +378,22 @@ impl<P: Program> Application<P> {
window: self.window,
}
}
+
+ /// Sets the executor of the [`Application`].
+ pub fn executor<E>(
+ self,
+ ) -> Application<
+ impl Program<State = P::State, Message = P::Message, Theme = P::Theme>,
+ >
+ where
+ E: Executor,
+ {
+ Application {
+ raw: program::with_executor::<P, E>(self.raw),
+ settings: self.settings,
+ window: self.window,
+ }
+ }
}
/// The title logic of some [`Application`].