Type Alias PossiblyRedactedRoomServerAclEventContent

Source
pub type PossiblyRedactedRoomServerAclEventContent = RoomServerAclEventContent;
Available on crate feature events only.
Expand description

The possibly redacted form of RoomServerAclEventContent.

This type is used when it’s not obvious whether the content is redacted or not.

Aliased Type§

struct PossiblyRedactedRoomServerAclEventContent {
    pub allow_ip_literals: bool,
    pub allow: Vec<String>,
    pub deny: Vec<String>,
}

Fields§

§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

Source

pub fn new( allow_ip_literals: bool, allow: Vec<String>, deny: Vec<String>, ) -> RoomServerAclEventContent

Creates a new RoomServerAclEventContent with the given IP literal allowance flag, allowed and denied servers.

Source

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

Source§

fn clone(&self) -> RoomServerAclEventContent

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RoomServerAclEventContent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for RoomServerAclEventContent

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<RoomServerAclEventContent, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl EventContent for RoomServerAclEventContent

Source§

type EventType = StateEventType

The Rust enum for the event kind’s known types.
Source§

fn event_type(&self) -> <RoomServerAclEventContent as EventContent>::EventType

Get the event’s type, like m.room.message.
Source§

impl PossiblyRedactedStateEventContent for RoomServerAclEventContent

Source§

type StateKey = EmptyStateKey

The type of the event’s state_key field.
Source§

impl RedactContent for RoomServerAclEventContent

Source§

type Redacted = RedactedRoomServerAclEventContent

The redacted form of the event’s content.
Source§

fn redact(self, _rules: &RedactionRules) -> RedactedRoomServerAclEventContent

Transform self into a redacted form (removing most or all fields) according to the spec. Read more
Source§

impl Serialize for RoomServerAclEventContent

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StateEventContent for RoomServerAclEventContent

Source§

type StateKey = EmptyStateKey

The type of the event’s state_key field.
Source§

impl StaticEventContent for RoomServerAclEventContent

Source§

const TYPE: &'static str = "m.room.server_acl"

The event type.
Source§

impl StaticStateEventContent for RoomServerAclEventContent

Source§

type PossiblyRedacted = RoomServerAclEventContent

The possibly redacted form of the event’s content.
Source§

type Unsigned = StateUnsigned<<RoomServerAclEventContent as StaticStateEventContent>::PossiblyRedacted>

The type of the event’s unsigned field.