pub struct LiveApp<B: Backend> {
ui: Ui<B>,
on_error: ErrorHandler,
app: RefCell<Option<App<B>>>,
}Fields§
§ui: Ui<B>§on_error: ErrorHandler§app: RefCell<Option<App<B>>>None until a program first loads.
Implementations§
Source§impl<B: Backend> LiveApp<B>
impl<B: Backend> LiveApp<B>
Sourcepub fn new(backend: B, on_error: ErrorHandler) -> Self
pub fn new(backend: B, on_error: ErrorHandler) -> Self
An app showing nothing yet; LiveApp::load gives it a program.
Sourcepub fn load(&self, program: Program) -> Result<(), RuntimeError>
pub fn load(&self, program: Program) -> Result<(), RuntimeError>
Shows program in place of the version running now, keeping each state it still
declares with the same name and type, or opens its windows if nothing runs yet.
§Errors
When evaluating a starting value or building the UI fails. Whatever was showing before keeps running.
§Panics
When program has errors; load only programs the checker accepted.
Sourcepub fn waker(&self, on_wake: WakeHandler) -> B::Waker
pub fn waker(&self, on_wake: WakeHandler) -> B::Waker
Returns something any thread can use to have on_wake run on the UI thread, where
it may call LiveApp::load.
Trait Implementations§
Auto Trait Implementations§
impl<B> !Freeze for LiveApp<B>
impl<B> !RefUnwindSafe for LiveApp<B>
impl<B> !Send for LiveApp<B>
impl<B> !Sync for LiveApp<B>
impl<B> !UnwindSafe for LiveApp<B>
impl<B> Unpin for LiveApp<B>
impl<B> UnsafeUnpin for LiveApp<B>
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