Allow canvas::State to produce messages

This commit is contained in:
Héctor Ramón Jiménez 2020-04-28 03:46:03 +02:00
parent 2ca73036ab
commit e4eb0553de
4 changed files with 31 additions and 17 deletions

View file

@ -80,7 +80,10 @@ impl Cache {
Geometry::from_primitive(Primitive::Cached { cache: primitive })
}
pub fn with<'a, T>(&'a self, input: T) -> impl crate::canvas::State + 'a
pub fn with<'a, T, Message>(
&'a self,
input: T,
) -> impl crate::canvas::State<Message> + 'a
where
T: Drawable + std::fmt::Debug + 'a,
{
@ -93,7 +96,7 @@ struct Bind<'a, T> {
input: T,
}
impl<'a, T> crate::canvas::State for Bind<'a, T>
impl<'a, T, Message> crate::canvas::State<Message> for Bind<'a, T>
where
T: Drawable + std::fmt::Debug + 'a,
{