pub enum Chat {
Channel(ChannelChat),
Group(GroupChat),
Private(PrivateChat),
Supergroup(SupergroupChat),
}
Expand description
Represents a chat.
Variants§
Channel(ChannelChat)
Represents a channel chat.
Group(GroupChat)
Represents a group chat.
Private(PrivateChat)
Represents a private chat.
Supergroup(SupergroupChat)
Represents a supergroup chat.
Implementations§
Source§impl Chat
impl Chat
Sourcepub fn get_id(&self) -> ChatPeerId
pub fn get_id(&self) -> ChatPeerId
Returns an ID of the chat.
Sourcepub fn get_username(&self) -> Option<&ChatUsername>
pub fn get_username(&self) -> Option<&ChatUsername>
Returns a username of the chat.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Chat
impl<'de> Deserialize<'de> for Chat
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Chat, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Chat, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<ChannelChat> for Chat
impl From<ChannelChat> for Chat
Source§fn from(value: ChannelChat) -> Chat
fn from(value: ChannelChat) -> Chat
Converts to this type from the input type.
Source§impl From<Chat> for MessageSender
impl From<Chat> for MessageSender
Source§fn from(value: Chat) -> MessageSender
fn from(value: Chat) -> MessageSender
Converts to this type from the input type.
Source§impl From<Chat> for PollAnswerVoter
impl From<Chat> for PollAnswerVoter
Source§fn from(value: Chat) -> PollAnswerVoter
fn from(value: Chat) -> PollAnswerVoter
Converts to this type from the input type.
Source§impl From<PrivateChat> for Chat
impl From<PrivateChat> for Chat
Source§fn from(value: PrivateChat) -> Chat
fn from(value: PrivateChat) -> Chat
Converts to this type from the input type.
Source§impl From<SupergroupChat> for Chat
impl From<SupergroupChat> for Chat
Source§fn from(value: SupergroupChat) -> Chat
fn from(value: SupergroupChat) -> Chat
Converts to this type from the input type.
Source§impl Serialize for Chat
impl Serialize for Chat
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl TryFromInput for Chat
impl TryFromInput for Chat
Source§type Error = Infallible
type Error = Infallible
An error when conversion failed.
Source§async fn try_from_input(
input: HandlerInput,
) -> Result<Option<Self>, Self::Error>
async fn try_from_input( input: HandlerInput, ) -> Result<Option<Self>, Self::Error>
Performs conversion. Read more
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
Mutably borrows from an owned value. Read more