Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark lots of enums #[non_exhaustive] #124

Merged
merged 5 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading