pub struct DocumentParts {
pub lang: String,
pub html_attributes: Vec<(String, String)>,
pub head: String,
pub head_extra: String,
pub body: Node,
pub nonce: Option<String>,
pub tail: Box<dyn FnOnce(RenderFlags) -> String + Send>,
pub known_styles: Vec<String>,
pub generator: Option<String>,
}Expand description
Everything needed to render a full HTML document.
Fields§
§lang: String§html_attributes: Vec<(String, String)>Other attributes of <html> (see Metadata::html_attribute). A
lang entry replaces DocumentParts::lang.
head: StringPre-rendered <head> contents (metadata).
head_extra: StringExtra head markup (e.g. dev scripts). Trusted.
body: Node§nonce: Option<String>CSP nonce applied to framework inline scripts.
tail: Box<dyn FnOnce(RenderFlags) -> String + Send>Called once the body is complete; returns markup appended before
</body> (client runtime scripts, depending on the flags).
known_styles: Vec<String>Ids of stylesheets the browser already has; they are not written again.
generator: Option<String>Written as <meta name="generator">, the first element of <head>:
what built the page (Next Rust 0.1.10). None leaves it out.
Implementations§
Source§impl DocumentParts
impl DocumentParts
pub fn new(body: impl View) -> DocumentParts
Auto Trait Implementations§
impl !RefUnwindSafe for DocumentParts
impl !Sync for DocumentParts
impl !UnwindSafe for DocumentParts
impl Forget for DocumentParts
impl Freeze for DocumentParts
impl Move for DocumentParts
impl Send for DocumentParts
impl Unpin for DocumentParts
impl UnsafeUnpin for DocumentParts
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more