pub struct EndTag<'i> { /* private fields */ }
Expand description
An HTML end tag rewritable unit.
Exposes API for examination and modification of a parsed HTML end tag.
Implementations§
Source§impl<'i> EndTag<'i>
impl<'i> EndTag<'i>
Sourcepub fn name_preserve_case(&self) -> String
pub fn name_preserve_case(&self) -> String
Returns the name of the tag, preserving its case.
Sourcepub fn set_name_str(&mut self, name: String)
pub fn set_name_str(&mut self, name: String)
Sets the name of the tag only. To rename the element, prefer Element::set_tag_name()
.
The name will be converted to the document’s encoding.
The name must have a valid syntax, and the closing tag must be valid in its context. The parser will not take the new name into account, so if the new tag alters the structure of the document, the rest of the generated document will be parsed differently than during rewriting.
Sourcepub fn before(&mut self, content: &str, content_type: ContentType)
pub fn before(&mut self, content: &str, content_type: ContentType)
Inserts content
before the end tag.
Consequent calls to the method append content
to the previously inserted content.
Sourcepub fn after(&mut self, content: &str, content_type: ContentType)
pub fn after(&mut self, content: &str, content_type: ContentType)
Inserts content
after the end tag.
Consequent calls to the method prepend content
to the previously inserted content.
Sourcepub fn replace(&mut self, content: &str, content_type: ContentType)
pub fn replace(&mut self, content: &str, content_type: ContentType)
Replaces the end tag with content
.
Consequent calls to the method overwrite previous replacement content.
Sourcepub fn streaming_before(
&mut self,
string_writer: Box<dyn StreamingHandler + Send>,
)
pub fn streaming_before( &mut self, string_writer: Box<dyn StreamingHandler + Send>, )
Inserts content from a StreamingHandler
before the end tag.
Consequent calls to the method append to the previously inserted content.
Use the streaming!
macro to make a StreamingHandler
from a closure.
Sourcepub fn streaming_after(
&mut self,
string_writer: Box<dyn StreamingHandler + Send>,
)
pub fn streaming_after( &mut self, string_writer: Box<dyn StreamingHandler + Send>, )
Inserts content from a StreamingHandler
after the end tag.
Consequent calls to the method prepend to the previously inserted content.
Use the streaming!
macro to make a StreamingHandler
from a closure.
Sourcepub fn streaming_replace(
&mut self,
string_writer: Box<dyn StreamingHandler + Send>,
)
pub fn streaming_replace( &mut self, string_writer: Box<dyn StreamingHandler + Send>, )
Replaces the end tag with content from a StreamingHandler
.
Consequent calls to the method overwrite previous replacement content.
Use the streaming!
macro to make a StreamingHandler
from a closure.
Sourcepub fn source_location(&self) -> SourceLocation
pub fn source_location(&self) -> SourceLocation
Position of this tag in the source document, before any rewriting