#[repr(i32)]pub enum MediaType {
Unspecified = 0,
Article = 1,
Image = 2,
Video = 3,
Document = 4,
Embed = 5,
}Expand description
Compatibility summary of the preview media.
Variants§
Unspecified = 0
No typed preview media was detected.
Article = 1
Metadata explicitly identifies this link as an article.
Image = 2
The preview’s primary media is an image.
Video = 3
The preview’s primary media is a video or video player.
Document = 4
The preview’s primary media is a document or downloadable file.
Embed = 5
The preview’s primary media is a provider embed.
Implementations§
Source§impl MediaType
impl MediaType
Sourcepub fn as_str_name(&self) -> &'static str
pub fn as_str_name(&self) -> &'static str
String value of the enum field names used in the ProtoBuf definition.
The values are not transformed in any way and thus are considered stable (if the ProtoBuf definition does not change) and safe for programmatic use.
Sourcepub fn from_str_name(value: &str) -> Option<MediaType>
pub fn from_str_name(value: &str) -> Option<MediaType>
Creates an enum from field names used in the ProtoBuf definition.
Trait Implementations§
impl Copy for MediaType
Source§impl<'de> Deserialize<'de> for MediaType
impl<'de> Deserialize<'de> for MediaType
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MediaType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MediaType, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for MediaType
Source§impl Ord for MediaType
impl Ord for MediaType
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for MediaType
impl PartialOrd for MediaType
Source§impl Serialize for MediaType
impl Serialize for MediaType
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for MediaType
Auto Trait Implementations§
impl Freeze for MediaType
impl RefUnwindSafe for MediaType
impl Send for MediaType
impl Sync for MediaType
impl Unpin for MediaType
impl UnsafeUnpin for MediaType
impl UnwindSafe for MediaType
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