pub struct DocumentSlots { /* private fields */ }Expand description
Customizable slots around Phoenix’s required React document elements.
Implementations§
Source§impl DocumentSlots
impl DocumentSlots
pub fn new() -> Self
Sourcepub fn language(self, language: impl Into<String>) -> Self
pub fn language(self, language: impl Into<String>) -> Self
Set the document language using an escaped lang attribute.
Sourcepub fn html_attribute(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Result<Self, DocumentTemplateError>
pub fn html_attribute( self, name: impl Into<String>, value: impl Into<String>, ) -> Result<Self, DocumentTemplateError>
Add or replace one escaped attribute on the <html> element.
§Errors
Returns an error when the attribute name is not valid HTML syntax.
Sourcepub fn body_attribute(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Result<Self, DocumentTemplateError>
pub fn body_attribute( self, name: impl Into<String>, value: impl Into<String>, ) -> Result<Self, DocumentTemplateError>
Add or replace one escaped attribute on the <body> element.
§Errors
Returns an error when the attribute name is not valid HTML syntax.
Sourcepub fn root_attribute(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Result<Self, DocumentTemplateError>
pub fn root_attribute( self, name: impl Into<String>, value: impl Into<String>, ) -> Result<Self, DocumentTemplateError>
Add or replace one escaped attribute on #phoenix-root.
Phoenix owns id and data-render-mode, so templates cannot replace
either attribute.
§Errors
Returns an error for invalid or framework-owned attribute names.
Sourcepub fn head(self, html: TrustedHtml) -> Self
pub fn head(self, html: TrustedHtml) -> Self
Append trusted markup after framework metadata and styles in <head>.
Sourcepub fn before_root(self, html: TrustedHtml) -> Self
pub fn before_root(self, html: TrustedHtml) -> Self
Insert trusted markup immediately before #phoenix-root.
Sourcepub fn after_root(self, html: TrustedHtml) -> Self
pub fn after_root(self, html: TrustedHtml) -> Self
Insert trusted markup after #phoenix-root and before Phoenix scripts.
Trait Implementations§
Source§impl Clone for DocumentSlots
impl Clone for DocumentSlots
Source§impl Debug for DocumentSlots
impl Debug for DocumentSlots
Source§impl Default for DocumentSlots
impl Default for DocumentSlots
impl Eq for DocumentSlots
Source§impl PartialEq for DocumentSlots
impl PartialEq for DocumentSlots
impl StructuralPartialEq for DocumentSlots
Auto Trait Implementations§
impl Freeze for DocumentSlots
impl RefUnwindSafe for DocumentSlots
impl Send for DocumentSlots
impl Sync for DocumentSlots
impl Unpin for DocumentSlots
impl UnsafeUnpin for DocumentSlots
impl UnwindSafe for DocumentSlots
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.