[][src]Struct lol_html::html_content::Doctype

pub struct Doctype<'i> { /* fields omitted */ }

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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.