[−][src]Struct lol_html::html_content::Doctype
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();
Methods
impl<'i> Doctype<'i>
[src]
pub fn name(&self) -> Option<String>
[src]
The name of the doctype.
pub fn public_id(&self) -> Option<String>
[src]
The public identifier of the doctype.
pub fn system_id(&self) -> Option<String>
[src]
The system identifier of the doctype.
Trait Implementations
impl<'_> Debug for Doctype<'_>
[src]
impl<'_> UserData for Doctype<'_>
[src]
fn user_data(&self) -> &dyn Any
[src]
fn user_data_mut(&mut self) -> &mut dyn Any
[src]
fn set_user_data(&mut self, data: impl Any)
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,