[−][src]Struct matrix_sdk::Room
A Matrix room.
Fields
room_id: RoomId
The unique id of the room.
room_name: RoomName
The name of the room, clients use this to represent a room.
own_user_id: UserId
The mxid of our own user.
creator: Option<UserId>
The mxid of the room creator.
direct_target: Option<UserId>
The mxid of the "direct" target if any
invited_members: HashMap<UserId, RoomMember, RandomState>
The map of invited room members.
joined_members: HashMap<UserId, RoomMember, RandomState>
The map of joined room members.
messages: MessageQueue
A queue of messages, holds no more than 10 of the most recent messages.
This is helpful when using a StateStore
to avoid multiple requests to
the server for messages.
typing_users: Vec<UserId, Global>
A list of users that are currently typing.
power_levels: Option<PowerLevels>
The power level requirements for specific actions in this room
encrypted: Option<EncryptionInfo>
Optional encryption info, will be Some
if the room is encrypted.
unread_highlight: Option<UInt>
Number of unread notifications with highlight flag set.
unread_notifications: Option<UInt>
Number of unread notifications.
tombstone: Option<Tombstone>
The tombstone state of this room.
Implementations
impl Room
[src]
pub fn new(room_id: &RoomId, own_user_id: &UserId) -> Room
[src]
Create a new room.
Arguments
-
room_id
- The unique id of the room. -
own_user_id
- The mxid of our own user.
pub fn display_name(&self) -> String
[src]
Return the display name of the room.
pub fn is_encrypted(&self) -> bool
[src]
Is the room a encrypted room.
pub fn encryption_info(&self) -> Option<&EncryptionInfo>
[src]
Get the encryption info if any of the room.
Returns None if the room is not encrypted.
pub fn member_is_tracked(&self, user_id: &UserId) -> bool
[src]
Check whether the user with the MXID user_id
is joined or invited to
the room.
Returns true if so, false otherwise.
pub fn get_member(&self, user_id: &UserId) -> Option<&RoomMember>
[src]
Get a room member by user ID.
If there is no such member, returns None
.
pub fn get_member_mut(&mut self, user_id: &UserId) -> Option<&mut RoomMember>
[src]
Get a room member by user ID.
If there is no such member, returns None
.
pub fn handle_membership(
&mut self,
event: &SyncStateEvent<MemberEventContent>,
state_event: bool
) -> (bool, HashMap<UserId, bool, RandomState>)
[src]
&mut self,
event: &SyncStateEvent<MemberEventContent>,
state_event: bool
) -> (bool, HashMap<UserId, bool, RandomState>)
Handle a room.member updating the room state if necessary.
Returns a tuple of:
- True if the joined member list changed, false otherwise.
- A map of display name ambiguity status changes (see
disambiguation_updates
).
pub fn handle_message(&mut self, event: &AnySyncMessageEvent) -> bool
[src]
Handle a room.message event and update the MessageQueue
if necessary.
Returns true if MessageQueue
was added to.
pub fn handle_redaction(&mut self, redacted_event: &SyncRedactionEvent) -> bool
[src]
Handle a room.redaction event and update the MessageQueue
.
Returns true if MessageQueue
was updated. The effected message event
has it's contents replaced with the RedactionEventContents
and the
whole redaction event is added to the Unsigned
redacted_because
field.
pub fn handle_room_aliases(
&mut self,
event: &SyncStateEvent<AliasesEventContent>
) -> bool
[src]
&mut self,
event: &SyncStateEvent<AliasesEventContent>
) -> bool
Handle a room.aliases event, updating the room state if necessary.
Returns true if the room name changed, false otherwise.
pub fn handle_canonical(
&mut self,
event: &SyncStateEvent<CanonicalAliasEventContent>
) -> bool
[src]
&mut self,
event: &SyncStateEvent<CanonicalAliasEventContent>
) -> bool
Handle a room.canonical_alias event, updating the room state if necessary.
Returns true if the room name changed, false otherwise.
pub fn handle_room_name(
&mut self,
event: &SyncStateEvent<NameEventContent>
) -> bool
[src]
&mut self,
event: &SyncStateEvent<NameEventContent>
) -> bool
Handle a room.name event, updating the room state if necessary.
Returns true if the room name changed, false otherwise.
pub fn handle_stripped_room_name(
&mut self,
event: &StrippedStateEvent<NameEventContent>
) -> bool
[src]
&mut self,
event: &StrippedStateEvent<NameEventContent>
) -> bool
Handle a room.name event, updating the room state if necessary.
Returns true if the room name changed, false otherwise.
pub fn handle_power_level(
&mut self,
event: &SyncStateEvent<PowerLevelsEventContent>
) -> bool
[src]
&mut self,
event: &SyncStateEvent<PowerLevelsEventContent>
) -> bool
Handle a room.power_levels event, updating the room state if necessary.
Returns true if the room name changed, false otherwise.
pub fn handle_direct(&mut self, user_id: &UserId) -> bool
[src]
Handle setting direct attribute as part of a m.direct event, updating the room if necessary
Returns true if the direct_target changed, false otherwise.
pub fn receive_timeline_event(&mut self, event: &AnySyncRoomEvent) -> bool
[src]
Receive a timeline event for this room and update the room state.
Returns true if the joined member list changed, false otherwise.
Arguments
event
- The event of the room.
pub fn receive_state_event(&mut self, event: &AnySyncStateEvent) -> bool
[src]
Receive a state event for this room and update the room state.
Returns true if the state of the Room
has changed, false otherwise.
Arguments
event
- The event of the room.
pub fn receive_stripped_state_event(
&mut self,
event: &AnyStrippedStateEvent
) -> bool
[src]
&mut self,
event: &AnyStrippedStateEvent
) -> bool
Receive a stripped state event for this room and update the room state.
Returns true if the state of the Room
has changed, false otherwise.
Arguments
event
- TheAnyStrippedStateEvent
sent by the server for invited but not joined rooms.
pub fn receive_presence_event(&mut self, event: &PresenceEvent) -> bool
[src]
Receive a presence event for a member of the current room.
Returns true if the event causes a change to the member's presence, false otherwise.
Arguments
event
- The presence event to receive and process.
pub fn update_member_profile(
&mut self,
target_member: &UserId,
event: &SyncStateEvent<MemberEventContent>,
change: MembershipChange
) -> (bool, HashMap<UserId, bool, RandomState>)
[src]
&mut self,
target_member: &UserId,
event: &SyncStateEvent<MemberEventContent>,
change: MembershipChange
) -> (bool, HashMap<UserId, bool, RandomState>)
Process an update of a member's profile.
Returns a tuple of:
- True if the event made changes to the room's state, false otherwise.
- A map of display name ambiguity status changes (see
disambiguation_updates
).
Arguments
target_member
- The ID of the member to update.event
- The profile update event for the specified room member.
pub fn update_member_power(
member: &mut RoomMember,
event: &SyncStateEvent<PowerLevelsEventContent>,
max_power: Int
) -> bool
[src]
member: &mut RoomMember,
event: &SyncStateEvent<PowerLevelsEventContent>,
max_power: Int
) -> bool
Process an update of a member's power level.
Arguments
event
- The power level event to process.max_power
- Maximum power level allowed.
Trait Implementations
impl Clone for Room
[src]
impl Debug for Room
[src]
impl<'de> Deserialize<'de> for Room
[src]
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Room, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
__deserializer: __D
) -> Result<Room, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
impl PartialEq<Room> for Room
[src]
impl Serialize for Room
[src]
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
impl StructuralPartialEq for Room
[src]
Auto Trait Implementations
impl RefUnwindSafe for Room
[src]
impl Send for Room
[src]
impl Sync for Room
[src]
impl Unpin for Room
[src]
impl UnwindSafe for Room
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AsyncTraitDeps for T where
T: Send + Sync + Debug,
[src]
T: Send + Sync + Debug,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Conv for T
impl<T> Conv for T
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> FmtForward for T
pub fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
Self: Binary,
pub fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
Self: Display,
pub fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
Self: LowerExp,
pub fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
Self: LowerHex,
pub fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
Self: Octal,
pub fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
Self: Pointer,
pub fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
Self: UpperExp,
pub fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
Self: UpperHex,
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pipe for T where
T: ?Sized,
T: ?Sized,
pub fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
pub fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
R: 'a,
pub fn pipe_ref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self) -> R
) -> R where
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut Self) -> R
) -> R where
R: 'a,
pub fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R where
Self: Borrow<B>,
R: 'a,
B: 'a + ?Sized,
Self: Borrow<B>,
R: 'a,
B: 'a + ?Sized,
pub fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
R: 'a,
B: 'a + ?Sized,
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R where
Self: BorrowMut<B>,
R: 'a,
B: 'a + ?Sized,
pub fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R where
Self: AsRef<U>,
R: 'a,
U: 'a + ?Sized,
Self: AsRef<U>,
R: 'a,
U: 'a + ?Sized,
pub fn pipe_as_mut<'a, U, R>(
&'a mut self,
func: impl FnOnce(&'a mut U) -> R
) -> R where
Self: AsMut<U>,
R: 'a,
U: 'a + ?Sized,
&'a mut self,
func: impl FnOnce(&'a mut U) -> R
) -> R where
Self: AsMut<U>,
R: 'a,
U: 'a + ?Sized,
pub fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Deref<Target = T>,
R: 'a,
T: 'a + ?Sized,
Self: Deref<Target = T>,
R: 'a,
T: 'a + ?Sized,
pub fn pipe_deref_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: DerefMut<Target = T> + Deref,
R: 'a,
T: 'a + ?Sized,
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: DerefMut<Target = T> + Deref,
R: 'a,
T: 'a + ?Sized,
impl<T> Pipe for T
impl<T> PipeAsRef for T
pub fn pipe_as_ref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: AsRef<T>,
R: 'a,
T: 'a,
Self: AsRef<T>,
R: 'a,
T: 'a,
pub fn pipe_as_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: AsMut<T>,
R: 'a,
T: 'a,
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: AsMut<T>,
R: 'a,
T: 'a,
impl<T> PipeBorrow for T
pub fn pipe_borrow<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R where
Self: Borrow<T>,
R: 'a,
T: 'a,
Self: Borrow<T>,
R: 'a,
T: 'a,
pub fn pipe_borrow_mut<'a, T, R>(
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
R: 'a,
T: 'a,
&'a mut self,
func: impl FnOnce(&'a mut T) -> R
) -> R where
Self: BorrowMut<T>,
R: 'a,
T: 'a,
impl<T> PipeDeref for T
pub fn pipe_deref<'a, R>(
&'a self,
func: impl FnOnce(&'a Self::Target) -> R
) -> R where
Self: Deref,
R: 'a,
&'a self,
func: impl FnOnce(&'a Self::Target) -> R
) -> R where
Self: Deref,
R: 'a,
pub fn pipe_deref_mut<'a, R>(
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
&'a mut self,
func: impl FnOnce(&'a mut Self::Target) -> R
) -> R where
Self: DerefMut,
R: 'a,
impl<T> PipeRef for T
pub fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
R: 'a,
pub fn pipe_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
R: 'a,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Tap for T
pub fn tap(self, func: impl FnOnce(&Self)) -> Self
pub fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self
pub fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Self: Borrow<B>,
B: ?Sized,
pub fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Self: BorrowMut<B>,
B: ?Sized,
pub fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
Self: AsRef<R>,
R: ?Sized,
pub fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Self: AsMut<R>,
R: ?Sized,
pub fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
Self: Deref<Target = T>,
T: ?Sized,
pub fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
pub fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
pub fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
pub fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
Self: Borrow<B>,
B: ?Sized,
pub fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
Self: BorrowMut<B>,
B: ?Sized,
pub fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
Self: AsRef<R>,
R: ?Sized,
pub fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
Self: AsMut<R>,
R: ?Sized,
pub fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
Self: Deref<Target = T>,
T: ?Sized,
pub fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
impl<T> Tap for T
pub fn tap<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
F: FnOnce(&Self) -> R,
pub fn tap_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&Self) -> R,
F: FnOnce(&Self) -> R,
pub fn tap_mut<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
F: FnOnce(&mut Self) -> R,
pub fn tap_mut_dbg<F, R>(self, func: F) -> Self where
F: FnOnce(&mut Self) -> R,
F: FnOnce(&mut Self) -> R,
impl<T, U> TapAsRef<U> for T where
U: ?Sized,
U: ?Sized,
pub fn tap_ref<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Self: AsRef<T>,
F: FnOnce(&T) -> R,
pub fn tap_ref_dbg<F, R>(self, func: F) -> Self where
Self: AsRef<T>,
F: FnOnce(&T) -> R,
Self: AsRef<T>,
F: FnOnce(&T) -> R,
pub fn tap_ref_mut<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
pub fn tap_ref_mut_dbg<F, R>(self, func: F) -> Self where
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
Self: AsMut<T>,
F: FnOnce(&mut T) -> R,
impl<T, U> TapBorrow<U> for T where
U: ?Sized,
U: ?Sized,
pub fn tap_borrow<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Self: Borrow<T>,
F: FnOnce(&T) -> R,
pub fn tap_borrow_dbg<F, R>(self, func: F) -> Self where
Self: Borrow<T>,
F: FnOnce(&T) -> R,
Self: Borrow<T>,
F: FnOnce(&T) -> R,
pub fn tap_borrow_mut<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
pub fn tap_borrow_mut_dbg<F, R>(self, func: F) -> Self where
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
Self: BorrowMut<T>,
F: FnOnce(&mut T) -> R,
impl<T> TapDeref for T
pub fn tap_deref<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Self: Deref,
F: FnOnce(&Self::Target) -> R,
pub fn tap_deref_dbg<F, R>(self, func: F) -> Self where
Self: Deref,
F: FnOnce(&Self::Target) -> R,
Self: Deref,
F: FnOnce(&Self::Target) -> R,
pub fn tap_deref_mut<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
pub fn tap_deref_mut_dbg<F, R>(self, func: F) -> Self where
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
Self: DerefMut,
F: FnOnce(&mut Self::Target) -> R,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> TryConv for T
impl<T> TryConv for T
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.
pub 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,