pub struct DesktopPlugin<UiState, UiAction, AsyncAction, RootProps = ()> {
pub Root: Component<RootProps>,
/* private fields */
}Expand description
Dioxus Plugin for Bevy
Fields§
§Root: Component<RootProps>Root component
Implementations§
Source§impl<UiState, UiAction, AsyncAction, RootProps> DesktopPlugin<UiState, UiAction, AsyncAction, RootProps>
impl<UiState, UiAction, AsyncAction, RootProps> DesktopPlugin<UiState, UiAction, AsyncAction, RootProps>
Sourcepub fn new(Root: DioxusComponent<RootProps>) -> Self
pub fn new(Root: DioxusComponent<RootProps>) -> Self
Initialize DioxusPlugin with root component and channel types
use dip::prelude::*;
fn main() {
App::new()
.add_plugin(DesktopPlugin::<NoUiState, NoUiAction, NoAsyncAction>::new(Root))
.run();
}
fn Root(cx: Scope) -> Element {
cx.render(rsx! {
h1 { "Hello, World !" }
})
}Trait Implementations§
Source§impl<UiState, UiAction, AsyncAction, RootProps> Plugin for DesktopPlugin<UiState, UiAction, AsyncAction, RootProps>
impl<UiState, UiAction, AsyncAction, RootProps> Plugin for DesktopPlugin<UiState, UiAction, AsyncAction, RootProps>
Auto Trait Implementations§
impl<UiState, UiAction, AsyncAction, RootProps> Freeze for DesktopPlugin<UiState, UiAction, AsyncAction, RootProps>
impl<UiState, UiAction, AsyncAction, RootProps> RefUnwindSafe for DesktopPlugin<UiState, UiAction, AsyncAction, RootProps>
impl<UiState, UiAction, AsyncAction, RootProps> Send for DesktopPlugin<UiState, UiAction, AsyncAction, RootProps>
impl<UiState, UiAction, AsyncAction, RootProps> Sync for DesktopPlugin<UiState, UiAction, AsyncAction, RootProps>
impl<UiState, UiAction, AsyncAction, RootProps> Unpin for DesktopPlugin<UiState, UiAction, AsyncAction, RootProps>
impl<UiState, UiAction, AsyncAction, RootProps> UnwindSafe for DesktopPlugin<UiState, UiAction, AsyncAction, RootProps>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.