#[non_exhaustive]pub struct CustomStatus {
pub text: String,
pub emoji: Option<Emoji>,
pub expiration: Option<Expiration>,
/* private fields */
}Expand description
Represents a user’s custom status in Google Chat. This includes a short text message with an optional emoji that a user sets to give more context about their availability.
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.text: StringRequired. The text of the custom status. This will be a string with maximum length of 64.
emoji: Option<Emoji>Required. The emoji of the custom status. Only Unicode emojis are supported; custom emojis are not supported.
expiration: Option<Expiration>The expiration time of the custom status. It can be specified as either an absolute timestamp or a time-to-live duration.
Implementations§
Source§impl CustomStatus
impl CustomStatus
Sourcepub fn set_or_clear_emoji<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_emoji<T>(self, v: Option<T>) -> Self
Sourcepub fn set_expiration<T: Into<Option<Expiration>>>(self, v: T) -> Self
pub fn set_expiration<T: Into<Option<Expiration>>>(self, v: T) -> Self
Sets the value of expiration.
Note that all the setters affecting expiration are mutually
exclusive.
§Example
use wkt::Timestamp;
let x = CustomStatus::new().set_expiration(Some(
google_chat_v1::model::custom_status::Expiration::ExpireTime(Timestamp::default().into())));Sourcepub fn expire_time(&self) -> Option<&Box<Timestamp>>
pub fn expire_time(&self) -> Option<&Box<Timestamp>>
The value of expiration
if it holds a ExpireTime, None if the field is not set or
holds a different branch.
Sourcepub fn set_expire_time<T: Into<Box<Timestamp>>>(self, v: T) -> Self
pub fn set_expire_time<T: Into<Box<Timestamp>>>(self, v: T) -> Self
Sets the value of expiration
to hold a ExpireTime.
Note that all the setters affecting expiration are
mutually exclusive.
§Example
use wkt::Timestamp;
let x = CustomStatus::new().set_expire_time(Timestamp::default()/* use setters */);
assert!(x.expire_time().is_some());
assert!(x.ttl().is_none());Sourcepub fn ttl(&self) -> Option<&Box<Duration>>
pub fn ttl(&self) -> Option<&Box<Duration>>
The value of expiration
if it holds a Ttl, None if the field is not set or
holds a different branch.
Sourcepub fn set_ttl<T: Into<Box<Duration>>>(self, v: T) -> Self
pub fn set_ttl<T: Into<Box<Duration>>>(self, v: T) -> Self
Sets the value of expiration
to hold a Ttl.
Note that all the setters affecting expiration are
mutually exclusive.
§Example
use wkt::Duration;
let x = CustomStatus::new().set_ttl(Duration::default()/* use setters */);
assert!(x.ttl().is_some());
assert!(x.expire_time().is_none());Trait Implementations§
Source§impl Clone for CustomStatus
impl Clone for CustomStatus
Source§fn clone(&self) -> CustomStatus
fn clone(&self) -> CustomStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more