Skip to content

Commit

Permalink
Merge branch 'mark-enums-non_exhaustive'
Browse files Browse the repository at this point in the history
  • Loading branch information
faern committed Apr 16, 2024
2 parents 4577e36 + f215e4a commit a87e63c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@
pub type Result<T> = std::result::Result<T, Error>;

#[derive(Debug)]
#[non_exhaustive]
pub enum Error {
/// Kernel drivers do not support launch arguments
LaunchArgumentsNotSupported,
Expand Down
3 changes: 3 additions & 0 deletions src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -809,6 +809,7 @@ impl LidSwitchStateChange {
/// Please refer to MSDN for more info about the data members:
/// <https://docs.microsoft.com/en-us/windows/win32/power/power-setting-guid>
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum PowerBroadcastSetting {
AcdcPowerSource(PowerSource),
BatteryPercentageRemaining(u32),
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit a87e63c

Please sign in to comment.