#[non_exhaustive]pub struct PresenceUpdate {
pub user_id: OwnedUserId,
pub presence: PresenceState,
pub status_msg: Option<String>,
pub last_active_ago: UInt,
pub currently_active: bool,
pub recipients: PresenceRecipientListUpdates,
pub stream_id: Option<Int>,
pub prev_id: Option<Int>,
}client or server only.Expand description
An update to the presence of a user.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.user_id: OwnedUserIdThe user ID this presence EDU is for.
presence: PresenceStateThe presence of the user.
status_msg: Option<String>An optional description to accompany the presence.
last_active_ago: UIntThe number of milliseconds that have elapsed since the user last did something.
currently_active: boolWhether or not the user is currently active.
Defaults to false.
recipients: PresenceRecipientListUpdatesunstable-msc4495 only.Changes to the user’s presence recipient list since the last EDU was sent, if any.
This field will only be present if prev_id is also present.
This field uses the unstable prefix defined in MSC4495.
stream_id: Option<Int>unstable-msc4495 only.The stream ID of the user’s current presence recipient list.
This field uses the unstable prefix defined in MSC4495.
prev_id: Option<Int>unstable-msc4495 only.The prior stream ID in the user’s presence delta stream, if any.
If this field does not match the most recently seen stream_id, the presence list should
be re-fetched.
This field uses the unstable prefix defined in MSC4495.
Implementations§
Source§impl PresenceUpdate
impl PresenceUpdate
Sourcepub fn new(
user_id: OwnedUserId,
presence: PresenceState,
last_activity: UInt,
) -> Self
pub fn new( user_id: OwnedUserId, presence: PresenceState, last_activity: UInt, ) -> Self
Creates a new PresenceUpdate with the given user_id, presence and last_activity.
Trait Implementations§
Source§impl Clone for PresenceUpdate
impl Clone for PresenceUpdate
Source§fn clone(&self) -> PresenceUpdate
fn clone(&self) -> PresenceUpdate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PresenceUpdate
impl Debug for PresenceUpdate
Source§impl<'de> Deserialize<'de> for PresenceUpdate
impl<'de> Deserialize<'de> for PresenceUpdate
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for PresenceUpdate
impl RefUnwindSafe for PresenceUpdate
impl Send for PresenceUpdate
impl Sync for PresenceUpdate
impl Unpin for PresenceUpdate
impl UnsafeUnpin for PresenceUpdate
impl UnwindSafe for PresenceUpdate
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more