Struct AttachmentMeta

Source
pub struct AttachmentMeta<'a> {
    pub guid: Option<&'a str>,
    pub transcription: Option<&'a str>,
    pub height: Option<&'a f64>,
    pub width: Option<&'a f64>,
    pub name: Option<&'a str>,
}
Expand description

Representation of attachment metadata used for rendering message body in a conversation feed.

Fields§

§guid: Option<&'a str>

GUID of the attachment in the attachment table

§transcription: Option<&'a str>

The transcription, if the attachment was an audio message sent from or received on a supported platform.

§height: Option<&'a f64>

The height of the attachment in points

§width: Option<&'a f64>

The width of the attachment in points

§name: Option<&'a str>

The attachment’s original filename

Implementations§

Source§

impl<'a> AttachmentMeta<'a>

Source

pub fn from_components(components: &'a [Archivable]) -> Option<Self>

Given a slice of parsed typedstream data, populate the attachment’s metadata fields.

§Example
use imessage_database::util::typedstream::models::{Archivable, Class, OutputData};
use imessage_database::tables::messages::models::AttachmentMeta;

// Sample components
let components = vec![
   Archivable::Object(
       Class {
           name: "NSString".to_string(),
           version: 1,
       },
       vec![OutputData::String(
           "__kIMFileTransferGUIDAttributeName".to_string(),
       )],
   ),
   Archivable::Object(
       Class {
           name: "NSString".to_string(),
           version: 1,
       },
       vec![OutputData::String(
           "4C339597-EBBB-4978-9B87-521C0471A848".to_string(),
       )],
   ),
];
let meta = AttachmentMeta::from_components(&components);

Trait Implementations§

Source§

impl<'a> Debug for AttachmentMeta<'a>

Source§

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

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

impl<'a> Default for AttachmentMeta<'a>

Source§

fn default() -> AttachmentMeta<'a>

Returns the “default value” for a type. Read more
Source§

impl<'a> PartialEq for AttachmentMeta<'a>

Source§

fn eq(&self, other: &AttachmentMeta<'a>) -> 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<'a> StructuralPartialEq for AttachmentMeta<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for AttachmentMeta<'a>

§

impl<'a> RefUnwindSafe for AttachmentMeta<'a>

§

impl<'a> Send for AttachmentMeta<'a>

§

impl<'a> Sync for AttachmentMeta<'a>

§

impl<'a> Unpin for AttachmentMeta<'a>

§

impl<'a> UnwindSafe for AttachmentMeta<'a>

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> 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, 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.