#[non_exhaustive]pub struct Attachment {Show 19 fields
pub id: AttachmentId,
pub filename: CompactString,
pub title: Option<CompactString>,
pub description: Option<CompactString>,
pub content_type: Option<CompactString>,
pub size: u64,
pub url: CompactString,
pub proxy_url: CompactString,
pub height: Option<u32>,
pub width: Option<u32>,
pub placeholder: Option<CompactString>,
pub placeholder_version: Option<u32>,
pub ephemeral: bool,
pub duration_secs: Option<f64>,
pub waveform: Option<CompactString>,
pub flags: AttachmentFlags,
pub clip_participants: Vec<User>,
pub clip_created_at: Option<Timestamp>,
pub application: Option<Box<PartialApplication>>,
}Expand description
Contains a float (duration_secs), so it is PartialEq but not
Eq (D-064).
discord.js counterpart: Attachment.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: AttachmentIdThe attachment’s ID.
filename: CompactStringThe file name.
title: Option<CompactString>The title of the file.
description: Option<CompactString>The description (alt text, max 1024 characters).
content_type: Option<CompactString>The media type.
size: u64The size in bytes.
url: CompactStringThe source URL.
proxy_url: CompactStringThe URL through Discord’s media proxy. It serves images, videos and audio; other files
get 415 Unsupported Media Type.
height: Option<u32>The height of an image or video, in pixels.
width: Option<u32>The width of an image or video, in pixels.
placeholder: Option<CompactString>A thumbhash placeholder of an image or video.
placeholder_version: Option<u32>The version of the placeholder.
ephemeral: boolWhether the attachment is ephemeral: it is removed after a while (but stays available as long as its message exists).
duration_secs: Option<f64>The duration of an audio or video file, in seconds.
waveform: Option<CompactString>A base64-encoded sampled waveform (voice messages).
flags: AttachmentFlagsThe attachment’s flags.
clip_participants: Vec<User>For clips: the users who were in the stream.
clip_created_at: Option<Timestamp>For clips: when the clip was created.
application: Option<Box<PartialApplication>>For clips: the application in the stream, if recognized.