Skip to main content

BuildContext

Struct BuildContext 

Source
pub struct BuildContext<'a> {
Show 23 fields pub view: &'a CatalogView, pub recipes: &'a RecipeIndex, pub data: &'a Value, pub local: &'a mut LocalState, pub template: &'a dyn Fn(&str) -> Option<UiNode>, pub viewport_height: f32, pub viewport_width: f32, pub hairline: f32, pub row_extent: f32, pub menu_row: f32, pub tab_bar: f32, pub checkbox: f32, pub gap_px: &'a dyn Fn(&str) -> f32, pub expand_controls: bool, pub strings: &'a StringTable, pub breakpoint: Option<String>, pub locale: &'a str, pub wide: bool, pub today: Option<String>, pub formatter: &'a dyn Formatter, pub now: f64, pub data_version: u64, pub read_only: bool,
}

Fields§

§view: &'a CatalogView§recipes: &'a RecipeIndex§data: &'a Value§local: &'a mut LocalState§template: &'a dyn Fn(&str) -> Option<UiNode>

Reduce a template component by id into a normalized subtree.

§viewport_height: f32§viewport_width: f32

Round 2: the viewport width (horizontal windows).

§hairline: f32

$control.hairline (Resizable handles, list dividers) and $control.row (the extent of an unmeasured list item).

§row_extent: f32§menu_row: f32

EXP-1259: $control.buttonSm, a menu row’s height (a searchable submenu’s list window).

§tab_bar: f32

VAPP-162: $control.tabBar, the item height of a vertical bar Segmented (the navigation rail).

§checkbox: f32

EXP-1548: $control.checkbox, the width of a Table’s selection column (part of the table’s minimum width).

§gap_px: &'a dyn Fn(&str) -> f32

The theme’s default gap for List items per gap enum, in px.

§expand_controls: bool

Expand form controls into label/field/description parts (a themed surface); off = geometry mode, every native is ONE measured leaf.

§strings: &'a StringTable

The surface’s built-in string table.

§breakpoint: Option<String>

The active breakpoint (None = base) for responsive native props.

§locale: &'a str

The surface locale (week start).

§wide: bool

The surface is at least md wide (the toast stack sits bottom-end).

§today: Option<String>

Today as yyyy-mm-dd (the host’s clock; calendars open on it).

§formatter: &'a dyn Formatter

Round 2: the surface formatter (Table cells, NumberField, chart ticks, pickers, calendar names, the format functions).

§now: f64

The clock (epoch ms) relative times read.

§data_version: u64

Bumped on every write to the data model (the key caches’ version).

§read_only: bool

VAPP-200: a read-only surface: every writing control builds as disabled: true (crate::read_only::disables).

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for BuildContext<'a>

§

impl<'a> !Send for BuildContext<'a>

§

impl<'a> !Sync for BuildContext<'a>

§

impl<'a> !UnwindSafe for BuildContext<'a>

§

impl<'a> Freeze for BuildContext<'a>

§

impl<'a> Unpin for BuildContext<'a>

§

impl<'a> UnsafeUnpin for BuildContext<'a>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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.