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>
impl<'a> AttachmentMeta<'a>
Sourcepub fn from_components(components: &'a [Archivable]) -> Option<Self>
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>
impl<'a> Debug for AttachmentMeta<'a>
Source§impl<'a> Default for AttachmentMeta<'a>
impl<'a> Default for AttachmentMeta<'a>
Source§fn default() -> AttachmentMeta<'a>
fn default() -> AttachmentMeta<'a>
Returns the “default value” for a type. Read more
Source§impl<'a> PartialEq for AttachmentMeta<'a>
impl<'a> PartialEq for AttachmentMeta<'a>
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> 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