Enum tbot::types::input_message_content::InputMessageContent[][src]

#[non_exhaustive]
pub enum InputMessageContent {
    Text(Text),
    Location(Location),
    Venue(Venue),
    Contact(Contact),
    Invoice(Invoice),
}

Represents InputMessageContent.

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Text(Text)

A text message.

Location(Location)

A location.

Venue(Venue)

A venue.

Contact(Contact)

A contact.

Invoice(Invoice)

An invoice.

Implementations

impl InputMessageContent[src]

pub fn is_text(&self) -> bool[src]

Returns true if self is of variant Text.

pub fn expect_text(self) -> Text where
    Self: Debug
[src]

Unwraps the value, yielding the content of Text.

Panics

Panics if the value is not Text, with a panic message including the content of self.

pub fn text(self) -> Option<Text>[src]

Returns Some if self is of variant Text, and None otherwise.

pub fn is_location(&self) -> bool[src]

Returns true if self is of variant Location.

pub fn expect_location(self) -> Location where
    Self: Debug
[src]

Unwraps the value, yielding the content of Location.

Panics

Panics if the value is not Location, with a panic message including the content of self.

pub fn location(self) -> Option<Location>[src]

Returns Some if self is of variant Location, and None otherwise.

pub fn is_venue(&self) -> bool[src]

Returns true if self is of variant Venue.

pub fn expect_venue(self) -> Venue where
    Self: Debug
[src]

Unwraps the value, yielding the content of Venue.

Panics

Panics if the value is not Venue, with a panic message including the content of self.

pub fn venue(self) -> Option<Venue>[src]

Returns Some if self is of variant Venue, and None otherwise.

pub fn is_contact(&self) -> bool[src]

Returns true if self is of variant Contact.

pub fn expect_contact(self) -> Contact where
    Self: Debug
[src]

Unwraps the value, yielding the content of Contact.

Panics

Panics if the value is not Contact, with a panic message including the content of self.

pub fn contact(self) -> Option<Contact>[src]

Returns Some if self is of variant Contact, and None otherwise.

pub fn is_invoice(&self) -> bool[src]

Returns true if self is of variant Invoice.

pub fn expect_invoice(self) -> Invoice where
    Self: Debug
[src]

Unwraps the value, yielding the content of Invoice.

Panics

Panics if the value is not Invoice, with a panic message including the content of self.

pub fn invoice(self) -> Option<Invoice>[src]

Returns Some if self is of variant Invoice, and None otherwise.

Trait Implementations

impl Clone for InputMessageContent[src]

impl Debug for InputMessageContent[src]

impl From<Contact> for InputMessageContent[src]

impl From<Invoice> for InputMessageContent[src]

impl From<Location> for InputMessageContent[src]

impl From<Text> for InputMessageContent[src]

impl From<Venue> for InputMessageContent[src]

impl PartialEq<InputMessageContent> for InputMessageContent[src]

impl Serialize for InputMessageContent[src]

impl StructuralPartialEq for InputMessageContent[src]

Auto Trait Implementations

impl RefUnwindSafe for InputMessageContent

impl Send for InputMessageContent

impl Sync for InputMessageContent

impl Unpin for InputMessageContent

impl UnwindSafe for InputMessageContent

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.