pub enum ViewEvent {
Input(InputEvent),
Lifecycle(LifecycleEvent),
Paint,
ScrollSync(ScrollOffsets),
Shutdown,
}Expand description
Top-level event sent from the main thread to a view thread.
Sent over mpsc::Sender<ViewEvent> — the single channel per view.
The view thread’s event loop matches on the category, then delegates
to specialized handlers.
Chrome equivalent: the dispatch in WebFrameWidgetImpl::HandleInputEvent()
for input, and separate IPC messages for lifecycle.
Variants§
Input(InputEvent)
An input event (mouse, keyboard, wheel).
Routed to the view’s EventHandler for hit testing and DOM dispatch.
Lifecycle(LifecycleEvent)
A lifecycle event (resize, focus change, scale factor change). Handled by the view’s layout/rendering pipeline.
Paint
Something changed — schedule a frame.
ScrollSync(ScrollOffsets)
Compositor posted updated scroll offsets after compositor-side scroll.
Chrome: ProxyImpl::SetNeedsCommitOnImplThread() posts scroll state back.
The view thread applies these before the next paint so positions match.
Shutdown
Clean shutdown — the view thread should exit its event loop.
Auto Trait Implementations§
impl Freeze for ViewEvent
impl RefUnwindSafe for ViewEvent
impl Send for ViewEvent
impl Sync for ViewEvent
impl Unpin for ViewEvent
impl UnsafeUnpin for ViewEvent
impl UnwindSafe for ViewEvent
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
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>
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>
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