pub struct RootHandler<RootElem: Element<NoEvent, ()> + Clone + 'static> {
pub root_widget: RootWidget<RootElem>,
pub init_tracing: bool,
}Expand description
Creates a GUI application from a component
Fields§
§root_widget: RootWidget<RootElem>§init_tracing: boolImplementations§
Source§impl<Comp: Component<Props = ()>> RootHandler<ComponentHolder<Comp, NoEvent, ()>>
impl<Comp: Component<Props = ()>> RootHandler<ComponentHolder<Comp, NoEvent, ()>>
Sourcepub fn new(root_component: Comp) -> Self
pub fn new(root_component: Comp) -> Self
Creates the data to start the application.
The root_component parameter should be roughly YourRootComponent::new(some_props).
Call launch to actually start the application.
Sourcepub fn with_initial_state(self, comp_local_state: Comp::LocalState) -> Self
pub fn with_initial_state(self, comp_local_state: Comp::LocalState) -> Self
Set the local state of the root component to a value other than default
Source§impl<RootElem: Element<NoEvent, ()> + Clone + 'static> RootHandler<RootElem>
impl<RootElem: Element<NoEvent, ()> + Clone + 'static> RootHandler<RootElem>
pub fn with_tracing(self, init_tracing: bool) -> Self
Sourcepub fn launch(self) -> Result<(), PlatformError>
pub fn launch(self) -> Result<(), PlatformError>
Start the application.
Auto Trait Implementations§
impl<RootElem> Freeze for RootHandler<RootElem>where
RootElem: Freeze,
<RootElem as Element>::AggregateChildrenState: Freeze,
<RootElem as Element>::BuildOutput: Freeze,
<<RootElem as Element>::BuildOutput as VirtualDom<NoEvent, ()>>::TargetWidgetSeq: Freeze,
impl<RootElem> !RefUnwindSafe for RootHandler<RootElem>
impl<RootElem> !Send for RootHandler<RootElem>
impl<RootElem> !Sync for RootHandler<RootElem>
impl<RootElem> Unpin for RootHandler<RootElem>where
RootElem: Unpin,
<RootElem as Element>::AggregateChildrenState: Unpin,
<RootElem as Element>::BuildOutput: Unpin,
<<RootElem as Element>::BuildOutput as VirtualDom<NoEvent, ()>>::TargetWidgetSeq: Unpin,
impl<RootElem> !UnwindSafe for RootHandler<RootElem>
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more