pub struct InlineQueryHandler { /* private fields */ }Expand description
Handler for Update.inline_query.
§Matching rules
- The update must carry an
inline_query. - If
chat_typesis set, the inline query’schat_typemust be in the list. Queries withoutchat_type(e.g. from secret chats) are rejected. - If
patternis set,re.match(pattern, query)must succeed. - When all checks pass, captured groups (if any) are returned as
MatchResult::RegexMatchorMatchResult::RegexMatchWithNames(when the pattern contains named capture groups).
Implementations§
Trait Implementations§
Source§impl Handler for InlineQueryHandler
impl Handler for InlineQueryHandler
Source§fn collect_additional_context(
&self,
context: &mut CallbackContext,
match_result: &MatchResult,
)
fn collect_additional_context( &self, context: &mut CallbackContext, match_result: &MatchResult, )
Populate context.matches (positional) and context.named_matches
(named groups) from the regex match result.
Source§fn check_update(&self, update: &Update) -> Option<MatchResult>
fn check_update(&self, update: &Update) -> Option<MatchResult>
Determine whether this handler is interested in
update. Read moreSource§fn handle_update(
&self,
update: Arc<Update>,
match_result: MatchResult,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send>>
fn handle_update( &self, update: Arc<Update>, match_result: MatchResult, ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send>>
Process the update. Called only when
check_update
returned Some.Source§fn block(&self) -> bool
fn block(&self) -> bool
Whether the application should block on this handler’s future before
dispatching to the next handler group.
Source§fn handle_update_with_context(
&self,
update: Arc<Update>,
match_result: MatchResult,
_context: CallbackContext,
) -> Pin<Box<dyn Future<Output = HandlerResult> + Send>>
fn handle_update_with_context( &self, update: Arc<Update>, match_result: MatchResult, _context: CallbackContext, ) -> Pin<Box<dyn Future<Output = HandlerResult> + Send>>
Process the update with an Application-provided
CallbackContext. Read moreAuto Trait Implementations§
impl Freeze for InlineQueryHandler
impl !RefUnwindSafe for InlineQueryHandler
impl Send for InlineQueryHandler
impl Sync for InlineQueryHandler
impl Unpin for InlineQueryHandler
impl UnsafeUnpin for InlineQueryHandler
impl !UnwindSafe for InlineQueryHandler
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more