Skip to main content

InputMessageContent

Enum InputMessageContent 

Source
pub enum InputMessageContent {
    InputInvoiceMessageContent(InputInvoiceMessageContent),
    InputVenueMessageContent(InputVenueMessageContent),
    InputLocationMessageContent(InputLocationMessageContent),
    InputContactMessageContent(InputContactMessageContent),
    InputTextMessageContent(InputTextMessageContent),
    InputRichMessageContent(InputRichMessageContent),
}
Expand description

Variants§

§

InputInvoiceMessageContent(InputInvoiceMessageContent)

§

InputVenueMessageContent(InputVenueMessageContent)

§

InputLocationMessageContent(InputLocationMessageContent)

§

InputContactMessageContent(InputContactMessageContent)

§

InputTextMessageContent(InputTextMessageContent)

§

InputRichMessageContent(InputRichMessageContent)

Implementations§

Source§

impl InputMessageContent

Source

pub fn address(&self) -> Option<&str>

Helper method for field address.

Address of the venue

Source

pub fn currency(&self) -> Option<&str>

Helper method for field currency.

Three-letter ISO 4217 currency code, see more on currencies. Pass XTR for payments in Telegram Stars.

Source

pub fn description(&self) -> Option<&str>

Helper method for field description.

Product description, 1-255 characters

Source

pub fn entities(&self) -> Option<&[MessageEntity]>

Helper method for field entities.

List of special entities that appear in message text, which can be specified instead of parse_mode

Source

pub fn first_name(&self) -> Option<&str>

Helper method for field first_name.

Contact’s first name

Source

pub fn foursquare_id(&self) -> Option<&str>

Helper method for field foursquare_id.

Foursquare identifier of the venue, if known

Source

pub fn foursquare_type(&self) -> Option<&str>

Helper method for field foursquare_type.

Foursquare type of the venue, if known. (For example, arts_entertainment/default, arts_entertainment/aquarium or food/icecream.)

Source

pub fn google_place_id(&self) -> Option<&str>

Helper method for field google_place_id.

Google Places identifier of the venue

Source

pub fn google_place_type(&self) -> Option<&str>

Helper method for field google_place_type.

Google Places type of the venue. (See supported types.)

Source

pub fn heading(&self) -> Option<u16>

Helper method for field heading.

For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.

Source

pub fn horizontal_accuracy(&self) -> Option<f64>

Helper method for field horizontal_accuracy.

The radius of uncertainty for the location, measured in meters; 0-1500

Source

pub fn is_flexible(&self) -> Option<bool>

Helper method for field is_flexible.

Pass true if the final price depends on the shipping method. Ignored for payments in Telegram Stars.

Source

pub fn last_name(&self) -> Option<&str>

Helper method for field last_name.

Contact’s last name

Source

pub fn latitude(&self) -> Option<f64>

Helper method for field latitude.

§Variants
  • InputVenueMessageContent. Latitude of the venue in degrees
  • InputLocationMessageContent. Latitude of the location in degrees

Helper method for field link_preview_options.

Link preview generation options for the message

Source

pub fn live_period(&self) -> Option<u32>

Helper method for field live_period.

Period in seconds during which the location can be updated, must be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely

Source

pub fn longitude(&self) -> Option<f64>

Helper method for field longitude.

§Variants
  • InputVenueMessageContent. Longitude of the venue in degrees
  • InputLocationMessageContent. Longitude of the location in degrees
Source

pub fn max_tip_amount(&self) -> Option<i64>

Helper method for field max_tip_amount.

The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_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). Defaults to 0. Not supported for payments in Telegram Stars.

Source

pub fn message_text(&self) -> Option<&str>

Helper method for field message_text.

Text of the message to be sent, 1-4096 characters

Source

pub fn need_email(&self) -> Option<bool>

Helper method for field need_email.

Pass true if you require the user’s email address to complete the order. Ignored for payments in Telegram Stars.

Source

pub fn need_name(&self) -> Option<bool>

Helper method for field need_name.

Pass true if you require the user’s full name to complete the order. Ignored for payments in Telegram Stars.

Source

pub fn need_phone_number(&self) -> Option<bool>

Helper method for field need_phone_number.

Pass true if you require the user’s phone number to complete the order. Ignored for payments in Telegram Stars.

Source

pub fn need_shipping_address(&self) -> Option<bool>

Helper method for field need_shipping_address.

Pass true if you require the user’s shipping address to complete the order. Ignored for payments in Telegram Stars.

Source

pub fn parse_mode(&self) -> Option<&str>

Helper method for field parse_mode.

Mode for parsing entities in the message text. See formatting options for more details.

Source

pub fn payload(&self) -> Option<&str>

Helper method for field payload.

Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes.

Source

pub fn phone_number(&self) -> Option<&str>

Helper method for field phone_number.

Contact’s phone number

Source

pub fn photo_height(&self) -> Option<i64>

Helper method for field photo_height.

Photo height

Source

pub fn photo_size(&self) -> Option<i64>

Helper method for field photo_size.

Photo size in bytes

Source

pub fn photo_url(&self) -> Option<&str>

Helper method for field photo_url.

URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service.

Source

pub fn photo_width(&self) -> Option<i64>

Helper method for field photo_width.

Photo width

Source

