Skip to content

Commit f1b0b91

Browse files
committed
refactor!: Mark all structs non_exhaustive
1 parent 7d3feb5 commit f1b0b91

12 files changed

Lines changed: 31 additions & 1 deletion

src/account.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use super::utils;
2020
serde(rename_all = "camelCase")
2121
)]
2222
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
23+
#[non_exhaustive]
2324
pub struct AccountCidr {
2425
pub name: String,
2526
pub cidr: Ipv4Net,
@@ -39,6 +40,7 @@ impl std::ops::Deref for AccountCidr {
3940
serde(rename_all = "camelCase")
4041
)]
4142
#[derive(Debug, Clone, PartialEq)]
43+
#[non_exhaustive]
4244
pub struct Tier {
4345
pub tier: u32,
4446
pub price: f32,
@@ -66,6 +68,7 @@ impl Hateoas for Tier {
6668
serde(rename_all = "camelCase")
6769
)]
6870
#[derive(Debug, Clone, PartialEq)]
71+
#[non_exhaustive]
6972
pub struct Account {
7073
#[cfg_attr(feature = "serde", serde(with = "time::serde::iso8601"))]
7174
pub created: OffsetDateTime,

src/azel.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use time::OffsetDateTime;
88
serde(rename_all = "camelCase")
99
)]
1010
#[derive(Debug, Clone, PartialEq)]
11+
#[non_exhaustive]
1112
pub struct Location {
1213
pub longitude: f64,
1314
pub latitude: f64,
@@ -20,6 +21,7 @@ pub struct Location {
2021
serde(rename_all = "camelCase")
2122
)]
2223
#[derive(Debug, Clone, PartialEq)]
24+
#[non_exhaustive]
2325
pub struct Direction {
2426
#[cfg_attr(feature = "serde", serde(with = "time::serde::iso8601"))]
2527
pub timestamp: OffsetDateTime,
@@ -33,6 +35,7 @@ pub struct Direction {
3335
serde(rename_all = "camelCase")
3436
)]
3537
#[derive(Debug, Clone, PartialEq)]
38+
#[non_exhaustive]
3639
pub struct AzEl {
3740
#[cfg_attr(feature = "serde", serde(with = "time::serde::iso8601"))]
3841
pub start: OffsetDateTime,

src/band.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ pub enum IoHardware {
4747
serde(rename_all = "camelCase")
4848
)]
4949
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
50+
#[non_exhaustive]
5051
pub struct IoConfiguration {
5152
#[cfg_attr(feature = "serde", serde(default))]
5253
pub start_hex_pattern: Option<String>,
@@ -63,6 +64,7 @@ pub struct IoConfiguration {
6364
serde(rename_all = "camelCase")
6465
)]
6566
#[derive(Debug, Clone, PartialEq)]
67+
#[non_exhaustive]
6668
pub struct Band {
6769
#[cfg_attr(feature = "serde", serde(with = "time::serde::iso8601"))]
6870
pub created: OffsetDateTime,

src/error.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use serde::Deserialize;
77
serde(rename_all = "camelCase")
88
)]
99
#[derive(Debug, Clone, PartialEq, Eq)]
10+
#[non_exhaustive]
1011
pub enum Error {
1112
PaginatedInner,
1213
PaginatedListMissing,

src/gateway_licenses.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use time::OffsetDateTime;
1212
serde(rename_all = "camelCase")
1313
)]
1414
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
15+
#[non_exhaustive]
1516
pub struct RegenerateResponse {
1617
pub account_id: u64,
1718
pub license_id: u32,
@@ -27,6 +28,7 @@ pub struct RegenerateResponse {
2728
serde(rename_all = "camelCase")
2829
)]
2930
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
31+
#[non_exhaustive]
3032
pub struct Verify {
3133
pub license_key: String,
3234
}
@@ -38,6 +40,7 @@ pub struct Verify {
3840
serde(rename_all = "camelCase")
3941
)]
4042
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
43+
#[non_exhaustive]
4144
pub struct VerifyResponse {
4245
pub valid: bool,
4346
pub license_id: Option<u32>,
@@ -59,6 +62,7 @@ pub struct VerifyResponse {
5962
serde(rename_all = "camelCase")
6063
)]
6164
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
65+
#[non_exhaustive]
6266
pub struct View(pub Vec<ViewOne>);
6367

