Trait Payload

Source
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 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).

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).

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Payload for AddStickerToSet

Source§

const NAME: &'static str = "AddStickerToSet"

Source§

type Output = True

Source§

impl Payload for AnswerCallbackQuery

Source§

const NAME: &'static str = "AnswerCallbackQuery"

Source§

type Output = True

Source§

impl Payload for AnswerInlineQuery

Source§

const NAME: &'static str = "AnswerInlineQuery"

Source§

type Output = True

Source§

impl Payload for AnswerPreCheckoutQuery

Source§

const NAME: &'static str = "AnswerPreCheckoutQuery"

Source§

type Output = True

Source§

impl Payload for AnswerShippingQuery

Source§

const NAME: &'static str = "AnswerShippingQuery"

Source§

type Output = True

Source§

impl Payload for AnswerWebAppQuery

Source§

const NAME: &'static str = "AnswerWebAppQuery"

Source§

type Output = SentWebAppMessage

Source§

impl Payload for ApproveChatJoinRequest

Source§

const NAME: &'static str = "ApproveChatJoinRequest"

Source§

type Output = True

Source§

impl Payload for BanChatMember

Source§

const NAME: &'static str = "BanChatMember"

Source§

type Output = True

Source§

impl Payload for BanChatSenderChat

Source§

const NAME: &'static str = "BanChatSenderChat"

Source§

type Output = True

Source§

impl Payload for Close

Source§

const NAME: &'static str = "Close"

Source§

type Output = True

Source§

impl Payload for CloseForumTopic

Source§

const NAME: &'static str = "CloseForumTopic"

Source§

type Output = True

Source§

impl Payload for CloseGeneralForumTopic

Source§

const NAME: &'static str = "CloseGeneralForumTopic"

Source§

type Output = True

Source§

impl Payload for CopyMessage

Source§

const NAME: &'static str = "CopyMessage"

Source§

type Output = MessageId

Source§

impl Payload for CopyMessages

Source§

const NAME: &'static str = "CopyMessages"

Source§

type Output = Vec<MessageId>

Source§

const NAME: &'static str = "CreateChatInviteLink"

Source§

type Output = ChatInviteLink

Source§

impl Payload for CreateForumTopic

Source§

const NAME: &'static str = "CreateForumTopic"

Source§

type Output = ForumTopic

Source§

const NAME: &'static str = "CreateInvoiceLink"

Source§

type Output = String

Source§

impl Payload for CreateNewStickerSet

Source§

const NAME: &'static str = "CreateNewStickerSet"

Source§

type Output = True

Source§

impl Payload for DeclineChatJoinRequest

Source§

const NAME: &'static str = "DeclineChatJoinRequest"

Source§

type Output = True

Source§

impl Payload for DeleteChatPhoto

Source§

const NAME: &'static str = "DeleteChatPhoto"

Source§

type Output = String

Source§

impl Payload for DeleteChatStickerSet

Source§

const NAME: &'static str = "DeleteChatStickerSet"

Source§

type Output = True

Source§

impl Payload for DeleteForumTopic

Source§

const NAME: &'static str = "DeleteForumTopic"

Source§

type Output = True

Source§

impl Payload for DeleteMessage

Source§

const NAME: &'static str = "DeleteMessage"

Source§

type Output = True

Source§

impl Payload for DeleteMessages

Source§

const NAME: &'static str = "DeleteMessages"

Source§

type Output = True

Source§

impl Payload for DeleteMyCommands

Source§

const NAME: &'static str = "DeleteMyCommands"

Source§

type Output = True

Source§

impl Payload for DeleteStickerFromSet

Source§

const NAME: &'static str = "DeleteStickerFromSet"

Source§

type Output = True

Source§

impl Payload for DeleteStickerSet

Source§

const NAME: &'static str = "DeleteStickerSet"

Source§

type Output = True

Source§

impl Payload for DeleteWebhook

Source§

const NAME: &'static str = "DeleteWebhook"

Source§

type Output = True

Source§

const NAME: &'static str = "EditChatInviteLink"

Source§

type Output = String

Source§

impl Payload for EditForumTopic

Source§

const NAME: &'static str = "EditForumTopic"

Source§

type Output = True

Source§

impl Payload for EditGeneralForumTopic

Source§

const NAME: &'static str = "EditGeneralForumTopic"

Source§

type Output = True

Source§

impl Payload for EditMessageCaption

Source§

const NAME: &'static str = "EditMessageCaption"

Source§

type Output = Message

Source§

