summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-09-18 21:21:02 +0200
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-09-18 21:47:36 +0200
commit7f4a73e1856134821e3e0af11f21469cdc4544a2 (patch)
tree832cba7861f0cae066d38174e1a75921f557b977
parent93068836182cb2a6527a267453f280eb5c0d34a3 (diff)
downloadiced-7f4a73e1856134821e3e0af11f21469cdc4544a2.tar.gz
iced-7f4a73e1856134821e3e0af11f21469cdc4544a2.tar.bz2
iced-7f4a73e1856134821e3e0af11f21469cdc4544a2.zip
Implement `executor` method for `Daemon`
-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`].