pub struct PageMetadata {Show 21 fields
pub title: Option<String>,
pub description: Option<String>,
pub keywords: Vec<String>,
pub author: Option<String>,
pub generator: Option<String>,
pub canonical: Option<String>,
pub base_url: Option<String>,
pub language: Option<String>,
pub charset: Option<String>,
pub viewport: Option<String>,
pub robots: RobotsMeta,
pub opengraph: OpenGraph,
pub twitter: TwitterCard,
pub alternates: Vec<AlternateLink>,
pub favicon: Option<String>,
pub apple_touch_icon: Option<String>,
pub theme_color: Option<String>,
pub published_date: Option<String>,
pub modified_date: Option<String>,
pub schema_type: Option<String>,
pub custom: HashMap<String, String>,
}Expand description
Complete page metadata
Fields§
§title: Option<String>Page title
description: Option<String>Meta description
keywords: Vec<String>Meta keywords
Author
generator: Option<String>Generator (CMS/framework)
canonical: Option<String>Canonical URL
base_url: Option<String>Base URL from
language: Option<String>Language (html lang attribute)
charset: Option<String>Character encoding
viewport: Option<String>Viewport
robots: RobotsMetaRobots directives
opengraph: OpenGraphOpenGraph data
twitter: TwitterCardTwitter Card data
alternates: Vec<AlternateLink>Alternate language versions
favicon: Option<String>Favicon URL
apple_touch_icon: Option<String>Apple touch icon
theme_color: Option<String>Theme color
published_date: Option<String>Published date
modified_date: Option<String>Modified date
schema_type: Option<String>Schema.org type (if detected)
custom: HashMap<String, String>Custom meta tags (name -> content)
Implementations§
Source§impl PageMetadata
impl PageMetadata
Sourcepub fn effective_title(&self) -> Option<&str>
pub fn effective_title(&self) -> Option<&str>
Get effective title (OG > Twitter > title tag)
Sourcepub fn effective_description(&self) -> Option<&str>
pub fn effective_description(&self) -> Option<&str>
Get effective description
Sourcepub fn effective_image(&self) -> Option<&str>
pub fn effective_image(&self) -> Option<&str>
Get effective image
Sourcepub fn should_index(&self) -> bool
pub fn should_index(&self) -> bool
Check if page should be indexed
Sourcepub fn should_follow(&self) -> bool
pub fn should_follow(&self) -> bool
Check if links should be followed
Trait Implementations§
Source§impl Clone for PageMetadata
impl Clone for PageMetadata
Source§fn clone(&self) -> PageMetadata
fn clone(&self) -> PageMetadata
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PageMetadata
impl Debug for PageMetadata
Source§impl Default for PageMetadata
impl Default for PageMetadata
Source§fn default() -> PageMetadata
fn default() -> PageMetadata
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PageMetadata
impl<'de> Deserialize<'de> for PageMetadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PageMetadata
impl RefUnwindSafe for PageMetadata
impl Send for PageMetadata
impl Sync for PageMetadata
impl Unpin for PageMetadata
impl UnwindSafe for PageMetadata
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