pub struct RestartSession { /* private fields */ }Expand description
A primary-installer Restart Manager session.
Shutdown consumes this value and produces a RestartPending, so restart
cannot be called out of sequence. This typestate is Send.
Implementations§
Source§impl RestartSession
impl RestartSession
Sourcepub fn session_key(&self) -> &SessionKey
pub fn session_key(&self) -> &SessionKey
Returns the key a secondary installer can pass to JoinedSession::join.
Sourcepub fn register_resources(&mut self, resources: &ResourceBatch) -> Result<()>
pub fn register_resources(&mut self, resources: &ResourceBatch) -> Result<()>
Registers a mixed collection in one native call.
Sourcepub fn register_files<I, P>(&mut self, files: I) -> Result<()>
pub fn register_files<I, P>(&mut self, files: I) -> Result<()>
Registers file paths. Directories are rejected by Restart Manager.
Sourcepub fn register_processes<I, P>(&mut self, processes: I) -> Result<()>
pub fn register_processes<I, P>(&mut self, processes: I) -> Result<()>
Registers exact process identities from any iterator.
Sourcepub fn register_services<I, S>(&mut self, services: I) -> Result<()>
pub fn register_services<I, S>(&mut self, services: I) -> Result<()>
Registers Windows services by short name.
Sourcepub fn affected_applications(&mut self) -> Result<AffectedApplications>
pub fn affected_applications(&mut self) -> Result<AffectedApplications>
Takes a reusable snapshot of affected applications and reboot reasons.
Sourcepub fn cancellation_handle(&self) -> CancellationHandle
pub fn cancellation_handle(&self) -> CancellationHandle
Creates a weak, thread-safe cancellation capability.
Sourcepub fn shutdown(self) -> RestartPending
pub fn shutdown(self) -> RestartPending
Gracefully attempts shutdown and always enters the recovery-required state.
Sourcepub fn shutdown_with_options(self, options: ShutdownOptions) -> RestartPending
pub fn shutdown_with_options(self, options: ShutdownOptions) -> RestartPending
Attempts shutdown and retains its outcome regardless of native success.
Sourcepub fn shutdown_with_progress<F>(
self,
options: ShutdownOptions,
callback: F,
) -> Result<RestartPending, OperationNotStarted<Self>>
pub fn shutdown_with_progress<F>( self, options: ShutdownOptions, callback: F, ) -> Result<RestartPending, OperationNotStarted<Self>>
Attempts shutdown while delivering validated, strictly increasing progress.
If the process-global callback lease cannot be acquired, the returned error also returns this session and no native operation has started.
Sourcepub fn set_filter(
&mut self,
target: &FilterTarget,
action: FilterAction,
) -> Result<()>
pub fn set_filter( &mut self, target: &FilterTarget, action: FilterAction, ) -> Result<()>
Adds or replaces a restart/shutdown filter.
Sourcepub fn remove_filter(&mut self, target: &FilterTarget) -> Result<()>
pub fn remove_filter(&mut self, target: &FilterTarget) -> Result<()>
Removes a filter from the selected target.