Struct carapax::types::ChatMemberUpdated
source · pub struct ChatMemberUpdated {
pub chat: Chat,
pub date: i64,
pub from: User,
pub new_chat_member: ChatMember,
pub old_chat_member: ChatMember,
pub invite_link: Option<ChatInviteLink>,
pub via_chat_folder_invite_link: Option<bool>,
pub via_join_request: Option<bool>,
}
Expand description
Represents changes in a status of a chat member.
Fields§
§chat: Chat
Chat the user belongs to.
date: i64
Date the change was done in Unix time.
from: User
Performer of the action, which resulted in the change.
new_chat_member: ChatMember
New information about the chat member.
old_chat_member: ChatMember
Previous information about the chat member.
invite_link: Option<ChatInviteLink>
Chat invite link, which was used by the user to join the chat; for joining by invite link events only.
via_chat_folder_invite_link: Option<bool>
Indicates whether the user joined the chat via a chat folder invite link.
via_join_request: Option<bool>
Indicates whether the user joined the chat after sending a direct join request and being approved by an administrator.
Implementations§
source§impl ChatMemberUpdated
impl ChatMemberUpdated
sourcepub fn new(
chat: Chat,
date: i64,
from: User,
new_chat_member: ChatMember,
old_chat_member: ChatMember
) -> ChatMemberUpdated
pub fn new( chat: Chat, date: i64, from: User, new_chat_member: ChatMember, old_chat_member: ChatMember ) -> ChatMemberUpdated
Creates a new ChatMemberUpdated
.
§Arguments
chat
- Chat the user belongs to.date
- Date the change was done in Unix time.from
- Performer of the action, which resulted in the change.new_chat_member
- New information about the chat member.old_chat_member
- Previous information about the chat member.
sourcepub fn with_invite_link(self, value: ChatInviteLink) -> ChatMemberUpdated
pub fn with_invite_link(self, value: ChatInviteLink) -> ChatMemberUpdated
Sets a new invite link
§Arguments
value
- The invite link, which was used by the user to join the chat.
sourcepub fn with_via_chat_folder_invite_link(self, value: bool) -> ChatMemberUpdated
pub fn with_via_chat_folder_invite_link(self, value: bool) -> ChatMemberUpdated
Sets a new value for a via_chat_folder_invite_link
flag.
§Arguments
value
- Indicates whether the user joined the chat via a chat folder invite link.
sourcepub fn with_via_join_request(self, value: bool) -> ChatMemberUpdated
pub fn with_via_join_request(self, value: bool) -> ChatMemberUpdated
Sets a new value for a via_join_request
flag.
§Arguments
value
- Indicates whether the user joined the chat after sending a direct join request and being approved by an administrator.
Trait Implementations§
source§impl Clone for ChatMemberUpdated
impl Clone for ChatMemberUpdated
source§fn clone(&self) -> ChatMemberUpdated
fn clone(&self) -> ChatMemberUpdated
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ChatMemberUpdated
impl Debug for ChatMemberUpdated
source§impl<'de> Deserialize<'de> for ChatMemberUpdated
impl<'de> Deserialize<'de> for ChatMemberUpdated
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<ChatMemberUpdated, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<ChatMemberUpdated, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for ChatMemberUpdated
impl PartialEq for ChatMemberUpdated
source§fn eq(&self, other: &ChatMemberUpdated) -> bool
fn eq(&self, other: &ChatMemberUpdated) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for ChatMemberUpdated
impl Serialize for ChatMemberUpdated
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 TryFrom<Update> for ChatMemberUpdated
impl TryFrom<Update> for ChatMemberUpdated
§type Error = UnexpectedUpdate
type Error = UnexpectedUpdate
The type returned in the event of a conversion error.
source§fn try_from(
value: Update
) -> Result<ChatMemberUpdated, <ChatMemberUpdated as TryFrom<Update>>::Error>
fn try_from( value: Update ) -> Result<ChatMemberUpdated, <ChatMemberUpdated as TryFrom<Update>>::Error>
Performs the conversion.
source§impl TryFromInput for ChatMemberUpdated
impl TryFromInput for ChatMemberUpdated
§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 ChatMemberUpdated
Auto Trait Implementations§
impl Freeze for ChatMemberUpdated
impl RefUnwindSafe for ChatMemberUpdated
impl Send for ChatMemberUpdated
impl Sync for ChatMemberUpdated
impl Unpin for ChatMemberUpdated
impl UnwindSafe for ChatMemberUpdated
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