Struct html_index::Builder [−][src]
pub struct Builder<'b> { /* fields omitted */ }
Create a new HTML builder.
Methods
impl<'b> Builder<'b>
[src]
impl<'b> Builder<'b>
pub fn new() -> Self
[src]
pub fn new() -> Self
Create a new instance from an HTML body, including <body></body>
tags.
pub fn raw_body(self, body: &'b str) -> Self
[src]
pub fn raw_body(self, body: &'b str) -> Self
Add a body to the document. The body must include <body></body>
tags.
pub fn description(self, desc: &str) -> Self
[src]
pub fn description(self, desc: &str) -> Self
Add a <meta name="description">
tag.
pub fn theme_color(self, color: &str) -> Self
[src]
pub fn theme_color(self, color: &str) -> Self
Add a <meta name="theme-color">
tag.
pub fn title(self, title: &str) -> Self
[src]
pub fn title(self, title: &str) -> Self
Add a <title>
tag.
pub fn script(self, src: &str) -> Self
[src]
pub fn script(self, src: &str) -> Self
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]
pub fn lazy_script(self, src: &str) -> Self
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]
pub fn blocking_script(self, src: &str) -> Self
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]
pub fn inline_script(self, src: &str) -> Self
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]
pub fn style(self, src: &str) -> Self
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]
pub fn inline_style(self, src: &str) -> Self
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]
pub fn blocking_style(self, src: &str) -> Self
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]
pub fn favicon(self, src: &str) -> Self
Add a favicon.
pub fn manifest(self, src: &str) -> Self
[src]
pub fn manifest(self, src: &str) -> Self
Add a manifest.json
link.
pub fn font(self, src: &str) -> Self
[src]
pub fn font(self, src: &str) -> Self
Add a <link as="font">
tag.
pub fn build(self) -> String
[src]
pub fn build(self) -> String
Create an HTML document.
Trait Implementations
impl<'b> Debug for Builder<'b>
[src]
impl<'b> Debug for Builder<'b>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'b> Clone for Builder<'b>
[src]
impl<'b> Clone for Builder<'b>