Skip to main content

Ui

Struct Ui 

Source
pub(super) struct Ui<'a, 'p, M: Module> {
    pub(super) emitter: &'a mut Emitter<M>,
    pub(super) shared: &'a mut Shared<'p>,
}

Fields§

§emitter: &'a mut Emitter<M>§shared: &'a mut Shared<'p>

Implementations§

Source§

impl<M: Module> Ui<'_, '_, M>

Source

fn menus( &mut self, frame: &Frame<'_>, menus: &[Menu<Stmts>], ) -> Result<List, CodegenError>

Source

pub(super) fn menu_entries( &mut self, frame: &Frame<'_>, aliases: &HashMap<LocalId, Alias>, entries: &[MenuEntry<Stmts>], ) -> Result<List, CodegenError>

A menu’s entries, whose items’ actions see aliases, as a context menu’s do.

Source§

impl<M: Module> Ui<'_, '_, M>

Source

pub(super) fn list( &mut self, blob: Blob, len: usize, ) -> Result<List, CodegenError>

Source

pub(super) fn frame_types( &mut self, frame: &Frame<'_>, ) -> Result<List, CodegenError>

Source

fn templates( &mut self, frame: &mut Frame<'_>, aliases: &HashMap<LocalId, Alias>, nodes: &Nodes, ) -> Result<List, CodegenError>

Emits nodes as an array of templates.

Source

fn template( &mut self, frame: &mut Frame<'_>, aliases: &HashMap<LocalId, Alias>, node: &Node, slot: &mut Slot<'_>, ) -> Result<TemplateKind, CodegenError>

Source

fn control( &mut self, frame: &mut Frame<'_>, aliases: &HashMap<LocalId, Alias>, node: &Node, slot: &mut Slot<'_>, ) -> Result<TemplateKind, CodegenError>

A control’s template: the functions behind what it shows and edits.

Source

fn display( &mut self, frame: &mut Frame<'_>, aliases: &HashMap<LocalId, Alias>, node: &Node, slot: &mut Slot<'_>, ) -> Result<TemplateKind, CodegenError>

A control that only shows something.

Source

fn input( &mut self, frame: &mut Frame<'_>, aliases: &HashMap<LocalId, Alias>, node: &Node, slot: &mut Slot<'_>, ) -> Result<TemplateKind, CodegenError>

A control the user works: the functions behind what it shows, edits and runs.

Source

fn for_region( &mut self, frame: &mut Frame<'_>, aliases: &HashMap<LocalId, Alias>, head: &Loop, body: &Nodes, slot: &mut Slot<'_>, ) -> Result<(), CodegenError>

Shows body once for each item head loops over.

Source

fn button( &mut self, frame: &mut Frame<'_>, aliases: &HashMap<LocalId, Alias>, (title, selected): (&Dynamic, Option<&Dynamic>), action: &Stmts, slot: &mut Slot<'_>, ) -> Result<(), CodegenError>

A button’s title, whether it is selected if it shows that, and its action.

Source

fn nav_item( &mut self, frame: &mut Frame<'_>, aliases: &HashMap<LocalId, Alias>, item: &NavItem, slot: &mut Slot<'_>, ) -> Result<(), CodegenError>

Source

fn if_region( &mut self, frame: &mut Frame<'_>, aliases: &HashMap<LocalId, Alias>, branches: &[(Rc<Expr>, Nodes)], otherwise: &Nodes, slot: &mut Slot<'_>, ) -> Result<(), CodegenError>

Shows the first branch whose condition holds, or else otherwise, which is the last list.

Source

fn for_value( &mut self, frame: &Frame<'_>, aliases: &HashMap<LocalId, Alias>, head: &Loop, list: &Expr, ) -> Result<FuncId, CodegenError>

Shows the body once per item of a copy of the list, with the item in the loop’s item.

Source

fn for_range( &mut self, frame: &Frame<'_>, aliases: &HashMap<LocalId, Alias>, local: LocalId, start: &Expr, end: &Expr, ) -> Result<FuncId, CodegenError>

Shows the body once per count from start up to, but not including, end, with the count in local.

Source

fn for_place( &mut self, frame: &mut Frame<'_>, aliases: &HashMap<LocalId, Alias>, head: &Loop, place: &Place, nodes: &Nodes, ) -> Result<(FuncId, List), CodegenError>

Shows the body once per item of the list at place, through an alias whose list positions are kept in extra frame slots.

Source

fn view( &mut self, frame: &Frame<'_>, aliases: &HashMap<LocalId, Alias>, view: ViewId, args: &[Expr], ) -> Result<FuncId, CodegenError>

Shows the view’s body in a new frame holding its arguments.

Source

fn function( &mut self, frame: &Frame<'_>, aliases: &HashMap<LocalId, Alias>, extra: bool, build: impl FnOnce(&mut Body<'_, '_, '_, M>, Value) -> Result<(), CodegenError>, ) -> Result<FuncId, CodegenError>

A function the runtime calls with the context, the template’s frame, and extra if there is one. It returns true where build leaves it.

Source

fn expansion( &mut self, frame: &Frame<'_>, aliases: &HashMap<LocalId, Alias>, build: impl FnOnce(&mut Body<'_, '_, '_, M>, Value) -> Result<(), CodegenError>, ) -> Result<FuncId, CodegenError>

A region’s expansion, which tells the sink it’s given what the region shows.

Source

fn shown( &mut self, frame: &Frame<'_>, aliases: &HashMap<LocalId, Alias>, shown: &Dynamic, slot: &mut Slot<'_>, field: usize, ) -> Result<(), CodegenError>

The function that works out shown, put in the template’s field at offset field.

Source

fn value( &mut self, frame: &Frame<'_>, aliases: &HashMap<LocalId, Alias>, shown: &Dynamic, ) -> Result<FuncId, CodegenError>

Writes what the UI shows, owned, to the pointer it’s given.

Source

pub(super) fn action( &mut self, frame: &Frame<'_>, aliases: &HashMap<LocalId, Alias>, action: &Stmts, ) -> Result<FuncId, CodegenError>

Source

fn optional_action( &mut self, frame: &Frame<'_>, aliases: &HashMap<LocalId, Alias>, action: Option<&Stmts>, slot: &mut Slot<'_>, ) -> Result<(), CodegenError>

The action of a control that may have one, such as a text field’s on Return.

Source

fn binding( &mut self, frame: &Frame<'_>, aliases: &HashMap<LocalId, Alias>, binding: &Binding, slot: &mut Slot<'_>, ) -> Result<(), CodegenError>

The functions that read a binding’s place, and write the user’s edits to it.

Source

fn region( &mut self, slot: &mut Slot<'_>, expand: FuncId, lists: &[List], ) -> Result<(), CodegenError>

Source

fn deps( &mut self, slot: &mut Slot<'_>, states: &StateSet, ) -> Result<(), CodegenError>

Auto Trait Implementations§

§

impl<'a, 'p, M> !Send for Ui<'a, 'p, M>

§

impl<'a, 'p, M> !Sync for Ui<'a, 'p, M>

§

impl<'a, 'p, M> !UnwindSafe for Ui<'a, 'p, M>

§

impl<'a, 'p, M> Freeze for Ui<'a, 'p, M>

§

impl<'a, 'p, M> RefUnwindSafe for Ui<'a, 'p, M>
where M: RefUnwindSafe,

§

impl<'a, 'p, M> Unpin for Ui<'a, 'p, M>

§

impl<'a, 'p, M> UnsafeUnpin for Ui<'a, 'p, M>

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> AutoreleaseSafe for T
where T: ?Sized,

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.