Struct freya::prelude::LaunchConfigBuilder
source · pub struct LaunchConfigBuilder<'a, T> {
pub width: f64,
pub height: f64,
pub decorations: bool,
pub title: &'static str,
pub transparent: bool,
pub state: Option<T>,
pub background: Color,
pub fonts: Vec<(&'a str, &'a [u8]), Global>,
pub on_setup: Option<Arc<Box<fn(_: &mut Window), Global>>>,
pub on_exit: Option<Arc<Box<fn(_: &mut Window), Global>>>,
}
Expand description
Configuration Builder.
Fields§
§width: f64
§height: f64
§decorations: bool
§title: &'static str
§transparent: bool
§state: Option<T>
§background: Color
§fonts: Vec<(&'a str, &'a [u8]), Global>
§on_setup: Option<Arc<Box<fn(_: &mut Window), Global>>>
§on_exit: Option<Arc<Box<fn(_: &mut Window), Global>>>
Implementations§
source§impl<'a, T> LaunchConfigBuilder<'a, T>where
T: Clone,
impl<'a, T> LaunchConfigBuilder<'a, T>where T: Clone,
sourcepub fn with_width(self, width: f64) -> LaunchConfigBuilder<'a, T>
pub fn with_width(self, width: f64) -> LaunchConfigBuilder<'a, T>
Specify a Window width.
sourcepub fn with_height(self, height: f64) -> LaunchConfigBuilder<'a, T>
pub fn with_height(self, height: f64) -> LaunchConfigBuilder<'a, T>
Specify a Window height.
sourcepub fn with_decorations(self, decorations: bool) -> LaunchConfigBuilder<'a, T>
pub fn with_decorations(self, decorations: bool) -> LaunchConfigBuilder<'a, T>
Whether the Window will have decorations or not.
sourcepub fn with_title(self, title: &'static str) -> LaunchConfigBuilder<'a, T>
pub fn with_title(self, title: &'static str) -> LaunchConfigBuilder<'a, T>
Specify the Window title.
sourcepub fn with_transparency(self, transparency: bool) -> LaunchConfigBuilder<'a, T>
pub fn with_transparency(self, transparency: bool) -> LaunchConfigBuilder<'a, T>
Make the Window transparent or not.
sourcepub fn with_state(self, state: T) -> LaunchConfigBuilder<'a, T>
pub fn with_state(self, state: T) -> LaunchConfigBuilder<'a, T>
Pass a custom value that your app will consume.
sourcepub fn with_background(self, background: &str) -> LaunchConfigBuilder<'a, T>
pub fn with_background(self, background: &str) -> LaunchConfigBuilder<'a, T>
Specify the Window background color.
sourcepub fn with_font(
self,
font_name: &'a str,
font: &'a [u8]
) -> LaunchConfigBuilder<'a, T>
pub fn with_font( self, font_name: &'a str, font: &'a [u8] ) -> LaunchConfigBuilder<'a, T>
Register a font.
sourcepub fn on_setup(
self,
callback: fn(_: &mut Window)
) -> LaunchConfigBuilder<'a, T>
pub fn on_setup( self, callback: fn(_: &mut Window) ) -> LaunchConfigBuilder<'a, T>
Register a callback that will be executed when the window is created.
sourcepub fn on_exit(self, callback: fn(_: &mut Window)) -> LaunchConfigBuilder<'a, T>
pub fn on_exit(self, callback: fn(_: &mut Window)) -> LaunchConfigBuilder<'a, T>
Register a callback that will be executed when the window is closed.
sourcepub fn build(self) -> LaunchConfig<'a, T>
pub fn build(self) -> LaunchConfig<'a, T>
Build the configuration.
Trait Implementations§
source§impl<'a, T> Clone for LaunchConfigBuilder<'a, T>where
T: Clone,
impl<'a, T> Clone for LaunchConfigBuilder<'a, T>where T: Clone,
source§fn clone(&self) -> LaunchConfigBuilder<'a, T>
fn clone(&self) -> LaunchConfigBuilder<'a, T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T> Default for LaunchConfigBuilder<'_, T>
impl<T> Default for LaunchConfigBuilder<'_, T>
source§fn default() -> LaunchConfigBuilder<'_, T>
fn default() -> LaunchConfigBuilder<'_, T>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a, T> RefUnwindSafe for LaunchConfigBuilder<'a, T>where T: RefUnwindSafe,
impl<'a, T> Send for LaunchConfigBuilder<'a, T>where T: Send,
impl<'a, T> Sync for LaunchConfigBuilder<'a, T>where T: Sync,
impl<'a, T> Unpin for LaunchConfigBuilder<'a, T>where T: Unpin,
impl<'a, T> UnwindSafe for LaunchConfigBuilder<'a, T>where T: 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
Mutably borrows from an owned value. Read more
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>
§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.