pub trait Installer {
type InstallPlan: Plan;
type InstallResult;
type Error: Error + Send + Sync + 'static;
// Required methods
fn perform_install<'a>(
&'a mut self,
install_plan: &'a Self::InstallPlan,
observer: Option<&'a dyn ProgressObserver>,
) -> LocalBoxFuture<'a, (Self::InstallResult, Vec<AppInstallResult<Self::Error>>)>;
fn perform_reboot(&mut self) -> LocalBoxFuture<'_, Result<(), Error>>;
fn try_create_install_plan<'a>(
&'a self,
request_params: &'a RequestParams,
request_metadata: Option<&'a RequestMetadata>,
response: &'a Response,
response_bytes: Vec<u8>,
ecdsa_signature: Option<Vec<u8>>,
) -> LocalBoxFuture<'a, Result<Self::InstallPlan, Self::Error>>;
}
Expand description
The trait for the platform-specific Installer to implement.
The Installer trait has two associated types:
InstallPlan - This is the type that implements the Plan trait, and represents the platform- specific installation plan (the data used to define what an update is).
InstallResult - InstallResult is data passed from the Installer trait implementation to the PolicyEngine trait implementation to help the PolicyEngine schedule the reboot.
Error - This the type that implements the thiserror::Error trait and is used to collect all of the errors that can occur during the installation of an update.
Required Associated Types§
Required Methods§
Sourcefn perform_install<'a>(
&'a mut self,
install_plan: &'a Self::InstallPlan,
observer: Option<&'a dyn ProgressObserver>,
) -> LocalBoxFuture<'a, (Self::InstallResult, Vec<AppInstallResult<Self::Error>>)>
fn perform_install<'a>( &'a mut self, install_plan: &'a Self::InstallPlan, observer: Option<&'a dyn ProgressObserver>, ) -> LocalBoxFuture<'a, (Self::InstallResult, Vec<AppInstallResult<Self::Error>>)>
Perform the installation as given by the install plan (as parsed form the Omaha server response). If given, provide progress via the observer, and a final finished or Error indication via the Future. The returned Vec of AppInstallResult must only include apps that have an update available and must be kept in the same order as it appears in the omaha response.
Sourcefn perform_reboot(&mut self) -> LocalBoxFuture<'_, Result<(), Error>>
fn perform_reboot(&mut self) -> LocalBoxFuture<'_, Result<(), Error>>
Perform a reboot of the system (in whichever manner that the installer needs to perform a reboot. This fn should not return unless reboot failed.
Sourcefn try_create_install_plan<'a>(
&'a self,
request_params: &'a RequestParams,
request_metadata: Option<&'a RequestMetadata>,
response: &'a Response,
response_bytes: Vec<u8>,
ecdsa_signature: Option<Vec<u8>>,
) -> LocalBoxFuture<'a, Result<Self::InstallPlan, Self::Error>>
fn try_create_install_plan<'a>( &'a self, request_params: &'a RequestParams, request_metadata: Option<&'a RequestMetadata>, response: &'a Response, response_bytes: Vec<u8>, ecdsa_signature: Option<Vec<u8>>, ) -> LocalBoxFuture<'a, Result<Self::InstallPlan, Self::Error>>
Try to create a new Plan from the given response, returning a Error if unable to do so. For update with multiple apps, the install plan must keep the order of the apps from the response.