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
impl Interpreter
Sourcepub(crate) fn new<B: Backend>(
machine: Machine,
ui: &Ui<B>,
engine: Weak<Engine<Self, B>>,
) -> Self
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.
pub(crate) fn machine(&self) -> &Machine
Sourcefn event(
&self,
run: impl FnOnce(&Machine) -> Result<(), RuntimeError>,
) -> Result<(), RuntimeError>
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.
fn receive(&self) -> Result<(), RuntimeError>
fn read( &self, binding: &Binding, frame: &Vec<Slot>, ) -> Result<Value, RuntimeError>
fn write( &self, binding: &Binding, frame: &Vec<Slot>, value: Value, ) -> Result<(), RuntimeError>
Trait Implementations§
Source§impl Logic for Interpreter
impl Logic for Interpreter
Source§type Frame = Vec<Slot>
type Frame = Vec<Slot>
The locals visible to a piece of UI, such as loop variables and view parameters.
Source§type Value = Rc<Dynamic>
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>
type Binding = Rc<Binding>
A place a text field or checkbox shows, and writes the user’s edits to.
type Error = RuntimeError
Source§fn text(
&self,
text: &Rc<Dynamic>,
frame: &Vec<Slot>,
) -> Result<String, RuntimeError>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
fn write_texts( &self, binding: &Rc<Binding>, frame: &Vec<Slot>, texts: Vec<String>, ) -> Result<(), RuntimeError>
Errors Read more
Source§fn expand(
&self,
region: &Region,
frame: &Rc<Vec<Slot>>,
) -> Result<Vec<Shown<Self>>, RuntimeError>
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 moreSource§fn take_changed(&self) -> StateSet
fn take_changed(&self) -> StateSet
The states changed since the last call.
Source§fn take_window_requests(&self) -> Vec<WindowRequest>
fn take_window_requests(&self) -> Vec<WindowRequest>
What code asked of the app’s windows since the last call, in order.
Auto Trait Implementations§
impl !Freeze for Interpreter
impl !RefUnwindSafe for Interpreter
impl !Send for Interpreter
impl !Sync for Interpreter
impl !UnwindSafe for Interpreter
impl Unpin for Interpreter
impl UnsafeUnpin for Interpreter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more