6468
/// Representation of a single license associated with an account.
@@ -70,6 +74,7 @@ pub struct View(pub Vec<ViewOne>);
7074
serde(rename_all = "camelCase")
7175
)]
7276
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
77+
#[non_exhaustive]
7378
pub struct ViewOne {
7479
pub id: u32,
7580
pub account_id: u64,

src/pagination.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ use url::Url;
99
/// A paginated response
1010
#[derive(Debug, Clone, Deserialize, PartialEq, Eq)]
1111
#[serde(rename_all = "camelCase")]
12+
#[non_exhaustive]
1213
pub struct Paginated<T>
1314
where
1415
T: DeserializeOwned,
@@ -38,6 +39,7 @@ where
3839
/// Page metadata included in a paginated stream
3940
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
4041
#[serde(rename_all = "camelCase")]
42+
#[non_exhaustive]
4143
pub struct Page {
4244
pub size: u32,
4345
pub total_elements: u32,

src/satellite.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use super::utils;
1515
serde(rename_all = "camelCase")
1616
)]
1717
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
18+
#[non_exhaustive]
1819
pub struct TwoLineElement {
1920
pub line1: String,
2021
pub line2: String,
@@ -27,6 +28,7 @@ pub struct TwoLineElement {
2728
serde(rename_all = "camelCase")
2829
)]
2930
#[derive(Debug, Clone, PartialEq, Eq)]
31+
#[non_exhaustive]
3032
pub struct Satellite {
3133
#[cfg_attr(feature = "serde", serde(with = "time::serde::iso8601"))]
3234
pub created: OffsetDateTime,

src/satellite_configuration.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use super::utils;
1616
serde(rename_all = "camelCase")
1717
)]
1818
#[derive(Debug, Clone, PartialEq, Eq)]
19+
#[non_exhaustive]
1920
pub struct SatelliteConfiguration {
2021
#[cfg_attr(feature = "serde", serde(with = "time::serde::iso8601"))]
2122
pub created: OffsetDateTime,

src/site.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use std::collections::HashMap;
44
use time::OffsetDateTime;
55
use url::Url;
66

7-
use crate::azel::Location;
87
use crate::Hateoas;
8+
use crate::azel::Location;
99

1010
#[cfg(feature = "serde")]
1111
use super::utils;
@@ -16,6 +16,7 @@ use super::utils;
1616
serde(rename_all = "camelCase")
1717
)]
1818
#[derive(Debug, Clone, PartialEq, Eq)]
19+
#[non_exhaustive]
1920
pub struct SiteHardware {
2021
pub manual: bool,
2122
#[cfg_attr(feature = "serde", serde(default))]
@@ -48,6 +49,7 @@ pub struct SiteHardware {
4849
serde(rename_all = "camelCase")
4950
)]
5051
#[derive(Debug, Clone, PartialEq)]
52+
#[non_exhaustive]
5153
pub struct Site {
5254
#[cfg_attr(feature = "serde", serde(with = "time::serde::iso8601"))]
5355
pub created: OffsetDateTime,
@@ -88,6 +90,7 @@ impl Hateoas for Site {
8890
serde(rename_all = "camelCase")
8991
)]
9092
#[derive(Debug, Clone, PartialEq, Eq)]
93+
#[non_exhaustive]
9194
pub struct SiteConfiguration {
9295
#[cfg_attr(feature = "serde", serde(with = "time::serde::iso8601"))]
9396
pub created: OffsetDateTime,

src/task.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ pub enum TaskStatusType {
5353
serde(rename_all = "camelCase")
5454
)]
5555
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
56+
#[non_exhaustive]
5657
pub struct TaskStatus {
5758
#[cfg_attr(feature = "serde", serde(with = "crate::utils::timestamp"))]
5859
pub created: OffsetDateTime,
@@ -100,6 +101,7 @@ pub enum TaskType {
100101
serde(rename_all = "camelCase")
101102
)]
102103
#[derive(Debug, Clone, PartialEq, Eq)]
104+
#[non_exhaustive]
103105
pub struct Task {
104106
#[cfg_attr(feature = "serde", serde(with = "time::serde::iso8601"))]
105107
pub created: OffsetDateTime,
@@ -159,6 +161,7 @@ impl Hateoas for Task {
159161
serde(rename_all = "camelCase")
160162
)]
161163
#[derive(Debug, Clone, PartialEq, Eq)]
164+
#[non_exhaustive]
162165
pub struct TaskStatusEvent {
163166
pub task_request_id: i32,
164167
pub task_request_uri: String,
@@ -179,6 +182,7 @@ impl TaskStatusEvent {
179182
serde(rename_all = "camelCase")
180183
)]
181184
#[derive(Debug, Clone, PartialEq, Eq)]
185+
#[non_exhaustive]
182186
pub struct TaskRequest {
183187
#[cfg_attr(feature = "serde", serde(with = "time::serde::iso8601"))]
184188
pub created: OffsetDateTime,

0 commit comments

Comments
 (0)