pub struct LegacyPresenceFormat { /* private fields */ }Expand description
Represents the details of the user’s presence.
Changes: Starting with Zulip 7.0 (feature level 178), this will always contain two keys,
\"website\" and \"aggregated\", with identical data. The server no longer stores which client submitted presence updates.
Previously, the {client_name} keys for these objects were the names of the different clients where the user was logged in, for example website or ZulipDesktop.
Implementations§
Source§impl LegacyPresenceFormat
impl LegacyPresenceFormat
Sourcepub const fn new() -> Self
pub const fn new() -> Self
creates a new LegacyPresenceFormat.
Source§impl LegacyPresenceFormat
impl LegacyPresenceFormat
Sourcepub fn client(&self) -> Option<&str>
pub fn client(&self) -> Option<&str>
Gets the LegacyPresenceFormat client.
The client’s platform name.
Changes: Starting with Zulip 7.0 (feature level 178), this will always be \"website\" as the server no longer stores which client submitted presence data.
Sourcepub fn set_client<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)
pub fn set_client<'a, C: Into<Cow<'a, str>>>(&mut self, val: C)
Sets the LegacyPresenceFormat client.
The client’s platform name.
Changes: Starting with Zulip 7.0 (feature level 178), this will always be \"website\" as the server no longer stores which client submitted presence data.
Sourcepub fn unset_client(&mut self) -> Option<String>
pub fn unset_client(&mut self) -> Option<String>
Unsets the LegacyPresenceFormat client.
The client’s platform name.
Changes: Starting with Zulip 7.0 (feature level 178), this will always be \"website\" as the server no longer stores which client submitted presence data.
Sourcepub fn with_client<'a, C: Into<Cow<'a, str>>>(self, val: C) -> Self
pub fn with_client<'a, C: Into<Cow<'a, str>>>(self, val: C) -> Self
Builder function that sets the LegacyPresenceFormat client.
The client’s platform name.
Changes: Starting with Zulip 7.0 (feature level 178), this will always be \"website\" as the server no longer stores which client submitted presence data.
Source§impl LegacyPresenceFormat
impl LegacyPresenceFormat
Sourcepub const fn status(&self) -> Option<LegacyPresenceStatus>
pub const fn status(&self) -> Option<LegacyPresenceStatus>
Gets the LegacyPresenceFormat status.
The status of the user on this client. Will be either "idle" or "active".
Sourcepub fn set_status(&mut self, val: LegacyPresenceStatus)
pub fn set_status(&mut self, val: LegacyPresenceStatus)
Sets the LegacyPresenceFormat status.
The status of the user on this client. Will be either "idle" or "active".
Sourcepub fn unset_status(&mut self) -> Option<LegacyPresenceStatus>
pub fn unset_status(&mut self) -> Option<LegacyPresenceStatus>
Unsets the LegacyPresenceFormat status.
The status of the user on this client. Will be either "idle" or "active".
Sourcepub fn with_status(self, val: LegacyPresenceStatus) -> Self
pub fn with_status(self, val: LegacyPresenceStatus) -> Self
Builder function that sets the LegacyPresenceFormat status.
The status of the user on this client. Will be either "idle" or "active".
Sourcepub const fn timestamp(&self) -> Option<i32>
pub const fn timestamp(&self) -> Option<i32>
Gets the LegacyPresenceFormat timestamp.
The UNIX timestamp of when this client sent the user’s presence to the server with the precision of a second.
Sourcepub fn set_timestamp(&mut self, val: i32)
pub fn set_timestamp(&mut self, val: i32)
Sets the LegacyPresenceFormat timestamp.
The UNIX timestamp of when this client sent the user’s presence to the server with the precision of a second.
Sourcepub fn unset_timestamp(&mut self) -> Option<i32>
pub fn unset_timestamp(&mut self) -> Option<i32>
Unsets the LegacyPresenceFormat timestamp.
The UNIX timestamp of when this client sent the user’s presence to the server with the precision of a second.
Sourcepub fn with_timestamp(self, val: i32) -> Self
pub fn with_timestamp(self, val: i32) -> Self
Builder function that sets the LegacyPresenceFormat timestamp.
The UNIX timestamp of when this client sent the user’s presence to the server with the precision of a second.
Sourcepub const fn pushable(&self) -> Option<bool>
pub const fn pushable(&self) -> Option<bool>
Gets the LegacyPresenceFormat pushable.
Whether the client is capable of showing mobile/push notifications to the user.
Not present in objects with the \"aggregated\" key.
Changes: Starting with Zulip 7.0 (feature level 178), always false when present as the server no longer stores which client submitted presence data.
Sourcepub fn set_pushable(&mut self, val: bool)
pub fn set_pushable(&mut self, val: bool)
Sets the LegacyPresenceFormat pushable.
Whether the client is capable of showing mobile/push notifications to the user.
Not present in objects with the \"aggregated\" key.
Changes: Starting with Zulip 7.0 (feature level 178), always false when present as the server no longer stores which client submitted presence data.
Sourcepub fn unset_pushable(&mut self) -> Option<bool>
pub fn unset_pushable(&mut self) -> Option<bool>
Unsets the LegacyPresenceFormat pushable.
Whether the client is capable of showing mobile/push notifications to the user.
Not present in objects with the \"aggregated\" key.
Changes: Starting with Zulip 7.0 (feature level 178), always false when present as the server no longer stores which client submitted presence data.
Sourcepub fn with_pushable(self, val: bool) -> Self
pub fn with_pushable(self, val: bool) -> Self
Builder function that sets the LegacyPresenceFormat pushable.
Whether the client is capable of showing mobile/push notifications to the user.
Not present in objects with the \"aggregated\" key.
Changes: Starting with Zulip 7.0 (feature level 178), always false when present as the server no longer stores which client submitted presence data.