diff options
| author | David Lönnhager <david.l@mullvad.net> | 2025-03-03 15:05:15 +0100 |
|---|---|---|
| committer | David Lönnhager <david.l@mullvad.net> | 2025-03-05 23:32:43 +0100 |
| commit | 10ec4379a554eb6153aacb93b0eecb9b74100b42 (patch) | |
| tree | 2badaf523023b7fab27be11d9a33dff8a025abe4 | |
| parent | 6b83bd97f13ac802adfa57a160a92dd34c24aa4f (diff) | |
| download | mullvadvpn-10ec4379a554eb6153aacb93b0eecb9b74100b42.tar.xz mullvadvpn-10ec4379a554eb6153aacb93b0eecb9b74100b42.zip | |
Attempt to explain difference between initialize_controller and AppController::initialize
| -rw-r--r-- | installer-downloader/src/controller.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/installer-downloader/src/controller.rs b/installer-downloader/src/controller.rs index aa5c93fa8a..6cca66e2be 100644 --- a/installer-downloader/src/controller.rs +++ b/installer-downloader/src/controller.rs @@ -35,6 +35,10 @@ enum TaskMessage { pub struct AppController {} /// Public entry function for registering a [AppDelegate]. +/// +/// This function uses the Mullvad API to fetch the current releases, a hardcoded public key to +/// verify the metadata, and the default HTTP client from `mullvad-update` and stores the files +/// in a temporary directory. pub fn initialize_controller<T: AppDelegate + 'static>(delegate: &mut T, environment: Environment) { use mullvad_update::{api::HttpVersionInfoProvider, app::HttpAppDownloader}; @@ -76,8 +80,8 @@ fn get_metadata_url() -> String { impl AppController { /// Initialize [AppController] using the provided delegate. /// - /// Providing the downloader and version info fetcher as type arguments, they're decoupled from - /// the logic of [AppController], allowing them to be mocked. + /// This function lets the caller provide a version information provider, download client, etc., + /// which is useful for testing. pub fn initialize<D, A, V, DirProvider>( delegate: &mut D, version_provider: V, |
