Trait install_framework_core::interface::Interface[][src]

pub trait Interface {
    type ErrorType;
    fn welcome(
        &mut self,
        installer_name: &'static str,
        installer_version: &'static str,
        installer_author: &'static str
    ) -> Result<(), Self::ErrorType>;
fn get_install_method(&mut self) -> Result<InstallMethod, Self::ErrorType>;
fn should_uninstall(&self) -> Result<bool, Self::ErrorType>;
fn run_install(
        &mut self,
        install: &mut dyn Installer,
        install_dir: &Path,
        method: InstallMethod,
        resources: &HashMap<&'static str, &'static [u8]>
    ) -> Result<(), Self::ErrorType>;
fn run_post_install(
        &mut self,
        post_install: &mut dyn PostInstall,
        install_dir: &Path
    ) -> Result<(), Self::ErrorType>;
fn run_uninstall(
        &mut self,
        install: &mut dyn Installer,
        install_dir: &Path,
        method: InstallMethod,
        resources: &HashMap<&'static str, &'static [u8]>
    ) -> Result<(), Self::ErrorType>;
fn run_post_uninstall(
        &mut self,
        post_uninstall: &mut dyn PostUninstall,
        install_dir: &Path
    ) -> Result<(), Self::ErrorType>;
fn error(&mut self, err: Self::ErrorType) -> i32;
fn finish(&mut self) -> i32; }

Represents an interface

Associated Types

Loading content...

Required methods

fn welcome(
    &mut self,
    installer_name: &'static str,
    installer_version: &'static str,
    installer_author: &'static str
) -> Result<(), Self::ErrorType>
[src]

Opens the welcome page for this interface

Arguments

  • installer_name - the name of this installer
  • installer_version - the version of this installer
  • installer_author - the author or company name of this installer

fn get_install_method(&mut self) -> Result<InstallMethod, Self::ErrorType>[src]

Returns the install method the user chose (only called if the installer supports both modes to decide which mode should be used to continue)

Returns

an InstallMethod

fn should_uninstall(&self) -> Result<bool, Self::ErrorType>[src]

Returns wether the user chose the uninstall option or the install option

fn run_install(
    &mut self,
    install: &mut dyn Installer,
    install_dir: &Path,
    method: InstallMethod,
    resources: &HashMap<&'static str, &'static [u8]>
) -> Result<(), Self::ErrorType>
[src]

Runs the install procedure for this interface

Arguments

  • install - the installer trait
  • install_dir - the computed installation directory
  • method - the installation method
  • resources - the resources map built by InstallerBuilder

fn run_post_install(
    &mut self,
    post_install: &mut dyn PostInstall,
    install_dir: &Path
) -> Result<(), Self::ErrorType>
[src]

Runs the post-install procedure for this interface

Arguments

  • post_install - the custom PostInstall step
  • install_dir - the computed installation directory

fn run_uninstall(
    &mut self,
    install: &mut dyn Installer,
    install_dir: &Path,
    method: InstallMethod,
    resources: &HashMap<&'static str, &'static [u8]>
) -> Result<(), Self::ErrorType>
[src]

Runs the uninstall procedure for this interface

Arguments

  • install - the installer trait
  • install_dir - the computed installation directory
  • method - the installation method
  • resources - the resources map built by InstallerBuilder

fn run_post_uninstall(
    &mut self,
    post_uninstall: &mut dyn PostUninstall,
    install_dir: &Path
) -> Result<(), Self::ErrorType>
[src]

Runs the post-uninstall procedure for this interface

Arguments

  • post_uninstall - the custom PostUninstall step
  • install_dir - the computed installation directory

fn error(&mut self, err: Self::ErrorType) -> i32[src]

Called when an error has occured

Arguments

  • err - the error object

Returns

expected program exit code for the given error object

fn finish(&mut self) -> i32[src]

Called when no error has occured and the installer is finished

Returns

expected program exit code

Loading content...

Implementors

Loading content...