Expand description
A leaf node value of html dom tree
Variants
Text(String)
Text variant of a virtual node
SafeHtml(String)
A safe html variant
Comment(String)
A comment node
Implementations
sourceimpl Leaf
impl Leaf
sourcepub fn is_safe_html(&self) -> bool
pub fn is_safe_html(&self) -> bool
returns true if this is a safe html text node
sourcepub fn unwrap_text(&self) -> &str
pub fn unwrap_text(&self) -> &str
unwrap the text content if this a text node, panics if it is not a text node
sourcepub fn unwrap_safe_html(&self) -> &str
pub fn unwrap_safe_html(&self) -> &str
unwrap the text content if this a text node, panics if it is not a text node
Trait Implementations
sourceimpl Render for Leaf
impl Render for Leaf
sourcefn render_with_indent(
&self,
buffer: &mut dyn Write,
_indent: usize,
_compressed: bool
) -> Result
fn render_with_indent(
&self,
buffer: &mut dyn Write,
_indent: usize,
_compressed: bool
) -> Result
render instance to a writable buffer with indention
sourcefn render_compressed(&self, buffer: &mut dyn Write) -> Result
fn render_compressed(&self, buffer: &mut dyn Write) -> Result
no new_lines, no indents
sourcefn render_to_string(&self) -> String
fn render_to_string(&self) -> String
render compressed html to string
sourcefn render_to_string_pretty(&self) -> String
fn render_to_string_pretty(&self) -> String
render to string with nice indention
impl StructuralPartialEq for Leaf
Auto Trait Implementations
impl RefUnwindSafe for Leaf
impl Send for Leaf
impl Sync for Leaf
impl Unpin for Leaf
impl UnwindSafe for Leaf
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more