use super::File; auto_derived!( /// Image positioning and size pub enum ImageSize { /// Show large preview at the bottom of the embed Large, /// Show small preview to the side of the embed Preview, } /// Image pub struct Image { /// URL to the original image pub url: String, /// Width of the image pub width: isize, /// Height of the image pub height: isize, /// Positioning and size pub size: ImageSize, } /// Video pub struct Video { /// URL to the original video pub url: String, /// Width of the video pub width: isize, /// Height of the video pub height: isize, } /// Type of remote Twitch content pub enum TwitchType { Channel, Video, Clip, } /// Type of remote Lightspeed.tv content pub enum LightspeedType { Channel, } /// Type of remote Bandcamp content pub enum BandcampType { Album, Track, } /// Information about special remote content #[serde(tag = "type")] pub enum Special { /// No remote content None, /// Content hint that this contains a GIF /// /// Use metadata to find video or image to play GIF, /// YouTube video YouTube { id: String, #[serde(skip_serializing_if = "Option::is_none")] timestamp: Option, }, /// Lightspeed.tv stream Lightspeed { content_type: LightspeedType, id: String, }, /// Twitch stream or clip Twitch { content_type: TwitchType, id: String, }, /// Spotify track Spotify { content_type: String, id: String }, /// Soundcloud track Soundcloud, /// Bandcamp track Bandcamp { content_type: BandcampType, id: String, }, AppleMusic { album_id: String, #[serde(skip_serializing_if = "Option::is_none")] track_id: Option, }, /// Streamable Video Streamable { id: String }, } /// Website metadata pub struct WebsiteMetadata { /// Direct URL to web page #[serde(skip_serializing_if = "Option::is_none")] url: Option, /// Original direct URL #[serde(skip_serializing_if = "Option::is_none")] original_url: Option, /// Remote content #[serde(skip_serializing_if = "Option::is_none")] special: Option, /// Title of website #[serde(skip_serializing_if = "Option::is_none")] title: Option, /// Description of website #[serde(skip_serializing_if = "Option::is_none")] description: Option, /// Embedded image #[serde(skip_serializing_if = "Option::is_none")] image: Option, /// Embedded video #[serde(skip_serializing_if = "Option::is_none")] video: Option