Message

Struct Message 

Source
pub struct Message {
    pub id: MessageId,
    pub from: User,
    pub date: i64,
    pub chat: MessageChat,
    pub forward: Option<Forward>,
    pub reply_to_message: Option<Box<MessageOrChannelPost>>,
    pub edit_date: Option<i64>,
    pub kind: MessageKind,
}
Expand description

This object represents a chat message.

Fields§

§id: MessageId

Unique message identifier inside this chat.

§from: User

Sender, can be empty for messages sent to channels.

§date: i64

Date the message was sent in Unix time.

§chat: MessageChat

Conversation the message belongs to.

§forward: Option<Forward>

Information about the original message.

§reply_to_message: Option<Box<MessageOrChannelPost>>

For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.

§edit_date: Option<i64>

Date the message was last edited in Unix time.

§kind: MessageKind

Kind of the message.

Trait Implementations§

Source§

impl Clone for Message

Source§

fn clone(&self) -> Message

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Message

Source§

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

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

impl<'de> Deserialize<'de> for Message

Source§

fn deserialize<D>( deserializer: D, ) -> Result<Message, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

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

impl MessageGetFiles for Message

Source§

fn get_files<'a>(&'a self) -> Option<Vec<GetFile>>

Obtain files from a message if available.
Source§

impl MessageText for Message

Source§

fn text<'a>(&'a self) -> Option<String>

Obtain text from a message if available.
Source§

impl PartialEq for Message

Source§

fn eq(&self, other: &Message) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for Message

Source§

fn partial_cmp(&self, other: &Message) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl ToMessageId for Message

Source§

impl ToSourceChat for Message

Source§

impl StructuralPartialEq for Message

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<M> CanDeleteMessage for M

Source§

impl<M> CanEditMessageCaption for M

Source§

fn edit_caption<'s, T>(&self, caption: T) -> EditMessageCaption<'s>
where T: Into<Cow<'s, str>>,

Source§

impl<M> CanEditMessageLiveLocation for M

Source§

fn edit_live_location( &self, latitude: f32, longitude: f32, ) -> EditMessageLiveLocation

Source§

impl<M> CanEditMessageReplyMarkup for M

Source§

fn edit_reply_markup<R>( &self, reply_markup: Option<R>, ) -> EditMessageReplyMarkup
where R: Into<ReplyMarkup>,

Source§

impl<M> CanEditMessageText for M

Source§

fn edit_text<'s, T>(&self, text: T) -> EditMessageText<'s>
where T: Into<Cow<'s, str>>,

Source§

impl<M> CanForwardMessage for M

Source§

fn forward<T>(&self, to: T) -> ForwardMessage
where T: ToChatRef,

Source§

impl<M> CanPinMessage for M

Source§

impl<M> CanReplySendAudio for M

Source§

fn audio_reply<'c, 'p, 't, T>(&self, audio: T) -> SendAudio<'c, 'p, 't>
where T: Into<InputFile>,

Source§

impl<M> CanReplySendContact for M

Source§

fn contact_reply<'p, 'f, 'l, P, F>( &self, phone_number: P, first_name: F, ) -> SendContact<'p, 'f, 'l>
where P: 'p + Into<Cow<'p, str>>, F: 'f + Into<Cow<'f, str>>,

Source§

impl<M> CanReplySendDocument for M

Source§

fn document_reply<'c, T>(&self, document: T) -> SendDocument<'c>
where T: Into<InputFile>,

Source§

impl<M> CanReplySendLocation for M

Source§

fn location_reply(&self, latitude: f32, longitude: f32) -> SendLocation

Source§

impl<M> CanReplySendMessage for M

Source§

fn text_reply<'c, 's, T>(&self, text: T) -> SendMessage<'s>
where T: Into<Cow<'s, str>>,

Source§

impl<M> CanReplySendPhoto for M

Source§

fn photo_reply<'c, T>(&self, photo: T) -> SendPhoto<'c>
where T: Into<InputFile>,

Source§

impl<M> CanReplySendPoll for M

Source§

fn poll_reply<'q, 'o, 'e, Q, O>( &self, question: Q, options: Vec<O>, ) -> SendPoll<'q, 'o, 'e>
where Q: Into<Cow<'q, str>>, O: Into<Cow<'o, str>>,

Source§

impl<M> CanReplySendVenue for M

Source§

fn venue_reply<'t, 'a, 'f, T, A>( &self, latitude: f32, longitude: f32, title: T, address: A, ) -> SendVenue<'t, 'a, 'f>
where T: Into<Cow<'t, str>>, A: Into<Cow<'a, str>>,

Source§

impl<M> CanReplySendVideo for M

Source§

fn video_reply<'c, T>(&self, video: T) -> SendVideo<'c>
where T: Into<InputFile>,

Source§

impl<M> CanStopMessageLiveLocation for M

Source§

impl<M> CanStopPoll for M

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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<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
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
Source§

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