pub enum InputMessageContent {
Text(InputTextMessageContent),
Rich(InputRichMessageContent),
Venue(InputVenueMessageContent),
Location(InputLocationMessageContent),
Contact(InputContactMessageContent),
Invoice(InputInvoiceMessageContent),
}Expand description
The content of a message sent as the result of an inline query.
§Variant order is load-bearing
This enum is #[serde(untagged)], so serde takes the first variant that
matches, and it ignores fields the variant does not declare. Venue
requires everything Location requires (latitude, longitude) plus
title and address — a strict superset — so Venue must be tried first.
With Location first, every venue deserialized as a location and silently
lost its title and address.
Adding a variant whose required fields are a superset of an existing one
means placing it above that one. Venue and Location are the only such
pair today; the others have disjoint required fields and their order is free.
Variants§
Text(InputTextMessageContent)
The message text.
Rich(InputRichMessageContent)
A rich formatted message.
Venue(InputVenueMessageContent)
A venue. Declared before Location — see the note above.
Location(InputLocationMessageContent)
A location on a map.
Contact(InputContactMessageContent)
A contact.
Invoice(InputInvoiceMessageContent)
An invoice.
Trait Implementations§
Source§impl Clone for InputMessageContent
impl Clone for InputMessageContent
Source§fn clone(&self) -> InputMessageContent
fn clone(&self) -> InputMessageContent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more