pub struct GiftPremiumSubscription { /* private fields */ }
Expand description
Gifts a Telegram Premium subscription to the given user.
Implementations§
Source§impl GiftPremiumSubscription
impl GiftPremiumSubscription
Sourcepub fn new(
month_count: i64,
star_count: i64,
user_id: i64,
) -> GiftPremiumSubscription
pub fn new( month_count: i64, star_count: i64, user_id: i64, ) -> GiftPremiumSubscription
Creates a new GiftPremiumSubscription
.
§Arguments
month_count
- Number of months the Telegram Premium subscription will be active for the user; must be one of 3, 6, or 12.star_count
- Number of Telegram Stars to pay for the Telegram Premium subscription; must be 1000 for 3 months, 1500 for 6 months, and 2500 for 12 months.user_id
- Unique identifier of the target user who will receive a Telegram Premium subscription.
Sourcepub fn with_text<T>(self, value: T) -> GiftPremiumSubscription
pub fn with_text<T>(self, value: T) -> GiftPremiumSubscription
Sets a new text.
§Arguments
value
- Text that will be shown along with the service message about the subscription; 0-128 characters
Sourcepub fn with_text_entities<T>(self, value: T) -> GiftPremiumSubscriptionwhere
T: IntoIterator<Item = TextEntity>,
pub fn with_text_entities<T>(self, value: T) -> GiftPremiumSubscriptionwhere
T: IntoIterator<Item = TextEntity>,
Sets a new list of text entities.
§Arguments
value
- A list of special entities that appear in the gift text. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.
Sourcepub fn with_text_parse_mode(self, value: ParseMode) -> GiftPremiumSubscription
pub fn with_text_parse_mode(self, value: ParseMode) -> GiftPremiumSubscription
Sets a new text parse mode.
§Arguments
value
- Mode for parsing entities in the text. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, and “custom_emoji” are ignored.
Trait Implementations§
Source§impl Clone for GiftPremiumSubscription
impl Clone for GiftPremiumSubscription
Source§fn clone(&self) -> GiftPremiumSubscription
fn clone(&self) -> GiftPremiumSubscription
Returns a duplicate 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 GiftPremiumSubscription
impl Debug for GiftPremiumSubscription
Source§impl Method for GiftPremiumSubscription
impl Method for GiftPremiumSubscription
Source§impl Serialize for GiftPremiumSubscription
impl Serialize for GiftPremiumSubscription
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
Auto Trait Implementations§
impl Freeze for GiftPremiumSubscription
impl RefUnwindSafe for GiftPremiumSubscription
impl Send for GiftPremiumSubscription
impl Sync for GiftPremiumSubscription
impl Unpin for GiftPremiumSubscription
impl UnwindSafe for GiftPremiumSubscription
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