impl Payload for EditMessageCaptionInline

Source§

const NAME: &'static str = "EditMessageCaptionInline"

Source§

type Output = True

Source§

impl Payload for EditMessageLiveLocation

Source§

const NAME: &'static str = "EditMessageLiveLocation"

Source§

type Output = Message

Source§

impl Payload for EditMessageLiveLocationInline

Source§

const NAME: &'static str = "EditMessageLiveLocationInline"

Source§

type Output = True

Source§

impl Payload for EditMessageMedia

Source§

const NAME: &'static str = "EditMessageMedia"

Source§

type Output = Message

Source§

impl Payload for EditMessageMediaInline

Source§

const NAME: &'static str = "EditMessageMediaInline"

Source§

type Output = True

Source§

impl Payload for EditMessageReplyMarkup

Source§

const NAME: &'static str = "EditMessageReplyMarkup"

Source§

type Output = Message

Source§

impl Payload for EditMessageReplyMarkupInline

Source§

const NAME: &'static str = "EditMessageReplyMarkupInline"

Source§

type Output = True

Source§

impl Payload for EditMessageText

Source§

const NAME: &'static str = "EditMessageText"

Source§

type Output = Message

Source§

impl Payload for EditMessageTextInline

Source§

const NAME: &'static str = "EditMessageTextInline"

Source§

type Output = True

Source§

const NAME: &'static str = "ExportChatInviteLink"

Source§

type Output = String

Source§

impl Payload for ForwardMessage

Source§

const NAME: &'static str = "ForwardMessage"

Source§

type Output = Message

Source§

impl Payload for ForwardMessages

Source§

const NAME: &'static str = "ForwardMessages"

Source§

type Output = Vec<MessageId>

Source§

impl Payload for GetChat

Source§

const NAME: &'static str = "GetChat"

Source§

type Output = Chat

Source§

impl Payload for GetChatAdministrators

Source§

const NAME: &'static str = "GetChatAdministrators"

Source§

type Output = Vec<ChatMember>

Source§

impl Payload for GetChatMember

Source§

const NAME: &'static str = "GetChatMember"

Source§

type Output = ChatMember

Source§

impl Payload for GetChatMemberCount

Source§

const NAME: &'static str = "GetChatMemberCount"

Source§

type Output = u32

Source§

impl Payload for GetChatMembersCount

Source§

const NAME: &'static str = "GetChatMembersCount"

Source§

type Output = u32

Source§

impl Payload for GetChatMenuButton

Source§

const NAME: &'static str = "GetChatMenuButton"

Source§

type Output = MenuButton

Source§

impl Payload for GetCustomEmojiStickers

Source§

const NAME: &'static str = "GetCustomEmojiStickers"

Source§

type Output = Vec<Sticker>

Source§

impl Payload for GetFile

Source§

const NAME: &'static str = "GetFile"

Source§

type Output = File

Source§

impl Payload for GetForumTopicIconStickers

Source§

const NAME: &'static str = "GetForumTopicIconStickers"

Source§

type Output = Vec<Sticker>

Source§

impl Payload for GetGameHighScores

Source§

const NAME: &'static str = "GetGameHighScores"

Source§

type Output = True

Source§

impl Payload for GetMe

Source§

const NAME: &'static str = "GetMe"

Source§

type Output = Me

Source§

impl Payload for GetMyCommands

Source§

const NAME: &'static str = "GetMyCommands"

Source§

type Output = Vec<BotCommand>

Source§

impl Payload for GetMyDefaultAdministratorRights

Source§

const NAME: &'static str = "GetMyDefaultAdministratorRights"

Source§

type Output = ChatAdministratorRights

Source§

impl Payload for GetMyDescription

Source§

const NAME: &'static str = "GetMyDescription"

Source§

type Output = BotDescription

Source§

impl Payload for GetMyName

Source§

const NAME: &'static str = "GetMyName"

Source§

type Output = BotName

Source§

impl Payload for GetMyShortDescription

Source§

const NAME: &'static str = "GetMyShortDescription"

Source§

type Output = BotShortDescription

Source§

impl Payload for GetStickerSet

Source§

const NAME: &'static str = "GetStickerSet"

Source§

type Output = StickerSet

Source§

impl Payload for GetUpdates

Source§

const NAME: &'static str = "GetUpdates"

Source§

type Output = Vec<Update>

Source§

impl Payload for GetUserChatBoosts

Source§

const NAME: &'static str = "GetUserChatBoosts"

Source§

type Output = UserChatBoosts

Source§

