pub struct DocumentTemplate { /* private fields */ }Expand description
Cloneable application hook for customizing the outer HTML document.
The callback controls document chrome only. Phoenix still owns the React root, hydration payload, module entrypoint, escaping, and request CSP nonce.
Implementations§
Source§impl DocumentTemplate
impl DocumentTemplate
Sourcepub fn new(slots: DocumentSlots) -> Self
pub fn new(slots: DocumentSlots) -> Self
Use one static set of document slots for every page.
Sourcepub fn try_from_fn<F>(render: F) -> Selfwhere
F: for<'a> Fn(DocumentContext<'a>) -> Result<DocumentSlots, DocumentTemplateError> + Send + Sync + 'static,
pub fn try_from_fn<F>(render: F) -> Selfwhere
F: for<'a> Fn(DocumentContext<'a>) -> Result<DocumentSlots, DocumentTemplateError> + Send + Sync + 'static,
Generate fallible document slots from each page envelope.
Trait Implementations§
Source§impl Clone for DocumentTemplate
impl Clone for DocumentTemplate
Source§fn clone(&self) -> DocumentTemplate
fn clone(&self) -> DocumentTemplate
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DocumentTemplate
impl Debug for DocumentTemplate
Auto Trait Implementations§
impl !RefUnwindSafe for DocumentTemplate
impl !UnwindSafe for DocumentTemplate
impl Freeze for DocumentTemplate
impl Send for DocumentTemplate
impl Sync for DocumentTemplate
impl Unpin for DocumentTemplate
impl UnsafeUnpin for DocumentTemplate
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