pub struct Draft {Show 15 fields
pub id: DraftId,
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 body: Option<String>,
pub starred: Option<bool>,
pub snippet: Option<String>,
pub attachments: Vec<Attachment>,
pub folders: Vec<FolderId>,
pub created_at: Option<i64>,
}Expand description
A draft message object from the Nylas API.
Drafts are email messages that are being composed but not yet sent.
§Example
let draft = Draft {
id: DraftId::new("draft_123"),
grant_id: GrantId::new("grant_123"),
thread_id: None,
subject: Some("Draft Subject".to_string()),
from: vec![],
to: vec![],
cc: vec![],
bcc: vec![],
reply_to: vec![],
body: Some("Draft body".to_string()),
starred: Some(false),
snippet: Some("Draft snippet...".to_string()),
attachments: vec![],
folders: vec![],
created_at: Some(1234567890),
};Fields§
§id: DraftIdUnique identifier for the draft.
grant_id: GrantIdGrant ID associated with this draft.
thread_id: Option<ThreadId>Thread ID this draft belongs to (for replies).
subject: Option<String>Subject line of the draft.
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).
body: Option<String>Body of the draft.
starred: Option<bool>Whether the draft is starred.
snippet: Option<String>Short snippet of the draft body.
attachments: Vec<Attachment>Attachments included with the draft.
folders: Vec<FolderId>Folder IDs this draft belongs to.
created_at: Option<i64>Unix timestamp when the draft was created.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Draft
impl<'de> Deserialize<'de> for Draft
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 Draft
impl StructuralPartialEq for Draft
Auto Trait Implementations§
impl Freeze for Draft
impl RefUnwindSafe for Draft
impl Send for Draft
impl Sync for Draft
impl Unpin for Draft
impl UnwindSafe for Draft
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