impl Payload for GetUserProfilePhotos

Source§

const NAME: &'static str = "GetUserProfilePhotos"

Source§

type Output = UserProfilePhotos

Source§

impl Payload for GetWebhookInfo

Source§

const NAME: &'static str = "GetWebhookInfo"

Source§

type Output = WebhookInfo

Source§

impl Payload for HideGeneralForumTopic

Source§

const NAME: &'static str = "HideGeneralForumTopic"

Source§

type Output = True

Source§

impl Payload for KickChatMember

Source§

const NAME: &'static str = "KickChatMember"

Source§

type Output = True

Source§

impl Payload for LeaveChat

Source§

const NAME: &'static str = "LeaveChat"

Source§

type Output = True

Source§

impl Payload for LogOut

Source§

const NAME: &'static str = "LogOut"

Source§

type Output = True

Source§

impl Payload for PinChatMessage

Source§

const NAME: &'static str = "PinChatMessage"

Source§

type Output = True

Source§

impl Payload for PromoteChatMember

Source§

const NAME: &'static str = "PromoteChatMember"

Source§

type Output = True

Source§

impl Payload for ReopenForumTopic

Source§

const NAME: &'static str = "ReopenForumTopic"

Source§

type Output = True

Source§

impl Payload for ReopenGeneralForumTopic

Source§

const NAME: &'static str = "ReopenGeneralForumTopic"

Source§

type Output = True

Source§

impl Payload for RestrictChatMember

Source§

const NAME: &'static str = "RestrictChatMember"

Source§

type Output = True

Source§

const NAME: &'static str = "RevokeChatInviteLink"

Source§

type Output = String

Source§

impl Payload for SendAnimation

Source§

const NAME: &'static str = "SendAnimation"

Source§

type Output = Message

Source§

impl Payload for SendAudio

Source§

const NAME: &'static str = "SendAudio"

Source§

type Output = Message

Source§

impl Payload for SendChatAction

Source§

const NAME: &'static str = "SendChatAction"

Source§

type Output = True

Source§

impl Payload for SendContact

Source§

const NAME: &'static str = "SendContact"

Source§

type Output = Message

Source§

impl Payload for SendDice

Source§

const NAME: &'static str = "SendDice"

Source§

type Output = Message

Source§

impl Payload for SendDocument

Source§

const NAME: &'static str = "SendDocument"

Source§

type Output = Message

Source§

impl Payload for SendGame

Source§

const NAME: &'static str = "SendGame"

Source§

type Output = Message

Source§

impl Payload for SendInvoice

Source§

const NAME: &'static str = "SendInvoice"

Source§

type Output = Message

Source§

impl Payload for SendLocation

Source§

const NAME: &'static str = "SendLocation"

Source§

type Output = Message

Source§

impl Payload for SendMediaGroup

Source§

const NAME: &'static str = "SendMediaGroup"

Source§

type Output = Vec<Message>

Source§

impl Payload for SendMessage

Source§

const NAME: &'static str = "SendMessage"

Source§

type Output = Message

Source§

impl Payload for SendPhoto

Source§

const NAME: &'static str = "SendPhoto"

Source§

type Output = Message

Source§

impl Payload for SendPoll

Source§

const NAME: &'static str = "SendPoll"

Source§

type Output = Message

Source§

impl Payload for SendSticker

Source§

const NAME: &'static str = "SendSticker"

Source§

type Output = Message

Source§

impl Payload for SendVenue

Source§

const NAME: &'static str = "SendVenue"

Source§

type Output = Message

Source§

impl Payload for SendVideo

Source§

const NAME: &'static str = "SendVideo"

Source§

type Output = Message

Source§

impl Payload for SendVideoNote

Source§

const NAME: &'static str = "SendVideoNote"

Source§

type Output = Message

Source§

impl Payload for SendVoice

Source§

const NAME: &'static str = "SendVoice"

Source§

type Output = Message

Source§

impl Payload for SetChatAdministratorCustomTitle

Source§

const NAME: &'static str = "SetChatAdministratorCustomTitle"

Source§

type Output = True

Source§

impl Payload for SetChatDescription

Source§

const NAME: &'static str = "SetChatDescription"

Source§

type Output = True

Source§

impl Payload for SetChatMenuButton

Source§

const NAME: &'static str = "SetChatMenuButton"

Source§

type Output = True

Source§

impl Payload for SetChatPermissions

Source§

const NAME: &'static str = "SetChatPermissions"

Source§

type Output = True

Source§

impl Payload for SetChatPhoto

