Struct matrix_sdk::ruma::events::room::server_acl::RoomServerAclEventContent
source · #[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>,
) -> RoomServerAclEventContent
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.
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<RoomServerAclEventContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RoomServerAclEventContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl EventContent for RoomServerAclEventContent
impl EventContent for RoomServerAclEventContent
§type EventType = StateEventType
type EventType = StateEventType
source§fn event_type(&self) -> <RoomServerAclEventContent as EventContent>::EventType
fn event_type(&self) -> <RoomServerAclEventContent as EventContent>::EventType
m.room.message
.source§impl From<RoomServerAclEventContent> for AnyStateEventContent
impl From<RoomServerAclEventContent> for AnyStateEventContent
source§fn from(c: RoomServerAclEventContent) -> AnyStateEventContent
fn from(c: RoomServerAclEventContent) -> AnyStateEventContent
source§impl PossiblyRedactedStateEventContent for RoomServerAclEventContent
impl PossiblyRedactedStateEventContent for RoomServerAclEventContent
§type StateKey = EmptyStateKey
type StateKey = EmptyStateKey
state_key
field.source§impl RedactContent for RoomServerAclEventContent
impl RedactContent for RoomServerAclEventContent
§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 Serialize for RoomServerAclEventContent
impl Serialize for RoomServerAclEventContent
source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
source§impl StateEventContent for RoomServerAclEventContent
impl StateEventContent for RoomServerAclEventContent
§type StateKey = EmptyStateKey
type StateKey = EmptyStateKey
state_key
field.source§impl StaticStateEventContent for RoomServerAclEventContent
impl StaticStateEventContent for RoomServerAclEventContent
§type PossiblyRedacted = RoomServerAclEventContent
type PossiblyRedacted = RoomServerAclEventContent
§type Unsigned = StateUnsigned<<RoomServerAclEventContent as StaticStateEventContent>::PossiblyRedacted>
type Unsigned = StateUnsigned<<RoomServerAclEventContent as StaticStateEventContent>::PossiblyRedacted>
unsigned
field.Auto Trait Implementations§
impl Freeze for RoomServerAclEventContent
impl RefUnwindSafe for RoomServerAclEventContent
impl Send for RoomServerAclEventContent
impl Sync for RoomServerAclEventContent
impl Unpin for RoomServerAclEventContent
impl UnwindSafe for RoomServerAclEventContent
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> CompatExt for T
impl<T> CompatExt for T
source§impl<T> EventContentFromType for Twhere
T: EventContent + DeserializeOwned,
impl<T> EventContentFromType for Twhere
T: EventContent + DeserializeOwned,
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
source§fn consume_handle(handle: Handle) -> Arc<T>
fn consume_handle(handle: Handle) -> Arc<T>
Arc<>
source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more