diff --git a/ruma-events/src/room/guest_access.rs b/ruma-events/src/room/guest_access.rs index ed6d72ae..d506240d 100644 --- a/ruma-events/src/room/guest_access.rs +++ b/ruma-events/src/room/guest_access.rs @@ -14,12 +14,20 @@ pub type GuestAccessEvent = StateEvent; /// The payload for `GuestAccessEvent`. #[derive(Clone, Debug, Deserialize, Serialize, StateEventContent)] +#[non_exhaustive] #[ruma_event(type = "m.room.guest_access")] pub struct GuestAccessEventContent { /// A policy for guest user access to a room. pub guest_access: GuestAccess, } +impl GuestAccessEventContent { + /// Creates a new `GuestAccessEventContent` with the given policy. + pub fn new(guest_access: GuestAccess) -> Self { + Self { guest_access } + } +} + /// A policy for guest user access to a room. #[derive(Clone, Copy, Debug, PartialEq, Display, EnumString, Deserialize, Serialize)] #[non_exhaustive]