Struct teloxide::adaptors::AutoSend[][src]

pub struct AutoSend<B> { /* fields omitted */ }

Send requests automatically.

Requests returned by <AutoSend<_> as Requester> are Futures which means that you can simply .await them instead of using .send().await.

Notes:

  1. This wrapper should be the most outer i.e.: AutoSend<CacheMe<Bot>> will automatically send requests, while CacheMe<AutoSend<Bot>> - won’t.
  2. After first call to poll on a request you will be unable to access payload nor could you use send_ref.

Examples

use teloxide_core::{
    requests::{Requester, RequesterExt},
    types::Me,
    Bot,
};

let bot = Bot::new("TOKEN").auto_send();
let myself: Me = bot.get_me().await?; // No .send()!

Implementations

impl<B> AutoSend<B>[src]

pub fn new(inner: B) -> AutoSend<B>[src]

Creates new AutoSend.

Note: it’s recommended to use RequesterExt::auto_send instead.

pub fn inner(&self) -> &B[src]

Allows to access the inner bot.

pub fn into_inner(self) -> B[src]

Unwraps the inner bot.

Trait Implementations

impl<B> Clone for AutoSend<B> where
    B: Clone
[src]

impl<'w, B> Download<'w> for AutoSend<B> where
    B: Download<'w>, 
[src]

type Err = <B as Download<'w>>::Err

An error returned from download_file.

type Fut = <B as Download<'w>>::Fut

A future returned from download_file.

type StreamErr = <B as Download<'w>>::StreamErr

An error returned from download_file_stream. Read more

type Stream = <B as Download<'w>>::Stream

A stream returned from download_file_stream. Read more

impl<B> Requester for AutoSend<B> where
    B: Requester
[src]

type Err = <B as Requester>::Err

Error type returned by all requests.

type GetMe = AutoRequest<<B as Requester>::GetMe>

type LogOut = AutoRequest<<B as Requester>::LogOut>

type Close = AutoRequest<<B as Requester>::Close>

type GetUpdates = AutoRequest<<B as Requester>::GetUpdates>

type SetWebhook = AutoRequest<<B as Requester>::SetWebhook>

type DeleteWebhook = AutoRequest<<B as Requester>::DeleteWebhook>

type GetWebhookInfo = AutoRequest<<B as Requester>::GetWebhookInfo>

type ForwardMessage = AutoRequest<<B as Requester>::ForwardMessage>

type CopyMessage = AutoRequest<<B as Requester>::CopyMessage>

type SendMessage = AutoRequest<<B as Requester>::SendMessage>

type SendPhoto = AutoRequest<<B as Requester>::SendPhoto>

type SendAudio = AutoRequest<<B as Requester>::SendAudio>

type SendDocument = AutoRequest<<B as Requester>::SendDocument>

type SendVideo = AutoRequest<<B as Requester>::SendVideo>

type SendAnimation = AutoRequest<<B as Requester>::SendAnimation>

type SendVoice = AutoRequest<<B as Requester>::SendVoice>

type SendVideoNote = AutoRequest<<B as Requester>::SendVideoNote>

type SendMediaGroup = AutoRequest<<B as Requester>::SendMediaGroup>

type SendLocation = AutoRequest<<B as Requester>::SendLocation>

type EditMessageLiveLocation = AutoRequest<<B as Requester>::EditMessageLiveLocation>

type EditMessageLiveLocationInline = AutoRequest<<B as Requester>::EditMessageLiveLocationInline>

type StopMessageLiveLocation = AutoRequest<<B as Requester>::StopMessageLiveLocation>

type StopMessageLiveLocationInline = AutoRequest<<B as Requester>::StopMessageLiveLocationInline>

type SendVenue = AutoRequest<<B as Requester>::SendVenue>

type SendContact = AutoRequest<<B as Requester>::SendContact>

type SendPoll = AutoRequest<<B as Requester>::SendPoll>

type SendDice = AutoRequest<<B as Requester>::SendDice>

type SendChatAction = AutoRequest<<B as Requester>::SendChatAction>

type GetUserProfilePhotos = AutoRequest<<B as Requester>::GetUserProfilePhotos>

type GetFile = AutoRequest<<B as Requester>::GetFile>

type KickChatMember = AutoRequest<<B as Requester>::KickChatMember>

type UnbanChatMember = AutoRequest<<B as Requester>::UnbanChatMember>

type RestrictChatMember = AutoRequest<<B as Requester>::RestrictChatMember>

type PromoteChatMember = AutoRequest<<B as Requester>::PromoteChatMember>

type SetChatAdministratorCustomTitle = AutoRequest<<B as Requester>::SetChatAdministratorCustomTitle>

type SetChatPermissions = AutoRequest<<B as Requester>::SetChatPermissions>

