Struct tgbot::types::ChatInviteLink

source ·
pub struct ChatInviteLink {
    pub creates_join_request: bool,
    pub creator: User,
    pub invite_link: String,
    pub is_primary: bool,
    pub is_revoked: bool,
    pub expire_date: Option<Integer>,
    pub member_limit: Option<Integer>,
    pub name: Option<String>,
    pub pending_join_request_count: Option<Integer>,
}
Expand description

Represents an invite link for a chat.

Fields§

§creates_join_request: bool

Indicates whether users joining the chat via the link need to be approved by chat administrators.

§creator: User

The creator of the link.

§invite_link: String

The invite link.

If the link was created by another chat administrator, then the second part of the link will be replaced with “…”.

§is_primary: bool

Indicates whether the link is primary.

§is_revoked: bool

Indicates whether the link is revoked.

§expire_date: Option<Integer>

The point in time (Unix timestamp) when the link will expire or has been expired.

§member_limit: Option<Integer>

The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999.

§name: Option<String>

The name of the invite link.

§pending_join_request_count: Option<Integer>

The number of pending join requests created using this link.

Implementations§

source

pub fn new<T>(invite_link: T, creator: User) -> Self
where T: Into<String>,

Creates a new ChatInviteLink.

§Arguments
  • invite_link - Invite link.
  • creator - Creator of the link.
source

pub fn with_creates_join_request(self, value: bool) -> Self

Sets a new value for a creates_join_request flag.

§Arguments
  • value - Indicates whether users joining the chat via the link need to be approved by chat administrators.
source

pub fn with_expire_date(self, value: Integer) -> Self

Sets a new expiration date.

§Arguments
  • value - The point in time (Unix timestamp) when the link will expire or has been expired.
source

pub fn with_is_primary(self, value: bool) -> Self

Sets a new value for an is_primary flag.

§Arguments
  • value - Indicates whether the link is primary.
source

pub fn with_is_revoked(self, value: bool) -> Self

Sets a new value for an is_revoked flag.

§Arguments
  • value - Indicates whether the link is revoked.
source

pub fn with_member_limit(self, value: Integer) -> Self

Sets a new member limit

§Arguments
  • value - The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999.
source

pub fn with_name<T>(self, value: T) -> Self
where T: Into<String>,

Sets a new name of the invite link.

§Arguments
  • value - The name of the invite link.
source

pub fn with_pending_join_request_count(self, value: Integer) -> Self

Sets a new pending join requests count.

§Arguments
  • value - The number of pending join requests created using this link.

Trait Implementations§

source§

fn clone(&self) -> ChatInviteLink

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

fn eq(&self, other: &ChatInviteLink) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

fn partial_cmp(&self, other: &ChatInviteLink) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> FromRef<T> for T
where T: Clone,

source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,