Mark JoinRulesEventContent as non_exhaustive
This commit is contained in:
parent
ea2992a412
commit
be175bbae6
@ -11,6 +11,7 @@ pub type JoinRulesEvent = StateEvent<JoinRulesEventContent>;
|
|||||||
|
|
||||||
/// The payload for `JoinRulesEvent`.
|
/// The payload for `JoinRulesEvent`.
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize, StateEventContent)]
|
#[derive(Clone, Debug, Deserialize, Serialize, StateEventContent)]
|
||||||
|
#[non_exhaustive]
|
||||||
#[ruma_event(type = "m.room.join_rules")]
|
#[ruma_event(type = "m.room.join_rules")]
|
||||||
pub struct JoinRulesEventContent {
|
pub struct JoinRulesEventContent {
|
||||||
/// The type of rules used for users wishing to join this room.
|
/// The type of rules used for users wishing to join this room.
|
||||||
@ -18,6 +19,13 @@ pub struct JoinRulesEventContent {
|
|||||||
pub join_rule: JoinRule,
|
pub join_rule: JoinRule,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl JoinRulesEventContent {
|
||||||
|
/// Creates a new `JoinRulesEventContent` with the given rule.
|
||||||
|
pub fn new(join_rule: JoinRule) -> Self {
|
||||||
|
Self { join_rule }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// The rule used for users wishing to join this room.
|
/// The rule used for users wishing to join this room.
|
||||||
#[derive(Clone, Copy, Debug, PartialEq, Display, EnumString, Deserialize, Serialize)]
|
#[derive(Clone, Copy, Debug, PartialEq, Display, EnumString, Deserialize, Serialize)]
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user