Struct RoomPowerLevelsEventContent
#[non_exhaustive]pub struct RoomPowerLevelsEventContent {
pub ban: Int,
pub events: BTreeMap<TimelineEventType, Int>,
pub events_default: Int,
pub invite: Int,
pub kick: Int,
pub redact: Int,
pub state_default: Int,
pub users: BTreeMap<OwnedUserId, Int>,
pub users_default: Int,
pub notifications: NotificationPowerLevels,
}
Expand description
The content of an m.room.power_levels
event.
Defines the power levels (privileges) of users 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.ban: Int
The level required to ban a user.
events: BTreeMap<TimelineEventType, Int>
The level required to send specific event types.
This is a mapping from event type to power level required.
events_default: Int
The default level required to send message events.
invite: Int
The level required to invite a user.
kick: Int
The level required to kick a user.
redact: Int
The level required to redact an event.
state_default: Int
The default level required to send state events.
users: BTreeMap<OwnedUserId, Int>
The power levels for specific users.
This is a mapping from user_id
to power level for that user.
users_default: Int
The default power level for every user in the room.
notifications: NotificationPowerLevels
The power level requirements for specific notification types.
This is a mapping from key
to power level for that notifications key.
Implementations§
§impl RoomPowerLevelsEventContent
impl RoomPowerLevelsEventContent
pub fn new(rules: &AuthorizationRules) -> RoomPowerLevelsEventContent
pub fn new(rules: &AuthorizationRules) -> RoomPowerLevelsEventContent
Creates a new RoomPowerLevelsEventContent
with all-default values for the given
authorization rules.
Trait Implementations§
§impl Clone for RoomPowerLevelsEventContent
impl Clone for RoomPowerLevelsEventContent
§fn clone(&self) -> RoomPowerLevelsEventContent
fn clone(&self) -> RoomPowerLevelsEventContent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for RoomPowerLevelsEventContent
impl Debug for RoomPowerLevelsEventContent
§impl<'de> Deserialize<'de> for RoomPowerLevelsEventContent
impl<'de> Deserialize<'de> for RoomPowerLevelsEventContent
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<RoomPowerLevelsEventContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<RoomPowerLevelsEventContent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl From<RoomPowerLevelsEventContent> for AnyStateEventContent
impl From<RoomPowerLevelsEventContent> for AnyStateEventContent
§fn from(c: RoomPowerLevelsEventContent) -> AnyStateEventContent
fn from(c: RoomPowerLevelsEventContent) -> AnyStateEventContent
§impl From<RoomPowerLevelsEventContent> for RoomPowerLevelsSource
impl From<RoomPowerLevelsEventContent> for RoomPowerLevelsSource
§fn from(value: RoomPowerLevelsEventContent) -> RoomPowerLevelsSource
fn from(value: RoomPowerLevelsEventContent) -> RoomPowerLevelsSource
§impl PossiblyRedactedStateEventContent for RoomPowerLevelsEventContent
impl PossiblyRedactedStateEventContent for RoomPowerLevelsEventContent
§type StateKey = EmptyStateKey
type StateKey = EmptyStateKey
state_key
field.§fn event_type(&self) -> StateEventType
fn event_type(&self) -> StateEventType
m.room.name
.§impl RedactContent for RoomPowerLevelsEventContent
impl RedactContent for RoomPowerLevelsEventContent
§type Redacted = RedactedRoomPowerLevelsEventContent
type Redacted = RedactedRoomPowerLevelsEventContent
§fn redact(
self,
rules: &RedactionRules,
) -> <RoomPowerLevelsEventContent as RedactContent>::Redacted
fn redact( self, rules: &RedactionRules, ) -> <RoomPowerLevelsEventContent as RedactContent>::Redacted
self
into a redacted form (removing most or all fields) according to the spec. Read more§impl Serialize for RoomPowerLevelsEventContent
impl Serialize for RoomPowerLevelsEventContent
§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,
§impl StateEventContent for RoomPowerLevelsEventContent
impl StateEventContent for RoomPowerLevelsEventContent
§type StateKey = EmptyStateKey
type StateKey = EmptyStateKey
state_key
field.§fn event_type(&self) -> StateEventType
fn event_type(&self) -> StateEventType
m.room.name
.§impl StaticStateEventContent for RoomPowerLevelsEventContent
impl StaticStateEventContent for RoomPowerLevelsEventContent
§type PossiblyRedacted = RoomPowerLevelsEventContent
type PossiblyRedacted = RoomPowerLevelsEventContent
§type Unsigned = StateUnsigned<<RoomPowerLevelsEventContent as StaticStateEventContent>::PossiblyRedacted>
type Unsigned = StateUnsigned<<RoomPowerLevelsEventContent as StaticStateEventContent>::PossiblyRedacted>
unsigned
field.§impl TryFrom<RoomPowerLevels> for RoomPowerLevelsEventContent
impl TryFrom<RoomPowerLevels> for RoomPowerLevelsEventContent
§type Error = PowerLevelsError
type Error = PowerLevelsError
§fn try_from(
c: RoomPowerLevels,
) -> Result<RoomPowerLevelsEventContent, <RoomPowerLevelsEventContent as TryFrom<RoomPowerLevels>>::Error>
fn try_from( c: RoomPowerLevels, ) -> Result<RoomPowerLevelsEventContent, <RoomPowerLevelsEventContent as TryFrom<RoomPowerLevels>>::Error>
impl JsonCastable<AnyStateEventContent> for RoomPowerLevelsEventContent
impl JsonCastable<Map<String, Value>> for RoomPowerLevelsEventContent
Auto Trait Implementations§
impl Freeze for RoomPowerLevelsEventContent
impl RefUnwindSafe for RoomPowerLevelsEventContent
impl Send for RoomPowerLevelsEventContent
impl Sync for RoomPowerLevelsEventContent
impl Unpin for RoomPowerLevelsEventContent
impl UnwindSafe for RoomPowerLevelsEventContent
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,
§impl<T> CompatExt for T
impl<T> CompatExt for T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> EventContentFromType for Twhere
T: StaticEventContent + DeserializeOwned,
impl<T> EventContentFromType for Twhere
T: StaticEventContent + DeserializeOwned,
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