pub trait Payload {
    type Output;

    const NAME: &'static str;

    // Provided method
    fn timeout_hint(&self) -> Option<Duration> { ... }
}
Expand description

Payload of a request.

Simply speaking, structures implementing this trait represent arguments of a Telegram bot API method.

Also, this trait provides some additional information needed to send a request to Telegram.

Required Associated Types§

source

type Output

The return type of a Telegram method.

Note: it should not include Result wrappers (e.g. it should be simply Message, True or something else).

Required Associated Constants§

source

const NAME: &'static str

Name of a Telegram method.

It is case insensitive, though must not include underscores. (e.g. GetMe, GETME, getme, getMe are ok, but get_me is not ok).

Provided Methods§

source

fn timeout_hint(&self) -> Option<Duration>

If this payload may take long time to execute (e.g. GetUpdates with big timeout), the minimum timeout that should be used.

Implementors§

source§

impl Payload for AddStickerToSet

§

type Output = True

source§

const NAME: &'static str = "AddStickerToSet"

source§

impl Payload for AnswerCallbackQuery

§

type Output = True

source§

const NAME: &'static str = "AnswerCallbackQuery"

source§

impl Payload for AnswerInlineQuery

§

type Output = True

source§

const NAME: &'static str = "AnswerInlineQuery"

source§

impl Payload for AnswerPreCheckoutQuery

§

type Output = True

source§

const NAME: &'static str = "AnswerPreCheckoutQuery"

source§

impl Payload for AnswerShippingQuery

§

type Output = True

source§

const NAME: &'static str = "AnswerShippingQuery"

source§

impl Payload for AnswerWebAppQuery

§

type Output = SentWebAppMessage

source§

const NAME: &'static str = "AnswerWebAppQuery"

source§

impl Payload for ApproveChatJoinRequest

§

type Output = True

source§

const NAME: &'static str = "ApproveChatJoinRequest"

source§

impl Payload for BanChatMember

§

type Output = True

source§

const NAME: &'static str = "BanChatMember"

source§

impl Payload for BanChatSenderChat

§

type Output = True

source§

const NAME: &'static str = "BanChatSenderChat"

source§

impl Payload for Close

§

type Output = True

source§

const NAME: &'static str = "Close"

source§

impl Payload for CloseForumTopic

§

type Output = True

source§

const NAME: &'static str = "CloseForumTopic"

source§

impl Payload for CloseGeneralForumTopic

§

type Output = True

source§

const NAME: &'static str = "CloseGeneralForumTopic"

source§

impl Payload for CopyMessage

§

type Output = MessageId

source§

const NAME: &'static str = "CopyMessage"

§

type Output = ChatInviteLink

source§

const NAME: &'static str = "CreateChatInviteLink"

source§

impl Payload for CreateForumTopic

§

type Output = ForumTopic

source§

const NAME: &'static str = "CreateForumTopic"

§

type Output = String

source§

const NAME: &'static str = "CreateInvoiceLink"

source§

impl Payload for CreateNewStickerSet

§

type Output = True

source§

const NAME: &'static str = "CreateNewStickerSet"

source§

impl Payload for DeclineChatJoinRequest

§

type Output = True

source§

const NAME: &'static str = "DeclineChatJoinRequest"

source§

impl Payload for DeleteChatPhoto

§

type Output = String

source§

const NAME: &'static str = "DeleteChatPhoto"

source§

impl Payload for DeleteChatStickerSet

§

type Output = True

source§

const NAME: &'static str = "DeleteChatStickerSet"

source§

impl Payload for DeleteForumTopic

§

type Output = True

source§

const NAME: &'static str = "DeleteForumTopic"

source§

impl Payload for DeleteMessage

§

type Output = True

source§

const NAME: &'static str = "DeleteMessage"

source§

impl Payload for DeleteMyCommands

§

type Output = True

source§

const NAME: &'static str = "DeleteMyCommands"

source§

impl Payload for DeleteStickerFromSet

§

type Output = True

source§

const NAME: &'static str = "DeleteStickerFromSet"

source§

impl Payload for DeleteWebhook

§

type Output = True

source§

const NAME: &'static str = "DeleteWebhook"

§

type Output = String

source§

const NAME: &'static str = "EditChatInviteLink"

source§

impl Payload for EditForumTopic

§

type Output = True

source§

const NAME: &'static str = "EditForumTopic"

source§

impl Payload for EditGeneralForumTopic

§

type Output = True

source§

const NAME: &'static str = "EditGeneralForumTopic"

source§

impl Payload for EditMessageCaption

§

type Output = Message

source§

const NAME: &'static str = "EditMessageCaption"

source§

impl Payload for EditMessageCaptionInline

§

type Output = True

source§

const NAME: &'static str = "EditMessageCaptionInline"

source§

impl Payload for EditMessageLiveLocation

§

type Output = Message

source§

const NAME: &'static str = "EditMessageLiveLocation"

source§

impl Payload for EditMessageLiveLocationInline

§

type Output = Message

source§

const NAME: &'static str = "EditMessageLiveLocationInline"

