5use wasm_bindgen::UnwrapThrowExt;
8 fn render<'a, 'bump>(&'a self, bump: &'bump Bump) -> Node<'bump>
13impl<'r, R> Render for &'r R
17 fn render<'a, 'bump>(&'a self, bump: &'bump Bump) -> Node<'bump>
25impl<R> Render for Rc<R>
29 fn render<'a, 'bump>(&'a self, bump: &'bump Bump) -> Node<'bump>
37/// A `RootRender` is a render component that can be the root rendering component
38/// mounted to a virtual DOM.
40/// In addition to rendering, it must also be `'static` so that it can be owned
41/// by the virtual DOM and `Any` so that it can be downcast to its concrete type
42/// by event listener callbacks.
44/// You do not need to implement this trait by hand: there is a blanket
45/// implementation for all `Render` types that fulfill the `RootRender`
47pub trait RootRender: Any + Render {
48 /// Get this `&RootRender` trait object as an `&Any` trait object reference.
49 fn as_any(&self) -> &Any;
51 /// Get this `&mut RootRender` trait object as an `&mut Any` trait object
53 fn as_any_mut(&mut self) -> &mut Any;
56impl<T: Any + Render> RootRender for T {
57 fn as_any(&self) -> &Any {
61 fn as_any_mut(&mut self) -> &mut Any {
67 /// Downcast this shared `&dyn RootRender` trait object reference to its
68 /// underlying concrete type.
72 /// Panics if this virtual DOM's root rendering component is not an `R`
74 pub fn unwrap_ref<R: RootRender>(&self) -> &R {
77 .expect_throw("bad `RootRender::unwrap_ref` call")
80 /// Downcast this exclusive `&mut dyn RootRender` trait object reference to
81 /// its underlying concrete type.
85 /// Panics if this virtual DOM's root rendering component is not an `R`
87 pub fn unwrap_mut<R: RootRender>(&mut self) -> &mut R {
90 .expect_throw("bad `RootRender::unwrap_ref` call")
97 fn render_is_object_safe() {
99 fn takes_dyn_render(_: &dyn super::Render) {}
103 fn root_render_is_object_safe() {
105 fn takes_dyn_render(_: &dyn super::RootRender) {}
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list