Enum telegram_bot::types::Chat [−][src]
pub enum Chat {
Private {
id: Integer,
first_name: String,
last_name: Option<String>,
username: Option<String>,
},
Group {
id: Integer,
title: String,
is_supergroup: bool,
},
Channel {
id: Integer,
title: String,
name: Option<String>,
},
}Either a Private or a Group or a Channel. Used in "chat" field of Message. Has some useful methods for less typing.
Variants
PrivateFields of Private
id: Integer | |
first_name: String | |
last_name: Option<String> | |
username: Option<String> |
GroupFields of Group
id: Integer | |
title: String | |
is_supergroup: bool |
ChannelFields of Channel
id: Integer | |
title: String | |
name: Option<String> |
Methods
impl Chat[src]
impl Chatpub fn id(&self) -> Integer[src]
pub fn id(&self) -> IntegerReturns the chat id, which is needed to send messages.
pub fn is_user(&self) -> bool[src]
pub fn is_user(&self) -> boolReturns if the Chat is a User
pub fn is_group(&self) -> bool[src]
pub fn is_group(&self) -> boolReturns if the Chat is a Group
pub fn is_supergroup(&self) -> bool[src]
pub fn is_supergroup(&self) -> boolReturns if the Chat is a SuperGroup
pub fn is_channel(&self) -> bool[src]
pub fn is_channel(&self) -> boolReturns if the Chat is a Channel
pub fn to_user(&self) -> Option<User>[src]
pub fn to_user(&self) -> Option<User>Trait Implementations
impl Debug for Chat[src]
impl Debug for Chatfn fmt(&self, f: &mut Formatter) -> Result[src]
fn fmt(&self, f: &mut Formatter) -> ResultFormats the value using the given formatter. Read more
impl PartialEq for Chat[src]
impl PartialEq for Chatfn eq(&self, other: &Chat) -> bool[src]
fn eq(&self, other: &Chat) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Chat) -> bool[src]
fn ne(&self, other: &Chat) -> boolThis method tests for !=.
impl Clone for Chat[src]
impl Clone for Chatfn clone(&self) -> Chat[src]
fn clone(&self) -> ChatReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)1.0.0
[src]Performs copy-assignment from source. Read more
impl Decodable for Chat[src]
impl Decodable for Chatimpl Encodable for Chat[src]
impl Encodable for Chat