WIP
This commit is contained in:
parent
c866c211b5
commit
0069dd5ce6
1 changed files with 5 additions and 2 deletions
|
@ -5,7 +5,7 @@ use derive_more::{Deref, DerefMut};
|
|||
pub(crate) use smallvec::SmallVec;
|
||||
use std::{any::Any, fmt::Debug, mem};
|
||||
|
||||
pub trait Element<V: 'static> {
|
||||
pub trait Element<V: 'static>: 'static + Sized {
|
||||
type ElementState: 'static;
|
||||
|
||||
fn element_id(&self) -> Option<ElementId>;
|
||||
|
@ -25,6 +25,10 @@ pub trait Element<V: 'static> {
|
|||
cx: &mut ViewContext<V>,
|
||||
);
|
||||
|
||||
fn into_any(self) -> AnyElement<V> {
|
||||
AnyElement::new(self)
|
||||
}
|
||||
|
||||
fn draw<T, R>(
|
||||
self,
|
||||
origin: Point<Pixels>,
|
||||
|
@ -34,7 +38,6 @@ pub trait Element<V: 'static> {
|
|||
f: impl FnOnce(&Self::ElementState, &mut ViewContext<V>) -> R,
|
||||
) -> R
|
||||
where
|
||||
Self: Sized,
|
||||
T: Clone + Default + Debug + Into<AvailableSpace>,
|
||||
{
|
||||
let mut element = RenderedElement {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue