This commit is contained in:
Nathan Sobo 2023-04-12 12:22:26 -06:00
parent a25f962185
commit 4cb13fb39c
3 changed files with 25 additions and 11 deletions

View file

@ -128,6 +128,16 @@ pub trait Drawable<V: View> {
}
}
fn into_root(self, cx: &ViewContext<V>) -> RootElement<V>
where
Self: 'static + Sized,
{
RootElement {
element: self.boxed(),
view: cx.handle().downgrade(),
}
}
fn named(self, name: impl Into<Cow<'static, str>>) -> Element<V>
where
Self: 'static + Sized,