#[non_exhaustive]pub struct RoomServerAclEventContent {
pub allow_ip_literals: bool,
pub allow: Vec<String>,
pub deny: Vec<String>,
}
Expand description
The content of an m.room.server_acl
event.
An event to indicate which servers are permitted to participate in the room.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.allow_ip_literals: bool
Whether to allow server names that are IP address literals.
This is strongly recommended to be set to false as servers running with IP literal names are strongly discouraged in order to require legitimate homeservers to be backed by a valid registered domain name.
allow: Vec<String>
The server names to allow in the room, excluding any port information.
Wildcards may be used to cover a wider range of hosts, where *
matches zero or more
characters and ?
matches exactly one character.
Defaults to an empty list when not provided, effectively disallowing every server.
deny: Vec<String>
The server names to disallow in the room, excluding any port information.
Wildcards may be used to cover a wider range of hosts, where * matches zero or more
characters and ?
matches exactly one character.
Defaults to an empty list when not provided.
Implementations§
Source§impl RoomServerAclEventContent
impl RoomServerAclEventContent
Sourcepub fn new(
allow_ip_literals: bool,
allow: Vec<String>,
deny: Vec<String>,
) -> Self
pub fn new( allow_ip_literals: bool, allow: Vec<String>, deny: Vec<String>, ) -> Self
Creates a new RoomServerAclEventContent
with the given IP literal allowance flag, allowed
and denied servers.
Sourcepub fn is_allowed(&self, server_name: &ServerName) -> bool
pub fn is_allowed(&self, server_name: &ServerName) -> bool
Returns true if and only if the server is allowed by the ACL rules.
Trait Implementations§
Source§impl Clone for RoomServerAclEventContent
impl Clone for RoomServerAclEventContent
Source§fn clone(&self) -> RoomServerAclEventContent
fn clone(&self) -> RoomServerAclEventContent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RoomServerAclEventContent
impl Debug for RoomServerAclEventContent
Source§impl<'de> Deserialize<'de> for RoomServerAclEventContent
impl<'de> Deserialize<'de> for RoomServerAclEventContent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl EventContent for RoomServerAclEventContent
impl EventContent for RoomServerAclEventContent
Source§type EventType = StateEventType
type EventType = StateEventType
Source§fn event_type(&self) -> Self::EventType
fn event_type(&self) -> Self::EventType
m.room.message
.Source§impl From<RoomServerAclEventContent> for AnyStateEventContent
impl From<RoomServerAclEventContent> for AnyStateEventContent
Source§fn from(c: RoomServerAclEventContent) -> Self
fn from(c: RoomServerAclEventContent) -> Self
Source§impl PossiblyRedactedStateEventContent for RoomServerAclEventContent
impl PossiblyRedactedStateEventContent for RoomServerAclEventContent
Source§type StateKey = EmptyStateKey
type StateKey = EmptyStateKey
state_key
field.Source§impl RedactContent for RoomServerAclEventContent
impl RedactContent for RoomServerAclEventContent
Source§type Redacted = RedactedRoomServerAclEventContent
type Redacted = RedactedRoomServerAclEventContent
Source§fn redact(self, version: &RoomVersionId) -> RedactedRoomServerAclEventContent
fn redact(self, version: &RoomVersionId) -> RedactedRoomServerAclEventContent
self
into a redacted form (removing most or all fields) according to the spec. Read moreSource§impl StateEventContent for RoomServerAclEventContent
impl StateEventContent for RoomServerAclEventContent
Source§type StateKey = EmptyStateKey
type StateKey = EmptyStateKey
state_key
field.Source§impl StaticStateEventContent for RoomServerAclEventContent
impl StaticStateEventContent for RoomServerAclEventContent
Source§type PossiblyRedacted = RoomServerAclEventContent
type PossiblyRedacted = RoomServerAclEventContent
Source§type Unsigned = StateUnsigned<<RoomServerAclEventContent as StaticStateEventContent>::PossiblyRedacted>
type Unsigned = StateUnsigned<<RoomServerAclEventContent as StaticStateEventContent>::PossiblyRedacted>
unsigned
field.