pub struct Invoice {
pub currency: String,
pub description: String,
pub start_parameter: String,
pub title: String,
pub total_amount: i64,
}
Expand description
Represents an invoice.
Fields§
§currency: String
Three-letter ISO 4217 currency code.
description: String
Product description.
start_parameter: String
Unique bot deep-linking parameter that can be used to generate this invoice.
title: String
Product name.
total_amount: i64
Total price in the smallest units of the currency (integer, not float/double).
For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
Implementations§
source§impl Invoice
impl Invoice
sourcepub fn new<A, B, C, D>(
currency: A,
description: B,
start_parameter: C,
title: D,
total_amount: i64
) -> Invoice
pub fn new<A, B, C, D>( currency: A, description: B, start_parameter: C, title: D, total_amount: i64 ) -> Invoice
Creates a new Invoice
.
§Arguments
currency
- ISO 4217 currency code.description
- Product description.start_parameter
- Unique bot deep-linking parameter.title
- Product name.total_amount
- Total price.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Invoice
impl<'de> Deserialize<'de> for Invoice
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<Invoice, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<Invoice, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<Invoice> for ExternalReplyData
impl From<Invoice> for ExternalReplyData
source§fn from(original: Invoice) -> ExternalReplyData
fn from(original: Invoice) -> ExternalReplyData
Converts to this type from the input type.
source§impl PartialEq for Invoice
impl PartialEq for Invoice
source§impl PartialOrd for Invoice
impl PartialOrd for Invoice
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for Invoice
impl Serialize for Invoice
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for Invoice
Auto Trait Implementations§
impl Freeze for Invoice
impl RefUnwindSafe for Invoice
impl Send for Invoice
impl Sync for Invoice
impl Unpin for Invoice
impl UnwindSafe for Invoice
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more