pub struct AutoApplyUpgrader { /* private fields */ }Expand description
Auto-apply upgrader with archive support.
Implementations§
Source§impl AutoApplyUpgrader
impl AutoApplyUpgrader
Sourcepub fn with_binary_cache(self, cache: BinaryCache) -> Self
pub fn with_binary_cache(self, cache: BinaryCache) -> Self
Configure a shared binary cache for downloaded upgrades.
When set, apply_upgrade will check the cache before downloading
and store freshly verified binaries so other nodes can reuse them.
Sourcepub fn with_stop_on_upgrade(self, stop: bool) -> Self
pub fn with_stop_on_upgrade(self, stop: bool) -> Self
Configure the upgrader to exit cleanly instead of spawning a new process.
When enabled, the node exits after applying an upgrade, relying on an external service manager (systemd, launchd, Windows Service) to restart it.
Sourcepub fn current_version(&self) -> &Version
pub fn current_version(&self) -> &Version
Get the current version.
Sourcepub fn current_binary_path() -> Result<PathBuf>
pub fn current_binary_path() -> Result<PathBuf>
Get the path to the currently running binary.
On Linux, /proc/self/exe may have a " (deleted)" suffix when the on-disk binary has
been replaced by another node’s upgrade. This function strips that suffix so that backup
creation, binary replacement, and restart all target the correct on-disk path.
§Errors
Returns an error if the binary path cannot be determined.
Sourcepub async fn apply_upgrade(&self, info: &UpgradeInfo) -> Result<UpgradeResult>
pub async fn apply_upgrade(&self, info: &UpgradeInfo) -> Result<UpgradeResult>
Perform the complete auto-apply upgrade workflow.
§Arguments
info- Upgrade information from the monitor
§Returns
Returns UpgradeResult::Success and triggers a restart on success.
Returns UpgradeResult::RolledBack if any step fails.
§Errors
Returns an error only for critical failures where rollback also fails.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AutoApplyUpgrader
impl !RefUnwindSafe for AutoApplyUpgrader
impl Send for AutoApplyUpgrader
impl Sync for AutoApplyUpgrader
impl Unpin for AutoApplyUpgrader
impl UnsafeUnpin for AutoApplyUpgrader
impl !UnwindSafe for AutoApplyUpgrader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more