Skip to main content

run_app_with_proxy

Function run_app_with_proxy 

Source
pub fn run_app_with_proxy<P, A, O>(
    config: WindowConfig,
    presenter: P,
    app: A,
    on_proxy: O,
) -> Result<(), EventLoopError>
where P: Presenter + 'static, A: App<WindowBackend<P>> + 'static, O: FnOnce(EventProxy),
Expand description

Same as run_app, but also hands on_proxy an EventProxy for injecting cross-thread events.

See run_windowed_with_proxy for when/why to use the _with_proxy variant over the plain one. The injected payload is always a u64, delivered as Event::Custom; see run_app_with_typed_proxy for injecting any T: Send + 'static.

See run_app’s “Presenting is automatic” section: this function shares the same automatic-present behavior.

§Errors

Returns [winit::error::EventLoopError] if the event loop cannot be created or fails while running.