[][src]Trait matrix_sdk_base::EventEmitter

pub trait EventEmitter: Send + Sync {
#[must_use]    pub fn on_room_member<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncStateEvent<MemberEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_room_name<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncStateEvent<NameEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_room_canonical_alias<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncStateEvent<CanonicalAliasEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_room_aliases<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncStateEvent<AliasesEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_room_avatar<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncStateEvent<AvatarEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_room_message<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncMessageEvent<MsgEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_room_message_feedback<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncMessageEvent<FeedbackEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_room_call_invite<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncMessageEvent<InviteEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_room_call_answer<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncMessageEvent<AnswerEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_room_call_candidates<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncMessageEvent<CandidatesEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_room_call_hangup<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncMessageEvent<HangupEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_room_redaction<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncRedactionEvent
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_room_power_levels<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncStateEvent<PowerLevelsEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_room_join_rules<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncStateEvent<JoinRulesEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_room_tombstone<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncStateEvent<TombstoneEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_state_member<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncStateEvent<MemberEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_state_name<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncStateEvent<NameEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_state_canonical_alias<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncStateEvent<CanonicalAliasEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_state_aliases<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncStateEvent<AliasesEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_state_avatar<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncStateEvent<AvatarEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_state_power_levels<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncStateEvent<PowerLevelsEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_state_join_rules<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncStateEvent<JoinRulesEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_stripped_state_member<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 StrippedStateEvent<MemberEventContent>,
        __arg3: Option<MemberEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_stripped_state_name<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 StrippedStateEvent<NameEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_stripped_state_canonical_alias<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 StrippedStateEvent<CanonicalAliasEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_stripped_state_aliases<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 StrippedStateEvent<AliasesEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_stripped_state_avatar<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 StrippedStateEvent<AvatarEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_stripped_state_power_levels<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 StrippedStateEvent<PowerLevelsEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_stripped_state_join_rules<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 StrippedStateEvent<JoinRulesEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_non_room_presence<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 PresenceEvent
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_non_room_ignored_users<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 BasicEvent<IgnoredUserListEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_non_room_push_rules<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 BasicEvent<PushRulesEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_non_room_fully_read<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncEphemeralRoomEvent<FullyReadEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_non_room_typing<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncEphemeralRoomEvent<TypingEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_non_room_receipt<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 SyncEphemeralRoomEvent<ReceiptEventContent>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_presence_event<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 PresenceEvent
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_unrecognized_event<'life0, 'life1, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 RawJsonValue
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... }
#[must_use] pub fn on_custom_event<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        __arg1: SyncRoom,
        __arg2: &'life1 CustomEvent<'life2>
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
, { ... } }

This trait allows any type implementing EventEmitter to specify event callbacks for each event. The Client calls each method when the corresponding event is received.

Examples


struct EventCallback;

#[async_trait]
impl EventEmitter for EventCallback {
    async fn on_room_message(&self, room: SyncRoom, event: &SyncMessageEvent<MessageEventContent>) {
        if let SyncRoom::Joined(room) = room {
            if let SyncMessageEvent {
                content: MessageEventContent::Text(TextMessageEventContent { body: msg_body, .. }),
                sender,
                ..
            } = event
            {
                let name = {
                   let room = room.read().await;
                   let member = room.joined_members.get(&sender).unwrap();
                   member
                       .display_name
                       .as_ref()
                       .map(ToString::to_string)
                       .unwrap_or(sender.to_string())
               };
                println!("{}: {}", name, msg_body);
            }
        }
    }
}

Provided methods

#[must_use]pub fn on_room_member<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncStateEvent<MemberEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a RoomEvent::RoomMember event.

#[must_use]pub fn on_room_name<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncStateEvent<NameEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a RoomEvent::RoomName event.

#[must_use]pub fn on_room_canonical_alias<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncStateEvent<CanonicalAliasEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a RoomEvent::RoomCanonicalAlias event.

#[must_use]pub fn on_room_aliases<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncStateEvent<AliasesEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a RoomEvent::RoomAliases event.

#[must_use]pub fn on_room_avatar<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncStateEvent<AvatarEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a RoomEvent::RoomAvatar event.

#[must_use]pub fn on_room_message<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncMessageEvent<MsgEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a RoomEvent::RoomMessage event.

#[must_use]pub fn on_room_message_feedback<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncMessageEvent<FeedbackEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a RoomEvent::RoomMessageFeedback event.

#[must_use]pub fn on_room_call_invite<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncMessageEvent<InviteEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a RoomEvent::CallInvite event

#[must_use]pub fn on_room_call_answer<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncMessageEvent<AnswerEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a RoomEvent::CallAnswer event

