[][src]Struct screen_13::prelude::Program

pub struct Program<'a, 'b> {
    pub author: &'static str,
    pub fullscreen: bool,
    pub icon: Option<Icon<'b>>,
    pub name: &'static str,
    pub resizable: bool,
    pub title: &'a str,
}

Program is the required information to start an event loop.

Remarks: The fullscreen/windowed setting this program describes may not be what Screen 13 chooses at runtime if there is a previously written configuration file present.

Fields

author: &'static strfullscreen: boolicon: Option<Icon<'b>>name: &'static strresizable: booltitle: &'a str

Implementations

impl Program<'static, 'static>[src]

pub const FULLSCREEN: Program<'static, 'static>[src]

A default program description, with a fullscreen setting.

This is most useful for small examples and demos. Real programs should fill in all the info manually.

pub const WINDOW: Program<'static, 'static>[src]

A default program description, with a window mode setting.

This is most useful for small examples and demos. Real programs should fill in all the info manually.

impl Program<'_, '_>[src]

pub const fn new(name: &'static str, author: &'static str) -> Self[src]

Creates a new Program description.

By default the program will be fullscreen; use the builder functions to change this and make other important choices.

Remarks: Programs running in windowed mode automatically select an appropriately sized and placed window. Current logic provides a window centered on the primary display covering approximately 75% of the desktop area.

Remarks: When in debug mode the default is windowed mode.

pub const fn with_fullscreen(self) -> Self[src]

Sets whether the program starts as fullscreen of in window mode.

pub const fn with_fullscreen_is(self, fullscreen: bool) -> Self[src]

Sets whether the program starts as fullscreen of in window mode.

pub const fn with_name_author(
    self,
    name: &'static str,
    author: &'static str
) -> Self
[src]

Sets the program name and program author (also known as publisher). These values are used for multiple purposes, including locating configuration files.

pub const fn with_resizable(self) -> Self[src]

Sets whether the window is resizable or not.

pub const fn with_resizable_is(self, resizable: bool) -> Self[src]

Sets whether the window is resizable or not.

pub const fn with_window(self) -> Self[src]

Sets whether the program starts in window mode instead of as fullscreen.

pub const fn with_window_is(self, window: bool) -> Self[src]

Sets whether the program starts in window mode instead of as fullscreen.

pub fn without_icon(self) -> Self[src]

Clears the previously set window icon.

impl<'a> Program<'a, '_>[src]

pub const fn with_title(self, title: &'a str) -> Self[src]

Sets the window title, separately from the program name which is used internally to cache configuration changes.

impl<'b> Program<'_, 'b>[src]

pub fn with_icon(self, icon: Icon<'b>) -> Self[src]

Sets the window icon. The icon must be an rgba formatted pixel array, and must be square.

pub fn with_icon_is(self, icon: Option<Icon<'b>>) -> Self[src]

Sets the window icon. The icon must be an rgba formatted pixel array, and must be square.

Trait Implementations

impl<'a, 'b> AsRef<Program<'a, 'b>> for Program<'a, 'b>[src]

impl<'a, 'b> Debug for Program<'a, 'b>[src]

impl Default for Program<'_, '_>[src]

impl<'a, 'b> Deserialize<'static> for Program<'a, 'b>[src]

impl<'a, 'b> Serialize for Program<'a, 'b>[src]

Auto Trait Implementations

impl<'a, 'b> RefUnwindSafe for Program<'a, 'b>[src]

impl<'a, 'b> Send for Program<'a, 'b>[src]

impl<'a, 'b> Sync for Program<'a, 'b>[src]

impl<'a, 'b> Unpin for Program<'a, 'b>[src]

impl<'a, 'b> UnwindSafe for Program<'a, 'b>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.