Struct appit::WindowBuilder

source ·
pub struct WindowBuilder<'a, Behavior, Application, AppMessage>
where Behavior: WindowBehavior<AppMessage>, AppMessage: Message,
{ /* private fields */ }
Expand description

A builder for a window.

This type is similar to winit’s WindowBuilder, except that it only supports the cross-platform interface. Support for additional platform-specific settings may be possible as long as all types introduced are Send.

Implementations§

source§

impl<'a, Behavior, Application, AppMessage> WindowBuilder<'a, Behavior, Application, AppMessage>
where Behavior: WindowBehavior<AppMessage>, Application: AsApplication<AppMessage>, AppMessage: Message,

source

pub fn open(self) -> Result<Option<Window<AppMessage::Window>>, OsError>

Opens the window, if the application is still running or has not started running. The events of the window will be processed in a thread spawned by this function.

If the application has shut down, this function returns None.

Errors

The only errors this funciton can return arise from winit::window::WindowBuilder::build.

Trait Implementations§

source§

impl<'a, Behavior, Application, AppMessage> Deref for WindowBuilder<'a, Behavior, Application, AppMessage>
where Behavior: WindowBehavior<AppMessage>, AppMessage: Message,

§

type Target = WindowAttributes

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'a, Behavior, Application, AppMessage> DerefMut for WindowBuilder<'a, Behavior, Application, AppMessage>
where Behavior: WindowBehavior<AppMessage>, AppMessage: Message,

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'a, Behavior, Application, AppMessage> RefUnwindSafe for WindowBuilder<'a, Behavior, Application, AppMessage>
where Application: RefUnwindSafe, <Behavior as WindowBehavior<AppMessage>>::Context: RefUnwindSafe,

§

impl<'a, Behavior, Application, AppMessage> Send for WindowBuilder<'a, Behavior, Application, AppMessage>
where Application: Sync,

§

impl<'a, Behavior, Application, AppMessage> Sync for WindowBuilder<'a, Behavior, Application, AppMessage>
where Application: Sync, <Behavior as WindowBehavior<AppMessage>>::Context: Sync,

§

impl<'a, Behavior, Application, AppMessage> Unpin for WindowBuilder<'a, Behavior, Application, AppMessage>
where <Behavior as WindowBehavior<AppMessage>>::Context: Unpin,

§

impl<'a, Behavior, Application, AppMessage> UnwindSafe for WindowBuilder<'a, Behavior, Application, AppMessage>
where Application: RefUnwindSafe, <Behavior as WindowBehavior<AppMessage>>::Context: 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> 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>,

§

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>,

§

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.