pub struct UpdatePrompt { /* private fields */ }Expand description
The update prompt: what is available, what will happen, and one action.
Implementations§
Source§impl UpdatePrompt
impl UpdatePrompt
Sourcepub fn new(
updater: Updater,
release: Release,
cx: &mut Context<'_, Self>,
) -> Self
pub fn new( updater: Updater, release: Release, cx: &mut Context<'_, Self>, ) -> Self
A prompt offering release.
Sourcepub fn auto_restart(self, auto_restart: bool) -> Self
pub fn auto_restart(self, auto_restart: bool) -> Self
Whether a successful install restarts the app itself (default true).
Turn it off to handle UpdatePromptEvent::Installed yourself — the
prompt then stays in its installing state, since only the host knows what
comes next.
Sourcepub fn window_root(self, window_root: bool) -> Self
pub fn window_root(self, window_root: bool) -> Self
Whether this prompt is the root view of its own update window: draws the
titlebar drag strip and pads for a transparent titlebar. super::open
sets it; leave it off when embedding the prompt in a window of your own.
Sourcepub fn stage(&self) -> Option<&UpdateStage>
pub fn stage(&self) -> Option<&UpdateStage>
The stage the installer is on, if one is running.
Sourcepub fn accept(&mut self, cx: &mut Context<'_, Self>)
pub fn accept(&mut self, cx: &mut Context<'_, Self>)
Take the action the button offers: install in place and restart, or — when this install can’t be rewritten — open the release page and dismiss.
Sourcepub fn dismiss(&mut self, cx: &mut Context<'_, Self>)
pub fn dismiss(&mut self, cx: &mut Context<'_, Self>)
Give up on the prompt (the “Later” button and Escape). Inert while an install is running, so the progress can’t be dismissed out from under itself.
Sourcepub fn set_stage(&mut self, stage: UpdateStage, cx: &mut Context<'_, Self>)
pub fn set_stage(&mut self, stage: UpdateStage, cx: &mut Context<'_, Self>)
Show a stage without running the installer — for a host driving its own install, and for previewing the states.
Sourcepub fn set_failed(
&mut self,
reason: impl Into<String>,
cx: &mut Context<'_, Self>,
)
pub fn set_failed( &mut self, reason: impl Into<String>, cx: &mut Context<'_, Self>, )
Show a failure without running the installer. The action button becomes “Try Again”.
Trait Implementations§
impl EventEmitter<UpdatePromptEvent> for UpdatePrompt
Source§impl Focusable for UpdatePrompt
impl Focusable for UpdatePrompt
Source§fn focus_handle(&self, _cx: &App) -> FocusHandle
fn focus_handle(&self, _cx: &App) -> FocusHandle
Source§impl Render for UpdatePrompt
impl Render for UpdatePrompt
Auto Trait Implementations§
impl !RefUnwindSafe for UpdatePrompt
impl !Send for UpdatePrompt
impl !Sync for UpdatePrompt
impl !UnwindSafe for UpdatePrompt
impl Freeze for UpdatePrompt
impl Unpin for UpdatePrompt
impl UnsafeUnpin for UpdatePrompt
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more