Implement executor method for Daemon

This commit is contained in:
Héctor Ramón Jiménez 2024-09-18 21:21:02 +02:00
parent 9306883618
commit 7f4a73e185
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -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`].