pub struct Shutdown {
pub busy: bool,
pub done: bool,
pub error: bool,
pub error_message: String,
/* private fields */
}Fields§
§busy: booltrue while waiting for a response from the server.
done: booltrue for one cycle after the server confirms the command.
error: booltrue for one cycle after the server returns an error.
error_message: StringError description from the server (empty when no error).
Implementations§
Source§impl Shutdown
impl Shutdown
Sourcepub fn initiate(&mut self, client: &mut CommandClient)
pub fn initiate(&mut self, client: &mut CommandClient)
Send a system.full_shutdown command to the server.
Does nothing if an operation is already in progress (busy is true).
The server will schedule a shutdown with a 15-second delay.
Sourcepub fn cancel(&mut self, client: &mut CommandClient)
pub fn cancel(&mut self, client: &mut CommandClient)
Send a system.cancel_full_shutdown command to the server.
Does nothing if an operation is already in progress (busy is true).
Sourcepub fn call(&mut self, client: &mut CommandClient)
pub fn call(&mut self, client: &mut CommandClient)
Poll for the server response. Call this once per scan cycle.
Updates busy, done, error, and error_message based on
whether a response has arrived.
Sourcepub fn is_initiating(&self) -> bool
pub fn is_initiating(&self) -> bool
Returns true if a shutdown initiation is currently pending.
Sourcepub fn is_cancelling(&self) -> bool
pub fn is_cancelling(&self) -> bool
Returns true if a shutdown cancellation is currently pending.