EffectFuture type added
@@ -2,10 +2,12 @@ use crate::runtime::msg::Msg;
use derive_more::From;
use futures::future::LocalBoxFuture;
+pub type EffectFuture = LocalBoxFuture<'static, Msg>;
+
#[derive(From)]
pub enum Effect {
Msg(Msg),
- Future(LocalBoxFuture<'static, Msg>),
+ Future(EffectFuture),
}
pub struct Effects {
@@ -44,13 +46,13 @@ impl Effects {
pub fn msg(msg: Msg) -> Self {
Effects::one(Effect::Msg(msg))
}
- pub fn future(future: LocalBoxFuture<'static, Msg>) -> Self {
+ pub fn future(future: EffectFuture) -> Self {
Effects::one(Effect::Future(future))
}
pub fn msgs(msgs: Vec<Msg>) -> Self {
Effects::many(msgs.into_iter().map(Effect::from).collect())
}
- pub fn futures(futures: Vec<LocalBoxFuture<'static, Msg>>) -> Self {
+ pub fn futures(futures: Vec<EffectFuture>) -> Self {
Effects::many(futures.into_iter().map(Effect::from).collect())
}
pub fn unchanged(mut self) -> Self {
