#[non_exhaustive]pub struct PushConditionRoomCtx {
pub room_id: OwnedRoomId,
pub member_count: UInt,
pub user_id: OwnedUserId,
pub user_display_name: String,
pub power_levels: Option<PushConditionPowerLevelsCtx>,
pub supported_features: Vec<RoomVersionFeature>,
/* private fields */
}
Expand description
The context of the room associated to an event to be able to test all push conditions.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.room_id: OwnedRoomId
The ID of the room.
member_count: UInt
The number of members in the room.
user_id: OwnedUserId
The user’s matrix ID.
user_display_name: String
The display name of the current user in the room.
power_levels: Option<PushConditionPowerLevelsCtx>
The room power levels context for the room.
If this is missing, push rules that require this will never match.
supported_features: Vec<RoomVersionFeature>
The list of features this room’s version or the room itself supports.
Implementations§
Source§impl PushConditionRoomCtx
impl PushConditionRoomCtx
Sourcepub fn new(
room_id: OwnedRoomId,
member_count: UInt,
user_id: OwnedUserId,
user_display_name: String,
) -> PushConditionRoomCtx
Available on crate feature events
only.
pub fn new( room_id: OwnedRoomId, member_count: UInt, user_id: OwnedUserId, user_display_name: String, ) -> PushConditionRoomCtx
events
only.Create a new PushConditionRoomCtx
.
Sourcepub fn with_has_thread_subscription_fn(
self,
has_thread_subscription_fn: impl for<'a> Fn(&'a EventId) -> Pin<Box<dyn Future<Output = bool> + Send + 'a>> + Send + Sync + 'static,
) -> PushConditionRoomCtx
Available on crate feature events
only.
pub fn with_has_thread_subscription_fn( self, has_thread_subscription_fn: impl for<'a> Fn(&'a EventId) -> Pin<Box<dyn Future<Output = bool> + Send + 'a>> + Send + Sync + 'static, ) -> PushConditionRoomCtx
events
only.Set a function to check if the user is subscribed to a thread, so as to define the push rules defined in MSC4306.
Sourcepub fn with_power_levels(
self,
power_levels: PushConditionPowerLevelsCtx,
) -> PushConditionRoomCtx
Available on crate feature events
only.
pub fn with_power_levels( self, power_levels: PushConditionPowerLevelsCtx, ) -> PushConditionRoomCtx
events
only.Add the given power levels context to this PushConditionRoomCtx
.
Trait Implementations§
Source§impl Clone for PushConditionRoomCtx
impl Clone for PushConditionRoomCtx
Source§fn clone(&self) -> PushConditionRoomCtx
fn clone(&self) -> PushConditionRoomCtx
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for PushConditionRoomCtx
impl !RefUnwindSafe for PushConditionRoomCtx
impl Send for PushConditionRoomCtx
impl Sync for PushConditionRoomCtx
impl Unpin for PushConditionRoomCtx
impl !UnwindSafe for PushConditionRoomCtx
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
Mutably borrows from an owned value. Read more