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
Private
Fields of Private
id: Integer | |
first_name: String | |
last_name: Option<String> | |
username: Option<String> |
Group
Fields of Group
id: Integer | |
title: String | |
is_supergroup: bool |
Channel
Fields of Channel
id: Integer | |
title: String | |
name: Option<String> |
Methods
impl Chat
[src]
impl Chat
pub fn id(&self) -> Integer
[src]
pub fn id(&self) -> Integer
Returns the chat id, which is needed to send messages.
pub fn is_user(&self) -> bool
[src]
pub fn is_user(&self) -> bool
Returns if the Chat is a User
pub fn is_group(&self) -> bool
[src]
pub fn is_group(&self) -> bool
Returns if the Chat is a Group
pub fn is_supergroup(&self) -> bool
[src]
pub fn is_supergroup(&self) -> bool
Returns if the Chat is a SuperGroup
pub fn is_channel(&self) -> bool
[src]
pub fn is_channel(&self) -> bool
Returns 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 Chat
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl PartialEq for Chat
[src]
impl PartialEq for Chat
fn eq(&self, other: &Chat) -> bool
[src]
fn eq(&self, other: &Chat) -> bool
This 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) -> bool
This method tests for !=
.
impl Clone for Chat
[src]
impl Clone for Chat
fn clone(&self) -> Chat
[src]
fn clone(&self) -> Chat
Returns 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 Chat
impl Encodable for Chat
[src]
impl Encodable for Chat