pub struct PollAnswerHandler { /* private fields */ }Expand description
Handler for Update.poll_answer.
Bots receive poll answer updates only for polls they sent.
Implementations§
Source§impl PollAnswerHandler
impl PollAnswerHandler
Sourcepub fn new(callback: HandlerCallback, block: bool) -> Self
pub fn new(callback: HandlerCallback, block: bool) -> Self
Create a new PollAnswerHandler.
Trait Implementations§
Source§impl Handler for PollAnswerHandler
impl Handler for PollAnswerHandler
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 PollAnswerHandler
impl !RefUnwindSafe for PollAnswerHandler
impl Send for PollAnswerHandler
impl Sync for PollAnswerHandler
impl Unpin for PollAnswerHandler
impl UnsafeUnpin for PollAnswerHandler
impl !UnwindSafe for PollAnswerHandler
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