1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
// SPDX-License-Identifier: MIT
// SPDX-FileCopyrightText: <text>
// Copyright(c) 2026 Liebherr-Digital Development Center GmbH
// Written by Thomas Witte <thomas.witte@liebherr.com>
// </text>
use Error;
use crate::;
/// An error that can occur during installation.
/// Feedback message to report the status of an ongoing installation.
/// An install progress iterator will return InstallationFeedback messages until the installation is finished.
/// Typically, these status messages will be reported (to the user, log, update server, …) using a progress reporter.
/// An iterator on the progress of an installation.
/// An installer that can install updates from an update source.
///
/// ``` rust
/// use libupdated::traits::installer::*;
/// use libupdated::traits::update_source::*;
/// use libupdated::update_workflow::UpdateError;
///
/// async fn example(installer: &(impl Installer + Rollback),
/// update: &impl Update) -> Result<(), UpdateError> {
/// let mut progress = installer.install(update)?;
///
/// while let Some(feedback) = progress.next().await? {
/// println!("Status: {}, Message: {}", feedback.status, feedback.message);
/// }
///
/// // installation finished, uninstall it again
///
/// if installer.rollback().await? == RollbackStatus::RebootRequired {
/// // reboot the system
/// }
///
/// Ok(())
/// }
/// ```
/// A trait for rolling back an installation.
/// This trait is separate from Installer, as not every installation can be rolled back.