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.
Implementations§
Source§impl EventLoopBuilder<()>
impl EventLoopBuilder<()>
Sourcepub fn new() -> EventLoopBuilder<()>
pub fn new() -> EventLoopBuilder<()>
Start building a new event loop.
Source§impl<T> EventLoopBuilder<T>
impl<T> EventLoopBuilder<T>
Sourcepub fn with_user_event() -> EventLoopBuilder<T>
pub fn with_user_event() -> EventLoopBuilder<T>
Start building a new event loop, with the given type as the user event type.
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> EventLoopBuilderExtX11 for EventLoopBuilder<T>
impl<T> EventLoopBuilderExtX11 for EventLoopBuilder<T>
Source§fn with_x11(&mut self) -> &mut EventLoopBuilder<T>
fn with_x11(&mut self) -> &mut EventLoopBuilder<T>
Source§fn with_any_thread(&mut self, any_thread: bool) -> &mut EventLoopBuilder<T>
fn with_any_thread(&mut self, any_thread: bool) -> &mut EventLoopBuilder<T>
Auto Trait Implementations§
impl<T> Freeze for EventLoopBuilder<T>
impl<T> RefUnwindSafe for EventLoopBuilder<T>where
T: RefUnwindSafe,
impl<T> Send for EventLoopBuilder<T>where
T: Send,
impl<T> Sync for EventLoopBuilder<T>where
T: Sync,
impl<T> Unpin for EventLoopBuilder<T>where
T: Unpin,
impl<T> UnwindSafe for EventLoopBuilder<T>where
T: UnwindSafe,
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<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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 moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().