Struct EventLoopWindowTarget

Source
pub struct EventLoopWindowTarget<TS: ThreadSafety = DefaultThreadSafety> { /* private fields */ }
Expand description

A reference to the EventLoop that allows the user access to the underlying display connections.

Unlike in winit, this type is cheaply clonable. It is not actually used that often, since most of its previous use cases don’t directly require the window target to be passed in. However, it is still useful for some things, like indicating the need to exit the application or getting available monitors.

Implementations§

Source§

impl<TS: ThreadSafety> EventLoopWindowTarget<TS>

Source

pub fn set_exit(&self)

Request that the event loop exit as soon as possible.

Source

pub fn set_exit_with_code(&self, code: i32)

Request that we exit as soon as possible with the given exit code.

Source

pub async fn exit(&self) -> !

Exit the program.

Source

pub async fn exit_with_code(&self, code: i32) -> !

Exit the program with the given exit code.

Source

pub fn resumed(&self) -> &Handler<(), TS>

Get the handler for the Resumed event.

Source

pub fn suspended(&self) -> &Handler<(), TS>

Get the handler for the Suspended event.

Source

pub async fn primary_monitor(&self) -> Option<MonitorHandle>

Get the primary monitor.

Source

pub async fn available_monitors(&self) -> impl Iterator<Item = MonitorHandle>

Get the available monitors.

Source

pub async fn set_device_event_filter(&self, filter: DeviceEventFilter)

Set the device event filter.

Trait Implementations§

Source§

impl<TS: ThreadSafety> Clone for EventLoopWindowTarget<TS>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<TS: ThreadSafety> Debug for EventLoopWindowTarget<TS>

Source§

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

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

impl<TS: ThreadSafety> EventLoopWindowTargetExtWayland for EventLoopWindowTarget<TS>

Source§

fn is_wayland(&self) -> bool

True if the EventLoopWindowTarget uses Wayland.
Source§

fn wayland_display(&self) -> Option<*mut c_void>

Returns a pointer to the wl_display object of wayland that is used by this EventLoopWindowTarget. Read more
Source§

impl<TS: ThreadSafety> EventLoopWindowTargetExtX11 for EventLoopWindowTarget<TS>

Source§

fn is_x11(&self) -> bool

True if the EventLoopWindowTarget uses X11.
Source§

impl<TS: ThreadSafety> HasRawDisplayHandle for EventLoopWindowTarget<TS>

Auto Trait Implementations§

§

impl<TS> Freeze for EventLoopWindowTarget<TS>
where <TS as __ThreadSafety>::Rc<Reactor<TS>>: Freeze,

§

impl<TS> RefUnwindSafe for EventLoopWindowTarget<TS>
where <TS as __ThreadSafety>::Rc<Reactor<TS>>: RefUnwindSafe,

§

impl<TS = ThreadUnsafe> !Send for EventLoopWindowTarget<TS>

§

impl<TS = ThreadUnsafe> !Sync for EventLoopWindowTarget<TS>

§

impl<TS> Unpin for EventLoopWindowTarget<TS>
where <TS as __ThreadSafety>::Rc<Reactor<TS>>: Unpin,

§

impl<TS> UnwindSafe for EventLoopWindowTarget<TS>
where <TS as __ThreadSafety>::Rc<Reactor<TS>>: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Event for T
where T: Clone + 'static,

Source§

type Clonable = T

Source§

type Unique<'a> = T

Source§

fn downgrade(unique: &mut <T as Event>::Unique<'_>) -> <T as Event>::Clonable

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.