pub struct Builder<G> { /* private fields */ }Implementations§
Source§impl<G: GlobalEventHandler> Builder<G>
impl<G: GlobalEventHandler> Builder<G>
pub fn register_widget<T: Widget + Default + 'static>( &mut self, ident: &'static str, )
pub fn fps(&mut self, fps: u32)
Sourcepub fn template(
&mut self,
ident: impl Into<String>,
template: impl ToSourceKind,
) -> Result<()>
pub fn template( &mut self, ident: impl Into<String>, template: impl ToSourceKind, ) -> Result<()>
Registers a component as a template-only component.
This component has no state or reacts to any events
Sourcepub fn component<C: Component>(
&mut self,
ident: impl Into<String>,
template: impl ToSourceKind,
component: C,
state: C::State,
) -> Result<ComponentId<C::Message>>
pub fn component<C: Component>( &mut self, ident: impl Into<String>, template: impl ToSourceKind, component: C, state: C::State, ) -> Result<ComponentId<C::Message>>
Registers a Component with the runtime. This returns a unique ComponentId that is used to send messages to the component.
A component can only be used once in a template. If you want multiple instances, register the component as a prototype instead, see [RuntimeBuilder::prototype].
Sourcepub fn default<C>(
&mut self,
ident: impl Into<String>,
template: impl ToSourceKind,
) -> Result<ComponentId<C::Message>>
pub fn default<C>( &mut self, ident: impl Into<String>, template: impl ToSourceKind, ) -> Result<ComponentId<C::Message>>
Registers a Component with the runtime as long as the component and the associated state
implements the Default trait.
This returns a unique ComponentId that is used to send messages to the component.
Sourcepub fn prototype<FC, FS, C>(
&mut self,
ident: impl Into<String>,
template: impl ToSourceKind,
proto: FC,
state: FS,
) -> Result<()>
pub fn prototype<FC, FS, C>( &mut self, ident: impl Into<String>, template: impl ToSourceKind, proto: FC, state: FS, ) -> Result<()>
pub fn with_global_event_handler<Eh>( self, global_event_handler: Eh, ) -> Builder<Eh>
pub fn finish<F>(self, f: F) -> Result<()>
Auto Trait Implementations§
impl<G> Freeze for Builder<G>where
G: Freeze,
impl<G> !RefUnwindSafe for Builder<G>
impl<G> !Send for Builder<G>
impl<G> !Sync for Builder<G>
impl<G> Unpin for Builder<G>where
G: Unpin,
impl<G> !UnwindSafe for Builder<G>
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