pub struct Message {Show 17 fields
pub id: MessageId,
pub grant_id: GrantId,
pub thread_id: Option<ThreadId>,
pub subject: Option<String>,
pub from: Vec<EmailAddress>,
pub to: Vec<EmailAddress>,
pub cc: Vec<EmailAddress>,
pub bcc: Vec<EmailAddress>,
pub reply_to: Vec<EmailAddress>,
pub date: i64,
pub unread: Option<bool>,
pub starred: Option<bool>,
pub snippet: Option<String>,
pub body: Option<String>,
pub attachments: Vec<Attachment>,
pub folders: Vec<FolderId>,
pub created_at: Option<i64>,
}Expand description
A message object from the Nylas API.
Messages are email messages in a user’s mailbox.
§Example
let message = Message {
id: MessageId::new("msg_123"),
grant_id: GrantId::new("grant_123"),
thread_id: Some(ThreadId::new("thread_123")),
subject: Some("Hello".to_string()),
from: vec![],
to: vec![],
cc: vec![],
bcc: vec![],
reply_to: vec![],
date: 1234567890,
unread: Some(false),
starred: Some(false),
snippet: Some("Message snippet...".to_string()),
body: Some("Message body".to_string()),
attachments: vec![],
folders: vec![],
created_at: Some(1234567890),
};Fields§
§id: MessageIdUnique identifier for the message.
grant_id: GrantIdGrant ID associated with this message.
thread_id: Option<ThreadId>Thread ID this message belongs to.
subject: Option<String>Subject line of the message.
from: Vec<EmailAddress>Sender email address(es).
to: Vec<EmailAddress>Recipient email address(es).
cc: Vec<EmailAddress>CC recipient email address(es).
bcc: Vec<EmailAddress>BCC recipient email address(es).
reply_to: Vec<EmailAddress>Reply-to email address(es).
date: i64Unix timestamp when the message was sent/received.
unread: Option<bool>Whether the message is unread.
starred: Option<bool>Whether the message is starred.
snippet: Option<String>Short snippet of the message body.
body: Option<String>Full body of the message.
attachments: Vec<Attachment>Attachments included with the message.
folders: Vec<FolderId>Folder IDs this message belongs to.
created_at: Option<i64>Unix timestamp when the message was created.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Message
impl<'de> Deserialize<'de> for Message
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Message
impl StructuralPartialEq for Message
Auto Trait Implementations§
impl Freeze for Message
impl RefUnwindSafe for Message
impl Send for Message
impl Sync for Message
impl Unpin for Message
impl UnwindSafe for Message
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more