[−][src]Struct gm_types::content::room::PowerLevels
m.room.power_levels
This event specifies the minimum level a user must have in order to perform a certain action. It also specifies the levels of each user in the room.
If a user_id is in the users list, then that user_id has the associated power level. Otherwise they have the default level users_default. If users_default is not supplied, it is assumed to be 0.
The level required to send a certain event is governed by events, state_default and events_default. If an event type is specified in events, then the user must have at least the level specified in order to send that event. If the event type is not supplied, it defaults to events_default for Message Events and state_default for State Events.
If there is no state_default in the m.room.power_levels event, the state_default is 50. If there is no events_default in the m.room.power_levels event, the events_default is 0. If the room contains no m.room.power_levels event, both the state_default and events_default are 0.
The power level required to invite a user to the room, kick a user from the room, ban a user from the room, or redact an event, is defined by invite, kick, ban, and redact, respectively. Each of these levels defaults to 50 if they are not specified in the m.room.power_levels event, or if the room contains no m.room.power_levels event.
Fields
ban: u32
The level required to ban a user. Defaults to 50 if unspecified.
events: HashMap<String, u32>
The level required to send specific event types. This is a mapping from event type to power level required.
events_default: u32
The default level required to send message events. Can be overridden by the events key. Defaults to 0 if unspecified.
invite: u32
The level required to invite a user. Defaults to 50 if unspecified.
kick: u32
The level required to kick a user. Defaults to 50 if unspecified.
redact: u32
The level required to redact an event. Defaults to 50 if unspecified.
state_default: u32
The default level required to send state events. Can be overridden by the events key. Defaults to 50 if unspecified, but 0 if there is no m.room.power_levels event at all.
users: HashMap<String, u32>
The power levels for specific users. This is a mapping from user_id to power level for that user.
users_default: u32
The default power level for every user in the room, unless their user_id is mentioned in the users key. Defaults to 0 if unspecified.
Trait Implementations
impl Clone for PowerLevels
[src]
fn clone(&self) -> PowerLevels
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for PowerLevels
[src]
impl<'de> Deserialize<'de> for PowerLevels
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Serialize for PowerLevels
[src]
Auto Trait Implementations
impl RefUnwindSafe for PowerLevels
impl Send for PowerLevels
impl Sync for PowerLevels
impl Unpin for PowerLevels
impl UnwindSafe for PowerLevels
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,