Struct mogram::message::Message

source ·
pub struct Message {
Show 13 fields pub message_id: i64, pub from: Option<User>, pub date: i64, pub text: Option<String>, pub chat: Chat, pub forward_from: Option<User>, pub forward_from_chat: Option<Chat>, pub forward_from_message_id: Option<i64>, pub forward_signature: Option<String>, pub forward_sender_name: Option<String>, pub forward_date: Option<i64>, pub reply_to_message: Option<i64>, pub sticker: Option<Sticker>,
}

Fields§

§message_id: i64

Unique message identifier inside this chat

§from: Option<User>

Sender, empty for messages sent to channels

§date: i64

Date the message was sent in Unix time

§text: Option<String>

Message text

§chat: Chat

Conversation the message belongs to

  • For sent messages, the first available identifier of the chat
  • For messages forwarded to the chat, the identifier of the original chat
  • For messages in channels, the identifier of the channel is contained in the chat_id field
§forward_from: Option<User>

For forwarded messages, sender of the original message

§forward_from_chat: Option<Chat>

For messages forwarded from channels, information about the original channel

§forward_from_message_id: Option<i64>

For messages forwarded from channels, identifier of the original message in the channel

§forward_signature: Option<String>

For messages forwarded from channels, signature of the post author if present

§forward_sender_name: Option<String>

Sender’s name for messages forwarded from users who disallow adding a link to their account in forwarded messages

§forward_date: Option<i64>

For forwarded messages, date the original message was sent in Unix time

§reply_to_message: Option<i64>

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.

§sticker: Option<Sticker>

Sticker for messages with a sticker

Trait Implementations§

source§

impl Clone for Message

source§

fn clone(&self) -> Message

Returns a copy 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

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

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

source§

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

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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, U> Into<U> for Twhere 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 Twhere T: Clone,

§

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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,