Struct teloxide_core::adaptors::throttle::Throttle
source · pub struct Throttle<B> { /* private fields */ }
throttle
only.Expand description
Automatic request limits respecting mechanism.
Telegram has strict limits, which, if exceeded will sooner or later cause
RequestError::RetryAfter(_)
errors. These errors can cause users of your
bot to never receive responses from the bot or receive them in a wrong
order.
This bot wrapper automatically checks for limits, suspending requests until they could be sent without exceeding limits (request order in chats is not changed).
It’s recommended to use this wrapper before other wrappers (i.e.:
SomeWrapper<Throttle<Bot>>
not Throttle<SomeWrapper<Bot>>
) because if
done otherwise inner wrappers may cause Throttle
to miscalculate limits
usage.
§Examples
use teloxide_core::{adaptors::throttle::Limits, requests::RequesterExt, Bot};
let bot = Bot::new("TOKEN")
.throttle(Limits::default());
/* send many requests here */
§Note about send-by-@channelusername
Telegram have limits on sending messages to the same chat. To check them
we store chat_id
s of several last requests. However there is no good way
to tell if given ChatId::Id(x)
corresponds to the same chat as
ChatId::ChannelUsername(u)
.
Our current approach is to just give up and check chat_id_a == chat_id_b
.
This may give incorrect results.
As such, we encourage not to use ChatId::ChannelUsername(u)
with this bot
wrapper.
Implementations§
source§impl<B> Throttle<B>
impl<B> Throttle<B>
sourcepub fn with_settings(
bot: B,
settings: Settings,
) -> (Self, impl Future<Output = ()>)
pub fn with_settings( bot: B, settings: Settings, ) -> (Self, impl Future<Output = ()>)
sourcepub fn new_spawn(bot: B, limits: Limits) -> Self
pub fn new_spawn(bot: B, limits: Limits) -> Self
Creates new Throttle
spawning the worker with tokio::spawn
Note: it’s recommended to use RequesterExt::throttle
instead.
sourcepub fn spawn_with_settings(bot: B, settings: Settings) -> Self
pub fn spawn_with_settings(bot: B, settings: Settings) -> Self
Creates new Throttle
spawning the worker with tokio::spawn
sourcepub fn into_inner(self) -> B
pub fn into_inner(self) -> B
Unwraps inner bot
sourcepub async fn set_limits(&self, new: Limits)
pub async fn set_limits(&self, new: Limits)
Sets new limits.
Note: changes may not be applied immediately.
Trait Implementations§
source§impl<B: Download> Download for Throttle<B>
impl<B: Download> Download for Throttle<B>
§type Err<'dst> = <B as Download>::Err<'dst>
type Err<'dst> = <B as Download>::Err<'dst>
download_file
.§type Fut<'dst> = <B as Download>::Fut<'dst>
type Fut<'dst> = <B as Download>::Fut<'dst>
download_file
.source§fn download_file<'dst>(
&self,
path: &str,
destination: &'dst mut (dyn AsyncWrite + Unpin + Send),
) -> Self::Fut<'dst>
fn download_file<'dst>( &self, path: &str, destination: &'dst mut (dyn AsyncWrite + Unpin + Send), ) -> Self::Fut<'dst>
destination
. Read more§type StreamErr = <B as Download>::StreamErr
type StreamErr = <B as Download>::StreamErr
download_file_stream
.§type Stream = <B as Download>::Stream
type Stream = <B as Download>::Stream
download_file_stream
.source§impl<B: Requester> Requester for Throttle<B>where
B::Err: AsResponseParameters,
B::SendMessage: Clone + Send + Sync + 'static,
B::ForwardMessage: Clone + Send + Sync + 'static,
B::CopyMessage: Clone + Send + Sync + 'static,
B::SendPhoto: Clone + Send + Sync + 'static,
B::SendAudio: Clone + Send + Sync + 'static,
B::SendDocument: Clone + Send + Sync + 'static,
B::SendVideo: Clone + Send + Sync + 'static,
B::SendAnimation: Clone + Send + Sync + 'static,
B::SendVoice: Clone + Send + Sync + 'static,
B::SendVideoNote: Clone + Send + Sync + 'static,
B::SendMediaGroup: Clone + Send + Sync + 'static,
B::SendLocation: Clone + Send + Sync + 'static,
B::SendVenue: Clone + Send + Sync + 'static,
B::SendContact: Clone + Send + Sync + 'static,
B::SendPoll: Clone + Send + Sync + 'static,
B::SendDice: Clone + Send + Sync + 'static,
B::SendSticker: Clone + Send + Sync + 'static,
B::SendInvoice: Clone + Send + Sync + 'static,
impl<B: Requester> Requester for Throttle<B>where
B::Err: AsResponseParameters,
B::SendMessage: Clone + Send + Sync + 'static,
B::ForwardMessage: Clone + Send + Sync + 'static,
B::CopyMessage: Clone + Send + Sync + 'static,
B::SendPhoto: Clone + Send + Sync + 'static,
B::SendAudio: Clone + Send + Sync + 'static,
B::SendDocument: Clone + Send + Sync + 'static,
B::SendVideo: Clone + Send + Sync + 'static,
B::SendAnimation: Clone + Send + Sync + 'static,
B::SendVoice: Clone + Send + Sync + 'static,
B::SendVideoNote: Clone + Send + Sync + 'static,
B::SendMediaGroup: Clone + Send + Sync + 'static,
B::SendLocation: Clone + Send + Sync + 'static,
B::SendVenue: Clone + Send + Sync + 'static,
B::SendContact: Clone + Send + Sync + 'static,
B::SendPoll: Clone + Send + Sync + 'static,
B::SendDice: Clone + Send + Sync + 'static,
B::SendSticker: Clone + Send + Sync + 'static,
B::SendInvoice: Clone + Send + Sync + 'static,
type SendMessage = ThrottlingRequest<<B as Requester>::SendMessage>
source§fn send_message<C, T>(&self, chat_id: C, text: T) -> Self::SendMessage
fn send_message<C, T>(&self, chat_id: C, text: T) -> Self::SendMessage
SendMessage
.type ForwardMessage = ThrottlingRequest<<B as Requester>::ForwardMessage>
source§fn forward_message<C, F>(
&self,
chat_id: C,
from_chat_id: F,
message_id: MessageId,
) -> Self::ForwardMessage
fn forward_message<C, F>( &self, chat_id: C, from_chat_id: F, message_id: MessageId, ) -> Self::ForwardMessage
ForwardMessage
.type CopyMessage = ThrottlingRequest<<B as Requester>::CopyMessage>
source§fn copy_message<C, F>(
&self,
chat_id: C,
from_chat_id: F,
message_id: MessageId,
) -> Self::CopyMessage
fn copy_message<C, F>( &self, chat_id: C, from_chat_id: F, message_id: MessageId, ) -> Self::CopyMessage
CopyMessage
.type SendPhoto = ThrottlingRequest<<B as Requester>::SendPhoto>
source§fn send_photo<C>(&self, chat_id: C, photo: InputFile) -> Self::SendPhoto
fn send_photo<C>(&self, chat_id: C, photo: InputFile) -> Self::SendPhoto
SendPhoto
.type SendAudio = ThrottlingRequest<<B as Requester>::SendAudio>
source§fn send_audio<C>(&self, chat_id: C, audio: InputFile) -> Self::SendAudio
fn send_audio<C>(&self, chat_id: C, audio: InputFile) -> Self::SendAudio
SendAudio
.type SendDocument = ThrottlingRequest<<B as Requester>::SendDocument>
source§fn send_document<C>(
&self,
chat_id: C,
document: InputFile,
) -> Self::SendDocument
fn send_document<C>( &self, chat_id: C, document: InputFile, ) -> Self::SendDocument
SendDocument
.type SendVideo = ThrottlingRequest<<B as Requester>::SendVideo>
source§fn send_video<C>(&self, chat_id: C, video: InputFile) -> Self::SendVideo
fn send_video<C>(&self, chat_id: C, video: InputFile) -> Self::SendVideo
SendVideo
.type SendAnimation = ThrottlingRequest<<B as Requester>::SendAnimation>
source§fn send_animation<C>(
&self,
chat_id: C,
animation: InputFile,
) -> Self::SendAnimation
fn send_animation<C>( &self, chat_id: C, animation: InputFile, ) -> Self::SendAnimation
SendAnimation
.type SendVoice = ThrottlingRequest<<B as Requester>::SendVoice>
source§fn send_voice<C>(&self, chat_id: C, voice: InputFile) -> Self::SendVoice
fn send_voice<C>(&self, chat_id: C, voice: InputFile) -> Self::SendVoice
SendVoice
.type SendVideoNote = ThrottlingRequest<<B as Requester>::SendVideoNote>
source§fn send_video_note<C>(
&self,
chat_id: C,
video_note: InputFile,
) -> Self::SendVideoNote
fn send_video_note<C>( &self, chat_id: C, video_note: InputFile, ) -> Self::SendVideoNote
SendVideoNote
.type SendMediaGroup = ThrottlingRequest<<B as Requester>::SendMediaGroup>
source§fn send_media_group<C, M>(&self, chat_id: C, media: M) -> Self::SendMediaGroup
fn send_media_group<C, M>(&self, chat_id: C, media: M) -> Self::SendMediaGroup
SendMediaGroup
.type SendLocation = ThrottlingRequest<<B as Requester>::SendLocation>
source§fn send_location<C>(
&self,
chat_id: C,
latitude: f64,
longitude: f64,
) -> Self::SendLocation
fn send_location<C>( &self, chat_id: C, latitude: f64, longitude: f64, ) -> Self::SendLocation
SendLocation
.type SendVenue = ThrottlingRequest<<B as Requester>::SendVenue>
source§fn send_venue<C, T, A>(
&self,
chat_id: C,
latitude: f64,
longitude: f64,
title: T,
address: A,
) -> Self::SendVenue
fn send_venue<C, T, A>( &self, chat_id: C, latitude: f64, longitude: f64, title: T, address: A, ) -> Self::SendVenue
SendVenue
.type SendContact = ThrottlingRequest<<B as Requester>::SendContact>
source§fn send_contact<C, P, F>(
&self,
chat_id: C,
phone_number: P,
first_name: F,
) -> Self::SendContact
fn send_contact<C, P, F>( &self, chat_id: C, phone_number: P, first_name: F, ) -> Self::SendContact
SendContact
.type SendPoll = ThrottlingRequest<<B as Requester>::SendPoll>
source§fn send_poll<C, Q, O>(
&self,
chat_id: C,
question: Q,
options: O,
) -> Self::SendPoll
fn send_poll<C, Q, O>( &self, chat_id: C, question: Q, options: O, ) -> Self::SendPoll
SendPoll
.type SendDice = ThrottlingRequest<<B as Requester>::SendDice>
type SendSticker = ThrottlingRequest<<B as Requester>::SendSticker>
source§fn send_sticker<C>(&self, chat_id: C, sticker: InputFile) -> Self::SendSticker
fn send_sticker<C>(&self, chat_id: C, sticker: InputFile) -> Self::SendSticker
SendSticker
.type SendInvoice = ThrottlingRequest<<B as Requester>::SendInvoice>
source§fn send_invoice<Ch, T, D, Pa, P, C, Pri>(
&self,
chat_id: Ch,
title: T,
description: D,
payload: Pa,
provider_token: P,
currency: C,
prices: Pri,
) -> Self::SendInvoice
fn send_invoice<Ch, T, D, Pa, P, C, Pri>( &self, chat_id: Ch, title: T, description: D, payload: Pa, provider_token: P, currency: C, prices: Pri, ) -> Self::SendInvoice
SendInvoice
.type GetMe = <B as Requester>::GetMe
type LogOut = <B as Requester>::LogOut
type Close = <B as Requester>::Close
type GetUpdates = <B as Requester>::GetUpdates
source§fn get_updates(&self) -> Self::GetUpdates
fn get_updates(&self) -> Self::GetUpdates
GetUpdates
.type SetWebhook = <B as Requester>::SetWebhook
source§fn set_webhook(&self, url: Url) -> Self::SetWebhook
fn set_webhook(&self, url: Url) -> Self::SetWebhook
SetWebhook
.type DeleteWebhook = <B as Requester>::DeleteWebhook
source§fn delete_webhook(&self) -> Self::DeleteWebhook
fn delete_webhook(&self) -> Self::DeleteWebhook
DeleteWebhook
.type GetWebhookInfo = <B as Requester>::GetWebhookInfo
source§fn get_webhook_info(&self) -> Self::GetWebhookInfo
fn get_webhook_info(&self) -> Self::GetWebhookInfo
GetWebhookInfo
.type ForwardMessages = <B as Requester>::ForwardMessages
source§fn forward_messages<C, F, M>(
&self,
chat_id: C,
from_chat_id: F,
message_ids: M,
) -> Self::ForwardMessages
fn forward_messages<C, F, M>( &self, chat_id: C, from_chat_id: F, message_ids: M, ) -> Self::ForwardMessages
ForwardMessages
.type CopyMessages = <B as Requester>::CopyMessages
source§fn copy_messages<C, F, M>(
&self,
chat_id: C,
from_chat_id: F,
message_ids: M,
) -> Self::CopyMessages
fn copy_messages<C, F, M>( &self, chat_id: C, from_chat_id: F, message_ids: M, ) -> Self::CopyMessages
CopyMessages
.type EditMessageLiveLocation = <B as Requester>::EditMessageLiveLocation
source§fn edit_message_live_location<C>(
&self,
chat_id: C,
message_id: MessageId,
latitude: f64,
longitude: f64,
) -> Self::EditMessageLiveLocation
fn edit_message_live_location<C>( &self, chat_id: C, message_id: MessageId, latitude: f64, longitude: f64, ) -> Self::EditMessageLiveLocation
EditMessageLiveLocation
.type EditMessageLiveLocationInline = <B as Requester>::EditMessageLiveLocationInline
source§fn edit_message_live_location_inline<I>(
&self,
inline_message_id: I,
latitude: f64,
longitude: f64,
) -> Self::EditMessageLiveLocationInline
fn edit_message_live_location_inline<I>( &self, inline_message_id: I, latitude: f64, longitude: f64, ) -> Self::EditMessageLiveLocationInline
EditMessageLiveLocationInline
.type StopMessageLiveLocation = <B as Requester>::StopMessageLiveLocation
source§fn stop_message_live_location<C>(
&self,
chat_id: C,
message_id: MessageId,
) -> Self::StopMessageLiveLocation
fn stop_message_live_location<C>( &self, chat_id: C, message_id: MessageId, ) -> Self::StopMessageLiveLocation
StopMessageLiveLocation
.type StopMessageLiveLocationInline = <B as Requester>::StopMessageLiveLocationInline
source§fn stop_message_live_location_inline<I>(
&self,
inline_message_id: I,
) -> Self::StopMessageLiveLocationInline
fn stop_message_live_location_inline<I>( &self, inline_message_id: I, ) -> Self::StopMessageLiveLocationInline
StopMessageLiveLocationInline
.type SendChatAction = <B as Requester>::SendChatAction
source§fn send_chat_action<C>(
&self,
chat_id: C,
action: ChatAction,
) -> Self::SendChatAction
fn send_chat_action<C>( &self, chat_id: C, action: ChatAction, ) -> Self::SendChatAction
SendChatAction
.type SetMessageReaction = <B as Requester>::SetMessageReaction
source§fn set_message_reaction<C>(
&self,
chat_id: C,
message_id: MessageId,
) -> Self::SetMessageReaction
fn set_message_reaction<C>( &self, chat_id: C, message_id: MessageId, ) -> Self::SetMessageReaction
SetMessageReaction
.type GetUserProfilePhotos = <B as Requester>::GetUserProfilePhotos
source§fn get_user_profile_photos(&self, user_id: UserId) -> Self::GetUserProfilePhotos
fn get_user_profile_photos(&self, user_id: UserId) -> Self::GetUserProfilePhotos
GetUserProfilePhotos
.type GetFile = <B as Requester>::GetFile
type KickChatMember = <B as Requester>::KickChatMember
source§fn kick_chat_member<C>(
&self,
chat_id: C,
user_id: UserId,
) -> Self::KickChatMember
fn kick_chat_member<C>( &self, chat_id: C, user_id: UserId, ) -> Self::KickChatMember
KickChatMember
.type BanChatMember = <B as Requester>::BanChatMember
source§fn ban_chat_member<C>(&self, chat_id: C, user_id: UserId) -> Self::BanChatMember
fn ban_chat_member<C>(&self, chat_id: C, user_id: UserId) -> Self::BanChatMember
BanChatMember
.type UnbanChatMember = <B as Requester>::UnbanChatMember
source§fn unban_chat_member<C>(
&self,
chat_id: C,
user_id: UserId,
) -> Self::UnbanChatMember
fn unban_chat_member<C>( &self, chat_id: C, user_id: UserId, ) -> Self::UnbanChatMember
UnbanChatMember
.type RestrictChatMember = <B as Requester>::RestrictChatMember
source§fn restrict_chat_member<C>(
&self,
chat_id: C,
user_id: UserId,
permissions: ChatPermissions,
) -> Self::RestrictChatMember
fn restrict_chat_member<C>( &self, chat_id: C, user_id: UserId, permissions: ChatPermissions, ) -> Self::RestrictChatMember
RestrictChatMember
.type PromoteChatMember = <B as Requester>::PromoteChatMember
source§fn promote_chat_member<C>(
&self,
chat_id: C,
user_id: UserId,
) -> Self::PromoteChatMember
fn promote_chat_member<C>( &self, chat_id: C, user_id: UserId, ) -> Self::PromoteChatMember
PromoteChatMember
.type SetChatAdministratorCustomTitle = <B as Requester>::SetChatAdministratorCustomTitle
source§fn set_chat_administrator_custom_title<Ch, C>(
&self,
chat_id: Ch,
user_id: UserId,
custom_title: C,
) -> Self::SetChatAdministratorCustomTitle
fn set_chat_administrator_custom_title<Ch, C>( &self, chat_id: Ch, user_id: UserId, custom_title: C, ) -> Self::SetChatAdministratorCustomTitle
SetChatAdministratorCustomTitle
.type BanChatSenderChat = <B as Requester>::BanChatSenderChat
source§fn ban_chat_sender_chat<C, S>(
&self,
chat_id: C,
sender_chat_id: S,
) -> Self::BanChatSenderChat
fn ban_chat_sender_chat<C, S>( &self, chat_id: C, sender_chat_id: S, ) -> Self::BanChatSenderChat
BanChatSenderChat
.type UnbanChatSenderChat = <B as Requester>::UnbanChatSenderChat
source§fn unban_chat_sender_chat<C, S>(
&self,
chat_id: C,
sender_chat_id: S,
) -> Self::UnbanChatSenderChat
fn unban_chat_sender_chat<C, S>( &self, chat_id: C, sender_chat_id: S, ) -> Self::UnbanChatSenderChat
UnbanChatSenderChat
.type SetChatPermissions = <B as Requester>::SetChatPermissions
source§fn set_chat_permissions<C>(
&self,
chat_id: C,
permissions: ChatPermissions,
) -> Self::SetChatPermissions
fn set_chat_permissions<C>( &self, chat_id: C, permissions: ChatPermissions, ) -> Self::SetChatPermissions
SetChatPermissions
.type ExportChatInviteLink = <B as Requester>::ExportChatInviteLink
source§fn export_chat_invite_link<C>(&self, chat_id: C) -> Self::ExportChatInviteLink
fn export_chat_invite_link<C>(&self, chat_id: C) -> Self::ExportChatInviteLink
ExportChatInviteLink
.type CreateChatInviteLink = <B as Requester>::CreateChatInviteLink
source§fn create_chat_invite_link<C>(&self, chat_id: C) -> Self::CreateChatInviteLink
fn create_chat_invite_link<C>(&self, chat_id: C) -> Self::CreateChatInviteLink
CreateChatInviteLink
.type EditChatInviteLink = <B as Requester>::EditChatInviteLink
source§fn edit_chat_invite_link<C, I>(
&self,
chat_id: C,
invite_link: I,
) -> Self::EditChatInviteLink
fn edit_chat_invite_link<C, I>( &self, chat_id: C, invite_link: I, ) -> Self::EditChatInviteLink
EditChatInviteLink
.type RevokeChatInviteLink = <B as Requester>::RevokeChatInviteLink
source§fn revoke_chat_invite_link<C, I>(
&self,
chat_id: C,
invite_link: I,
) -> Self::RevokeChatInviteLink
fn revoke_chat_invite_link<C, I>( &self, chat_id: C, invite_link: I, ) -> Self::RevokeChatInviteLink
RevokeChatInviteLink
.type SetChatPhoto = <B as Requester>::SetChatPhoto
source§fn set_chat_photo<C>(&self, chat_id: C, photo: InputFile) -> Self::SetChatPhoto
fn set_chat_photo<C>(&self, chat_id: C, photo: InputFile) -> Self::SetChatPhoto
SetChatPhoto
.type DeleteChatPhoto = <B as Requester>::DeleteChatPhoto
source§fn delete_chat_photo<C>(&self, chat_id: C) -> Self::DeleteChatPhoto
fn delete_chat_photo<C>(&self, chat_id: C) -> Self::DeleteChatPhoto
DeleteChatPhoto
.type SetChatTitle = <B as Requester>::SetChatTitle
source§fn set_chat_title<C, T>(&self, chat_id: C, title: T) -> Self::SetChatTitle
fn set_chat_title<C, T>(&self, chat_id: C, title: T) -> Self::SetChatTitle
SetChatTitle
.type SetChatDescription = <B as Requester>::SetChatDescription
source§fn set_chat_description<C>(&self, chat_id: C) -> Self::SetChatDescription
fn set_chat_description<C>(&self, chat_id: C) -> Self::SetChatDescription
SetChatDescription
.type PinChatMessage = <B as Requester>::PinChatMessage
source§fn pin_chat_message<C>(
&self,
chat_id: C,
message_id: MessageId,
) -> Self::PinChatMessage
fn pin_chat_message<C>( &self, chat_id: C, message_id: MessageId, ) -> Self::PinChatMessage
PinChatMessage
.type UnpinChatMessage = <B as Requester>::UnpinChatMessage
source§fn unpin_chat_message<C>(&self, chat_id: C) -> Self::UnpinChatMessage
fn unpin_chat_message<C>(&self, chat_id: C) -> Self::UnpinChatMessage
UnpinChatMessage
.type UnpinAllChatMessages = <B as Requester>::UnpinAllChatMessages
source§fn unpin_all_chat_messages<C>(&self, chat_id: C) -> Self::UnpinAllChatMessages
fn unpin_all_chat_messages<C>(&self, chat_id: C) -> Self::UnpinAllChatMessages
UnpinAllChatMessages
.type LeaveChat = <B as Requester>::LeaveChat
source§fn leave_chat<C>(&self, chat_id: C) -> Self::LeaveChat
fn leave_chat<C>(&self, chat_id: C) -> Self::LeaveChat
LeaveChat
.type GetChat = <B as Requester>::GetChat
type GetChatAdministrators = <B as Requester>::GetChatAdministrators
source§fn get_chat_administrators<C>(&self, chat_id: C) -> Self::GetChatAdministrators
fn get_chat_administrators<C>(&self, chat_id: C) -> Self::GetChatAdministrators
GetChatAdministrators
.type GetChatMembersCount = <B as Requester>::GetChatMembersCount
source§fn get_chat_members_count<C>(&self, chat_id: C) -> Self::GetChatMembersCount
fn get_chat_members_count<C>(&self, chat_id: C) -> Self::GetChatMembersCount
GetChatMembersCount
.type GetChatMemberCount = <B as Requester>::GetChatMemberCount
source§fn get_chat_member_count<C>(&self, chat_id: C) -> Self::GetChatMemberCount
fn get_chat_member_count<C>(&self, chat_id: C) -> Self::GetChatMemberCount
GetChatMemberCount
.type GetChatMember = <B as Requester>::GetChatMember
source§fn get_chat_member<C>(&self, chat_id: C, user_id: UserId) -> Self::GetChatMember
fn get_chat_member<C>(&self, chat_id: C, user_id: UserId) -> Self::GetChatMember
GetChatMember
.type SetChatStickerSet = <B as Requester>::SetChatStickerSet
source§fn set_chat_sticker_set<C, S>(
&self,
chat_id: C,
sticker_set_name: S,
) -> Self::SetChatStickerSet
fn set_chat_sticker_set<C, S>( &self, chat_id: C, sticker_set_name: S, ) -> Self::SetChatStickerSet
SetChatStickerSet
.type DeleteChatStickerSet = <B as Requester>::DeleteChatStickerSet
source§fn delete_chat_sticker_set<C>(&self, chat_id: C) -> Self::DeleteChatStickerSet
fn delete_chat_sticker_set<C>(&self, chat_id: C) -> Self::DeleteChatStickerSet
DeleteChatStickerSet
.type GetForumTopicIconStickers = <B as Requester>::GetForumTopicIconStickers
source§fn get_forum_topic_icon_stickers(&self) -> Self::GetForumTopicIconStickers
fn get_forum_topic_icon_stickers(&self) -> Self::GetForumTopicIconStickers
GetForumTopicIconStickers
.type CreateForumTopic = <B as Requester>::CreateForumTopic
source§fn create_forum_topic<C, N, I>(
&self,
chat_id: C,
name: N,
icon_color: u32,
icon_custom_emoji_id: I,
) -> Self::CreateForumTopic
fn create_forum_topic<C, N, I>( &self, chat_id: C, name: N, icon_color: u32, icon_custom_emoji_id: I, ) -> Self::CreateForumTopic
CreateForumTopic
.type EditForumTopic = <B as Requester>::EditForumTopic
source§fn edit_forum_topic<C>(
&self,
chat_id: C,
message_thread_id: ThreadId,
) -> Self::EditForumTopic
fn edit_forum_topic<C>( &self, chat_id: C, message_thread_id: ThreadId, ) -> Self::EditForumTopic
EditForumTopic
.type CloseForumTopic = <B as Requester>::CloseForumTopic
source§fn close_forum_topic<C>(
&self,
chat_id: C,
message_thread_id: ThreadId,
) -> Self::CloseForumTopic
fn close_forum_topic<C>( &self, chat_id: C, message_thread_id: ThreadId, ) -> Self::CloseForumTopic
CloseForumTopic
.type ReopenForumTopic = <B as Requester>::ReopenForumTopic
source§fn reopen_forum_topic<C>(
&self,
chat_id: C,
message_thread_id: ThreadId,
) -> Self::ReopenForumTopic
fn reopen_forum_topic<C>( &self, chat_id: C, message_thread_id: ThreadId, ) -> Self::ReopenForumTopic
ReopenForumTopic
.type DeleteForumTopic = <B as Requester>::DeleteForumTopic
source§fn delete_forum_topic<C>(
&self,
chat_id: C,
message_thread_id: ThreadId,
) -> Self::DeleteForumTopic
fn delete_forum_topic<C>( &self, chat_id: C, message_thread_id: ThreadId, ) -> Self::DeleteForumTopic
DeleteForumTopic
.type UnpinAllForumTopicMessages = <B as Requester>::UnpinAllForumTopicMessages
source§fn unpin_all_forum_topic_messages<C>(
&self,
chat_id: C,
message_thread_id: ThreadId,
) -> Self::UnpinAllForumTopicMessages
fn unpin_all_forum_topic_messages<C>( &self, chat_id: C, message_thread_id: ThreadId, ) -> Self::UnpinAllForumTopicMessages
UnpinAllForumTopicMessages
.type EditGeneralForumTopic = <B as Requester>::EditGeneralForumTopic
source§fn edit_general_forum_topic<C, N>(
&self,
chat_id: C,
name: N,
) -> Self::EditGeneralForumTopic
fn edit_general_forum_topic<C, N>( &self, chat_id: C, name: N, ) -> Self::EditGeneralForumTopic
EditGeneralForumTopic
.type CloseGeneralForumTopic = <B as Requester>::CloseGeneralForumTopic
source§fn close_general_forum_topic<C>(
&self,
chat_id: C,
) -> Self::CloseGeneralForumTopic
fn close_general_forum_topic<C>( &self, chat_id: C, ) -> Self::CloseGeneralForumTopic
CloseGeneralForumTopic
.type ReopenGeneralForumTopic = <B as Requester>::ReopenGeneralForumTopic
source§fn reopen_general_forum_topic<C>(
&self,
chat_id: C,
) -> Self::ReopenGeneralForumTopic
fn reopen_general_forum_topic<C>( &self, chat_id: C, ) -> Self::ReopenGeneralForumTopic
ReopenGeneralForumTopic
.type HideGeneralForumTopic = <B as Requester>::HideGeneralForumTopic
source§fn hide_general_forum_topic<C>(&self, chat_id: C) -> Self::HideGeneralForumTopic
fn hide_general_forum_topic<C>(&self, chat_id: C) -> Self::HideGeneralForumTopic
HideGeneralForumTopic
.type UnhideGeneralForumTopic = <B as Requester>::UnhideGeneralForumTopic
source§fn unhide_general_forum_topic<C>(
&self,
chat_id: C,
) -> Self::UnhideGeneralForumTopic
fn unhide_general_forum_topic<C>( &self, chat_id: C, ) -> Self::UnhideGeneralForumTopic
UnhideGeneralForumTopic
.type UnpinAllGeneralForumTopicMessages = <B as Requester>::UnpinAllGeneralForumTopicMessages
source§fn unpin_all_general_forum_topic_messages<C>(
&self,
chat_id: C,
) -> Self::UnpinAllGeneralForumTopicMessages
fn unpin_all_general_forum_topic_messages<C>( &self, chat_id: C, ) -> Self::UnpinAllGeneralForumTopicMessages
UnpinAllGeneralForumTopicMessages
.type AnswerCallbackQuery = <B as Requester>::AnswerCallbackQuery
source§fn answer_callback_query<C>(
&self,
callback_query_id: C,
) -> Self::AnswerCallbackQuery
fn answer_callback_query<C>( &self, callback_query_id: C, ) -> Self::AnswerCallbackQuery
AnswerCallbackQuery
.type GetUserChatBoosts = <B as Requester>::GetUserChatBoosts
source§fn get_user_chat_boosts<C>(
&self,
chat_id: C,
user_id: UserId,
) -> Self::GetUserChatBoosts
fn get_user_chat_boosts<C>( &self, chat_id: C, user_id: UserId, ) -> Self::GetUserChatBoosts
GetUserChatBoosts
.type SetMyCommands = <B as Requester>::SetMyCommands
source§fn set_my_commands<C>(&self, commands: C) -> Self::SetMyCommandswhere
C: IntoIterator<Item = BotCommand>,
fn set_my_commands<C>(&self, commands: C) -> Self::SetMyCommandswhere
C: IntoIterator<Item = BotCommand>,
SetMyCommands
.type GetMyCommands = <B as Requester>::GetMyCommands
source§fn get_my_commands(&self) -> Self::GetMyCommands
fn get_my_commands(&self) -> Self::GetMyCommands
GetMyCommands
.type SetMyName = <B as Requester>::SetMyName
source§fn set_my_name(&self) -> Self::SetMyName
fn set_my_name(&self) -> Self::SetMyName
SetMyName
.type GetMyName = <B as Requester>::GetMyName
source§fn get_my_name(&self) -> Self::GetMyName
fn get_my_name(&self) -> Self::GetMyName
GetMyName
.type SetMyDescription = <B as Requester>::SetMyDescription
source§fn set_my_description(&self) -> Self::SetMyDescription
fn set_my_description(&self) -> Self::SetMyDescription
SetMyDescription
.type GetMyDescription = <B as Requester>::GetMyDescription
source§fn get_my_description(&self) -> Self::GetMyDescription
fn get_my_description(&self) -> Self::GetMyDescription
GetMyDescription
.type SetMyShortDescription = <B as Requester>::SetMyShortDescription
source§fn set_my_short_description(&self) -> Self::SetMyShortDescription
fn set_my_short_description(&self) -> Self::SetMyShortDescription
SetMyShortDescription
.type GetMyShortDescription = <B as Requester>::GetMyShortDescription
source§fn get_my_short_description(&self) -> Self::GetMyShortDescription
fn get_my_short_description(&self) -> Self::GetMyShortDescription
GetMyShortDescription
.type SetChatMenuButton = <B as Requester>::SetChatMenuButton
SetChatMenuButton
.type GetChatMenuButton = <B as Requester>::GetChatMenuButton
GetChatMenuButton
.type SetMyDefaultAdministratorRights = <B as Requester>::SetMyDefaultAdministratorRights
source§fn set_my_default_administrator_rights(
&self,
) -> Self::SetMyDefaultAdministratorRights
fn set_my_default_administrator_rights( &self, ) -> Self::SetMyDefaultAdministratorRights
SetMyDefaultAdministratorRights
.type GetMyDefaultAdministratorRights = <B as Requester>::GetMyDefaultAdministratorRights
source§fn get_my_default_administrator_rights(
&self,
) -> Self::GetMyDefaultAdministratorRights
fn get_my_default_administrator_rights( &self, ) -> Self::GetMyDefaultAdministratorRights
GetMyDefaultAdministratorRights
.type DeleteMyCommands = <B as Requester>::DeleteMyCommands
source§fn delete_my_commands(&self) -> Self::DeleteMyCommands
fn delete_my_commands(&self) -> Self::DeleteMyCommands
DeleteMyCommands
.type AnswerInlineQuery = <B as Requester>::AnswerInlineQuery
source§fn answer_inline_query<I, R>(
&self,
inline_query_id: I,
results: R,
) -> Self::AnswerInlineQuery
fn answer_inline_query<I, R>( &self, inline_query_id: I, results: R, ) -> Self::AnswerInlineQuery
AnswerInlineQuery
.type AnswerWebAppQuery = <B as Requester>::AnswerWebAppQuery
source§fn answer_web_app_query<W>(
&self,
web_app_query_id: W,
result: InlineQueryResult,
) -> Self::AnswerWebAppQuery
fn answer_web_app_query<W>( &self, web_app_query_id: W, result: InlineQueryResult, ) -> Self::AnswerWebAppQuery
AnswerWebAppQuery
.type EditMessageText = <B as Requester>::EditMessageText
source§fn edit_message_text<C, T>(
&self,
chat_id: C,
message_id: MessageId,
text: T,
) -> Self::EditMessageText
fn edit_message_text<C, T>( &self, chat_id: C, message_id: MessageId, text: T, ) -> Self::EditMessageText
EditMessageText
.type EditMessageTextInline = <B as Requester>::EditMessageTextInline
source§fn edit_message_text_inline<I, T>(
&self,
inline_message_id: I,
text: T,
) -> Self::EditMessageTextInline
fn edit_message_text_inline<I, T>( &self, inline_message_id: I, text: T, ) -> Self::EditMessageTextInline
EditMessageTextInline
.type EditMessageCaption = <B as Requester>::EditMessageCaption
EditMessageCaption
.type EditMessageCaptionInline = <B as Requester>::EditMessageCaptionInline
EditMessageCaptionInline
.type EditMessageMedia = <B as Requester>::EditMessageMedia
source§fn edit_message_media<C>(
&self,
chat_id: C,
message_id: MessageId,
media: InputMedia,
) -> Self::EditMessageMedia
fn edit_message_media<C>( &self, chat_id: C, message_id: MessageId, media: InputMedia, ) -> Self::EditMessageMedia
EditMessageMedia
.type EditMessageMediaInline = <B as Requester>::EditMessageMediaInline
source§fn edit_message_media_inline<I>(
&self,
inline_message_id: I,
media: InputMedia,
) -> Self::EditMessageMediaInline
fn edit_message_media_inline<I>( &self, inline_message_id: I, media: InputMedia, ) -> Self::EditMessageMediaInline
EditMessageMediaInline
.type EditMessageReplyMarkup = <B as Requester>::EditMessageReplyMarkup
source§fn edit_message_reply_markup<C>(
&self,
chat_id: C,
message_id: MessageId,
) -> Self::EditMessageReplyMarkup
fn edit_message_reply_markup<C>( &self, chat_id: C, message_id: MessageId, ) -> Self::EditMessageReplyMarkup
EditMessageReplyMarkup
.type EditMessageReplyMarkupInline = <B as Requester>::EditMessageReplyMarkupInline
source§fn edit_message_reply_markup_inline<I>(
&self,
inline_message_id: I,
) -> Self::EditMessageReplyMarkupInline
fn edit_message_reply_markup_inline<I>( &self, inline_message_id: I, ) -> Self::EditMessageReplyMarkupInline
EditMessageReplyMarkupInline
.type StopPoll = <B as Requester>::StopPoll
source§fn stop_poll<C>(&self, chat_id: C, message_id: MessageId) -> Self::StopPoll
fn stop_poll<C>(&self, chat_id: C, message_id: MessageId) -> Self::StopPoll
StopPoll
.type DeleteMessage = <B as Requester>::DeleteMessage
source§fn delete_message<C>(
&self,
chat_id: C,
message_id: MessageId,
) -> Self::DeleteMessage
fn delete_message<C>( &self, chat_id: C, message_id: MessageId, ) -> Self::DeleteMessage
DeleteMessage
.type DeleteMessages = <B as Requester>::DeleteMessages
source§fn delete_messages<C, M>(
&self,
chat_id: C,
message_ids: M,
) -> Self::DeleteMessages
fn delete_messages<C, M>( &self, chat_id: C, message_ids: M, ) -> Self::DeleteMessages
DeleteMessages
.type GetStickerSet = <B as Requester>::GetStickerSet
source§fn get_sticker_set<N>(&self, name: N) -> Self::GetStickerSet
fn get_sticker_set<N>(&self, name: N) -> Self::GetStickerSet
GetStickerSet
.type GetCustomEmojiStickers = <B as Requester>::GetCustomEmojiStickers
source§fn get_custom_emoji_stickers<C>(
&self,
custom_emoji_ids: C,
) -> Self::GetCustomEmojiStickerswhere
C: IntoIterator<Item = String>,
fn get_custom_emoji_stickers<C>(
&self,
custom_emoji_ids: C,
) -> Self::GetCustomEmojiStickerswhere
C: IntoIterator<Item = String>,
GetCustomEmojiStickers
.type UploadStickerFile = <B as Requester>::UploadStickerFile
source§fn upload_sticker_file(
&self,
user_id: UserId,
sticker: InputFile,
sticker_format: StickerFormat,
) -> Self::UploadStickerFile
fn upload_sticker_file( &self, user_id: UserId, sticker: InputFile, sticker_format: StickerFormat, ) -> Self::UploadStickerFile
UploadStickerFile
.type CreateNewStickerSet = <B as Requester>::CreateNewStickerSet
source§fn create_new_sticker_set<N, T, S>(
&self,
user_id: UserId,
name: N,
title: T,
stickers: S,
sticker_format: StickerFormat,
) -> Self::CreateNewStickerSet
fn create_new_sticker_set<N, T, S>( &self, user_id: UserId, name: N, title: T, stickers: S, sticker_format: StickerFormat, ) -> Self::CreateNewStickerSet
CreateNewStickerSet
.type AddStickerToSet = <B as Requester>::AddStickerToSet
source§fn add_sticker_to_set<N>(
&self,
user_id: UserId,
name: N,
sticker: InputSticker,
) -> Self::AddStickerToSet
fn add_sticker_to_set<N>( &self, user_id: UserId, name: N, sticker: InputSticker, ) -> Self::AddStickerToSet
AddStickerToSet
.type SetStickerPositionInSet = <B as Requester>::SetStickerPositionInSet
source§fn set_sticker_position_in_set<S>(
&self,
sticker: S,
position: u32,
) -> Self::SetStickerPositionInSet
fn set_sticker_position_in_set<S>( &self, sticker: S, position: u32, ) -> Self::SetStickerPositionInSet
SetStickerPositionInSet
.type DeleteStickerFromSet = <B as Requester>::DeleteStickerFromSet
source§fn delete_sticker_from_set<S>(&self, sticker: S) -> Self::DeleteStickerFromSet
fn delete_sticker_from_set<S>(&self, sticker: S) -> Self::DeleteStickerFromSet
DeleteStickerFromSet
.type SetStickerSetThumbnail = <B as Requester>::SetStickerSetThumbnail
source§fn set_sticker_set_thumbnail<N>(
&self,
name: N,
user_id: UserId,
) -> Self::SetStickerSetThumbnail
fn set_sticker_set_thumbnail<N>( &self, name: N, user_id: UserId, ) -> Self::SetStickerSetThumbnail
SetStickerSetThumbnail
.type SetCustomEmojiStickerSetThumbnail = <B as Requester>::SetCustomEmojiStickerSetThumbnail
source§fn set_custom_emoji_sticker_set_thumbnail<N>(
&self,
name: N,
) -> Self::SetCustomEmojiStickerSetThumbnail
fn set_custom_emoji_sticker_set_thumbnail<N>( &self, name: N, ) -> Self::SetCustomEmojiStickerSetThumbnail
SetCustomEmojiStickerSetThumbnail
.type SetStickerSetTitle = <B as Requester>::SetStickerSetTitle
source§fn set_sticker_set_title<N, T>(
&self,
name: N,
title: T,
) -> Self::SetStickerSetTitle
fn set_sticker_set_title<N, T>( &self, name: N, title: T, ) -> Self::SetStickerSetTitle
SetStickerSetTitle
.type DeleteStickerSet = <B as Requester>::DeleteStickerSet
source§fn delete_sticker_set<N>(&self, name: N) -> Self::DeleteStickerSet
fn delete_sticker_set<N>(&self, name: N) -> Self::DeleteStickerSet
DeleteStickerSet
.type SetStickerEmojiList = <B as Requester>::SetStickerEmojiList
source§fn set_sticker_emoji_list<S, E>(
&self,
sticker: S,
emoji_list: E,
) -> Self::SetStickerEmojiList
fn set_sticker_emoji_list<S, E>( &self, sticker: S, emoji_list: E, ) -> Self::SetStickerEmojiList
SetStickerEmojiList
.type SetStickerKeywords = <B as Requester>::SetStickerKeywords
source§fn set_sticker_keywords<S>(&self, sticker: S) -> Self::SetStickerKeywords
fn set_sticker_keywords<S>(&self, sticker: S) -> Self::SetStickerKeywords
SetStickerKeywords
.type SetStickerMaskPosition = <B as Requester>::SetStickerMaskPosition
source§fn set_sticker_mask_position<S>(
&self,
sticker: S,
) -> Self::SetStickerMaskPosition
fn set_sticker_mask_position<S>( &self, sticker: S, ) -> Self::SetStickerMaskPosition
SetStickerMaskPosition
.type AnswerShippingQuery = <B as Requester>::AnswerShippingQuery
source§fn answer_shipping_query<S>(
&self,
shipping_query_id: S,
ok: bool,
) -> Self::AnswerShippingQuery
fn answer_shipping_query<S>( &self, shipping_query_id: S, ok: bool, ) -> Self::AnswerShippingQuery
AnswerShippingQuery
.type CreateInvoiceLink = <B as Requester>::CreateInvoiceLink
source§fn create_invoice_link<T, D, Pa, P, C, Pri>(
&self,
title: T,
description: D,
payload: Pa,
provider_token: P,
currency: C,
prices: Pri,
) -> Self::CreateInvoiceLink
fn create_invoice_link<T, D, Pa, P, C, Pri>( &self, title: T, description: D, payload: Pa, provider_token: P, currency: C, prices: Pri, ) -> Self::CreateInvoiceLink
CreateInvoiceLink
.type AnswerPreCheckoutQuery = <B as Requester>::AnswerPreCheckoutQuery
source§fn answer_pre_checkout_query<P>(
&self,
pre_checkout_query_id: P,
ok: bool,
) -> Self::AnswerPreCheckoutQuery
fn answer_pre_checkout_query<P>( &self, pre_checkout_query_id: P, ok: bool, ) -> Self::AnswerPreCheckoutQuery
AnswerPreCheckoutQuery
.type SetPassportDataErrors = <B as Requester>::SetPassportDataErrors
source§fn set_passport_data_errors<E>(
&self,
user_id: UserId,
errors: E,
) -> Self::SetPassportDataErrorswhere
E: IntoIterator<Item = PassportElementError>,
fn set_passport_data_errors<E>(
&self,
user_id: UserId,
errors: E,
) -> Self::SetPassportDataErrorswhere
E: IntoIterator<Item = PassportElementError>,
SetPassportDataErrors
.type SendGame = <B as Requester>::SendGame
source§fn send_game<C, G>(&self, chat_id: C, game_short_name: G) -> Self::SendGame
fn send_game<C, G>(&self, chat_id: C, game_short_name: G) -> Self::SendGame
SendGame
.type SetGameScore = <B as Requester>::SetGameScore
source§fn set_game_score(
&self,
user_id: UserId,
score: u64,
chat_id: u32,
message_id: MessageId,
) -> Self::SetGameScore
fn set_game_score( &self, user_id: UserId, score: u64, chat_id: u32, message_id: MessageId, ) -> Self::SetGameScore
SetGameScore
.type SetGameScoreInline = <B as Requester>::SetGameScoreInline
source§fn set_game_score_inline<I>(
&self,
user_id: UserId,
score: u64,
inline_message_id: I,
) -> Self::SetGameScoreInline
fn set_game_score_inline<I>( &self, user_id: UserId, score: u64, inline_message_id: I, ) -> Self::SetGameScoreInline
SetGameScoreInline
.type ApproveChatJoinRequest = <B as Requester>::ApproveChatJoinRequest
source§fn approve_chat_join_request<C>(
&self,
chat_id: C,
user_id: UserId,
) -> Self::ApproveChatJoinRequest
fn approve_chat_join_request<C>( &self, chat_id: C, user_id: UserId, ) -> Self::ApproveChatJoinRequest
ApproveChatJoinRequest
.type DeclineChatJoinRequest = <B as Requester>::DeclineChatJoinRequest
source§fn decline_chat_join_request<C>(
&self,
chat_id: C,
user_id: UserId,
) -> Self::DeclineChatJoinRequest
fn decline_chat_join_request<C>( &self, chat_id: C, user_id: UserId, ) -> Self::DeclineChatJoinRequest
DeclineChatJoinRequest
.type GetGameHighScores = <B as Requester>::GetGameHighScores
source§fn get_game_high_scores<T>(
&self,
user_id: UserId,
target: T,
) -> Self::GetGameHighScoreswhere
T: Into<TargetMessage>,
fn get_game_high_scores<T>(
&self,
user_id: UserId,
target: T,
) -> Self::GetGameHighScoreswhere
T: Into<TargetMessage>,
GetGameHighScores
.Auto Trait Implementations§
impl<B> Freeze for Throttle<B>where
B: Freeze,
impl<B> !RefUnwindSafe for Throttle<B>
impl<B> Send for Throttle<B>where
B: Send,
impl<B> Sync for Throttle<B>where
B: Sync,
impl<B> Unpin for Throttle<B>where
B: Unpin,
impl<B> !UnwindSafe for Throttle<B>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> Erasable for T
impl<T> Erasable for T
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>
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>
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 moresource§impl<T> RequesterExt for Twhere
T: Requester,
impl<T> RequesterExt for Twhere
T: Requester,
source§fn cache_me(self) -> CacheMe<Self> ⓘwhere
Self: Sized,
fn cache_me(self) -> CacheMe<Self> ⓘwhere
Self: Sized,
cache_me
only.get_me
caching ability, see CacheMe
for more.source§fn erase<'a>(self) -> ErasedRequester<'a, Self::Err> ⓘwhere
Self: 'a + Sized,
fn erase<'a>(self) -> ErasedRequester<'a, Self::Err> ⓘwhere
Self: 'a + Sized,
erased
only.source§fn trace(self, settings: Settings) -> Trace<Self> ⓘwhere
Self: Sized,
fn trace(self, settings: Settings) -> Trace<Self> ⓘwhere
Self: Sized,
trace_adaptor
only.Trace
for more.source§fn throttle(self, limits: Limits) -> Throttle<Self> ⓘ
fn throttle(self, limits: Limits) -> Throttle<Self> ⓘ
throttle
only.