#[non_exhaustive]pub enum PowerEventParam {
PowerStatusChange,
ResumeAutomatic,
ResumeSuspend,
Suspend,
PowerSettingChange(PowerBroadcastSetting),
BatteryLow,
OemEvent,
QuerySuspend,
QuerySuspendFailed,
ResumeCritical,
}Expand description
Enum describing the PowerEvent event
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
PowerStatusChange
ResumeAutomatic
ResumeSuspend
Suspend
PowerSettingChange(PowerBroadcastSetting)
BatteryLow
OemEvent
QuerySuspend
QuerySuspendFailed
ResumeCritical
Implementations§
Source§impl PowerEventParam
impl PowerEventParam
Sourcepub unsafe fn from_event(
event_type: u32,
event_data: *mut c_void,
) -> Result<Self, ParseRawError>
pub unsafe fn from_event( event_type: u32, event_data: *mut c_void, ) -> Result<Self, ParseRawError>
Extract PowerEventParam from event_type and event_data
§Safety
Invalid event_data pointer may cause undefined behavior in some circumstances.
Please refer to MSDN for more info about the requirements:
https://docs.microsoft.com/en-us/windows/win32/api/winsvc/nc-winsvc-lphandler_function_ex
Trait Implementations§
Source§impl Clone for PowerEventParam
impl Clone for PowerEventParam
Source§fn clone(&self) -> PowerEventParam
fn clone(&self) -> PowerEventParam
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PowerEventParam
impl Debug for PowerEventParam
Source§impl Hash for PowerEventParam
impl Hash for PowerEventParam
Source§impl PartialEq for PowerEventParam
impl PartialEq for PowerEventParam
impl Copy for PowerEventParam
impl Eq for PowerEventParam
impl StructuralPartialEq for PowerEventParam
Auto Trait Implementations§
impl Freeze for PowerEventParam
impl RefUnwindSafe for PowerEventParam
impl Send for PowerEventParam
impl Sync for PowerEventParam
impl Unpin for PowerEventParam
impl UnwindSafe for PowerEventParam
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
Mutably borrows from an owned value. Read more