Skip to main content

SETUP

Struct SETUP 

Source
pub struct SETUP;
Expand description

Setup service.

This service runs install and uninstall operations sequentially. Operations start once the current app update finishes and there are no other running operations.

Implementations§

Source§

impl SETUP

Source

pub fn register_task_type<T>(&self)
where T: SetupTask,

Register a custom task type.

Source

pub fn install( &self, config: InstallConfig, update: Option<UninstallConfig>, ) -> ResponseVar<Result<UninstallConfig, SetupError>>

Enqueue a new install operation.

This will prepare and commit an install.

Returns a response var that updates once with the result of the operation. If successful an UninstallConfig, this data can be (de)serialized and used with to uninstall.

Source

pub fn prepare_install( &self, config: InstallConfig, update: Option<UninstallConfig>, ) -> ResponseVar<Result<PreparedInstallConfig, SetupError>>

Enqueue a new prepare install operation.

This will run all expensive install operations that can run without affecting the system or previous installs. One reason to run this step separate is to begin an update installation while the application is still running.

If update is set the tasks will use it to find and patch/replace a previous install.

Returns a response var that updates once with the result of the operation. If successful a PreparedInstallConfig, this data can be (de)serialized and used with to commit_install or cancel_prepared.

Source

pub fn cancel_prepared( &self, config: PreparedInstallConfig, ) -> ResponseVar<Result<(), SetupError>>

Enqueue a prepared install cancellation operation.

Note that prepare_install will automatically cancel if requested. This method cancels a prepared install that already completed.

Source

pub fn commit_install( &self, config: PreparedInstallConfig, ) -> ResponseVar<Result<UninstallConfig, SetupError>>

Enqueue a new commit prepared install operation.

This operation cannot be canceled once it starts, if cancel is requested while enqueued the cancel_prepared operation will run instead.

Returns a response var that updates once with the result of the operation. If successful an UninstallConfig, this data can be (de)serialized and used with to uninstall.

Source

pub fn uninstall( &self, config: UninstallConfig, ) -> ResponseVar<Result<(), SetupError>>

Enqueue a new uninstall operation.

This will quickly validate the installation and uninstall. During uninstall the operation cannot be canceled.

Returns a response var that updates once with the result of the operation.

Source

pub fn validate_uninstall( &self, config: UninstallConfig, ) -> ResponseVar<Result<UninstallConfig, SetupError>>

Enqueue a new validate uninstall config operation.

This will verify that the uninstall config can still be used to uninstall.

Returns a response var that updates once with the result of the operation. If successful the config data is returned, potentially corrected if recoverable issues where found.

Source

pub fn status(&self) -> Var<SetupStatus>

Status of running operation.

Auto Trait Implementations§

§

impl Freeze for SETUP

§

impl RefUnwindSafe for SETUP

§

impl Send for SETUP

§

impl Sync for SETUP

§

impl Unpin for SETUP

§

impl UnsafeUnpin for SETUP

§

impl UnwindSafe for SETUP

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

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Downcast for T
where T: 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.
§

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

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

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

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> StateValue for T
where T: Any + Send + Sync,

§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

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

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more