Struct MetaBuilder

Source
pub struct MetaBuilder(/* private fields */);

Implementations§

Source§

impl MetaBuilder

Source

pub fn id(self, value: impl AttributeValue<String>) -> Self

Source

pub fn class(self, value: impl AttributeValue<String>) -> Self

Source

pub fn charset(self, value: impl AttributeValue<String>) -> Self

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”.

Source

pub fn content(self, value: impl AttributeValue<String>) -> Self

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

Source

pub fn http_equiv(self, value: impl AttributeValue<String>) -> Self

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.
Source

pub fn name(self, value: impl AttributeValue<String>) -> Self

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.

Source§

impl MetaBuilder

Source

pub fn on_blur( self, f: impl 'static + FnMut(FocusEvent, HtmlMetaElement), ) -> Self

Source

pub fn on_click( self, f: impl 'static + FnMut(MouseEvent, HtmlMetaElement), ) -> Self

Source

pub fn on_change(self, f: impl 'static + FnMut(Event, HtmlMetaElement)) -> Self

Source

pub fn on_dblclick( self, f: impl 'static + FnMut(MouseEvent, HtmlMetaElement), ) -> Self

Source

pub fn on_focusout( self, f: impl 'static + FnMut(FocusEvent, HtmlMetaElement), ) -> Self

Source

pub fn on_input( self, f: impl 'static + FnMut(InputEvent, HtmlMetaElement), ) -> Self

Source

pub fn on_keydown( self, f: impl 'static + FnMut(KeyboardEvent, HtmlMetaElement), ) -> Self

Source

pub fn on_keyup( self, f: impl 'static + FnMut(KeyboardEvent, HtmlMetaElement), ) -> Self

Source

pub fn effect(self, f: impl Effect<HtmlMetaElement>) -> Self

Trait Implementations§

Source§

impl Builder for MetaBuilder

Source§

impl DomElement for MetaBuilder

Source§

impl From<MetaBuilder> for Element

Source§

fn from(builder: MetaBuilder) -> Self

Converts to this type from the input type.
Source§

impl From<MetaBuilder> for ElementBuilder

Source§

fn from(builder: MetaBuilder) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.