Skip to main content

Interpreter

Struct Interpreter 

Source
pub(crate) struct Interpreter {
    machine: Machine,
    downloads: Downloads<Targets>,
    dialogs: Dialogs<Answer>,
    views: Vec<ViewTemplate>,
}

Fields§

§machine: Machine§downloads: Downloads<Targets>§dialogs: Dialogs<Answer>§views: Vec<ViewTemplate>

Indexed by ViewId.

Implementations§

Source§

impl Interpreter

Source

pub(crate) fn new<B: Backend>( machine: Machine, ui: &Ui<B>, engine: Weak<Engine<Self, B>>, ) -> Self

Runs machine for engine, which shows file dialogs and receives their answers and download reports through ui.

Source

pub(crate) fn machine(&self) -> &Machine

Source

fn event( &self, run: impl FnOnce(&Machine) -> Result<(), RuntimeError>, ) -> Result<(), RuntimeError>

Runs code for an event, then starts the downloads and asks for the dialogs it asked for, even if it failed after asking.

Source

fn receive(&self) -> Result<(), RuntimeError>

Source

fn read( &self, binding: &Binding, frame: &Vec<Slot>, ) -> Result<Value, RuntimeError>

Source

fn write( &self, binding: &Binding, frame: &Vec<Slot>, value: Value, ) -> Result<(), RuntimeError>

Source

fn round_frames( &self, head: &Loop, frame: &Vec<Slot>, ) -> Result<Vec<Rc<Vec<Slot>>>, RuntimeError>

The frames a for region shows its body in, one per time round.

Trait Implementations§

Source§

impl Logic for Interpreter

Source§

type Frame = Vec<Slot>

The locals visible to a piece of UI, such as loop variables and view parameters.
Source§

type Value = Rc<Dynamic>

A value the UI shows, or reads when the user acts, such as a label’s text or a nav item’s value. Each is read as the type the checker gave it.
Source§

type Binding = Rc<Binding>

A place a text field or checkbox shows, and writes the user’s edits to.
Source§

type Action = Rc<[Stmt]>

What a button does when clicked.
Source§

type Region = Region

An if, for or view call: UI whose shape depends on state.
Source§

type Error = RuntimeError

Source§

fn text( &self, text: &Rc<Dynamic>, frame: &Vec<Slot>, ) -> Result<String, RuntimeError>

Errors Read more
Source§

fn number( &self, number: &Rc<Dynamic>, frame: &Vec<Slot>, ) -> Result<i64, RuntimeError>

Errors Read more
Source§

fn flag( &self, flag: &Rc<Dynamic>, frame: &Vec<Slot>, ) -> Result<bool, RuntimeError>

Errors Read more
Source§

fn texts( &self, texts: &Rc<Dynamic>, frame: &Vec<Slot>, ) -> Result<Vec<String>, RuntimeError>

Errors Read more
Source§

fn read_number( &self, binding: &Rc<Binding>, frame: &Vec<Slot>, ) -> Result<i64, RuntimeError>

Errors Read more
Source§

fn read_text( &self, binding: &Rc<Binding>, frame: &Vec<Slot>, ) -> Result<String, RuntimeError>

Errors Read more
Source§

fn read_checked( &self, binding: &Rc<Binding>, frame: &Vec<Slot>, ) -> Result<bool, RuntimeError>

Errors Read more
Source§

fn write_text( &self, binding: &Rc<Binding>, frame: &Vec<Slot>, text: &str, ) -> Result<(), RuntimeError>

Errors Read more
Source§

fn write_checked( &self, binding: &Rc<Binding>, frame: &Vec<Slot>, checked: bool, ) -> Result<(), RuntimeError>

Errors Read more
Source§

fn write_number( &self, binding: &Rc<Binding>, frame: &Vec<Slot>, number: i64, ) -> Result<(), RuntimeError>

Errors Read more
Source§

fn write_texts( &self, binding: &Rc<Binding>, frame: &Vec<Slot>, texts: Vec<String>, ) -> Result<(), RuntimeError>

Errors Read more
Source§

fn run(&self, action: &Block, frame: &Vec<Slot>) -> Result<(), RuntimeError>

Errors Read more
Source§

fn expand( &self, region: &Region, frame: &Rc<Vec<Slot>>, ) -> Result<Vec<Shown<Self>>, RuntimeError>

What region shows now, in order: lists of templates, each with its own frame. Read more
Source§

fn take_changed(&self) -> StateSet

The states changed since the last call.
Source§

fn take_window_requests(&self) -> Vec<WindowRequest>

What code asked of the app’s windows since the last call, in order.

Auto Trait Implementations§

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