TagId

Enum TagId 

Source
#[repr(u8)]
pub enum TagId {
Show 113 variants Unknown = 0, A = 1, Abbr = 2, Address = 3, Area = 4, Article = 5, Aside = 6, Audio = 7, B = 8, Base = 9, Bdi = 10, Bdo = 11, Blockquote = 12, Body = 13, Br = 14, Button = 15, Canvas = 16, Caption = 17, Cite = 18, Code = 19, Col = 20, Colgroup = 21, Data = 22, Datalist = 23, Dd = 24, Del = 25, Details = 26, Dfn = 27, Dialog = 28, Div = 29, Dl = 30, Dt = 31, Em = 32, Embed = 33, Fieldset = 34, Figcaption = 35, Figure = 36, Footer = 37, Form = 38, H1 = 39, H2 = 40, H3 = 41, H4 = 42, H5 = 43, H6 = 44, Head = 45, Header = 46, Hgroup = 47, Hr = 48, Html = 49, I = 50, Iframe = 51, Img = 52, Input = 53, Ins = 54, Kbd = 55, Label = 56, Legend = 57, Li = 58, Link = 59, Main = 60, Map = 61, Mark = 62, Menu = 63, Meta = 64, Meter = 65, Nav = 66, Noscript = 67, Object = 68, Ol = 69, Optgroup = 70, Option = 71, Output = 72, P = 73, Param = 74, Picture = 75, Pre = 76, Progress = 77, Q = 78, Rp = 79, Rt = 80, Ruby = 81, S = 82, Samp = 83, Script = 84, Section = 85, Select = 86, Slot = 87, Small = 88, Source = 89, Span = 90, Strong = 91, Style = 92, Sub = 93, Summary = 94, Sup = 95, Table = 96, Tbody = 97, Td = 98, Template = 99, Textarea = 100, Tfoot = 101, Th = 102, Thead = 103, Time = 104, Title = 105, Tr = 106, Track = 107, U = 108, Ul = 109, Var = 110, Video = 111, Wbr = 112,
}
Expand description

Interned tag identifier for common HTML5 elements.

Known tags use a u8 discriminant for O(1) comparison. Unknown/custom tags fall back to string comparison.

Variants§

§

Unknown = 0

§

A = 1

§

Abbr = 2

§

Address = 3

§

Area = 4

§

Article = 5

§

Aside = 6

§

Audio = 7

§

B = 8

§

Base = 9

§

Bdi = 10

§

Bdo = 11

§

Blockquote = 12

§

Body = 13

§

Br = 14

§

Button = 15

§

Canvas = 16

§

Caption = 17

§

Cite = 18

§

Code = 19

§

Col = 20

§

Colgroup = 21

§

Data = 22

§

Datalist = 23

§

Dd = 24

§

Del = 25

§

Details = 26

§

Dfn = 27

§

Dialog = 28

§

Div = 29

§

Dl = 30

§

Dt = 31

§

Em = 32

§

Embed = 33

§

Fieldset = 34

§

Figcaption = 35

§

Figure = 36

§

Footer = 37

§

Form = 38

§

H1 = 39

§

H2 = 40

§

H3 = 41

§

H4 = 42

§

H5 = 43

§

H6 = 44

§

Head = 45

§

Header = 46

§

Hgroup = 47

§

Hr = 48

§

Html = 49

§

I = 50

§

Iframe = 51

§

Img = 52

§

Input = 53

§

Ins = 54

§

Kbd = 55

§

Label = 56

§

Legend = 57

§

Li = 58

§

Main = 60

§

Map = 61

§

Mark = 62

§

Menu = 63

§

Meta = 64

§

Meter = 65

§

Nav = 66

§

Noscript = 67

§

Object = 68

§

Ol = 69

§

Optgroup = 70

§

Option = 71

§

Output = 72

§

P = 73

§

Param = 74

§

Picture = 75

§

Pre = 76

§

Progress = 77

§

Q = 78

§

Rp = 79

§

Rt = 80

§

Ruby = 81

§

S = 82

§

Samp = 83

§

Script = 84

§

Section = 85

§

Select = 86

§

Slot = 87

§

Small = 88

§

Source = 89

§

Span = 90

§

Strong = 91

§

Style = 92

§

Sub = 93

§

Summary = 94

§

Sup = 95

§

Table = 96

§

Tbody = 97

§

Td = 98

§

Template = 99

§

Textarea = 100

§

Tfoot = 101

§

Th = 102

§

Thead = 103

§

Time = 104

§

Title = 105

§

Tr = 106

§

Track = 107

§

U = 108

§

Ul = 109

§

Var = 110

§

Video = 111

§

Wbr = 112

Implementations§

Source§

impl TagId

Source

pub fn from_name(name: &str) -> Self

Interns a tag name string to a TagId.

Source

pub const fn as_str(self) -> Option<&'static str>

Returns the canonical tag name.

Trait Implementations§

Source§

impl Clone for TagId

Source§

fn clone(&self) -> TagId

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TagId

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Hash for TagId

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for TagId

Source§

fn eq(&self, other: &TagId) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for TagId

Source§

impl Eq for TagId

Source§

impl StructuralPartialEq for TagId

Auto Trait Implementations§

§

impl Freeze for TagId

§

impl RefUnwindSafe for TagId

§

impl Send for TagId

§

impl Sync for TagId

§

impl Unpin for TagId

§

impl UnwindSafe for TagId

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.