This commit is contained in:
Andrey Tkachenko 2021-04-09 21:09:28 +04:00
parent 0ae487e4de
commit 16ea88b644
2 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,5 @@
#![feature(associated_type_defaults, never_type, unsize, specialization)] #![feature(associated_type_defaults, never_type, unsize, specialization)]
#![feature(generic_associated_types)]
pub mod convert; pub mod convert;
pub mod engine; pub mod engine;
@ -27,4 +28,4 @@ pub mod prelude {
pub use crate::renderable::{Renderable, RenderImplementation, Stub}; pub use crate::renderable::{Renderable, RenderImplementation, Stub};
pub use crate::node::Node; pub use crate::node::Node;
pub use crate::view::View; pub use crate::view::View;
} }

View File

@ -12,10 +12,10 @@ pub trait View<E, CE>
{ {
type InputContext: Context; type InputContext: Context;
type OutputContext: Context; type OutputContext: Context;
type Renderable: Renderable<E>; type Renderable<T: Renderable<CE> + 'static>: Renderable<E>;
fn receive_context(&mut self, ctx: Self::InputContext) -> Self::OutputContext; fn receive_context(&mut self, ctx: Self::InputContext) -> Self::OutputContext;
fn build<C: Renderable<CE> + 'static>(self, children: Option<C>) -> Self::Renderable; fn build<C: Renderable<CE> + 'static>(self, children: Option<C>) -> Self::Renderable<C>;
} }
// It will have sense when `specialization` will be ready to use // It will have sense when `specialization` will be ready to use