pub struct ChatBoostHandler { /* private fields */ }Expand description
Handler for Update.chat_boost and Update.removed_chat_boost.
Implementations§
Source§impl ChatBoostHandler
impl ChatBoostHandler
Sourcepub fn new(
callback: HandlerCallback,
boost_type: ChatBoostType,
chat_ids: HashSet<i64>,
chat_usernames: HashSet<String>,
block: bool,
) -> Self
pub fn new( callback: HandlerCallback, boost_type: ChatBoostType, chat_ids: HashSet<i64>, chat_usernames: HashSet<String>, block: bool, ) -> Self
Create a new ChatBoostHandler.
Trait Implementations§
Source§impl Handler for ChatBoostHandler
impl Handler for ChatBoostHandler
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 collect_additional_context(
&self,
_context: &mut CallbackContext,
_match_result: &MatchResult,
)
fn collect_additional_context( &self, _context: &mut CallbackContext, _match_result: &MatchResult, )
Populate additional context fields (e.g.
context.args, context.matches)
from the match result before the handler callback is invoked. Read moreSource§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 ChatBoostHandler
impl !RefUnwindSafe for ChatBoostHandler
impl Send for ChatBoostHandler
impl Sync for ChatBoostHandler
impl Unpin for ChatBoostHandler
impl UnsafeUnpin for ChatBoostHandler
impl !UnwindSafe for ChatBoostHandler
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