pub struct Chat {
pub id: i64,
pub tg_type: String,
pub title: Option<String>,
pub username: Option<String>,
pub first_name: Option<String>,
pub last_name: Option<String>,
pub is_forum: Option<bool>,
}Expand description
This object represents a chat.
Fields§
§id: i64Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
tg_type: StringType of the chat, can be either “private”, “group”, “supergroup” or “channel”
title: Option<String>Optional. Title, for supergroups, channels and group chats
username: Option<String>Optional. Username, for private chats, supergroups and channels if available
first_name: Option<String>Optional. First name of the other party in a private chat
last_name: Option<String>Optional. Last name of the other party in a private chat
is_forum: Option<bool>Optional. True, if the supergroup chat is a forum (has topics enabled)
Implementations§
Source§impl Chat
impl Chat
pub fn new(id: i64) -> Self
Sourcepub fn get_id<'a>(&'a self) -> i64
pub fn get_id<'a>(&'a self) -> i64
Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
Sourcepub fn set_id<'a>(&'a mut self, id: i64) -> &'a mut Self
pub fn set_id<'a>(&'a mut self, id: i64) -> &'a mut Self
Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.
Sourcepub fn get_tg_type<'a>(&'a self) -> &'a str
pub fn get_tg_type<'a>(&'a self) -> &'a str
Type of the chat, can be either “private”, “group”, “supergroup” or “channel”
Sourcepub fn set_tg_type<'a>(&'a mut self, tg_type: String) -> &'a mut Self
pub fn set_tg_type<'a>(&'a mut self, tg_type: String) -> &'a mut Self
Type of the chat, can be either “private”, “group”, “supergroup” or “channel”
Sourcepub fn get_title<'a>(&'a self) -> Option<&'a str>
pub fn get_title<'a>(&'a self) -> Option<&'a str>
Optional. Title, for supergroups, channels and group chats
Sourcepub fn set_title<'a>(&'a mut self, title: Option<String>) -> &'a mut Self
pub fn set_title<'a>(&'a mut self, title: Option<String>) -> &'a mut Self
Optional. Title, for supergroups, channels and group chats
Sourcepub fn get_username<'a>(&'a self) -> Option<&'a str>
pub fn get_username<'a>(&'a self) -> Option<&'a str>
Optional. Username, for private chats, supergroups and channels if available
Sourcepub fn set_username<'a>(&'a mut self, username: Option<String>) -> &'a mut Self
pub fn set_username<'a>(&'a mut self, username: Option<String>) -> &'a mut Self
Optional. Username, for private chats, supergroups and channels if available
Sourcepub fn get_first_name<'a>(&'a self) -> Option<&'a str>
pub fn get_first_name<'a>(&'a self) -> Option<&'a str>
Optional. First name of the other party in a private chat
Sourcepub fn set_first_name<'a>(
&'a mut self,
first_name: Option<String>,
) -> &'a mut Self
pub fn set_first_name<'a>( &'a mut self, first_name: Option<String>, ) -> &'a mut Self
Optional. First name of the other party in a private chat
Sourcepub fn get_last_name<'a>(&'a self) -> Option<&'a str>
pub fn get_last_name<'a>(&'a self) -> Option<&'a str>
Optional. Last name of the other party in a private chat
Sourcepub fn set_last_name<'a>(
&'a mut self,
last_name: Option<String>,
) -> &'a mut Self
pub fn set_last_name<'a>( &'a mut self, last_name: Option<String>, ) -> &'a mut Self
Optional. Last name of the other party in a private chat
Sourcepub fn get_is_forum<'a>(&'a self) -> Option<bool>
pub fn get_is_forum<'a>(&'a self) -> Option<bool>
Optional. True, if the supergroup chat is a forum (has topics enabled)
Sourcepub fn set_is_forum<'a>(&'a mut self, is_forum: Option<bool>) -> &'a mut Self
pub fn set_is_forum<'a>(&'a mut self, is_forum: Option<bool>) -> &'a mut Self
Optional. True, if the supergroup chat is a forum (has topics enabled)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Chat
impl<'de> Deserialize<'de> for Chat
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 From<NoSkipChat> for Chat
impl From<NoSkipChat> for Chat
Source§fn from(t: NoSkipChat) -> Self
fn from(t: NoSkipChat) -> Self
Source§impl Into<NoSkipChat> for Chat
impl Into<NoSkipChat> for Chat
Source§fn into(self) -> NoSkipChat
fn into(self) -> NoSkipChat
Source§impl Ord for Chat
impl Ord for Chat
Source§impl PartialOrd for Chat
impl PartialOrd for Chat
impl Eq for Chat
impl StructuralPartialEq for Chat
Auto Trait Implementations§
impl Freeze for Chat
impl RefUnwindSafe for Chat
impl Send for Chat
impl Sync for Chat
impl Unpin for Chat
impl UnwindSafe for Chat
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
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.