pub struct Runner {
pub scopes: FxHashMap<ScopeId, Rc<RefCell<Scope>>>,
pub scopes_storages: Rc<RefCell<FxHashMap<ScopeId, ScopeStorage>>>,
pub node_to_scope: FxHashMap<NodeId, ScopeId>,
/* private fields */
}Fields§
§scopes: FxHashMap<ScopeId, Rc<RefCell<Scope>>>§scopes_storages: Rc<RefCell<FxHashMap<ScopeId, ScopeStorage>>>§node_to_scope: FxHashMap<NodeId, ScopeId>Implementations§
Source§impl Runner
impl Runner
pub fn new(root: impl Fn() -> Element + 'static) -> Self
pub fn verify_scopes_integrity(&self)
pub fn provide_root_context<T: 'static + Clone>( &mut self, context: impl FnOnce() -> T, ) -> T
pub fn handle_event( &mut self, node_id: impl Into<NodeId>, event_name: EventName, event_type: EventType, bubbles: bool, ) -> bool
pub async fn handle_events(&mut self)
Sourcepub fn handle_events_immediately(&mut self)
pub fn handle_events_immediately(&mut self)
Useful for freya-testing
pub fn sync_and_update(&mut self) -> Mutations
pub fn run_in<T>(&self, run: impl FnOnce() -> T) -> T
Sourcepub fn reload(&mut self)
pub fn reload(&mut self)
Reloads the runner for a hot-reload: cancels tasks, reloads every scope’s hooks
(contexts are preserved), and marks every scope dirty. Task cancellation must
happen first so stale wakers can’t fire Message::PollTask against
freshly-reloaded scopes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Runner
impl !RefUnwindSafe for Runner
impl !Send for Runner
impl !Sync for Runner
impl Unpin for Runner
impl UnsafeUnpin for Runner
impl !UnwindSafe for Runner
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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