HeadBuilder

Struct HeadBuilder 

Source
pub struct HeadBuilder { /* private fields */ }
Expand description

A builder struct for Head

Implementations§

Source§

impl HeadBuilder

Source

pub fn build(&mut self) -> Head

Finish building the element

Source

pub fn data( &mut self, data_key: impl Into<Cow<'static, str>>, value: impl Into<Cow<'static, str>>, ) -> &mut HeadBuilder

Insert a data-* property

Source

pub fn base<F>(&mut self, f: F) -> &mut Self
where F: for<'a> FnOnce(&'a mut BaseBuilder) -> &'a mut BaseBuilder,

Append a new Base element

Append a new Link element

Source

pub fn meta<F>(&mut self, f: F) -> &mut Self
where F: for<'a> FnOnce(&'a mut MetaBuilder) -> &'a mut MetaBuilder,

Append a new Meta element

Source

pub fn no_script<F>(&mut self, f: F) -> &mut Self
where F: for<'a> FnOnce(&'a mut NoScriptBuilder) -> &'a mut NoScriptBuilder,

Append a new NoScript element

Source

pub fn script<F>(&mut self, f: F) -> &mut Self
where F: for<'a> FnOnce(&'a mut ScriptBuilder) -> &'a mut ScriptBuilder,

Append a new Script element

Source

pub fn style<F>(&mut self, f: F) -> &mut Self
where F: for<'a> FnOnce(&'a mut StyleBuilder) -> &'a mut StyleBuilder,

Append a new Style element

Source

pub fn template<F>(&mut self, f: F) -> &mut Self
where F: for<'a> FnOnce(&'a mut TemplateBuilder) -> &'a mut TemplateBuilder,

Append a new Template element

Source

pub fn title<F>(&mut self, f: F) -> &mut Self
where F: for<'a> FnOnce(&'a mut TitleBuilder) -> &'a mut TitleBuilder,

Append a new Title element

Source

pub fn access_key(&mut self, value: impl Into<Cow<'static, str>>) -> &mut Self

Set the value of the accesskey attribute

Source

pub fn auto_capitalize( &mut self, value: impl Into<Cow<'static, str>>, ) -> &mut Self

Set the value of the autocapitalize attribute

Source

pub fn autofocus(&mut self, value: bool) -> &mut Self

Set the value of the autofocus attribute

Source

pub fn class(&mut self, value: impl Into<Cow<'static, str>>) -> &mut Self

Set the value of the class attribute

Source

pub fn content_editable( &mut self, value: impl Into<Cow<'static, str>>, ) -> &mut Self

Set the value of the contenteditable attribute

Source

pub fn direction(&mut self, value: impl Into<Cow<'static, str>>) -> &mut Self

Set the value of the dir attribute

Source

pub fn draggable(&mut self, value: bool) -> &mut Self

Set the value of the draggable attribute

Source

pub fn enter_key_hint( &mut self, value: impl Into<Cow<'static, str>>, ) -> &mut Self

Set the value of the enterkeyhint attribute

Source

pub fn export_parts(&mut self, value: impl Into<Cow<'static, str>>) -> &mut Self

Set the value of the exportparts attribute

Source

pub fn hidden(&mut self, value: impl Into<Cow<'static, str>>) -> &mut Self

Set the value of the hidden attribute

Source

pub fn id(&mut self, value: impl Into<Cow<'static, str>>) -> &mut Self

Set the value of the id attribute

Source

pub fn inert(&mut self, value: bool) -> &mut Self

Set the value of the inert attribute

Source

pub fn input_mode(&mut self, value: impl Into<Cow<'static, str>>) -> &mut Self

Set the value of the inputmode attribute

Source

pub fn is_(&mut self, value: impl Into<Cow<'static, str>>) -> &mut Self

Set the value of the is attribute

Source

pub fn item_id(&mut self, value: impl Into<Cow<'static, str>>) -> &mut Self

Set the value of the itemid attribute

Source

pub fn item_prop(&mut self, value: impl Into<Cow<'static, str>>) -> &mut Self

Set the value of the itemprop attribute

Source

pub fn item_ref(&mut self, value: impl Into<Cow<'static, str>>) -> &mut Self

Set the value of the itemref attribute

Source

pub fn item_scope(&mut self, value: impl Into<Cow<'static, str>>) -> &mut Self

Set the value of the itemscope attribute

Source

pub fn item_type(&mut self, value: impl Into<Cow<'static, str>>) -> &mut Self

Set the value of the itemtype attribute

Source

pub fn lang(&mut self, value: impl Into<Cow<'static, str>>) -> &mut Self

Set the value of the lang attribute

Source

pub fn nonce(&mut self, value: impl Into<Cow<'static, str>>) -> &mut Self

Set the value of the nonce attribute

Source

pub fn part(&mut self, value: impl Into<Cow<'static, str>>) -> &mut Self

Set the value of the part attribute

Source

pub fn slot(&mut self, value: impl Into<Cow<'static, str>>) -> &mut Self

Set the value of the slot attribute

Source

pub fn spellcheck(&mut self, value: impl Into<Cow<'static, str>>) -> &mut Self

Set the value of the spellcheck attribute

Source

pub fn style_attr(&mut self, value: impl Into<Cow<'static, str>>) -> &mut Self

Set the value of the style attribute

Source

pub fn tab_index(&mut self, value: i64) -> &mut Self

Set the value of the tabindex attribute

Source

pub fn title_attr(&mut self, value: impl Into<Cow<'static, str>>) -> &mut Self

Set the value of the title attribute

Source

pub fn translate(&mut self, value: bool) -> &mut Self

Set the value of the translate attribute

Source

pub fn push<T>(&mut self, child_el: T) -> &mut Self
where T: Into<HeadChild>,

Push a new child element to the list of children.

Source

pub fn extend<I, T>(&mut self, iter: I) -> &mut Self
where I: IntoIterator<Item = T>, T: Into<HeadChild>,

Extend the list of children with an iterator of child elements.

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.