pub struct MMStatus {
pub text: String,
pub emoji: String,
pub duration: Option<String>,
pub expires_at: Option<DateTime<Local>>,
}Expand description
Custom struct to serialize the HTTP POST data into a json objecting using serde_json For a description of these fields see the MatterMost OpenApi sources
Fields§
§text: Stringcustom status text description
emoji: Stringcustom status emoji name
duration: Option<String>custom status duration
expires_at: Option<DateTime<Local>>custom status expiration
Implementations§
Source§impl MMStatus
impl MMStatus
Sourcepub fn new(text: String, emoji: String) -> MMStatus
pub fn new(text: String, emoji: String) -> MMStatus
Create a MMStatus ready to be sent to the mm_base_uri mattermost instance.
Authentication is done with the private access token.
Sourcepub fn expires_at(&mut self, time_str: &Option<String>)
pub fn expires_at(&mut self, time_str: &Option<String>)
Add expiration time with the format “hh:mm” to the mattermost custom status
Sourcepub fn to_json(&self) -> Result<String, MMSError>
pub fn to_json(&self) -> Result<String, MMSError>
This function is essentially used for debugging or testing
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MMStatus
impl<'de> Deserialize<'de> for MMStatus
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for MMStatus
impl StructuralPartialEq for MMStatus
Auto Trait Implementations§
impl Freeze for MMStatus
impl RefUnwindSafe for MMStatus
impl Send for MMStatus
impl Sync for MMStatus
impl Unpin for MMStatus
impl UnwindSafe for MMStatus
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