pub struct Permissions {Show 16 fields
pub room: WeakRef<Room>,
pub power_levels: RefCell<RoomPowerLevels>,
power_levels_drop_guard: OnceCell<EventHandlerDropGuard>,
pub is_joined: Cell<bool>,
pub own_power_level: Cell<i64>,
pub default_power_level: Cell<i64>,
pub mute_power_level: Cell<i64>,
pub can_change_avatar: Cell<bool>,
pub can_change_name: Cell<bool>,
pub can_change_topic: Cell<bool>,
pub can_invite: Cell<bool>,
pub can_send_message: Cell<bool>,
pub can_send_reaction: Cell<bool>,
pub can_redact_own: Cell<bool>,
pub can_redact_other: Cell<bool>,
pub can_notify_room: Cell<bool>,
}
Fields§
§room: WeakRef<Room>
The room where these permissions apply.
power_levels: RefCell<RoomPowerLevels>
The source of the power levels information.
power_levels_drop_guard: OnceCell<EventHandlerDropGuard>
§is_joined: Cell<bool>
Whether our own member is joined.
own_power_level: Cell<i64>
The power level of our own member.
default_power_level: Cell<i64>
The default power level for members.
mute_power_level: Cell<i64>
The power level to mute members.
can_change_avatar: Cell<bool>
Whether our own member can change the room’s avatar.
can_change_name: Cell<bool>
Whether our own member can change the room’s name.
can_change_topic: Cell<bool>
Whether our own member can change the room’s topic.
can_invite: Cell<bool>
Whether our own member can invite another user.
can_send_message: Cell<bool>
Whether our own member can send a message.
can_send_reaction: Cell<bool>
Whether our own member can send a reaction.
can_redact_own: Cell<bool>
Whether our own member can redact their own event.
can_redact_other: Cell<bool>
Whether our own member can redact the event of another user.
can_notify_room: Cell<bool>
Whether our own member can notify the whole room.
Implementations§
source§impl Permissions
impl Permissions
sourcefn register_type()
fn register_type()
Registers the type only once.
source§impl Permissions
impl Permissions
sourcepub(super) fn init_own_member(&self, own_member: Member)
pub(super) fn init_own_member(&self, own_member: Member)
Initialize the room.
sourcepub(super) fn own_member(&self) -> Option<Member>
pub(super) fn own_member(&self) -> Option<Member>
The room member for our own user.
sourcepub(super) async fn init_power_levels(&self)
pub(super) async fn init_power_levels(&self)
Initialize the power levels from the store.
sourcefn update_is_joined(&self)
fn update_is_joined(&self)
Update whether our own member is joined
sourcefn update_power_levels(&self, power_levels: RoomPowerLevels)
fn update_power_levels(&self, power_levels: RoomPowerLevels)
Update the power levels with the given data.
sourcefn permissions_changed(&self)
fn permissions_changed(&self)
Trigger updates when the permissions changed.
sourcefn update_own_power_level(&self)
fn update_own_power_level(&self)
Update the power level of our own member.
sourcefn update_default_power_level(&self)
fn update_default_power_level(&self)
Update the default power level for members.
sourcefn update_mute_power_level(&self)
fn update_mute_power_level(&self)
Update the power level to mute members.
sourcepub(super) fn is_allowed_to(&self, room_action: PowerLevelAction) -> bool
pub(super) fn is_allowed_to(&self, room_action: PowerLevelAction) -> bool
Whether our own member is allowed to do the given action.
sourcefn update_can_change_avatar(&self)
fn update_can_change_avatar(&self)
Update whether our own member can change the room’s avatar.
sourcefn update_can_change_name(&self)
fn update_can_change_name(&self)
Update whether our own member can change the room’s name.
sourcefn update_can_change_topic(&self)
fn update_can_change_topic(&self)
Update whether our own member can change the room’s topic.
sourcefn update_can_invite(&self)
fn update_can_invite(&self)
Update whether our own member can invite another user in the room.
sourcefn update_can_send_message(&self)
fn update_can_send_message(&self)
Update whether our own member can send a message in the room.
sourcefn update_can_send_reaction(&self)
fn update_can_send_reaction(&self)
Update whether our own member can send a reaction.
sourcefn update_can_redact_own(&self)
fn update_can_redact_own(&self)
Update whether our own member can redact their own event.
sourcefn update_can_redact_other(&self)
fn update_can_redact_other(&self)
Update whether our own member can redact the event of another user.
sourcefn update_can_notify_room(&self)
fn update_can_notify_room(&self)
Update whether our own member can notify the whole room.
Trait Implementations§
source§impl Debug for Permissions
impl Debug for Permissions
source§impl Default for Permissions
impl Default for Permissions
source§impl DerivedObjectProperties for Permissions
impl DerivedObjectProperties for Permissions
source§fn derived_properties() -> &'static [ParamSpec]
fn derived_properties() -> &'static [ParamSpec]
source§fn derived_property(&self, id: usize, pspec: &ParamSpec) -> Value
fn derived_property(&self, id: usize, pspec: &ParamSpec) -> Value
ObjectImpl
but auto-generated by the Properties
macro
to allow handling more complex use-cases.source§fn derived_set_property(&self, id: usize, value: &Value, pspec: &ParamSpec)
fn derived_set_property(&self, id: usize, value: &Value, pspec: &ParamSpec)
ObjectImpl
but auto-generated by the Properties
macro
to allow handling more complex use-cases.source§impl ObjectImpl for Permissions
impl ObjectImpl for Permissions
source§fn properties() -> &'static [ParamSpec]
fn properties() -> &'static [ParamSpec]
source§fn set_property(&self, id: usize, value: &Value, pspec: &ParamSpec)
fn set_property(&self, id: usize, value: &Value, pspec: &ParamSpec)
source§fn constructed(&self)
fn constructed(&self)
source§fn notify(&self, pspec: &ParamSpec)
fn notify(&self, pspec: &ParamSpec)
self.notify("property")
.fn dispatch_properties_changed(&self, pspecs: &[ParamSpec])
source§impl ObjectSubclass for Permissions
impl ObjectSubclass for Permissions
source§type ParentType = Object
type ParentType = Object
source§type Interfaces = ()
type Interfaces = ()
source§type Class = ClassStruct<Permissions>
type Class = ClassStruct<Permissions>
source§type Instance = InstanceStruct<Permissions>
type Instance = InstanceStruct<Permissions>
source§type Type = Permissions
type Type = Permissions
wrapper!
source§const ALLOW_NAME_CONFLICT: bool = false
const ALLOW_NAME_CONFLICT: bool = false
source§fn type_init(_type_: &mut InitializingType<Self>)
fn type_init(_type_: &mut InitializingType<Self>)
source§fn class_init(_klass: &mut Self::Class)
fn class_init(_klass: &mut Self::Class)
source§fn with_class(_klass: &Self::Class) -> Self
fn with_class(_klass: &Self::Class) -> Self
source§fn instance_init(_obj: &InitializingObject<Self>)
fn instance_init(_obj: &InitializingObject<Self>)
Auto Trait Implementations§
impl !Freeze for Permissions
impl !RefUnwindSafe for Permissions
impl !Send for Permissions
impl !Sync for Permissions
impl Unpin for Permissions
impl !UnwindSafe for Permissions
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, 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,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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 moresource§impl<T> ObjectImplExt for Twhere
T: ObjectImpl,
impl<T> ObjectImplExt for Twhere
T: ObjectImpl,
source§fn parent_constructed(&self)
fn parent_constructed(&self)
glib::Object::constructed()
.source§fn parent_notify(&self, pspec: &ParamSpec)
fn parent_notify(&self, pspec: &ParamSpec)
glib::Object::notify()
.source§fn parent_dispatch_properties_changed(&self, pspecs: &[ParamSpec])
fn parent_dispatch_properties_changed(&self, pspecs: &[ParamSpec])
glib::Object::dispatch_properties_changed()
.source§fn signal_chain_from_overridden(
&self,
token: &SignalClassHandlerToken,
values: &[Value],
) -> Option<Value>
fn signal_chain_from_overridden( &self, token: &SignalClassHandlerToken, values: &[Value], ) -> Option<Value>
source§impl<T> ObjectSubclassExt for Twhere
T: ObjectSubclass,
impl<T> ObjectSubclassExt for Twhere
T: ObjectSubclass,
source§fn instance(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
fn instance(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
source§fn from_instance(obj: &<T as ObjectSubclass>::Type) -> &T
fn from_instance(obj: &<T as ObjectSubclass>::Type) -> &T
source§fn obj(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
fn obj(&self) -> BorrowedObject<'_, <T as ObjectSubclass>::Type>
source§fn from_obj(obj: &<T as ObjectSubclass>::Type) -> &T
fn from_obj(obj: &<T as ObjectSubclass>::Type) -> &T
source§fn ref_counted(&self) -> ObjectImplRef<T>
fn ref_counted(&self) -> ObjectImplRef<T>
self
.