Struct tbot::contexts::PreCheckout
source · #[non_exhaustive]pub struct PreCheckout {
pub bot: Bot,
pub id: Id,
pub from: User,
pub currency: String,
pub total_amount: u32,
pub invoice_payload: String,
pub shipping_option_id: Option<String>,
pub order_info: Option<OrderInfo>,
}
Expand description
The context for pre_checkout
handlers.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.bot: Bot
A bot for calling API without information inference.
id: Id
The ID of the query.
from: User
The user who sent the query.
currency: String
The currency of of the invoice.
total_amount: u32
The total price.
invoice_payload: String
The invoice payload sent previously by the bot.
shipping_option_id: Option<String>
The ID of the chosen shipping option.
order_info: Option<OrderInfo>
The order information.
Implementations§
source§impl PreCheckout
impl PreCheckout
sourcepub fn ok(&self) -> AnswerPreCheckoutQuery<'_>
pub fn ok(&self) -> AnswerPreCheckoutQuery<'_>
Reports that shipping is possible and shows possible shipping options.
sourcepub fn err(&self, err: impl Into<String>) -> AnswerPreCheckoutQuery<'_>
pub fn err(&self, err: impl Into<String>) -> AnswerPreCheckoutQuery<'_>
Reports that shipping is impossible and shows the error message.
Trait Implementations§
source§impl Clone for PreCheckout
impl Clone for PreCheckout
source§fn clone(&self) -> PreCheckout
fn clone(&self) -> PreCheckout
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more