common: Make all pub structs non_exhaustive
This commit is contained in:
parent
5a7e2cddcf
commit
626b5a5d06
@ -66,6 +66,7 @@ pub struct PublicRoomsChunk {
|
|||||||
/// This struct will not be updated even if additional fields are added to `PublicRoomsChunk` in a
|
/// This struct will not be updated even if additional fields are added to `PublicRoomsChunk` in a
|
||||||
/// new (non-breaking) release of the Matrix specification.
|
/// new (non-breaking) release of the Matrix specification.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
#[allow(clippy::exhaustive_structs)]
|
||||||
pub struct PublicRoomsChunkInit {
|
pub struct PublicRoomsChunkInit {
|
||||||
/// The number of members joined to the room.
|
/// The number of members joined to the room.
|
||||||
pub num_joined_members: UInt,
|
pub num_joined_members: UInt,
|
||||||
|
@ -152,6 +152,7 @@ pub struct SimplePushRule {
|
|||||||
/// This struct will not be updated even if additional fields are added to `SimplePushRule` in a new
|
/// This struct will not be updated even if additional fields are added to `SimplePushRule` in a new
|
||||||
/// (non-breaking) release of the Matrix specification.
|
/// (non-breaking) release of the Matrix specification.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
#[allow(clippy::exhaustive_structs)]
|
||||||
pub struct SimplePushRuleInit {
|
pub struct SimplePushRuleInit {
|
||||||
/// Actions to determine if and how a notification is delivered for events matching this rule.
|
/// Actions to determine if and how a notification is delivered for events matching this rule.
|
||||||
pub actions: Vec<Action>,
|
pub actions: Vec<Action>,
|
||||||
@ -241,6 +242,7 @@ impl ConditionalPushRule {
|
|||||||
/// This struct will not be updated even if additional fields are added to `ConditionalPushRule` in
|
/// This struct will not be updated even if additional fields are added to `ConditionalPushRule` in
|
||||||
/// a new (non-breaking) release of the Matrix specification.
|
/// a new (non-breaking) release of the Matrix specification.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
#[allow(clippy::exhaustive_structs)]
|
||||||
pub struct ConditionalPushRuleInit {
|
pub struct ConditionalPushRuleInit {
|
||||||
/// Actions to determine if and how a notification is delivered for events matching this rule.
|
/// Actions to determine if and how a notification is delivered for events matching this rule.
|
||||||
pub actions: Vec<Action>,
|
pub actions: Vec<Action>,
|
||||||
@ -338,6 +340,7 @@ impl PatternedPushRule {
|
|||||||
/// This struct will not be updated even if additional fields are added to `PatterenedPushRule` in a
|
/// This struct will not be updated even if additional fields are added to `PatterenedPushRule` in a
|
||||||
/// new (non-breaking) release of the Matrix specification.
|
/// new (non-breaking) release of the Matrix specification.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
#[allow(clippy::exhaustive_structs)]
|
||||||
pub struct PatternedPushRuleInit {
|
pub struct PatternedPushRuleInit {
|
||||||
/// Actions to determine if and how a notification is delivered for events matching this rule.
|
/// Actions to determine if and how a notification is delivered for events matching this rule.
|
||||||
pub actions: Vec<Action>,
|
pub actions: Vec<Action>,
|
||||||
|
@ -113,6 +113,7 @@ impl PushCondition {
|
|||||||
|
|
||||||
/// The context of the room associated to an event to be able to test all push conditions.
|
/// The context of the room associated to an event to be able to test all push conditions.
|
||||||
#[derive(Clone, Debug)]
|
#[derive(Clone, Debug)]
|
||||||
|
#[allow(clippy::exhaustive_structs)]
|
||||||
pub struct PushConditionRoomCtx {
|
pub struct PushConditionRoomCtx {
|
||||||
/// The ID of the room.
|
/// The ID of the room.
|
||||||
pub room_id: RoomId,
|
pub room_id: RoomId,
|
||||||
|
@ -61,6 +61,7 @@ impl Default for ComparisonOperator {
|
|||||||
/// let greater = RoomMemberCountIs::gt(uint!(3));
|
/// let greater = RoomMemberCountIs::gt(uint!(3));
|
||||||
/// ```
|
/// ```
|
||||||
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
|
||||||
|
#[allow(clippy::exhaustive_structs)]
|
||||||
pub struct RoomMemberCountIs {
|
pub struct RoomMemberCountIs {
|
||||||
/// One of `==`, `<`, `>`, `>=`, `<=`, or no prefix.
|
/// One of `==`, `<`, `>`, `>=`, `<=`, or no prefix.
|
||||||
pub prefix: ComparisonOperator,
|
pub prefix: ComparisonOperator,
|
||||||
|
@ -42,6 +42,7 @@ pub struct Protocol {
|
|||||||
/// This struct will not be updated even if additional fields are added to `Prococol` in a new
|
/// This struct will not be updated even if additional fields are added to `Prococol` in a new
|
||||||
/// (non-breaking) release of the Matrix specification.
|
/// (non-breaking) release of the Matrix specification.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
#[allow(clippy::exhaustive_structs)]
|
||||||
pub struct ProtocolInit {
|
pub struct ProtocolInit {
|
||||||
/// Fields which may be used to identify a third party user.
|
/// Fields which may be used to identify a third party user.
|
||||||
pub user_fields: Vec<String>,
|
pub user_fields: Vec<String>,
|
||||||
@ -96,6 +97,7 @@ pub struct ProtocolInstance {
|
|||||||
/// This struct will not be updated even if additional fields are added to `Prococol` in a new
|
/// This struct will not be updated even if additional fields are added to `Prococol` in a new
|
||||||
/// (non-breaking) release of the Matrix specification.
|
/// (non-breaking) release of the Matrix specification.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
#[allow(clippy::exhaustive_structs)]
|
||||||
pub struct ProtocolInstanceInit {
|
pub struct ProtocolInstanceInit {
|
||||||
/// A human-readable description for the protocol, such as the name.
|
/// A human-readable description for the protocol, such as the name.
|
||||||
pub desc: String,
|
pub desc: String,
|
||||||
@ -150,6 +152,7 @@ pub struct FieldType {
|
|||||||
/// This struct will not be updated even if additional fields are added to `FieldType` in a new
|
/// This struct will not be updated even if additional fields are added to `FieldType` in a new
|
||||||
/// (non-breaking) release of the Matrix specification.
|
/// (non-breaking) release of the Matrix specification.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
#[allow(clippy::exhaustive_structs)]
|
||||||
pub struct FieldTypeInit {
|
pub struct FieldTypeInit {
|
||||||
/// A regular expression for validation of a field's value.
|
/// A regular expression for validation of a field's value.
|
||||||
pub regexp: String,
|
pub regexp: String,
|
||||||
@ -188,6 +191,7 @@ impl Location {
|
|||||||
|
|
||||||
/// A third party network user.
|
/// A third party network user.
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
|
#[cfg_attr(not(feature = "unstable-exhaustive-types"), non_exhaustive)]
|
||||||
pub struct User {
|
pub struct User {
|
||||||
/// A matrix user ID representing a third party user.
|
/// A matrix user ID representing a third party user.
|
||||||
pub userid: UserId,
|
pub userid: UserId,
|
||||||
@ -246,6 +250,7 @@ pub struct ThirdPartyIdentifier {
|
|||||||
/// This struct will not be updated even if additional fields are added to `ThirdPartyIdentifier`
|
/// This struct will not be updated even if additional fields are added to `ThirdPartyIdentifier`
|
||||||
/// in a new (non-breaking) release of the Matrix specification.
|
/// in a new (non-breaking) release of the Matrix specification.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
#[allow(clippy::exhaustive_structs)]
|
||||||
pub struct ThirdPartyIdentifierInit {
|
pub struct ThirdPartyIdentifierInit {
|
||||||
/// The third party identifier address.
|
/// The third party identifier address.
|
||||||
pub address: String,
|
pub address: String,
|
||||||
|
@ -7,6 +7,7 @@ use std::{
|
|||||||
|
|
||||||
/// A timestamp represented as the number of milliseconds since the unix epoch.
|
/// A timestamp represented as the number of milliseconds since the unix epoch.
|
||||||
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize)]
|
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize)]
|
||||||
|
#[allow(clippy::exhaustive_structs)]
|
||||||
#[serde(transparent)]
|
#[serde(transparent)]
|
||||||
pub struct MilliSecondsSinceUnixEpoch(pub UInt);
|
pub struct MilliSecondsSinceUnixEpoch(pub UInt);
|
||||||
|
|
||||||
@ -42,6 +43,7 @@ impl MilliSecondsSinceUnixEpoch {
|
|||||||
|
|
||||||
/// A timestamp represented as the number of seconds since the unix epoch.
|
/// A timestamp represented as the number of seconds since the unix epoch.
|
||||||
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize)]
|
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize)]
|
||||||
|
#[allow(clippy::exhaustive_structs)]
|
||||||
#[serde(transparent)]
|
#[serde(transparent)]
|
||||||
pub struct SecondsSinceUnixEpoch(pub UInt);
|
pub struct SecondsSinceUnixEpoch(pub UInt);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user