summaryrefslogtreecommitdiffstats
path: root/src/daemon.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-09-18 21:57:04 +0200
committerLibravatar GitHub <noreply@github.com>2024-09-18 21:57:04 +0200
commitdb7ba958d1ddebe6a2fcbec00582f81524cc6e69 (patch)
tree64183c913c7560f6d19df593383be0d7abbb3c81 /src/daemon.rs
parentfc722f1356f9720b3b922a525e8b08bedddb6a5b (diff)
parent7f4a73e1856134821e3e0af11f21469cdc4544a2 (diff)
downloadiced-db7ba958d1ddebe6a2fcbec00582f81524cc6e69.tar.gz
iced-db7ba958d1ddebe6a2fcbec00582f81524cc6e69.tar.bz2
iced-db7ba958d1ddebe6a2fcbec00582f81524cc6e69.zip
Merge pull request #2580 from mtkennerly/feature/custom-executor
Allow specifying a custom executor
Diffstat (limited to 'src/daemon.rs')
-rw-r--r--src/daemon.rs17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/daemon.rs b/src/daemon.rs
index 6a6ad133..81254bf9 100644
--- a/src/daemon.rs
+++ b/src/daemon.rs
@@ -2,7 +2,7 @@
use crate::application;
use crate::program::{self, Program};
use crate::window;
-use crate::{Element, Font, Result, Settings, Subscription, Task};
+use crate::{Element, Executor, Font, Result, Settings, Subscription, Task};
use std::borrow::Cow;
@@ -223,6 +223,21 @@ impl<P: Program> Daemon<P> {
settings: self.settings,
}
}
+
+ /// Sets the executor of the [`Daemon`].
+ pub fn executor<E>(
+ self,
+ ) -> Daemon<
+ impl Program<State = P::State, Message = P::Message, Theme = P::Theme>,
+ >
+ where
+ E: Executor,
+ {
+ Daemon {
+ raw: program::with_executor::<P, E>(self.raw),
+ settings: self.settings,
+ }
+ }
}
/// The title logic of some [`Daemon`].