[−][src]Struct html_index::Builder
Create a new HTML builder.
Implementations
impl<'b> Builder<'b>[src]
pub fn new() -> Self[src]
Create a new instance from an HTML body, including <body></body> tags.
pub fn raw_body(self, body: &'b str) -> Self[src]
Add a body to the document. The body must include <body></body> tags.
pub fn lang(self, lang: &'b str) -> Self[src]
Set the document language.
pub fn description(self, desc: &str) -> Self[src]
Add a <meta name="description"> tag.
pub fn theme_color(self, color: &str) -> Self[src]
Add a <meta name="theme-color"> tag.
pub fn title(self, title: &str) -> Self[src]
Add a <title> tag.
pub fn script(self, src: &str) -> Self[src]
Add a <script defer> tag. This is ideal for loading scripts that are
important for the main application, but shouldn't interfere with the
initial rendering.
pub fn lazy_script(self, src: &str) -> Self[src]
Add a <link rel="prefetch"> tag. This is ideal for loading scripts in
the background after the main application has loaded.
pub fn blocking_script(self, src: &str) -> Self[src]
Add a <script> tag. This is ideal for loading scripts that should be
loaded before any rendering can start.
pub fn inline_script(self, src: &str) -> Self[src]
Add a <script></script> tag. This is ideal for loading custom scripts
that are essential for loading.
pub fn style(self, src: &str) -> Self[src]
Add a non-blocking <link as="style"> tag. This is ideal for including
styles that aren't essential for an initial render pass.
Generally this should be combined with .inline_style() to optimize a
render pipeline.
onerror exists because of a bug in firefox. See https://github.com/filamentgroup/loadCSS/issues/246 for more details
pub fn inline_style(self, src: &str) -> Self[src]
Add an inline <style> tag. This is ideal for including styles that
should be available for an initial render pass.
Generally this should be combined with .style() to optimize a render
pipeline.
pub fn blocking_style(self, src: &str) -> Self[src]
Add a blocking <link rel="stylesheet"> tag. This is ideal for externally
loading scripts that should be loaded before any rendering can be
initialized.
pub fn favicon(self, src: &str) -> Self[src]
Add a favicon.
pub fn manifest(self, src: &str) -> Self[src]
Add a manifest.json link.
pub fn font(self, src: &str) -> Self[src]
Add a <link as="font"> tag.
pub fn build(self) -> String[src]
Create an HTML document.
Trait Implementations
impl<'b> Clone for Builder<'b>[src]
impl<'b> Debug for Builder<'b>[src]
impl<'b> Default for Builder<'b>[src]
Auto Trait Implementations
impl<'b> RefUnwindSafe for Builder<'b>
impl<'b> Send for Builder<'b>
impl<'b> Sync for Builder<'b>
impl<'b> Unpin for Builder<'b>
impl<'b> UnwindSafe for Builder<'b>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,