Struct Window

Source
pub struct Window<'class, 'listener, WML> { /* private fields */ }
Available on crate feature ui only.
Expand description

A window based on a WindowClass.

Implementations§

Source§

impl<'class, 'listener, WML: WindowMessageListener> Window<'class, 'listener, WML>

Source

pub fn create_new( class: &'class WindowClass<'_, WML>, listener: &'listener WML, window_name: &str, ) -> Result<Self>

Creates a new window.

User interaction with the window will result in messages sent to the WindowMessageListener provided here.

Source

pub fn set_listener(&self, listener: &'listener WML) -> Result<()>

Changes the WindowMessageListener.

Doing this is likely only possible using a WindowMessageListener that doesn’t contain any closures since Window requires the listener to be of a specific type and closures in Rust each have their own (new) type.

Source

pub fn add_notification_icon<'a, NI: Icon + 'a>( &'a self, options: NotificationIconOptions<NI, &'a str>, ) -> Result<NotificationIcon<'a, WML>>

Adds a notification icon.

The window’s WindowMessageListener will receive messages when user interactions with the icon occur.

Trait Implementations§

Source§

impl<WML> AsMut<WindowHandle> for Window<'_, '_, WML>

Source§

fn as_mut(&mut self) -> &mut WindowHandle

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<WML> AsRef<WindowHandle> for Window<'_, '_, WML>

Source§

fn as_ref(&self) -> &WindowHandle

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<'class, 'listener, WML: Debug> Debug for Window<'class, 'listener, WML>

Source§

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

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

impl<WML> Drop for Window<'_, '_, WML>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'class, 'listener, WML> Freeze for Window<'class, 'listener, WML>

§

impl<'class, 'listener, WML> RefUnwindSafe for Window<'class, 'listener, WML>
where WML: RefUnwindSafe,

§

impl<'class, 'listener, WML> !Send for Window<'class, 'listener, WML>

§

impl<'class, 'listener, WML> !Sync for Window<'class, 'listener, WML>

§

impl<'class, 'listener, WML> Unpin for Window<'class, 'listener, WML>

§

impl<'class, 'listener, WML> !UnwindSafe for Window<'class, 'listener, WML>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V