Struct window::NoWindow

source ·
pub struct NoWindow { /* private fields */ }
Expand description

A window without user interface, often used in server event loops.

This structure holds just enough state to return values that were set. The size can be changed because the event loop does not emit Render events when the width or height is zero.

Implementations§

source§

impl NoWindow

source

pub fn new(settings: &WindowSettings) -> NoWindow

Creates a new NoWindow.

Trait Implementations§

source§

impl AdvancedWindow for NoWindow

source§

fn get_title(&self) -> String

Gets a copy of the title of the window.
source§

fn set_title(&mut self, value: String)

Sets the title of the window.
source§

fn get_exit_on_esc(&self) -> bool

Gets whether to exit when pressing esc. Read more
source§

fn set_exit_on_esc(&mut self, _value: bool)

Sets whether to exit when pressing esc. Read more
source§

fn get_automatic_close(&self) -> bool

Gets whether the window will automatically close when attempting to close it. Read more
source§

fn set_automatic_close(&mut self, value: bool)

Sets whether the window will automatically close when attempting to close it. If this is disabled, attempts to close the window can be detected via an Input::Close(..) event, and Window::set_should_close() can be called to actually close the window. Read more
source§

fn set_capture_cursor(&mut self, _value: bool)

Sets whether to capture/grab the cursor. Read more
source§

fn show(&mut self)

Shows the window. Read more
source§

fn hide(&mut self)

Hides the window. Read more
source§

fn get_position(&self) -> Option<Position>

Gets the position of window.
source§

fn set_position<P: Into<Position>>(&mut self, val: P)

Sets the position of window. Read more
source§

fn set_size<S: Into<Size>>(&mut self, val: S)

Sets the window size. Read more
source§

fn title(self, value: String) -> Self

Sets title on window. Read more
source§

fn exit_on_esc(self, value: bool) -> Self

Sets whether to exit when pressing the Esc button. Read more
source§

fn automatic_close(self, value: bool) -> Self

Sets whether the window will automatically close when attempting to close it. If this is disabled, attempts to close the window can be detected via an Input::Close(..) event, and Window::set_should_close() can be called to actually close the window. Read more
source§

fn capture_cursor(self, value: bool) -> Self

Sets whether to capture/grab the cursor. Read more
source§

fn position<P: Into<Position>>(self, val: P) -> Self

Sets the position of window. Read more
source§

impl BuildFromWindowSettings for NoWindow

source§

fn build_from_window_settings( settings: &WindowSettings ) -> Result<Self, Box<dyn Error>>

Errors

This function will always return without error.

source§

impl Debug for NoWindow

source§

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

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

impl Window for NoWindow

source§

fn set_should_close(&mut self, value: bool)

Tells the window to close or stay open.
source§

fn should_close(&self) -> bool

Returns true if the window should close.
source§

fn size(&self) -> Size

Gets the size of the window.
source§

fn swap_buffers(&mut self)

Swaps render buffers. Read more
source§

fn wait_event(&mut self) -> Event

Wait indefinitely for an input event to be available from the window.
source§

fn wait_event_timeout(&mut self, _timeout: Duration) -> Option<Event>

Wait for an input event to be available from the window or for the specified timeout to be reached. Read more
source§

fn poll_event(&mut self) -> Option<Event>

Polls an input event from the window. Read more
source§

fn draw_size(&self) -> Size

Gets the draw size of the window. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere 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 Twhere 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.