#[non_exhaustive]pub struct PresenceStatus {
pub msg: Option<String>,
/* private fields */
}Available on crate feature
unstable-msc4532 only.Expand description
A user’s extensible status.
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.msg: Option<String>An optional description to accompany the presence.
Implementations§
Source§impl PresenceStatus
impl PresenceStatus
Sourcepub fn new(msg: Option<String>) -> PresenceStatus
Available on crate feature events only.
pub fn new(msg: Option<String>) -> PresenceStatus
events only.Creates a new PresenceStatus with the given message.
Sourcepub fn with_data(
msg: Option<String>,
data: Map<String, Value>,
) -> PresenceStatus
Available on crate feature events only.
pub fn with_data( msg: Option<String>, data: Map<String, Value>, ) -> PresenceStatus
events only.Creates a new PresenceStatus with the given message and additional data.
Sourcepub fn data(&self) -> Cow<'_, Map<String, Value>>
Available on crate feature events only.
pub fn data(&self) -> Cow<'_, Map<String, Value>>
events only.The data of this PresenceStatus.
The returned JSON object won’t contain the msg field; use Self::msg to access it.
Prefer to use the public fields when possible; this method is meant to be used to access unsupported fields only.
Trait Implementations§
Source§impl Clone for PresenceStatus
impl Clone for PresenceStatus
Source§fn clone(&self) -> PresenceStatus
fn clone(&self) -> PresenceStatus
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PresenceStatus
impl Debug for PresenceStatus
Source§impl Default for PresenceStatus
impl Default for PresenceStatus
Source§fn default() -> PresenceStatus
fn default() -> PresenceStatus
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PresenceStatus
impl<'de> Deserialize<'de> for PresenceStatus
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<PresenceStatus, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PresenceStatus, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PresenceStatus
impl PartialEq for PresenceStatus
Source§impl Serialize for PresenceStatus
impl Serialize for PresenceStatus
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for PresenceStatus
Auto Trait Implementations§
impl Freeze for PresenceStatus
impl RefUnwindSafe for PresenceStatus
impl Send for PresenceStatus
impl Sync for PresenceStatus
impl Unpin for PresenceStatus
impl UnsafeUnpin for PresenceStatus
impl UnwindSafe for PresenceStatus
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