pub(crate) trait RoomPowerLevelsEventOptionExt {
// Required methods
fn user_power_level(
&self,
user_id: &UserId,
creators: impl Iterator<Item = OwnedUserId>,
rules: &AuthorizationRules,
) -> Result<UserPowerLevel>;
fn get_as_int_or_default(
&self,
field: RoomPowerLevelsIntField,
rules: &AuthorizationRules,
) -> Result<Int>;
fn event_power_level(
&self,
event_type: &TimelineEventType,
state_key: Option<&str>,
rules: &AuthorizationRules,
) -> Result<Int>;
}Expand description
Helper trait for Option<RoomPowerLevelsEvent<E>>.
Required Methods§
Sourcefn user_power_level(
&self,
user_id: &UserId,
creators: impl Iterator<Item = OwnedUserId>,
rules: &AuthorizationRules,
) -> Result<UserPowerLevel>
fn user_power_level( &self, user_id: &UserId, creators: impl Iterator<Item = OwnedUserId>, rules: &AuthorizationRules, ) -> Result<UserPowerLevel>
Get the power level of the user with the given ID.
Sourcefn get_as_int_or_default(
&self,
field: RoomPowerLevelsIntField,
rules: &AuthorizationRules,
) -> Result<Int>
fn get_as_int_or_default( &self, field: RoomPowerLevelsIntField, rules: &AuthorizationRules, ) -> Result<Int>
Get the value of a field that should contain an integer, or its default value if it is absent.
Sourcefn event_power_level(
&self,
event_type: &TimelineEventType,
state_key: Option<&str>,
rules: &AuthorizationRules,
) -> Result<Int>
fn event_power_level( &self, event_type: &TimelineEventType, state_key: Option<&str>, rules: &AuthorizationRules, ) -> Result<Int>
Get the power level required to send an event of the given type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.