pub struct UrlPreview {Show 13 fields
pub id: i64,
pub url: Option<String>,
pub site_name: Option<String>,
pub title: Option<String>,
pub description: Option<String>,
pub photo: Option<Photo>,
pub duration: Option<i64>,
pub media_type: Option<i32>,
pub display_url: Option<String>,
pub provider: Option<String>,
pub author: Option<String>,
pub media: Option<UrlPreviewMedia>,
pub layout: Option<UrlPreviewLayout>,
}Fields§
§id: i64ID of the URL preview row in our database.
url: Option<String>URL of the link
site_name: Option<String>Site name of the link
title: Option<String>Title of the link
description: Option<String>Description of the link
photo: Option<Photo>Image ID of the link
duration: Option<i64>Duration of the content
media_type: Option<i32>Metadata-derived content type of the preview target
display_url: Option<String>Sanitized URL text for display only, not a fetch target.
provider: Option<String>Stable provider key from the preview pipeline, such as “youtube” or “loom”.
Author, channel, account, or publisher when provided by metadata.
media: Option<UrlPreviewMedia>Typed primary media for this preview.
layout: Option<UrlPreviewLayout>Server-provided layout hints that clients can adapt to available space.
Implementations§
Source§impl UrlPreview
impl UrlPreview
Sourcepub fn site_name(&self) -> &str
pub fn site_name(&self) -> &str
Returns the value of site_name, or the default value if site_name is unset.
Sourcepub fn title(&self) -> &str
pub fn title(&self) -> &str
Returns the value of title, or the default value if title is unset.
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
Returns the value of description, or the default value if description is unset.
Sourcepub fn duration(&self) -> i64
pub fn duration(&self) -> i64
Returns the value of duration, or the default value if duration is unset.
Sourcepub fn media_type(&self) -> MediaType
pub fn media_type(&self) -> MediaType
Returns the enum value of media_type, or the default if the field is unset or set to an invalid enum value.
Sourcepub fn set_media_type(&mut self, value: MediaType)
pub fn set_media_type(&mut self, value: MediaType)
Sets media_type to the provided enum value.
Sourcepub fn display_url(&self) -> &str
pub fn display_url(&self) -> &str
Returns the value of display_url, or the default value if display_url is unset.
Sourcepub fn provider(&self) -> &str
pub fn provider(&self) -> &str
Returns the value of provider, or the default value if provider is unset.
Returns the value of author, or the default value if author is unset.
Trait Implementations§
Source§impl Clone for UrlPreview
impl Clone for UrlPreview
Source§fn clone(&self) -> UrlPreview
fn clone(&self) -> UrlPreview
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UrlPreview
impl Debug for UrlPreview
Source§impl Default for UrlPreview
impl Default for UrlPreview
Source§fn default() -> UrlPreview
fn default() -> UrlPreview
Source§impl<'de> Deserialize<'de> for UrlPreview
impl<'de> Deserialize<'de> for UrlPreview
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<UrlPreview, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<UrlPreview, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Message for UrlPreview
impl Message for UrlPreview
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self.Source§impl PartialEq for UrlPreview
impl PartialEq for UrlPreview
Source§fn eq(&self, other: &UrlPreview) -> bool
fn eq(&self, other: &UrlPreview) -> bool
self and other values to be equal, and is used by ==.