Mark HistoryVisibilityEventContent as non_exhaustive
This commit is contained in:
parent
1e17afbc52
commit
7aac2f5439
@ -12,6 +12,7 @@ pub type HistoryVisibilityEvent = StateEvent<HistoryVisibilityEventContent>;
|
||||
|
||||
/// The payload for `HistoryVisibilityEvent`.
|
||||
#[derive(Clone, Debug, Deserialize, Serialize, StateEventContent)]
|
||||
#[non_exhaustive]
|
||||
#[ruma_event(type = "m.room.history_visibility")]
|
||||
pub struct HistoryVisibilityEventContent {
|
||||
/// Who can see the room history.
|
||||
@ -19,6 +20,13 @@ pub struct HistoryVisibilityEventContent {
|
||||
pub history_visibility: HistoryVisibility,
|
||||
}
|
||||
|
||||
impl HistoryVisibilityEventContent {
|
||||
/// Creates a new `HistoryVisibilityEventContent` with the given policy.
|
||||
pub fn new(history_visibility: HistoryVisibility) -> Self {
|
||||
Self { history_visibility }
|
||||
}
|
||||
}
|
||||
|
||||
/// Who can see a room's history.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Display, EnumString, Deserialize, Serialize)]
|
||||
#[non_exhaustive]
|
||||
|
Loading…
x
Reference in New Issue
Block a user