Skip to content

Allow returning errors from eframe app creator #4474

@emilk

Description

@emilk

eframe::run_native takes a closure that creates the user's application. We should have some way of returning errors from it.

It already has a rather complicated signature:

pub type AppCreator = Box<dyn FnOnce(&CreationContext<'_>) -> Box<dyn App>>;

And that would need to become something like

type DynError = Box<dyn std::error::Error>;
pub type AppCreator = Box<dyn FnOnce(&CreationContext<'_>) -> Result<Box<dyn App>>, DynError>;

…unless we can come up with something nicer.

Motivation

In Rerun we initialize the renderer in the app creation callback, and that can fail because of missing features of the host GPU.

Metadata

Metadata

Assignees

Labels

eframeRelates to epi and eframererunDesired for Rerun.io

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions