Struct link_preview::preview::LinkPreview[][src]

pub struct LinkPreview {
    pub title: Option<String>,
    pub description: Option<String>,
    pub domain: Option<String>,
    pub image_url: Option<Url>,
}

Fields

title: Option<String>description: Option<String>domain: Option<String>image_url: Option<Url>

Implementations

Retrieves the String representation of image_url Url instance

Attempts to find the description of the page in the following order:

  • Document’s <link rel="canonical" /> element's href` attribute
  • OpenGraphTag’s image meta tag (og:image)

Attempts to find the description of the page in the following order:

  • OpenGraphTag’s image meta tag (og:image)
  • Document’s <link rel="image_url" /> element's href` attribute
  • Twitter Card’s image meta tag (twitter:image)
  • Schema.org image meta tag (image)

Attempts to find the description of the page in the following order:

  • OpenGraphTag’s description meta tag (og:description)
  • Twitter Card’s description meta tag (twitter:description)
  • Schema.org description meta tag (description)
  • Description meta tag (description)
  • The first p element from the document

Attempts to find the title of the page in the following order:

  • OpenGraphTag’s title meta tag (og:title)
  • Twitter Card’s title meta tag (twitter:title)
  • Schema.org title meta tag (title)
  • The HTML’s document title
  • The first <h1> tag in the document
  • The first <h2> tag in the document

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

The associated error which can be returned from parsing.

Parses a string s to return a value of this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.