Struct conrod::UiBuilder
[−]
[src]
pub struct UiBuilder { 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
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:
- the widget graph node and edge
Vec
s - 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 needed.
Methods
impl UiBuilder
[src]
fn new() -> Self
Begin building a new Ui
instance.
fn theme(self, value: Theme) -> Self
The theme used to set default styling for widgets.
If this field is None
when build
is called, Theme::default
will be used.
fn widgets_capacity(self, value: usize) -> Self
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
Vec
s - 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.
fn build(self) -> Ui
Build Ui from the given builder