pub struct EventLoopBuilder<T>where
T: 'static,{ /* private fields */ }Expand description
Object that allows building the event loop.
This is used to make specifying options that affect the whole application easier. But note that constructing multiple event loops is not supported.
This can be created using EventLoop::new or EventLoop::with_user_event.
Implementations§
Source§impl EventLoopBuilder<()>
impl EventLoopBuilder<()>
Sourcepub fn new() -> EventLoopBuilder<()>
👎Deprecated: use EventLoop::builder instead
pub fn new() -> EventLoopBuilder<()>
EventLoop::builder insteadStart building a new event loop.
Source§impl<T> EventLoopBuilder<T>
impl<T> EventLoopBuilder<T>
Sourcepub fn build(&mut self) -> Result<EventLoop<T>, EventLoopError>
pub fn build(&mut self) -> Result<EventLoop<T>, EventLoopError>
Builds a new event loop.
For cross-platform compatibility, the EventLoop must be created on the main thread,
and only once per application.
Calling this function will result in display backend initialisation.
§Panics
Attempting to create the event loop off the main thread will panic. This
restriction isn’t strictly necessary on all platforms, but is imposed to
eliminate any nasty surprises when porting to platforms that require it.
EventLoopBuilderExt::any_thread functions are exposed in the relevant
platform module if the target platform supports creating an event
loop on any thread.
§Platform-specific
- Wayland/X11: to prevent running under
WaylandorX11unsetWAYLAND_DISPLAYorDISPLAYrespectively when building the event loop. - Android: must be configured with an
AndroidAppfromandroid_main()by calling.with_android_app(app)before calling.build(), otherwise it’ll panic.
Trait Implementations§
Source§impl<T> Default for EventLoopBuilder<T>where
T: Default + 'static,
impl<T> Default for EventLoopBuilder<T>where
T: Default + 'static,
Source§fn default() -> EventLoopBuilder<T>
fn default() -> EventLoopBuilder<T>
Source§impl<T> EventLoopBuilderExtMacOS for EventLoopBuilder<T>
impl<T> EventLoopBuilderExtMacOS for EventLoopBuilder<T>
Source§fn with_activation_policy(
&mut self,
activation_policy: ActivationPolicy,
) -> &mut EventLoopBuilder<T>
fn with_activation_policy( &mut self, activation_policy: ActivationPolicy, ) -> &mut EventLoopBuilder<T>
with_activation_policy(ActivationPolicy::Regular) will prevent
the application from running as an “agent”, even if LSUIElement is set to true. Read more