pub struct Message {
pub id: String,
pub thread_id: Option<String>,
pub label_ids: Vec<String>,
pub snippet: Option<String>,
pub internal_date: Option<String>,
pub history_id: Option<String>,
pub size_estimate: Option<i64>,
pub payload: Option<Value>,
pub raw: Option<String>,
}Expand description
A Gmail message.
Fields§
§id: StringGmail message id.
thread_id: Option<String>Id of the thread this message belongs to.
label_ids: Vec<String>Labels currently applied to this message.
snippet: Option<String>A short, plain-text snippet of the message body.
internal_date: Option<String>Epoch milliseconds as a decimal string — Gmail’s own wire format.
history_id: Option<String>The mailbox history id at the time this message last changed.
size_estimate: Option<i64>Estimated size of the message in bytes.
payload: Option<Value>The parsed MIME structure (headers, body parts). Preserved as raw
JSON — see the module doc for why. Present when format is
full, metadata, or minimal with parts; absent otherwise.
raw: Option<String>The full RFC 2822 message, base64url-encoded. Present only when
format=raw was requested.
Implementations§
Source§impl Message
impl Message
Sourcepub fn internal_date_utc(&self) -> Option<DateTime<Utc>>
pub fn internal_date_utc(&self) -> Option<DateTime<Utc>>
Parses Self::internal_date into a UTC timestamp.
Returns None when absent or unparsable — Gmail’s field is a
decimal-string epoch-millisecond value; malformed input degrades
gracefully rather than erroring.
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>,
impl Eq for Message
Source§impl JsonlSerialize for Message
impl JsonlSerialize 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 UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.