source§

impl Payload for EditMessageMedia

§

type Output = Message

source§

const NAME: &'static str = "EditMessageMedia"

source§

impl Payload for EditMessageMediaInline

§

type Output = True

source§

const NAME: &'static str = "EditMessageMediaInline"

source§

impl Payload for EditMessageReplyMarkup

§

type Output = Message

source§

const NAME: &'static str = "EditMessageReplyMarkup"

source§

impl Payload for EditMessageReplyMarkupInline

§

type Output = True

source§

const NAME: &'static str = "EditMessageReplyMarkupInline"

source§

impl Payload for EditMessageText

§

type Output = Message

source§

const NAME: &'static str = "EditMessageText"

source§

impl Payload for EditMessageTextInline

§

type Output = True

source§

const NAME: &'static str = "EditMessageTextInline"

§

type Output = String

source§

const NAME: &'static str = "ExportChatInviteLink"

source§

impl Payload for ForwardMessage

§

type Output = Message

source§

const NAME: &'static str = "ForwardMessage"

source§

impl Payload for GetChat

§

type Output = Chat

source§

const NAME: &'static str = "GetChat"

source§

impl Payload for GetChatAdministrators

§

type Output = Vec<ChatMember, Global>

source§

const NAME: &'static str = "GetChatAdministrators"

source§

impl Payload for GetChatMember

§

type Output = ChatMember

source§

const NAME: &'static str = "GetChatMember"

source§

impl Payload for GetChatMemberCount

§

type Output = u32

source§

const NAME: &'static str = "GetChatMemberCount"

source§

impl Payload for GetChatMembersCount

§

type Output = u32

source§

const NAME: &'static str = "GetChatMembersCount"

source§

impl Payload for GetChatMenuButton

§

type Output = MenuButton

source§

const NAME: &'static str = "GetChatMenuButton"

source§

impl Payload for GetCustomEmojiStickers

§

type Output = Vec<Sticker, Global>

source§

const NAME: &'static str = "GetCustomEmojiStickers"

source§

impl Payload for GetFile

§

type Output = File

source§

const NAME: &'static str = "GetFile"

source§

impl Payload for GetForumTopicIconStickers

§

type Output = Vec<Sticker, Global>

source§

const NAME: &'static str = "GetForumTopicIconStickers"

source§

impl Payload for GetGameHighScores

§

type Output = True

source§

const NAME: &'static str = "GetGameHighScores"

source§

impl Payload for GetMe

§

type Output = Me

source§

const NAME: &'static str = "GetMe"

source§

impl Payload for GetMyCommands

§

type Output = Vec<BotCommand, Global>

source§

const NAME: &'static str = "GetMyCommands"

source§

impl Payload for GetMyDefaultAdministratorRights

§

type Output = ChatAdministratorRights

source§

const NAME: &'static str = "GetMyDefaultAdministratorRights"

source§

impl Payload for GetStickerSet

§

type Output = StickerSet

source§

const NAME: &'static str = "GetStickerSet"

source§

impl Payload for GetUpdates

§

type Output = Vec<Update, Global>

source§

const NAME: &'static str = "GetUpdates"

source§

impl Payload for GetUserProfilePhotos

§

type Output = UserProfilePhotos

source§

const NAME: &'static str = "GetUserProfilePhotos"

source§

impl Payload for GetWebhookInfo

§

type Output = WebhookInfo

source§

const NAME: &'static str = "GetWebhookInfo"

source§

impl Payload for HideGeneralForumTopic

§

type Output = True

source§

const NAME: &'static str = "HideGeneralForumTopic"

source§

impl Payload for KickChatMember

§

type Output = True

source§

const NAME: &'static str = "KickChatMember"

source§

impl Payload for LeaveChat

§

type Output = True

source§

const NAME: &'static str = "LeaveChat"

source§

impl Payload for LogOut

§

type Output = True

source§

const NAME: &'static str = "LogOut"

source§

impl Payload for PinChatMessage

§

type Output = True

source§

const NAME: &'static str = "PinChatMessage"

source§

impl Payload for PromoteChatMember

§

type Output = True

source§

const NAME: &'static str = "PromoteChatMember"

source§

impl Payload for ReopenForumTopic

§

type Output = True

source§

const NAME: &'static str = "ReopenForumTopic"

source§

impl Payload for ReopenGeneralForumTopic

§

type Output = True

source§

const NAME: &'static str = "ReopenGeneralForumTopic"

source§

impl Payload for RestrictChatMember

§

type Output = True

source§

const NAME: &'static str = "RestrictChatMember"

§

type Output = String

source§

const NAME: &'static str = "RevokeChatInviteLink"

source§

impl Payload for SendAnimation

§

type Output = Message

source§

const NAME: &'static str = "SendAnimation"

source§

impl Payload for SendAudio

§

type Output = Message

source§

const NAME: &'static str = "SendAudio"

source§

impl Payload for SendChatAction

§

type Output = True

source§

const NAME: &'static str = "SendChatAction"

source§

impl Payload for SendContact

§

