pub struct Window<UserEventType = ()>where
UserEventType: 'static,{ /* private fields */ }Expand description
Struct representing a window.
Implementations§
Source§impl Window<()>
impl Window<()>
Sourcepub fn new_centered<Str, Size>(
title: Str,
size: Size,
) -> Result<Window<()>, BacktraceError<WindowCreationError>>
pub fn new_centered<Str, Size>( title: Str, size: Size, ) -> Result<Window<()>, BacktraceError<WindowCreationError>>
Create a new window, centered in the middle of the primary monitor.
Sourcepub fn new_fullscreen_borderless<Str>(
title: Str,
) -> Result<Window<()>, BacktraceError<WindowCreationError>>
pub fn new_fullscreen_borderless<Str>( title: Str, ) -> Result<Window<()>, BacktraceError<WindowCreationError>>
Create a new window, in fullscreen borderless mode on the primary monitor.
Sourcepub fn new_with_options(
title: &str,
options: WindowCreationOptions,
) -> Result<Window<()>, BacktraceError<WindowCreationError>>
pub fn new_with_options( title: &str, options: WindowCreationOptions, ) -> Result<Window<()>, BacktraceError<WindowCreationError>>
Create a new window with the specified options.
Source§impl<UserEventType: 'static> Window<UserEventType>
impl<UserEventType: 'static> Window<UserEventType>
Sourcepub fn new_with_user_events(
title: &str,
options: WindowCreationOptions,
) -> Result<Self, BacktraceError<WindowCreationError>>
pub fn new_with_user_events( title: &str, options: WindowCreationOptions, ) -> Result<Self, BacktraceError<WindowCreationError>>
Create a new window with the specified options, with support for user events. See window::UserEventSender.
Sourcepub fn create_user_event_sender(&self) -> UserEventSender<UserEventType>
pub fn create_user_event_sender(&self) -> UserEventSender<UserEventType>
Creates a window::UserEventSender, which can be used to post custom events to this event loop from another thread.
If calling this, specify the type of the event data using
Window::<YourTypeHere>::new_with_user_events().
See UserEventSender::send_event, WindowHandler::on_user_event.
Sourcepub fn run_loop<H>(self, handler: H) -> !where
H: WindowHandler<UserEventType> + 'static,
pub fn run_loop<H>(self, handler: H) -> !where
H: WindowHandler<UserEventType> + 'static,
Run the window event loop, with the specified callback handler.
Once the event loop finishes running, the entire app will terminate, even if other threads are still running. See window::WindowHelper::terminate_loop().
Auto Trait Implementations§
impl<UserEventType> Freeze for Window<UserEventType>
impl<UserEventType> RefUnwindSafe for Window<UserEventType>where
UserEventType: RefUnwindSafe,
impl<UserEventType> Send for Window<UserEventType>where
UserEventType: Send,
impl<UserEventType> Sync for Window<UserEventType>where
UserEventType: Sync,
impl<UserEventType> Unpin for Window<UserEventType>where
UserEventType: Unpin,
impl<UserEventType> UnsafeUnpin for Window<UserEventType>
impl<UserEventType> UnwindSafe for Window<UserEventType>where
UserEventType: 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 more