type SetChatPhoto = AutoRequest<<B as Requester>::SetChatPhoto>

type DeleteChatPhoto = AutoRequest<<B as Requester>::DeleteChatPhoto>

type SetChatTitle = AutoRequest<<B as Requester>::SetChatTitle>

type SetChatDescription = AutoRequest<<B as Requester>::SetChatDescription>

type PinChatMessage = AutoRequest<<B as Requester>::PinChatMessage>

type UnpinChatMessage = AutoRequest<<B as Requester>::UnpinChatMessage>

type UnpinAllChatMessages = AutoRequest<<B as Requester>::UnpinAllChatMessages>

type LeaveChat = AutoRequest<<B as Requester>::LeaveChat>

type GetChat = AutoRequest<<B as Requester>::GetChat>

type GetChatAdministrators = AutoRequest<<B as Requester>::GetChatAdministrators>

type GetChatMembersCount = AutoRequest<<B as Requester>::GetChatMembersCount>

type GetChatMember = AutoRequest<<B as Requester>::GetChatMember>

type SetChatStickerSet = AutoRequest<<B as Requester>::SetChatStickerSet>

type DeleteChatStickerSet = AutoRequest<<B as Requester>::DeleteChatStickerSet>

type AnswerCallbackQuery = AutoRequest<<B as Requester>::AnswerCallbackQuery>

type SetMyCommands = AutoRequest<<B as Requester>::SetMyCommands>

type GetMyCommands = AutoRequest<<B as Requester>::GetMyCommands>

type AnswerInlineQuery = AutoRequest<<B as Requester>::AnswerInlineQuery>

type EditMessageText = AutoRequest<<B as Requester>::EditMessageText>

type EditMessageTextInline = AutoRequest<<B as Requester>::EditMessageTextInline>

type EditMessageCaption = AutoRequest<<B as Requester>::EditMessageCaption>

type EditMessageCaptionInline = AutoRequest<<B as Requester>::EditMessageCaptionInline>

type EditMessageMedia = AutoRequest<<B as Requester>::EditMessageMedia>

type EditMessageMediaInline = AutoRequest<<B as Requester>::EditMessageMediaInline>

type EditMessageReplyMarkup = AutoRequest<<B as Requester>::EditMessageReplyMarkup>

type EditMessageReplyMarkupInline = AutoRequest<<B as Requester>::EditMessageReplyMarkupInline>

type StopPoll = AutoRequest<<B as Requester>::StopPoll>

type DeleteMessage = AutoRequest<<B as Requester>::DeleteMessage>

type SendSticker = AutoRequest<<B as Requester>::SendSticker>

type GetStickerSet = AutoRequest<<B as Requester>::GetStickerSet>

type UploadStickerFile = AutoRequest<<B as Requester>::UploadStickerFile>

type CreateNewStickerSet = AutoRequest<<B as Requester>::CreateNewStickerSet>

type AddStickerToSet = AutoRequest<<B as Requester>::AddStickerToSet>

type SetStickerPositionInSet = AutoRequest<<B as Requester>::SetStickerPositionInSet>

type DeleteStickerFromSet = AutoRequest<<B as Requester>::DeleteStickerFromSet>

type SetStickerSetThumb = AutoRequest<<B as Requester>::SetStickerSetThumb>

type SendInvoice = AutoRequest<<B as Requester>::SendInvoice>

type AnswerShippingQuery = AutoRequest<<B as Requester>::AnswerShippingQuery>

type AnswerPreCheckoutQuery = AutoRequest<<B as Requester>::AnswerPreCheckoutQuery>

type SetPassportDataErrors = AutoRequest<<B as Requester>::SetPassportDataErrors>

type SendGame = AutoRequest<<B as Requester>::SendGame>

type SetGameScore = AutoRequest<<B as Requester>::SetGameScore>

type SetGameScoreInline = AutoRequest<<B as Requester>::SetGameScoreInline>

type GetGameHighScores = AutoRequest<<B as Requester>::GetGameHighScores>

type GetUpdatesFaultTolerant = AutoRequest<<B as Requester>::GetUpdatesFaultTolerant>

Auto Trait Implementations

impl<B> RefUnwindSafe for AutoSend<B> where
    B: RefUnwindSafe

impl<B> Send for AutoSend<B> where
    B: Send

impl<B> Sync for AutoSend<B> where
    B: Sync

impl<B> Unpin for AutoSend<B> where
    B: Unpin

impl<B> UnwindSafe for AutoSend<B> where
    B: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<Choices> CoproductSubsetter<CNil, HNil> for Choices

type Remainder = Choices

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U, I> LiftInto<U, I> for T where
    U: LiftFrom<T, I>, 

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> RequesterExt for T where
    T: Requester
[src]

impl<Source> Sculptor<HNil, HNil> for Source

type Remainder = Source

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.