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 = _

source§

impl Payload for AnswerCallbackQuery

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for AnswerInlineQuery

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for AnswerPreCheckoutQuery

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for AnswerShippingQuery

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for AnswerWebAppQuery

§

type Output = SentWebAppMessage

source§

const NAME: &'static str = _

source§

impl Payload for ApproveChatJoinRequest

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for BanChatMember

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for BanChatSenderChat

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for Close

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for CloseForumTopic

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for CloseGeneralForumTopic

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for CopyMessage

§

type Output = MessageId

source§

const NAME: &'static str = _

§

type Output = ChatInviteLink

source§

const NAME: &'static str = _

source§

impl Payload for CreateForumTopic

§

type Output = ForumTopic

source§

const NAME: &'static str = _

§

type Output = String

source§

const NAME: &'static str = _

source§

impl Payload for CreateNewStickerSet

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for DeclineChatJoinRequest

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for DeleteChatPhoto

§

type Output = String

source§

const NAME: &'static str = _

source§

impl Payload for DeleteChatStickerSet

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for DeleteForumTopic

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for DeleteMessage

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for DeleteMyCommands

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for DeleteStickerFromSet

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for DeleteWebhook

§

type Output = True

source§

const NAME: &'static str = _

§

type Output = String

source§

const NAME: &'static str = _

source§

impl Payload for EditForumTopic

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for EditGeneralForumTopic

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for EditMessageCaption

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for EditMessageCaptionInline

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for EditMessageLiveLocation

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for EditMessageLiveLocationInline

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for EditMessageMedia

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for EditMessageMediaInline

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for EditMessageReplyMarkup

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for EditMessageReplyMarkupInline

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for EditMessageText

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for EditMessageTextInline

§

type Output = True

source§

const NAME: &'static str = _

§

type Output = String

source§

const NAME: &'static str = _

source§

impl Payload for ForwardMessage

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for GetChat

§

type Output = Chat

source§

const NAME: &'static str = _

source§

impl Payload for GetChatAdministrators

§

type Output = Vec<ChatMember, Global>

source§

const NAME: &'static str = _

source§

impl Payload for GetChatMember

§

type Output = ChatMember

source§

const NAME: &'static str = _

source§

impl Payload for GetChatMemberCount

§

type Output = u32

source§

const NAME: &'static str = _

source§

impl Payload for GetChatMembersCount

§

type Output = u32

source§

const NAME: &'static str = _

source§

impl Payload for GetChatMenuButton

§

type Output = MenuButton

source§

const NAME: &'static str = _

source§

impl Payload for GetCustomEmojiStickers

§

type Output = Vec<Sticker, Global>

source§

const NAME: &'static str = _

source§

impl Payload for GetFile

§

type Output = File

source§

const NAME: &'static str = _

source§

impl Payload for GetForumTopicIconStickers

§

type Output = Vec<Sticker, Global>

source§

const NAME: &'static str = _

source§

impl Payload for GetGameHighScores

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for GetMe

§

type Output = Me

source§

const NAME: &'static str = _

source§

impl Payload for GetMyCommands

§

type Output = Vec<BotCommand, Global>

source§

const NAME: &'static str = _

source§

impl Payload for GetMyDefaultAdministratorRights

source§

impl Payload for GetStickerSet

§

type Output = StickerSet

source§

const NAME: &'static str = _

source§

impl Payload for GetUpdates

§

type Output = Vec<Update, Global>

source§

const NAME: &'static str = _

source§

impl Payload for GetUserProfilePhotos

§

type Output = UserProfilePhotos

source§

const NAME: &'static str = _

source§

impl Payload for GetWebhookInfo

§

type Output = WebhookInfo

source§

const NAME: &'static str = _

source§

impl Payload for HideGeneralForumTopic

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for KickChatMember

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for LeaveChat

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for LogOut

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for PinChatMessage

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for PromoteChatMember

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for ReopenForumTopic

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for ReopenGeneralForumTopic

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for RestrictChatMember

§

type Output = True

source§

const NAME: &'static str = _

§

type Output = String

source§

const NAME: &'static str = _

source§

impl Payload for SendAnimation

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for SendAudio

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for SendChatAction

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for SendContact

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for SendDice

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for SendDocument

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for SendGame

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for SendInvoice

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for SendLocation

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for SendMediaGroup

§

type Output = Vec<Message, Global>

source§

const NAME: &'static str = _

source§

impl Payload for SendMessage

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for SendPhoto

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for SendPoll

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for SendSticker

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for SendVenue

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for SendVideo

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for SendVideoNote

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for SendVoice

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for SetChatAdministratorCustomTitle

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for SetChatDescription

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for SetChatMenuButton

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for SetChatPermissions

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for SetChatPhoto

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for SetChatStickerSet

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for SetChatTitle

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for SetGameScore

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for SetGameScoreInline

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for SetMyCommands

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for SetMyDefaultAdministratorRights

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for SetPassportDataErrors

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for SetStickerPositionInSet

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for SetStickerSetThumb

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for SetWebhook

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for StopMessageLiveLocation

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for StopMessageLiveLocationInline

§

type Output = Message

source§

const NAME: &'static str = _

source§

impl Payload for StopPoll

§

type Output = Poll

source§

const NAME: &'static str = _

source§

impl Payload for UnbanChatMember

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for UnbanChatSenderChat

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for UnhideGeneralForumTopic

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for UnpinAllChatMessages

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for UnpinAllForumTopicMessages

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for UnpinChatMessage

§

type Output = True

source§

const NAME: &'static str = _

source§

impl Payload for UploadStickerFile

§

type Output = FileMeta

source§

const NAME: &'static str = _