#[non_exhaustive]pub enum PresenceState {
Offline,
Online,
Unavailable,
Active,
Idle,
Busy,
}Expand description
A description of a user’s connectivity and availability for chat.
This type can hold an arbitrary string. To build this with a custom value, convert it from a
string with ::from() / .into(). To check for values that are not available as a
documented variant here, use its string representation, obtained through
.as_str().
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Offline
Disconnected from the service.
Online
Deprecated when MSC4532 is enabled, use a revised state instead
Connected to the service.
Deprecated when MSC4532 is enabled, use a revised state instead
Connected to the service but not available for chat.
Active
unstable-msc4532 only.The user is available to reply.
This uses the unstable prefix defined in MSC4532.
Idle
unstable-msc4532 only.The user has a connected client and may reply (potentially unreachable).
This uses the unstable prefix defined in MSC4532.
Busy
unstable-msc4532 only.The user is unavailable to reply (fully unreachable).
This uses the unstable prefix defined in MSC4532.
Implementations§
Source§impl PresenceState
impl PresenceState
Source§impl PresenceState
impl PresenceState
Sourcepub fn as_msc4532_state(&self, currently_active: bool) -> Self
Available on crate feature unstable-msc4532 only.
pub fn as_msc4532_state(&self, currently_active: bool) -> Self
unstable-msc4532 only.If this PresenceState is a legacy (non-MSC4532) state, return the equivalent MSC4532
state.
This uses the behavior map as defined in the proposal.
Sourcepub fn as_legacy_state(&self) -> Self
Available on crate feature unstable-msc4532 only.
pub fn as_legacy_state(&self) -> Self
unstable-msc4532 only.If this PresenceState is an MSC4532 state, return the equivalent legacy (non-MSC4532)
state.
This uses the behavior map as defined in the proposal.
Sourcepub fn is_msc4532_state(&self) -> bool
Available on crate feature unstable-msc4532 only.
pub fn is_msc4532_state(&self) -> bool
unstable-msc4532 only.Returns true if this PresenceState is a MSC4532 state.
This uses the behavior map as defined in the proposal.
Sourcepub fn currently_active(&self) -> bool
Available on crate feature unstable-msc4532 only.
pub fn currently_active(&self) -> bool
unstable-msc4532 only.Return a reasonable currently_active value for this PresenceState.
Trait Implementations§
Source§impl AsRef<str> for PresenceState
impl AsRef<str> for PresenceState
Source§impl Clone for PresenceState
impl Clone for PresenceState
Source§impl Debug for PresenceState
impl Debug for PresenceState
Source§impl Default for PresenceState
impl Default for PresenceState
Source§impl Default for &PresenceState
impl Default for &PresenceState
Source§impl<'de> Deserialize<'de> for PresenceState
impl<'de> Deserialize<'de> for PresenceState
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>,
Source§impl Display for PresenceState
impl Display for PresenceState
impl Eq for PresenceState
Source§impl<T> From<T> for PresenceState
impl<T> From<T> for PresenceState
Source§impl Ord for PresenceState
impl Ord for PresenceState
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for PresenceState
impl PartialEq for PresenceState
Source§impl PartialOrd for PresenceState
impl PartialOrd for PresenceState
Auto Trait Implementations§
impl Freeze for PresenceState
impl RefUnwindSafe for PresenceState
impl Send for PresenceState
impl Sync for PresenceState
impl Unpin for PresenceState
impl UnsafeUnpin for PresenceState
impl UnwindSafe for PresenceState
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.