Draft

Struct Draft 

Source
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: DraftId

Unique identifier for the draft.

§grant_id: GrantId

Grant 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 Clone for Draft

Source§

fn clone(&self) -> Draft

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 Draft

Source§

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

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

impl<'de> Deserialize<'de> for Draft

Source§

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

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

impl PartialEq for Draft

Source§

fn eq(&self, other: &Draft) -> 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 Serialize for Draft

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for Draft

Source§

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> 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<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, 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> Same for T

Source§

type Output = T

Should always be Self
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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,