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
impl Compiled
Sourcepub(crate) fn new<B: Backend>(
context: Context,
views: Vec<ViewTemplate>,
ui: &Ui<B>,
engine: Weak<Engine<Self, B>>,
) -> Self
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.
Sourcefn event(
&self,
run: impl FnOnce() -> Result<(), AppError>,
) -> Result<(), AppError>
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.
fn receive(&self) -> Result<(), AppError>
Sourcefn call(&self, run: impl FnOnce(*const Context) -> bool) -> Result<(), AppError>
fn call(&self, run: impl FnOnce(*const Context) -> bool) -> Result<(), AppError>
Runs a compiled call, turning its false into the failure it recorded.
Sourcefn read(
&self,
read: ReadFn,
frame: &Frame,
ty: &'static TypeDesc,
) -> Result<Value, AppError>
fn read( &self, read: ReadFn, frame: &Frame, ty: &'static TypeDesc, ) -> Result<Value, AppError>
The value a compiled read gives, owned by the caller.
fn write( &self, binding: &Binding, frame: &Frame, value: Slot, ) -> Result<(), AppError>
Trait Implementations§
Source§impl Logic for Compiled
impl Logic for Compiled
Source§type Frame = Frame
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
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
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
type Action = unsafe extern "C" fn(*const Context, *mut u64) -> bool
What a button does when clicked.
type Error = AppError
Source§fn texts(&self, texts: &ReadFn, frame: &Frame) -> Result<Vec<String>, AppError>
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>
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>
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>
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>
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>
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>
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>
fn write_texts( &self, binding: &Binding, frame: &Frame, texts: Vec<String>, ) -> Result<(), AppError>
Errors Read more
Source§fn expand(
&self,
region: &Region,
frame: &Rc<Frame>,
) -> Result<Vec<Shown<Self>>, AppError>
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 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 Compiled
impl !RefUnwindSafe for Compiled
impl !Send for Compiled
impl !Sync for Compiled
impl !UnwindSafe for Compiled
impl Unpin for Compiled
impl UnsafeUnpin for Compiled
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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