type Output = Message

source§

const NAME: &'static str = "SendContact"

source§

impl Payload for SendDice

§

type Output = Message

source§

const NAME: &'static str = "SendDice"

source§

impl Payload for SendDocument

§

type Output = Message

source§

const NAME: &'static str = "SendDocument"

source§

impl Payload for SendGame

§

type Output = Message

source§

const NAME: &'static str = "SendGame"

source§

impl Payload for SendInvoice

§

type Output = Message

source§

const NAME: &'static str = "SendInvoice"

source§

impl Payload for SendLocation

§

type Output = Message

source§

const NAME: &'static str = "SendLocation"

source§

impl Payload for SendMediaGroup

§

type Output = Vec<Message, Global>

source§

const NAME: &'static str = "SendMediaGroup"

source§

impl Payload for SendMessage

§

type Output = Message

source§

const NAME: &'static str = "SendMessage"

source§

impl Payload for SendPhoto

§

type Output = Message

source§

const NAME: &'static str = "SendPhoto"

source§

impl Payload for SendPoll

§

type Output = Message

source§

const NAME: &'static str = "SendPoll"

source§

impl Payload for SendSticker

§

type Output = Message

source§

const NAME: &'static str = "SendSticker"

source§

impl Payload for SendVenue

§

type Output = Message

source§

const NAME: &'static str = "SendVenue"

source§

impl Payload for SendVideo

§

type Output = Message

source§

const NAME: &'static str = "SendVideo"

source§

impl Payload for SendVideoNote

§

type Output = Message

source§

const NAME: &'static str = "SendVideoNote"

source§

impl Payload for SendVoice

§

type Output = Message

source§

const NAME: &'static str = "SendVoice"

source§

impl Payload for SetChatAdministratorCustomTitle

§

type Output = True

source§

const NAME: &'static str = "SetChatAdministratorCustomTitle"

source§

impl Payload for SetChatDescription

§

type Output = True

source§

const NAME: &'static str = "SetChatDescription"

source§

impl Payload for SetChatMenuButton

§

type Output = True

source§

const NAME: &'static str = "SetChatMenuButton"

source§

impl Payload for SetChatPermissions

§

type Output = True

source§

const NAME: &'static str = "SetChatPermissions"

source§

impl Payload for SetChatPhoto

§

type Output = True

source§

const NAME: &'static str = "SetChatPhoto"

source§

impl Payload for SetChatStickerSet

§

type Output = True

source§

const NAME: &'static str = "SetChatStickerSet"

source§

impl Payload for SetChatTitle

§

type Output = True

source§

const NAME: &'static str = "SetChatTitle"

source§

impl Payload for SetGameScore

§

type Output = Message

source§

const NAME: &'static str = "SetGameScore"

source§

impl Payload for SetGameScoreInline

§

type Output = Message

source§

const NAME: &'static str = "SetGameScoreInline"

source§

impl Payload for SetMyCommands

§

type Output = True

source§

const NAME: &'static str = "SetMyCommands"

source§

impl Payload for SetMyDefaultAdministratorRights

§

type Output = True

source§

const NAME: &'static str = "SetMyDefaultAdministratorRights"

source§

impl Payload for SetPassportDataErrors

§

type Output = True

source§

const NAME: &'static str = "SetPassportDataErrors"

source§

impl Payload for SetStickerPositionInSet

§

type Output = True

source§

const NAME: &'static str = "SetStickerPositionInSet"

source§

impl Payload for SetStickerSetThumb

§

type Output = True

source§

const NAME: &'static str = "SetStickerSetThumb"

source§

impl Payload for SetWebhook

§

type Output = True

source§

const NAME: &'static str = "SetWebhook"

source§

impl Payload for StopMessageLiveLocation

§

type Output = Message

source§

const NAME: &'static str = "StopMessageLiveLocation"

source§

impl Payload for StopMessageLiveLocationInline

§

type Output = Message

source§

const NAME: &'static str = "StopMessageLiveLocationInline"

source§

impl Payload for StopPoll

§

type Output = Poll

source§

const NAME: &'static str = "StopPoll"

source§

impl Payload for UnbanChatMember

§

type Output = True

source§

const NAME: &'static str = "UnbanChatMember"

source§

impl Payload for UnbanChatSenderChat

§

type Output = True

source§

const NAME: &'static str = "UnbanChatSenderChat"

source§

impl Payload for UnhideGeneralForumTopic

§

type Output = True

source§

const NAME: &'static str = "UnhideGeneralForumTopic"

source§

impl Payload for UnpinAllChatMessages

§

type Output = True

source§

const NAME: &'static str = "UnpinAllChatMessages"

source§

impl Payload for UnpinAllForumTopicMessages

§

type Output = True

source§

const NAME: &'static str = "UnpinAllForumTopicMessages"

source§

impl Payload for UnpinChatMessage

§

type Output = True

source§

const NAME: &'static str = "UnpinChatMessage"

source§

impl Payload for UploadStickerFile

§

type Output = FileMeta

source§

const NAME: &'static str = "UploadStickerFile"