diff --git a/CHANGELOG.md b/CHANGELOG.md index f25e1e1..90c1171 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. (See: `LidSwitchStateChange`) - Add function for obtaining service SID infos. (See: `Service::get_config_service_sid_info`). +### Changed +- Breaking: Make a bunch of enums `#[non_exhaustive]`: `Error`, `PowerBroadcastSetting`, + `PowerEventParam`, `SessionChangeReason` and `ServiceControl`. + ## [0.6.0] - 2023-03-07 ### Added diff --git a/src/lib.rs b/src/lib.rs index d495253..058e701 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -179,6 +179,7 @@ pub type Result = std::result::Result; #[derive(Debug)] +#[non_exhaustive] pub enum Error { /// Kernel drivers do not support launch arguments LaunchArgumentsNotSupported, diff --git a/src/service.rs b/src/service.rs index 360cb03..ab9eb79 100644 --- a/src/service.rs +++ b/src/service.rs @@ -809,6 +809,7 @@ impl LidSwitchStateChange { /// Please refer to MSDN for more info about the data members: /// #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[non_exhaustive] pub enum PowerBroadcastSetting { AcdcPowerSource(PowerSource), BatteryPercentageRemaining(u32), @@ -898,6 +899,7 @@ impl PowerBroadcastSetting { /// Enum describing the PowerEvent event #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[non_exhaustive] pub enum PowerEventParam { PowerStatusChange, ResumeAutomatic, @@ -1081,6 +1083,7 @@ impl UserEventCode { /// Enum describing the service control operations. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] +#[non_exhaustive] pub enum ServiceControl { Continue, Interrogate,