EventLoopBuilder

Struct EventLoopBuilder 

Source
pub struct EventLoopBuilder { /* private fields */ }
Expand description

Object that allows for building the EventLoop.

This specifies options that affect the whole application, like the current Android app or whether to use the Wayland backend. You cannot create more than one EventLoop per application.

Implementations§

Source§

impl EventLoopBuilder

Source

pub fn new() -> Self

Create a new EventLoopBuilder.

Source

pub fn build<TS: ThreadSafety>(&mut self) -> EventLoop<TS>

Builds a new event loop.

In general, this function must be called on the same thread that main() is being run inside of. This can be circumvented in some cases using platform specific options. See the platform module for more information. Attempting to violate this property or create more than one event loop per application will result in a panic.

This function results in platform-specific backend initialization.

Trait Implementations§

Source§

impl Debug for EventLoopBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EventLoopBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl EventLoopBuilderExtWindows for EventLoopBuilder

Source§

fn with_any_thread(&mut self, any_thread: bool) -> &mut Self

Whether to allow the event loop to be created off of the main thread. Read more
Source§

fn with_dpi_aware(&mut self, dpi_aware: bool) -> &mut Self

Whether to enable process-wide DPI awareness. Read more
Source§

fn with_msg_hook<F>(&mut self, callback: F) -> &mut Self
where F: FnMut(*const c_void) -> bool + 'static,

A callback to be executed before dispatching a win32 message to the window procedure. Return true to disable winit’s internal message dispatching.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.