[−][src]Struct tbot::state::StatefulEventLoop
A stateful event loop.
Implementations
impl<S> StatefulEventLoop<S>
[src]
#[must_use]pub fn get_state(&self) -> Arc<S>
[src]
Returns an Arc
to the state.
pub fn into_stateless(self) -> EventLoop
[src]
Turns this event loop into a stateless one. Handlers added on this event loop are still kept.
pub fn with_other_state<T>(self, other_state: T) -> StatefulEventLoop<T> where
T: Send + Sync + 'static,
[src]
T: Send + Sync + 'static,
Turns this event loop into another with other state. Handlers added on this event loop are still kept and will receive the previous state.
pub fn username(&mut self, username: String)
[src]
Sets the bot's username.
The username is used when checking if a command such as
/command@username
was directed to the bot.
pub fn polling(self) -> Polling
[src]
Starts polling configuration.
pub fn webhook(self, url: &str, port: u16) -> Webhook<'_>
[src]
Starts webhook configuration.
See our wiki to learn how to use webhook with tbot
.
impl<S> StatefulEventLoop<S> where
S: Send + Sync + 'static,
[src]
S: Send + Sync + 'static,
pub fn command<H, F>(&mut self, command: &'static str, handler: H) where
H: Fn(Arc<Command<Text>>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Command<Text>>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for a command.
Note that commands such as /command@username
will be completely
ignored unless you configure the event loop with your bot's username
with either username
or fetch_username
.
pub fn command_if<H, HF, P, PF>(
&mut self,
command: &'static str,
predicate: P,
handler: H
) where
H: Fn(Arc<Command<Text>>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Command<Text>>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
&mut self,
command: &'static str,
predicate: P,
handler: H
) where
H: Fn(Arc<Command<Text>>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Command<Text>>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for a command which is run if the predicate returns true.
Note that commands such as /command@username
will be completely
ignored unless you configure the event loop with your bot's username
with either username
or fetch_username
.
pub fn commands<Cm, H, F>(&mut self, commands: Cm, handler: H) where
Cm: IntoIterator<Item = &'static str>,
H: Fn(Arc<Command<Text>>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
Cm: IntoIterator<Item = &'static str>,
H: Fn(Arc<Command<Text>>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for a sequence of commands.
Note that commands such as /command@username
will be completely
ignored unless you configure the event loop with your bot's username
with either username
or fetch_username
.
pub fn commands_if<Cm, H, HF, P, PF>(
&mut self,
commands: Cm,
predicate: P,
handler: H
) where
Cm: IntoIterator<Item = &'static str>,
H: Fn(Arc<Command<Text>>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Command<Text>>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
&mut self,
commands: Cm,
predicate: P,
handler: H
) where
Cm: IntoIterator<Item = &'static str>,
H: Fn(Arc<Command<Text>>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Command<Text>>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for a sequence of commands which is run if the predicate returns true.
Note that commands such as /command@username
will be completely
ignored unless you configure the event loop with your bot's username
with either username
or fetch_username
.
pub fn start<H, F>(&mut self, handler: H) where
H: Fn(Arc<Command<Text>>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Command<Text>>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for the /start
command.
pub fn start_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Command<Text>>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Command<Text>>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Command<Text>>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Command<Text>>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for the /start
command which is run
if the predicate returns true.
pub fn help<H, F>(&mut self, handler: H) where
H: Fn(Arc<Command<Text>>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Command<Text>>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for the /help
command.
pub fn help_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Command<Text>>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Command<Text>>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Command<Text>>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Command<Text>>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for the /help
command which is run if the predicate
returns true.
pub fn settings<H, F>(&mut self, handler: H) where
H: Fn(Arc<Command<Text>>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Command<Text>>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for the /settings
command.
pub fn settings_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Command<Text>>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Command<Text>>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Command<Text>>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Command<Text>>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for the /settings
command which is run
if the predicate returns true.
pub fn edited_command<H, F>(&mut self, command: &'static str, handler: H) where
H: Fn(Arc<Command<EditedText>>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Command<EditedText>>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for an edited command.
pub fn edited_command_if<H, HF, P, PF>(
&mut self,
command: &'static str,
predicate: P,
handler: H
) where
H: Fn(Arc<Command<EditedText>>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Command<EditedText>>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
&mut self,
command: &'static str,
predicate: P,
handler: H
) where
H: Fn(Arc<Command<EditedText>>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Command<EditedText>>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for an edited command which is run if the predicate returns true.
pub fn edited_commands<Cm, H, F>(&mut self, commands: Cm, handler: H) where
Cm: IntoIterator<Item = &'static str>,
H: Fn(Arc<Command<EditedText>>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
Cm: IntoIterator<Item = &'static str>,
H: Fn(Arc<Command<EditedText>>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for a sequence of edited commands.
pub fn edited_commands_if<Cm, H, HF, P, PF>(
&mut self,
commands: Cm,
predicate: P,
handler: H
) where
Cm: IntoIterator<Item = &'static str>,
H: Fn(Arc<Command<EditedText>>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Command<EditedText>>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
&mut self,
commands: Cm,
predicate: P,
handler: H
) where
Cm: IntoIterator<Item = &'static str>,
H: Fn(Arc<Command<EditedText>>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Command<EditedText>>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for a sequence of edited commands which is run if the predicate returns true.
pub fn after_update<H, F>(&mut self, handler: H) where
H: Fn(Arc<Update>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Update>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler which is run after handling an update.
pub fn after_update_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Update>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Update>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Update>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Update>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler which is run after handling an update and if the predicate returns true.
pub fn animation<H, F>(&mut self, handler: H) where
H: Fn(Arc<Animation>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Animation>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for animations.
pub fn animation_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Animation>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Animation>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Animation>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Animation>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for animations which is run if the predicate returns true.
pub fn audio<H, F>(&mut self, handler: H) where
H: Fn(Arc<Audio>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Audio>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for audio.
pub fn audio_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Audio>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Audio>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Audio>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Audio>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for audio which is run if the predicate returns true.
pub fn before_update<H, F>(&mut self, handler: H) where
H: Fn(Arc<Update>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Update>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler which is run before handling an update.
pub fn before_update_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Update>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Update>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Update>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Update>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler which is run before handling an update and if the predicate returns true.
pub fn chosen_inline<H, F>(&mut self, handler: H) where
H: Fn(Arc<ChosenInline>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<ChosenInline>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for chosen inline results.
pub fn chosen_inline_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<ChosenInline>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<ChosenInline>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<ChosenInline>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<ChosenInline>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for chosen inline results which is run if the predicate returns true.
pub fn contact<H, F>(&mut self, handler: H) where
H: Fn(Arc<Contact>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Contact>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for contacts.
pub fn contact_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Contact>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Contact>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Contact>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Contact>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for contacts which is run if the predicate returns true.
pub fn connected_website<H, F>(&mut self, handler: H) where
H: Fn(Arc<ConnectedWebsite>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<ConnectedWebsite>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for connected websites.
pub fn connected_website_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<ConnectedWebsite>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<ConnectedWebsite>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<ConnectedWebsite>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<ConnectedWebsite>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for connected websites which is run if the predicate returns true.
pub fn created_group<H, F>(&mut self, handler: H) where
H: Fn(Arc<CreatedGroup>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<CreatedGroup>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for created groups.
pub fn created_group_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<CreatedGroup>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<CreatedGroup>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<CreatedGroup>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<CreatedGroup>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for created groups which is run if the predicate returns true.
pub fn data_callback<H, F>(&mut self, handler: H) where
H: Fn(Arc<DataCallback>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<DataCallback>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for data callbacks.
pub fn data_callback_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<DataCallback>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<DataCallback>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<DataCallback>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<DataCallback>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for data callbacks which is run if the predicate returns true.
pub fn deleted_chat_photo<H, F>(&mut self, handler: H) where
H: Fn(Arc<DeletedChatPhoto>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<DeletedChatPhoto>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for deleted chat photos.
pub fn deleted_chat_photo_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<DeletedChatPhoto>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<DeletedChatPhoto>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<DeletedChatPhoto>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<DeletedChatPhoto>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for deleted chat photos which is run if the predicate returns true.
pub fn dice<H, F>(&mut self, handler: H) where
H: Fn(Arc<Dice>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Dice>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for dice.
pub fn dice_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Dice>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Dice>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Dice>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Dice>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for dice which is run if the predicate returns true.
pub fn document<H, F>(&mut self, handler: H) where
H: Fn(Arc<Document>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Document>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for documents.
pub fn document_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Document>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Document>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Document>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Document>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for documents which is run if the predicate returns true.
pub fn edited_animation<H, F>(&mut self, handler: H) where
H: Fn(Arc<EditedAnimation>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<EditedAnimation>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for edited animations.
pub fn edited_animation_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<EditedAnimation>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<EditedAnimation>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<EditedAnimation>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<EditedAnimation>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for edited animations which is run if the predicate returns true.
pub fn edited_audio<H, F>(&mut self, handler: H) where
H: Fn(Arc<EditedAudio>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<EditedAudio>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for edited audio.
pub fn edited_audio_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<EditedAudio>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<EditedAudio>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<EditedAudio>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<EditedAudio>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for edited audio which is run if the predicate returns true.
pub fn edited_document<H, F>(&mut self, handler: H) where
H: Fn(Arc<EditedDocument>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<EditedDocument>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for edited documents.
pub fn edited_document_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<EditedDocument>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<EditedDocument>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<EditedDocument>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<EditedDocument>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for edited documents which is run if the predicate returns true.
pub fn edited_location<H, F>(&mut self, handler: H) where
H: Fn(Arc<EditedLocation>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<EditedLocation>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for edited locations.
pub fn edited_location_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<EditedLocation>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<EditedLocation>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<EditedLocation>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<EditedLocation>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for edited locations which is run if the predicate returns true.
pub fn edited_photo<H, F>(&mut self, handler: H) where
H: Fn(Arc<EditedPhoto>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<EditedPhoto>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for edited photos.
pub fn edited_photo_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<EditedPhoto>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<EditedPhoto>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<EditedPhoto>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<EditedPhoto>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for edited photos which is run if the predicate returns true.
pub fn edited_text<H, F>(&mut self, handler: H) where
H: Fn(Arc<EditedText>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<EditedText>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for edited text messages.
pub fn edited_text_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<EditedText>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<EditedText>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<EditedText>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<EditedText>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for edited text messages which is run if the predicate returns true.
pub fn edited_video<H, F>(&mut self, handler: H) where
H: Fn(Arc<EditedVideo>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<EditedVideo>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for edited videos.
pub fn edited_video_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<EditedVideo>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<EditedVideo>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<EditedVideo>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<EditedVideo>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for edited videos which is run if the predicate returns true.
pub fn game_callback<H, F>(&mut self, handler: H) where
H: Fn(Arc<GameCallback>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<GameCallback>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for game callbacks.
pub fn game_callback_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<GameCallback>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<GameCallback>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<GameCallback>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<GameCallback>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for game callbacks which is run if the predicate returns true.
pub fn game<H, F>(&mut self, handler: H) where
H: Fn(Arc<Game>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Game>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for game messages.
pub fn game_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Game>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Game>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Game>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Game>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for game messages which is run if the predicate returns true.
pub fn inline<H, F>(&mut self, handler: H) where
H: Fn(Arc<Inline>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Inline>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for inline queries.
pub fn inline_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Inline>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Inline>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Inline>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Inline>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for inline queries which is run if the predicate returns true.
pub fn invoice<H, F>(&mut self, handler: H) where
H: Fn(Arc<Invoice>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Invoice>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for invoices.
pub fn invoice_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Invoice>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Invoice>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Invoice>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Invoice>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for invoices which is run if the predicate returns true.
pub fn left_member<H, F>(&mut self, handler: H) where
H: Fn(Arc<LeftMember>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<LeftMember>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for left members.
pub fn left_member_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<LeftMember>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<LeftMember>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<LeftMember>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<LeftMember>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for left members which is run if the predicate returns true.
pub fn location<H, F>(&mut self, handler: H) where
H: Fn(Arc<Location>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Location>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for locations.
pub fn location_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Location>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Location>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Location>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Location>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for locations which is run if the predicate returns true.
pub fn migration<H, F>(&mut self, handler: H) where
H: Fn(Arc<Migration>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Migration>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for migrations.
pub fn migration_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Migration>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Migration>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Migration>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Migration>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for migrations which is run if the predicate returns true.
pub fn new_chat_photo<H, F>(&mut self, handler: H) where
H: Fn(Arc<NewChatPhoto>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<NewChatPhoto>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for new chat photos.
pub fn new_chat_photo_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<NewChatPhoto>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<NewChatPhoto>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<NewChatPhoto>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<NewChatPhoto>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for new chat photos which is run if the predicate returns true.
pub fn new_chat_title<H, F>(&mut self, handler: H) where
H: Fn(Arc<NewChatTitle>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<NewChatTitle>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for new chat titles.
pub fn new_chat_title_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<NewChatTitle>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<NewChatTitle>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<NewChatTitle>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<NewChatTitle>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for new chat titles which is run if the predicate returns true.
pub fn new_members<H, F>(&mut self, handler: H) where
H: Fn(Arc<NewMembers>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<NewMembers>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for new members.
pub fn new_members_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<NewMembers>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<NewMembers>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<NewMembers>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<NewMembers>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for new members which is run if the predicate returns true.
pub fn passport<H, F>(&mut self, handler: H) where
H: Fn(Arc<Passport>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Passport>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for passport data.
pub fn passport_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Passport>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Passport>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Passport>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Passport>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for passport data which is run if the predicate returns true.
pub fn payment<H, F>(&mut self, handler: H) where
H: Fn(Arc<Payment>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Payment>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for successful payments.
pub fn payment_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Payment>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Payment>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Payment>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Payment>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for successful payments which is run if the predicate returns true.
pub fn photo<H, F>(&mut self, handler: H) where
H: Fn(Arc<Photo>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Photo>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for photos.
pub fn photo_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Photo>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Photo>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Photo>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Photo>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for photos which is run if the predicate returns true.
pub fn pinned_message<H, F>(&mut self, handler: H) where
H: Fn(Arc<PinnedMessage>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<PinnedMessage>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for pinned messages.
pub fn pinned_message_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<PinnedMessage>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<PinnedMessage>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<PinnedMessage>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<PinnedMessage>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for pinned messages which is run if the predicate returns true.
pub fn poll<H, F>(&mut self, handler: H) where
H: Fn(Arc<Poll>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Poll>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for poll messages.
pub fn poll_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Poll>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Poll>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Poll>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Poll>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for poll messages which is run if the predicate returns true.
pub fn pre_checkout<H, F>(&mut self, handler: H) where
H: Fn(Arc<PreCheckout>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<PreCheckout>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for pre-checkout queries.
pub fn pre_checkout_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<PreCheckout>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<PreCheckout>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<PreCheckout>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<PreCheckout>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for pre-checkout queries which is run if the predicate returns true.
pub fn shipping<H, F>(&mut self, handler: H) where
H: Fn(Arc<Shipping>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Shipping>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for shipping queries.
pub fn shipping_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Shipping>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Shipping>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Shipping>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Shipping>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for shipping queries which is run if the predicate returns true.
pub fn sticker<H, F>(&mut self, handler: H) where
H: Fn(Arc<Sticker>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Sticker>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for stickers.
pub fn sticker_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Sticker>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Sticker>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Sticker>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Sticker>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for stickers which is run if the predicate returns true.
pub fn text<H, F>(&mut self, handler: H) where
H: Fn(Arc<Text>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Text>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for text messages.
pub fn text_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Text>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Text>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Text>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Text>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for text messages which is run if the predicate returns true.
pub fn unhandled<H, F>(&mut self, handler: H) where
H: Fn(Arc<Unhandled>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Unhandled>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for unhandled updates.
pub fn unhandled_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Unhandled>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Unhandled>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Unhandled>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Unhandled>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for unhandled updates which is run if the predicate returns true.
pub fn updated_poll<H, F>(&mut self, handler: H) where
H: Fn(Arc<UpdatedPoll>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<UpdatedPoll>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for new states of polls.
pub fn updated_poll_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<UpdatedPoll>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<UpdatedPoll>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<UpdatedPoll>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<UpdatedPoll>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for new states of polls which is run if the predicate returns true.
pub fn poll_answer<H, F>(&mut self, handler: H) where
H: Fn(Arc<PollAnswer>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<PollAnswer>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for new answers in the poll.
pub fn poll_answer_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<PollAnswer>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<PollAnswer>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<PollAnswer>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<PollAnswer>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for new answers in the poll which is run if the predicate returns true.
pub fn venue<H, F>(&mut self, handler: H) where
H: Fn(Arc<Venue>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Venue>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for venues.
pub fn venue_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Venue>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Venue>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Venue>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Venue>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for venues which is run if the predicate returns true.
pub fn video<H, F>(&mut self, handler: H) where
H: Fn(Arc<Video>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Video>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for videos.
pub fn video_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Video>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Video>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Video>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Video>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for videos which is run if the predicate returns true.
pub fn video_note<H, F>(&mut self, handler: H) where
H: Fn(Arc<VideoNote>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<VideoNote>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for video notes.
pub fn video_note_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<VideoNote>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<VideoNote>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<VideoNote>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<VideoNote>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for video notes which is run if the predicate returns true.
pub fn voice<H, F>(&mut self, handler: H) where
H: Fn(Arc<Voice>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
[src]
H: Fn(Arc<Voice>, Arc<S>) -> F + Send + Sync + 'static,
F: Future<Output = ()> + Send + 'static,
Adds a new handler for voice messages.
pub fn voice_if<H, HF, P, PF>(&mut self, predicate: P, handler: H) where
H: Fn(Arc<Voice>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Voice>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
[src]
H: Fn(Arc<Voice>, Arc<S>) -> HF + Send + Sync + 'static,
HF: Future<Output = ()> + Send + 'static,
P: Fn(Arc<Voice>, Arc<S>) -> PF + Send + Sync + 'static,
PF: Future<Output = bool> + Send + 'static,
Adds a new handler for voice messages which is run if the predicate returns true.
impl<S> StatefulEventLoop<S>
[src]
pub async fn fetch_username<'_>(&'_ mut self) -> Result<(), MethodCall>
[src]
Fetches the bot's username.
The username is used when checking if a command such as
/command@username
was directed to the bot.
Auto Trait Implementations
impl<S> !RefUnwindSafe for StatefulEventLoop<S>
impl<S> Send for StatefulEventLoop<S> where
S: Send + Sync,
S: Send + Sync,
impl<S> Sync for StatefulEventLoop<S> where
S: Send + Sync,
S: Send + Sync,
impl<S> Unpin for StatefulEventLoop<S>
impl<S> !UnwindSafe for StatefulEventLoop<S>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> WithSubscriber for T
[src]
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,