Skip to main content

FromUpdate

Trait FromUpdate 

Source
pub trait FromUpdate<'r, T: Sync>
where Self: Sized,
{ // Required method fn from_update( bot: &'r Bot, update: &'r Update, state: Option<&'r BotState<T>>, ) -> Option<Self>; }
Expand description

Allow a parameter to be parsed from an update and the bot state. Any type implementing this trait can be used as parameter in a handler

Required Methods§

Source

fn from_update( bot: &'r Bot, update: &'r Update, state: Option<&'r BotState<T>>, ) -> Option<Self>

Instantiate Self from an incoming update

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<'r, T: Sync> FromUpdate<'r, T> for &'r Update

Source§

impl<'r, T: Sync> FromUpdate<'r, T> for &'r Message

Source§

impl<'r, T: Sync> FromUpdate<'r, T> for &'r Bot

Source§

impl<'r, T: Sync> FromUpdate<'r, T> for &'r BotState<T>

Source§

impl<'r, T: Sync> FromUpdate<'r, T> for ChatId