pub fn prices(&self) -> Option<&[LabeledPrice]>

Helper method for field prices.

Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.

Source

pub fn provider_data(&self) -> Option<&str>

Helper method for field provider_data.

A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider.

Source

pub fn provider_token(&self) -> Option<&str>

Helper method for field provider_token.

Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.

Source

pub fn proximity_alert_radius(&self) -> Option<u32>

Helper method for field proximity_alert_radius.

For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.

Source

pub fn rich_message(&self) -> Option<&InputRichMessage>

Helper method for field rich_message.

The message to be sent. Only previously uploaded files may be used in the message.

Source

pub fn send_email_to_provider(&self) -> Option<bool>

Helper method for field send_email_to_provider.

Pass true if the user’s email address should be sent to the provider. Ignored for payments in Telegram Stars.

Source

pub fn send_phone_number_to_provider(&self) -> Option<bool>

Helper method for field send_phone_number_to_provider.

Pass true if the user’s phone number should be sent to the provider. Ignored for payments in Telegram Stars.

Source

pub fn suggested_tip_amounts(&self) -> Option<&[i64]>

Helper method for field suggested_tip_amounts.

A JSON-serialized Array of suggested amounts of tip in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.

Source

pub fn title(&self) -> Option<&str>

Helper method for field title.

§Variants
  • InputInvoiceMessageContent. Product name, 1-32 characters
  • InputVenueMessageContent. Name of the venue
Source

pub fn vcard(&self) -> Option<&str>

Helper method for field vcard.

Additional data about the contact in the form of a vCard, 0-2048 bytes

Source

pub fn blocks(&self) -> Option<&[InputRichBlock]>

Helper method for nested field blocks.

Source

pub fn html(&self) -> Option<&str>

Helper method for nested field html.

Source

pub fn is_disabled(&self) -> Option<bool>

Helper method for nested field is_disabled.

Source

pub fn is_rtl(&self) -> Option<bool>

Helper method for nested field is_rtl.

Source

pub fn markdown(&self) -> Option<&str>

Helper method for nested field markdown.

Source

pub fn media(&self) -> Option<&[InputRichMessageMedia]>

Helper method for nested field media.

Source

pub fn prefer_large_media(&self) -> Option<bool>

Helper method for nested field prefer_large_media.

Source

pub fn prefer_small_media(&self) -> Option<bool>

Helper method for nested field prefer_small_media.

Source

pub fn show_above_text(&self) -> Option<bool>

Helper method for nested field show_above_text.

Source

pub fn skip_entity_detection(&self) -> Option<bool>

Helper method for nested field skip_entity_detection.

Source

pub fn url(&self) -> Option<&str>

Helper method for nested field url.

Trait Implementations§

Source§

impl Clone for InputMessageContent

Source§

fn clone(&self) -> InputMessageContent

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InputMessageContent

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for InputMessageContent

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<'a> From<&'a InputMessageContent> for InputMessageContentType

Source§

fn from(val: &'a InputMessageContent) -> Self

Converts to this type from the input type.
Source§

impl From<InputContactMessageContent> for InputMessageContent

Source§

fn from(val: InputContactMessageContent) -> Self

Converts to this type from the input type.
Source§

impl From<InputInvoiceMessageContent> for InputMessageContent

Source§

fn from(val: InputInvoiceMessageContent) -> Self

Converts to this type from the input type.
Source§

impl From<InputLocationMessageContent> for InputMessageContent

Source§

fn from(val: InputLocationMessageContent) -> Self

Converts to this type from the input type.
Source§

impl From<InputMessageContent> for InputMessageContentType

Source§

fn from(val: InputMessageContent) -> Self

Converts to this type from the input type.
Source§

impl From<InputRichMessageContent> for InputMessageContent

Source§

fn from(val: InputRichMessageContent) -> Self

Converts to this type from the input type.
Source§

impl From<InputTextMessageContent> for InputMessageContent

Source§

fn from(val: InputTextMessageContent) -> Self

Converts to this type from the input type.
Source§

impl From<InputVenueMessageContent> for InputMessageContent

Source§

fn from(val: InputVenueMessageContent) -> Self

Converts to this type from the input type.
Source§

impl Serialize for InputMessageContent

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TryFrom<InputMessageContent> for InputInvoiceMessageContent

Source§

type Error = ConvertToType

The type returned in the event of a conversion error.
Source§

fn try_from(val: InputMessageContent) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<InputMessageContent> for InputVenueMessageContent

Source§

type Error = ConvertToType

The type returned in the event of a conversion error.
Source§

fn try_from(val: InputMessageContent) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<InputMessageContent> for InputLocationMessageContent

Source§

type Error = ConvertToType

The type returned in the event of a conversion error.
Source§

fn try_from(val: InputMessageContent) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<InputMessageContent> for InputContactMessageContent

Source§

type Error = ConvertToType

The type returned in the event of a conversion error.
Source§

fn try_from(val: InputMessageContent) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<InputMessageContent> for InputTextMessageContent

Source§

type Error = ConvertToType

The type returned in the event of a conversion error.
Source§

fn try_from(val: InputMessageContent) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<InputMessageContent> for InputRichMessageContent

Source§

type Error = ConvertToType

The type returned in the event of a conversion error.
Source§

fn try_from(val: InputMessageContent) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more