Implement executor method for Daemon
This commit is contained in:
parent
9306883618
commit
7f4a73e185
1 changed files with 16 additions and 1 deletions
|
|
@ -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`].
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue