pub trait Run: WindowBehavior<()> {
// Provided methods
fn run() -> Result<(), EventLoopError>
where Self::Context: Default { ... }
fn run_with(context: Self::Context) -> Result<(), EventLoopError> { ... }
}
Expand description
A runnable window.
Provided Methods§
sourcefn run() -> Result<(), EventLoopError>
fn run() -> Result<(), EventLoopError>
Runs a window with a default instance of this behavior’s
Context
.
This function is shorthand for creating a PendingApp
, opening this
window inside of it, and running the pending app.
§Errors
Returns an EventLoopError
upon the loop exiting due to an error. See
[EventLoop::run
] for more information.
sourcefn run_with(context: Self::Context) -> Result<(), EventLoopError>
fn run_with(context: Self::Context) -> Result<(), EventLoopError>
Runs a window with the provided Context
.
This function is shorthand for creating a PendingApp
, opening this
window inside of it, and running the pending app.
§Errors
Returns an EventLoopError
upon the loop exiting due to an error. See
[EventLoop::run
] for more information.
Object Safety§
This trait is not object safe.