pub struct Runner<A>where
A: CoordinatorApp,{ /* private fields */ }Expand description
Core runtime runner coordinating event dispatch and render passes.
Implementations§
Source§impl<A> Runner<A>where
A: CoordinatorApp,
impl<A> Runner<A>where
A: CoordinatorApp,
Sourcepub fn with_config(self, config: RunnerConfig) -> Runner<A>
pub fn with_config(self, config: RunnerConfig) -> Runner<A>
Apply a custom runner configuration.
Sourcepub fn coordinator(&self) -> &LayoutCoordinator<A>
pub fn coordinator(&self) -> &LayoutCoordinator<A>
Access the underlying coordinator.
Sourcepub fn coordinator_mut(&mut self) -> &mut LayoutCoordinator<A>
pub fn coordinator_mut(&mut self) -> &mut LayoutCoordinator<A>
Mutable access to the underlying coordinator.
Sourcepub fn config(&self) -> RunnerConfig
pub fn config(&self) -> RunnerConfig
Runner configuration.
Sourcepub fn tick_count(&self) -> u64
pub fn tick_count(&self) -> u64
Current tick count.
Sourcepub fn handle_event(
&mut self,
event: RunnerEvent,
) -> Result<RunnerAction, LayoutError>
pub fn handle_event( &mut self, event: RunnerEvent, ) -> Result<RunnerAction, LayoutError>
Handle a runner event and return the desired action.
Sourcepub fn handle_coordinator_event(
&mut self,
event: CoordinatorEvent,
) -> Result<RunnerAction, LayoutError>
pub fn handle_coordinator_event( &mut self, event: CoordinatorEvent, ) -> Result<RunnerAction, LayoutError>
Handle coordinator events that are outside the standard input stream.
Sourcepub fn handle_tick(
&mut self,
tick: TickEvent,
) -> Result<RunnerAction, LayoutError>
pub fn handle_tick( &mut self, tick: TickEvent, ) -> Result<RunnerAction, LayoutError>
Handle a tick event and update the tick counter.
Sourcepub fn register_element(
&mut self,
metadata: ElementMetadata,
element: Arc<dyn Element>,
) -> Result<RunnerAction, LayoutError>
pub fn register_element( &mut self, metadata: ElementMetadata, element: Arc<dyn Element>, ) -> Result<RunnerAction, LayoutError>
Register a new element with the runtime.
Sourcepub fn unregister_element(
&mut self,
id: ElementId,
) -> Result<RunnerAction, LayoutError>
pub fn unregister_element( &mut self, id: ElementId, ) -> Result<RunnerAction, LayoutError>
Remove an element from the runtime.
Sourcepub fn set_visibility(
&mut self,
id: ElementId,
visibility: Visibility,
) -> Result<RunnerAction, LayoutError>
pub fn set_visibility( &mut self, id: ElementId, visibility: Visibility, ) -> Result<RunnerAction, LayoutError>
Update element visibility.
Sourcepub fn request_focus(
&mut self,
request: FocusRequest,
) -> Result<RunnerAction, LayoutError>
pub fn request_focus( &mut self, request: FocusRequest, ) -> Result<RunnerAction, LayoutError>
Apply a focus change request.
Sourcepub fn needs_redraw(&self) -> bool
pub fn needs_redraw(&self) -> bool
Whether the runner should redraw based on dirty state.
Trait Implementations§
Auto Trait Implementations§
impl<A> Freeze for Runner<A>where
A: Freeze,
impl<A> !RefUnwindSafe for Runner<A>
impl<A> Send for Runner<A>where
A: Send,
impl<A> Sync for Runner<A>where
A: Sync,
impl<A> Unpin for Runner<A>where
A: Unpin,
impl<A> UnsafeUnpin for Runner<A>where
A: UnsafeUnpin,
impl<A> !UnwindSafe for Runner<A>
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