#[must_use]pub fn on_room_call_candidates<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncMessageEvent<CandidatesEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a RoomEvent::CallCandidates event

#[must_use]pub fn on_room_call_hangup<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncMessageEvent<HangupEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a RoomEvent::CallHangup event

#[must_use]pub fn on_room_redaction<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncRedactionEvent
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a RoomEvent::RoomRedaction event.

#[must_use]pub fn on_room_power_levels<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncStateEvent<PowerLevelsEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a RoomEvent::RoomPowerLevels event.

#[must_use]pub fn on_room_join_rules<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncStateEvent<JoinRulesEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a RoomEvent::Tombstone event.

#[must_use]pub fn on_room_tombstone<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncStateEvent<TombstoneEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a RoomEvent::Tombstone event.

#[must_use]pub fn on_state_member<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncStateEvent<MemberEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a StateEvent::RoomMember event.

#[must_use]pub fn on_state_name<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncStateEvent<NameEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a StateEvent::RoomName event.

#[must_use]pub fn on_state_canonical_alias<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncStateEvent<CanonicalAliasEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a StateEvent::RoomCanonicalAlias event.

#[must_use]pub fn on_state_aliases<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncStateEvent<AliasesEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a StateEvent::RoomAliases event.

#[must_use]pub fn on_state_avatar<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncStateEvent<AvatarEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a StateEvent::RoomAvatar event.

#[must_use]pub fn on_state_power_levels<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncStateEvent<PowerLevelsEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a StateEvent::RoomPowerLevels event.

#[must_use]pub fn on_state_join_rules<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncStateEvent<JoinRulesEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a StateEvent::RoomJoinRules event.

#[must_use]pub fn on_stripped_state_member<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 StrippedStateEvent<MemberEventContent>,
    __arg3: Option<MemberEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a AnyStrippedStateEvent::StrippedRoomMember event.

#[must_use]pub fn on_stripped_state_name<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 StrippedStateEvent<NameEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a AnyStrippedStateEvent::StrippedRoomName event.

#[must_use]pub fn on_stripped_state_canonical_alias<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 StrippedStateEvent<CanonicalAliasEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a AnyStrippedStateEvent::StrippedRoomCanonicalAlias event.

#[must_use]pub fn on_stripped_state_aliases<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 StrippedStateEvent<AliasesEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a AnyStrippedStateEvent::StrippedRoomAliases event.

#[must_use]pub fn on_stripped_state_avatar<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 StrippedStateEvent<AvatarEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a AnyStrippedStateEvent::StrippedRoomAvatar event.

#[must_use]pub fn on_stripped_state_power_levels<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 StrippedStateEvent<PowerLevelsEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a AnyStrippedStateEvent::StrippedRoomPowerLevels event.

#[must_use]pub fn on_stripped_state_join_rules<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 StrippedStateEvent<JoinRulesEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a AnyStrippedStateEvent::StrippedRoomJoinRules event.

#[must_use]pub fn on_non_room_presence<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 PresenceEvent
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a NonRoomEvent::RoomPresence event.

#[must_use]pub fn on_non_room_ignored_users<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 BasicEvent<IgnoredUserListEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a NonRoomEvent::RoomName event.

#[must_use]pub fn on_non_room_push_rules<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 BasicEvent<PushRulesEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a NonRoomEvent::RoomCanonicalAlias event.

#[must_use]pub fn on_non_room_fully_read<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncEphemeralRoomEvent<FullyReadEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a NonRoomEvent::RoomAliases event.

#[must_use]pub fn on_non_room_typing<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncEphemeralRoomEvent<TypingEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a NonRoomEvent::Typing event.

#[must_use]pub fn on_non_room_receipt<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 SyncEphemeralRoomEvent<ReceiptEventContent>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a NonRoomEvent::Receipt event.

This is always a read receipt.

#[must_use]pub fn on_presence_event<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 PresenceEvent
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a NonRoomEvent::RoomAliases event.

#[must_use]pub fn on_unrecognized_event<'life0, 'life1, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 RawJsonValue
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a Event::Custom event or if deserialization fails because the event was unknown to ruma.

The only guarantee this method can give about the event is that it is valid JSON.

#[must_use]pub fn on_custom_event<'life0, 'life1, 'life2, 'async_trait>(
    &'life0 self,
    __arg1: SyncRoom,
    __arg2: &'life1 CustomEvent<'life2>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    'life2: 'async_trait,
    Self: 'async_trait, 
[src]

Fires when Client receives a Event::Custom event or if deserialization fails because the event was unknown to ruma.

The only guarantee this method can give about the event is that it is in the shape of a valid matrix event.

Loading content...

Implementors

Loading content...