Derive and for most enums

This commit is contained in:
Mihai Dinculescu
2022-10-29 15:51:41 +01:00
parent 8cc948816d
commit 0a05fd38c9
7 changed files with 14 additions and 9 deletions

View File

@@ -1,7 +1,7 @@
use crate::bindings;
/// Specifies under which conditions the data is to be sent by the server and received by the client.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Condition {
/// The default, data will be sent strictly according to the defined period.
None,

View File

@@ -1,5 +1,5 @@
/// [`crate::SimConnectObject`] object property data type.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum DataType {
Float64,
Bool,

View File

@@ -3,7 +3,7 @@ use std::os::raw::c_char;
use crate::{bindings, fixed_c_str_to_string, SimConnectError};
/// SimConnect System Event Request.
#[derive(Debug, Copy, Clone, num_enum::TryFromPrimitive)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, num_enum::TryFromPrimitive)]
#[repr(u32)]
#[non_exhaustive]
pub enum SystemEventRequest {
@@ -84,7 +84,7 @@ impl SystemEventRequest {
}
/// Cockpit view type.
#[derive(Debug, Copy, Clone, num_enum::TryFromPrimitive)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, num_enum::TryFromPrimitive)]
#[repr(u32)]
pub enum ViewType {
/// No cockpit view.
@@ -98,7 +98,7 @@ pub enum ViewType {
}
/// SimConnect System Event Notification.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq)]
#[non_exhaustive]
pub enum SystemEvent {
/// A notification every second.
@@ -274,7 +274,7 @@ pub(crate) const CLIENT_EVENT_START: u32 = 128;
/// SimConnect Client Event.
///
/// WIP. As defined by <https://www.prepar3d.com/SDKv5/sdk/references/variables/event_ids.html>.
#[derive(Debug, Copy, Clone, num_enum::TryFromPrimitive)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, num_enum::TryFromPrimitive)]
#[repr(u32)]
#[non_exhaustive]
pub enum ClientEvent {

View File

@@ -2,7 +2,7 @@ use crate::bindings;
/// Facility Type. The simulation keeps a facilities cache of all the airports, waypoints, NDB and VOR stations within a certain radius of the user aircraft.
/// They can be requested using [`crate::SimConnect::subscribe_to_facilities`] or [`crate::SimConnect::request_facilities_list`].
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum FacilityType {
Airport,
Waypoint,

View File

@@ -1,5 +1,5 @@
/// SimConnect event notification group.
#[derive(Debug, Copy, Clone)]
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
#[repr(u32)]
pub enum NotificationGroup {
Group0,

View File

@@ -5,7 +5,7 @@ use crate::bindings;
/// 1 - every other interval.
/// 2 - every third interval.
/// etc.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Period {
/// Specifies that the data should be sent once only. Note that this is not an efficient way of receiving data frequently, use one of the other periods if there is a regular frequency to the data request.
Once,