[][src]Struct conrod_core::UiBuilder

pub struct UiBuilder {
    pub window_dimensions: Dimensions,
    pub maybe_theme: Option<Theme>,
    pub maybe_widgets_capacity: Option<usize>,
}

A constructor type for building a Ui instance with a set of optional parameters.

Fields

window_dimensions: Dimensions

The initial dimensions of the window in which the Ui exists.

maybe_theme: Option<Theme>

The theme used to set default styling for widgets.

If this field is None when build is called, Theme::default will be used.

maybe_widgets_capacity: Option<usize>

An estimation of the maximum number of widgets that will be used with this Ui instance.

This value is used to determine the size with which various collections should be reserved. This may make the first cycle of widget instantiations more efficient as the collections will not be required to grow dynamically. These collections include:

If this field is None when build is called, these collections will be initialised with no pre-reserved size and will instead grow organically as needed.

Implementations

impl UiBuilder[src]

pub fn new(window_dimensions: Dimensions) -> Self[src]

Begin building a new Ui instance.

Give the initial dimensions of the window within which the Ui will be instantiated as a Scalar (DPI agnostic) value.

pub fn theme(self, value: Theme) -> Self[src]

The theme used to set default styling for widgets.

If this field is None when build is called, Theme::default will be used.

pub fn widgets_capacity(self, value: usize) -> Self[src]

An estimation of the maximum number of widgets that will be used with this Ui instance.

This value is used to determine the size with which various collections should be reserved. This may make the first cycle of widget instantiations more efficient as the collections will not be required to grow dynamically. These collections include:

  • the widget graph node and edge Vecs
  • the HashSet used to track updated widgets
  • the widget DepthOrder (a kind of toposort describing the order of widgets in their rendering order).

If this field is None when build is called, these collections will be initialised with no pre-reserved size and will instead grow organically as required.

pub fn build(self) -> Ui[src]

Build Ui from the given builder

Auto Trait Implementations

impl !RefUnwindSafe for UiBuilder

impl Send for UiBuilder

impl !Sync for UiBuilder

impl Unpin for UiBuilder

impl !UnwindSafe for UiBuilder

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