Skip to main content

Compiled

Struct Compiled 

Source
pub struct Compiled {
    context: Context,
    views: Vec<ViewTemplate>,
    downloads: Downloads<Targets>,
    dialogs: Dialogs<Answer>,
}

Fields§

§context: Context§views: Vec<ViewTemplate>

Indexed by view id.

§downloads: Downloads<Targets>§dialogs: Dialogs<Answer>

Implementations§

Source§

impl Compiled

Source

pub(crate) fn new<B: Backend>( context: Context, views: Vec<ViewTemplate>, ui: &Ui<B>, engine: Weak<Engine<Self, B>>, ) -> Self

Runs compiled code against context for engine, which shows file dialogs and receives their answers and download reports through ui.

Source

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

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<(), AppError>

Source

fn call(&self, run: impl FnOnce(*const Context) -> bool) -> Result<(), AppError>

Runs a compiled call, turning its false into the failure it recorded.

Source

fn read( &self, read: ReadFn, frame: &Frame, ty: &'static TypeDesc, ) -> Result<Value, AppError>

The value a compiled read gives, owned by the caller.

Source

fn write( &self, binding: &Binding, frame: &Frame, value: Slot, ) -> Result<(), AppError>

Trait Implementations§

Source§

impl Debug for Compiled

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Logic for Compiled

Source§

type Frame = Frame

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

type Value = unsafe extern "C" fn(*const Context, *const u64, *mut u64) -> bool

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

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

type Action = unsafe extern "C" fn(*const Context, *mut u64) -> bool

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

Source§

fn text(&self, text: &ReadFn, frame: &Frame) -> Result<String, AppError>

Errors Read more
Source§

fn number(&self, number: &ReadFn, frame: &Frame) -> Result<i64, AppError>

Errors Read more
Source§

fn flag(&self, flag: &ReadFn, frame: &Frame) -> Result<bool, AppError>

Errors Read more
Source§

fn texts(&self, texts: &ReadFn, frame: &Frame) -> Result<Vec<String>, AppError>

Errors Read more
Source§

fn read_number(&self, binding: &Binding, frame: &Frame) -> Result<i64, AppError>

Errors Read more
Source§

fn read_text( &self, binding: &Binding, frame: &Frame, ) -> Result<String, AppError>

Errors Read more
Source§

fn read_checked( &self, binding: &Binding, frame: &Frame, ) -> Result<bool, AppError>

Errors Read more
Source§

fn write_text( &self, binding: &Binding, frame: &Frame, text: &str, ) -> Result<(), AppError>

Errors Read more
Source§

fn write_checked( &self, binding: &Binding, frame: &Frame, checked: bool, ) -> Result<(), AppError>

Errors Read more
Source§

fn write_number( &self, binding: &Binding, frame: &Frame, number: i64, ) -> Result<(), AppError>

Errors Read more
Source§

fn write_texts( &self, binding: &Binding, frame: &Frame, texts: Vec<String>, ) -> Result<(), AppError>

Errors Read more
Source§

fn run(&self, action: &ActionFn, frame: &Frame) -> Result<(), AppError>

Errors Read more
Source§

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

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