[][src]Struct moxie_dom::elements::metadata::MetaBuilder

#[must_use = "needs to be built"]pub struct MetaBuilder { /* fields omitted */ }

The HTML <meta> element represents metadata that cannot be represented by other HTML meta-related elements, like [<base>], [<link>], [<script>], [<style>] or [<title>].

Note: the attribute name has a specific meaning for the element, and the itemprop attribute must not be set on the same element that has any existing name, http-equiv or charset attributes.

A type for initializing the element's attributes before calling build.

Implementations

impl MetaBuilder[src]

pub fn build(self) -> Meta[src]

Initialize the element with all of the attributes so far.

impl MetaBuilder[src]

pub fn charset(self, to_set: impl ToString) -> Self[src]

This attribute declares the document's character encoding. If the attribute is present, its value must be an ASCII case-insensitive match for the string "utf-8".

pub fn content(self, to_set: impl ToString) -> Self[src]

This attribute contains the value for the http-equiv or name attribute, depending on which is used.

pub fn http_equiv(self, to_set: impl ToString) -> Self[src]

Defines a pragma directive. The attribute is named http-equiv(alent) because all the allowed values are names of particular HTTP headers:

  • content-security-policy: Allows page authors to define a content policy for the current page. Content policies mostly specify allowed server origins and script endpoints which help guard against cross-site scripting attacks.
  • content-type: If specified, the content attribute must have the value text/html; charset=utf-8. Note: Can only be used in documents served with a text/html MIME type — not in documents served with an XML MIME type.
  • default-style: Sets the name of the default CSS style sheet set.
  • x-ua-compatible: If specified, the content attribute must have the value "IE=edge". User agents are required to ignore this pragma.
  • refresh: This instruction specifies:
    • The number of seconds until the page should be reloaded - only if the content attribute contains a positive integer.
    • The number of seconds until the page should redirect to another - only if the content attribute contains a positive integer followed by the string ';url=', and a valid URL.
    • Accessibility concerns: Pages set with a refresh value run the risk of having the time interval being too short. People navigating with the aid of assistive technology such as a screen reader may be unable to read through and understand the page's content before being automatically redirected. The abrupt, unannounced updating of the page content may also be disorienting for people experiencing low vision conditions.

pub fn name(self, to_set: impl ToString) -> Self[src]

The name and content attributes can be used together to provide document metadata in terms of name-value pairs, with the name attribute giving the metadata name, and the content attribute giving the value.

See standard metadata names for details about the set of standard metadata names defined in the HTML specification.

Trait Implementations

impl Element for MetaBuilder[src]

impl<E> EventTarget<E> for MetaBuilder where
    E: GlobalEvent
[src]

impl GlobalEventHandler for MetaBuilder[src]

impl HtmlElement for MetaBuilder[src]

impl Node for MetaBuilder[src]

Auto Trait Implementations

impl !RefUnwindSafe for MetaBuilder

impl !Send for MetaBuilder

impl !Sync for MetaBuilder

impl Unpin for MetaBuilder

impl !UnwindSafe for MetaBuilder

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<N> Child for N where
    N: Node
[src]

impl<T> Downcast for T where
    T: Any

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.