Struct lol_html::html_content::Doctype
source · pub struct Doctype<'i> { /* private fields */ }
Expand description
A document type declaration preamble.
Note that unlike other HTML content, Doctype
can’t be modified and should be used only for
the examination purposes.
Example
use lol_html::{rewrite_str, doctype, RewriteStrSettings};
rewrite_str(
r#"<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd""#,
RewriteStrSettings {
document_content_handlers: vec![
doctype!(|d| {
assert_eq!(d.name(), Some("html".into()));
assert_eq!(d.public_id(), Some("-//W3C//DTD XHTML 1.0 Transitional//EN".into()));
assert_eq!(d.system_id(), Some("DTD/xhtml1-transitional.dtd".into()));
Ok(())
})
],
..RewriteStrSettings::default()
}
).unwrap();
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<'i> !RefUnwindSafe for Doctype<'i>
impl<'i> !Send for Doctype<'i>
impl<'i> !Sync for Doctype<'i>
impl<'i> Unpin for Doctype<'i>
impl<'i> !UnwindSafe for Doctype<'i>
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