Skip to main content

Tag

Struct Tag 

Source
pub struct Tag<'a> {
    pub name: &'a str,
    pub self_closing: bool,
    /* private fields */
}

Fields§

§name: &'a str

Lowercased, as the spec stores tag names.

§self_closing: bool

Implementations§

Source§

impl<'a> Tag<'a>

Source

pub fn attrs(&self) -> Attrs<'a> ⓘ

The attributes in source order, names lowercased, duplicates dropped (the first one wins). Each is a slice of the input when nothing in it had to change.

Source

pub fn attr_span(&self, i: usize) -> Option<Range<usize>>

Where the ith attribute Tag::attrs gives was written, as a range of the input from its name’s first byte to the end of its value (past a closing quote), or of its name when it has none.

Trait Implementations§

Source§

impl<'a> Debug for Tag<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Forget for Tag<'a>

§

impl<'a> Freeze for Tag<'a>

§

impl<'a> Move for Tag<'a>

§

impl<'a> RefUnwindSafe for Tag<'a>

§

impl<'a> Send for Tag<'a>

§

impl<'a> Sync for Tag<'a>

§

impl<'a> Unpin for Tag<'a>

§

impl<'a> UnsafeUnpin for Tag<'a>

§

impl<'a> UnwindSafe for Tag<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.