Source§

const NAME: &'static str = "SetChatPhoto"

Source§

type Output = True

Source§

impl Payload for SetChatStickerSet

Source§

const NAME: &'static str = "SetChatStickerSet"

Source§

type Output = True

Source§

impl Payload for SetChatTitle

Source§

const NAME: &'static str = "SetChatTitle"

Source§

type Output = True

Source§

impl Payload for SetCustomEmojiStickerSetThumbnail

Source§

const NAME: &'static str = "SetCustomEmojiStickerSetThumbnail"

Source§

type Output = True

Source§

impl Payload for SetGameScore

Source§

const NAME: &'static str = "SetGameScore"

Source§

type Output = Message

Source§

impl Payload for SetGameScoreInline

Source§

const NAME: &'static str = "SetGameScoreInline"

Source§

type Output = True

Source§

impl Payload for SetMessageReaction

Source§

const NAME: &'static str = "SetMessageReaction"

Source§

type Output = True

Source§

impl Payload for SetMyCommands

Source§

const NAME: &'static str = "SetMyCommands"

Source§

type Output = True

Source§

impl Payload for SetMyDefaultAdministratorRights

Source§

const NAME: &'static str = "SetMyDefaultAdministratorRights"

Source§

type Output = True

Source§

impl Payload for SetMyDescription

Source§

const NAME: &'static str = "SetMyDescription"

Source§

type Output = True

Source§

impl Payload for SetMyName

Source§

const NAME: &'static str = "SetMyName"

Source§

type Output = True

Source§

impl Payload for SetMyShortDescription

Source§

const NAME: &'static str = "SetMyShortDescription"

Source§

type Output = True

Source§

impl Payload for SetPassportDataErrors

Source§

const NAME: &'static str = "SetPassportDataErrors"

Source§

type Output = True

Source§

impl Payload for SetStickerEmojiList

Source§

const NAME: &'static str = "SetStickerEmojiList"

Source§

type Output = True

Source§

impl Payload for SetStickerKeywords

Source§

const NAME: &'static str = "SetStickerKeywords"

Source§

type Output = True

Source§

impl Payload for SetStickerMaskPosition

Source§

const NAME: &'static str = "SetStickerMaskPosition"

Source§

type Output = True

Source§

impl Payload for SetStickerPositionInSet

Source§

const NAME: &'static str = "SetStickerPositionInSet"

Source§

type Output = True

Source§

impl Payload for SetStickerSetThumbnail

Source§

const NAME: &'static str = "SetStickerSetThumbnail"

Source§

type Output = True

Source§

impl Payload for SetStickerSetTitle

Source§

const NAME: &'static str = "SetStickerSetTitle"

Source§

type Output = True

Source§

impl Payload for SetWebhook

Source§

const NAME: &'static str = "SetWebhook"

Source§

type Output = True

Source§

impl Payload for StopMessageLiveLocation

Source§

const NAME: &'static str = "StopMessageLiveLocation"

Source§

type Output = Message

Source§

impl Payload for StopMessageLiveLocationInline

Source§

const NAME: &'static str = "StopMessageLiveLocationInline"

Source§

type Output = True

Source§

impl Payload for StopPoll

Source§

const NAME: &'static str = "StopPoll"

Source§

type Output = Poll

Source§

impl Payload for UnbanChatMember

Source§

const NAME: &'static str = "UnbanChatMember"

Source§

type Output = True

Source§

impl Payload for UnbanChatSenderChat

Source§

const NAME: &'static str = "UnbanChatSenderChat"

Source§

type Output = True

Source§

impl Payload for UnhideGeneralForumTopic

Source§

const NAME: &'static str = "UnhideGeneralForumTopic"

Source§

type Output = True

Source§

impl Payload for UnpinAllChatMessages

Source§

const NAME: &'static str = "UnpinAllChatMessages"

Source§

type Output = True

Source§

impl Payload for UnpinAllForumTopicMessages

Source§

const NAME: &'static str = "UnpinAllForumTopicMessages"

Source§

type Output = True

Source§

impl Payload for UnpinAllGeneralForumTopicMessages

Source§

const NAME: &'static str = "UnpinAllGeneralForumTopicMessages"

Source§

type Output = True

Source§

impl Payload for UnpinChatMessage

Source§

const NAME: &'static str = "UnpinChatMessage"

Source§

type Output = True

Source§

impl Payload for UploadStickerFile

Source§

const NAME: &'static str = "UploadStickerFile"

Source§

type Output = FileMeta