pub struct Updater { /* private fields */ }Expand description
Reusable update coordinator.
Implementations§
Source§impl Updater
impl Updater
Sourcepub fn preflight_stage(&self) -> Result<()>
pub fn preflight_stage(&self) -> Result<()>
Checks whether the installed executable is safe to update before a transport starts downloading artifact bytes.
Updater::stage repeats this check so callers cannot bypass it or
rely on stale preflight state.
pub async fn stage<R>(
&self,
reader: R,
directive: &UpdateDirective,
) -> Result<StagedArtifact>where
R: AsyncRead + Unpin,
Source§impl Updater
impl Updater
Sourcepub async fn migrate_state_file(
&self,
new_state_file: impl Into<PathBuf>,
) -> Result<MigrationOutcome>
pub async fn migrate_state_file( &self, new_state_file: impl Into<PathBuf>, ) -> Result<MigrationOutcome>
Moves this executable’s durable state authority to a new idle marker path.
An initial migration refuses to run while any marker, marker temporary, staged artifact, or rollback artifact exists. Once authority already names the destination, a retry only confirms the directory boundary and does not reject transaction state created through the returned updater. Both success variants carry the updater bound to the new state path; callers must retain it even when the authority rename’s directory sync is reported as indeterminate. Retrying the same migration is idempotent.
pub async fn install( &self, validated: ValidatedArtifact, previous_version: impl Into<String>, ) -> Result<InstallOutcome>
pub async fn recover_on_startup( &self, running_version: &str, ) -> Result<RecoveryAction>
pub async fn confirm_success( &self, running_version: &str, ) -> Result<ConfirmationOutcome>
Source§impl Updater
impl Updater
Sourcepub async fn validate(
&self,
staged: StagedArtifact,
) -> Result<ValidatedArtifact>
pub async fn validate( &self, staged: StagedArtifact, ) -> Result<ValidatedArtifact>
Executes --version and consumes the staged artifact on success.