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(original: ChannelChat) -> Chat
fn from(original: 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(original: Chat) -> PollAnswerVoter
fn from(original: Chat) -> PollAnswerVoter
Converts to this type from the input type.
source§impl From<PrivateChat> for Chat
impl From<PrivateChat> for Chat
source§fn from(original: PrivateChat) -> Chat
fn from(original: PrivateChat) -> Chat
Converts to this type from the input type.
source§impl From<SupergroupChat> for Chat
impl From<SupergroupChat> for Chat
source§fn from(original: SupergroupChat) -> Chat
fn from(original: SupergroupChat) -> Chat
Converts to this type from the input type.
source§impl PartialEq for Chat
impl PartialEq for Chat
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
§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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more