pub struct App { /* private fields */ }Implementations§
Source§impl App
impl App
pub fn new(deps: AppDeps) -> Self
Sourcepub fn with_notifier(
deps: AppDeps,
notifier: Box<dyn Notifier + Send + Sync>,
) -> Self
pub fn with_notifier( deps: AppDeps, notifier: Box<dyn Notifier + Send + Sync>, ) -> Self
Used by tests to inject a CapturingNotifier.
Sourcepub fn with_notifier_and_registration(
deps: AppDeps,
notifier: Box<dyn Notifier + Send + Sync>,
registration: SharedRegistration,
) -> Self
pub fn with_notifier_and_registration( deps: AppDeps, notifier: Box<dyn Notifier + Send + Sync>, registration: SharedRegistration, ) -> Self
Used by ui::run to share the orchestration loop’s
SharedRegistration slot with the UI.
pub fn registration_handle(&self) -> SharedRegistration
pub fn attach_tray(&mut self, tray: TrayHandle)
pub fn quit_requested_handle(&self) -> Arc<AtomicBool> ⓘ
pub fn notification_prefs(&self) -> NotificationPrefs
pub fn set_notification_prefs(&mut self, prefs: NotificationPrefs)
pub fn tray_variant(&self) -> TrayVariant
Sourcepub fn default_notifier_box() -> Box<dyn Notifier + Send + Sync>
pub fn default_notifier_box() -> Box<dyn Notifier + Send + Sync>
Exposed for ui::run which builds a notifier before App::new.
Sourcepub fn drain_notifications(&mut self)
pub fn drain_notifications(&mut self)
Process any new entries in the recent-jobs ring and emit notifications according to current prefs. Idempotent.
Sourcepub fn refresh_tray_variant(&mut self) -> TrayVariant
pub fn refresh_tray_variant(&mut self) -> TrayVariant
Recompute the tray variant from live state. Pushes the new icon + tooltip to the OS tray when the variant changes.
Sourcepub fn render(&mut self, ui: &mut Ui)
pub fn render(&mut self, ui: &mut Ui)
Shared by both the real ui entry point and the headless test
harness so the layout is exercised in tests too. Takes a
&mut Ui rather than a &Context to match the new eframe
0.34 API (Panel::show_inside).
Sourcepub fn current_tab(&self) -> Tab
pub fn current_tab(&self) -> Tab
Expose the current tab for tests + future tray-state derivation.
pub fn deps(&self) -> &AppDeps
Trait Implementations§
Source§impl App for App
impl App for App
Source§fn ui(&mut self, ui: &mut Ui, _frame: &mut Frame)
fn ui(&mut self, ui: &mut Ui, _frame: &mut Frame)
Called each time the UI needs repainting, which may be many times per second. Read more
Source§fn logic(&mut self, ctx: &Context, frame: &mut Frame)
fn logic(&mut self, ctx: &Context, frame: &mut Frame)
Called once before each call to
Self::ui,
and additionally also called when the UI is hidden, but egui::Context::request_repaint was called. Read moreSource§fn update(&mut self, ctx: &Context, frame: &mut Frame)
fn update(&mut self, ctx: &Context, frame: &mut Frame)
👎Deprecated:
Use Self::ui instead
Called each time the UI needs repainting, which may be many times per second. Read more
Source§fn save(&mut self, _storage: &mut dyn Storage)
fn save(&mut self, _storage: &mut dyn Storage)
Called on shutdown, and perhaps at regular intervals. Allows you to save state. Read more
Source§fn on_exit(&mut self, _gl: Option<&Context>)
fn on_exit(&mut self, _gl: Option<&Context>)
Called once on shutdown, after
Self::save. Read moreSource§fn auto_save_interval(&self) -> Duration
fn auto_save_interval(&self) -> Duration
Time between automatic calls to
Self::saveSource§fn clear_color(&self, _visuals: &Visuals) -> [f32; 4]
fn clear_color(&self, _visuals: &Visuals) -> [f32; 4]
Background color values for the app, e.g. what is sent to
gl.clearColor. Read moreSource§fn persist_egui_memory(&self) -> bool
fn persist_egui_memory(&self) -> bool
Controls whether or not the egui memory (window positions etc) will be
persisted (only if the “persistence” feature is enabled).
Source§fn raw_input_hook(&mut self, _ctx: &Context, _raw_input: &mut RawInput)
fn raw_input_hook(&mut self, _ctx: &Context, _raw_input: &mut RawInput)
A hook for manipulating or filtering raw input before it is processed by
Self::update. Read moreAuto Trait Implementations§
impl Freeze for App
impl !RefUnwindSafe for App
impl Send for App
impl Sync for App
impl Unpin for App
impl UnsafeUnpin for App
impl !UnwindSafe for App
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.