#[non_exhaustive]pub struct Metadata {Show 13 fields
pub title: Option<String>,
pub description: Option<String>,
pub canonical: Option<String>,
pub lang: Option<String>,
pub site_name: Option<String>,
pub image: Option<String>,
pub author: Option<String>,
pub published: Option<String>,
pub keywords: Vec<String>,
pub og: Vec<(String, String)>,
pub twitter: Vec<(String, String)>,
pub json_ld: Vec<String>,
pub feeds: Vec<String>,
}Expand description
Metadata about a page, from its <title>, <meta> and <link> tags,
JSON-LD blocks and a few in-page conventions. Built by Dom::metadata.
Every field is owned, so the struct outlives the Dom. Scalar fields
take the first non-empty value from a list of sources, in the order given
on each field; text fields have their whitespace collapsed, URL fields are
trimmed but not resolved (use resolve_url with
the page URL or Dom::base_url).
With the serde feature, Metadata implements serde::Serialize (a map
with one key per field).
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.title: Option<String><title> (not one inside an <svg>), else og:title, else
twitter:title.
description: Option<String><meta name=description>, else og:description, else
twitter:description.
canonical: Option<String><link rel=canonical href>, else og:url.
lang: Option<String>The lang of the <html> element, else <meta http-equiv=content-language>.
site_name: Option<String>og:site_name, else <meta name=application-name>.
image: Option<String>og:image (or og:image:url, og:image:secure_url), else
twitter:image (or twitter:image:src), else <link rel=image_src>.
<meta name=author>, else article:author unless it is a URL, else
the text of the first <a rel=author>, else the article:author URL.
published: Option<String>The publication date as written (usually ISO 8601):
article:published_time, else <meta itemprop=datePublished>, else a
date-style <meta name> (date, pubdate, publish-date,
dc.date, dc.date.issued, dcterms.date, dcterms.created, …), else
the datetime of the first <time> that is inside an <article> or
carries pubdate / itemprop=datePublished.
keywords: Vec<String><meta name=keywords> (else news_keywords) split on commas, else the
article:tag values.
og: Vec<(String, String)>Every OpenGraph <meta property=… content=…> pair — properties in the
og:, article:, book:, profile:, music: and video:
namespaces — in document order, with the full, lower-cased property
name as the key ("og:title", "article:published_time"). Repeated
properties (several og:images) are all kept.
twitter: Vec<(String, String)>Every Twitter-card <meta name=twitter:… content=…> pair (also when
written with property=), in document order, keys lower-cased
("twitter:card").
json_ld: Vec<String>The raw, trimmed contents of each non-empty <script type="application/ld+json">, in document order. Not parsed: hand them
to a JSON parser.
feeds: Vec<String>The href of each <link rel=alternate> whose type is RSS
(application/rss+xml), Atom (application/atom+xml) or JSON Feed
(application/feed+json), in document order.