Skip to main content

HtmlTag

Enum HtmlTag 

#[non_exhaustive]
pub enum HtmlTag<'a> {
Show 137 variants A, Abbr, Address, Area, Article, Aside, Audio, B, Base, Bdi, Bdo, Big, Blockquote, Body, Br, Button, Canvas, Caption, Center, Cite, Code, Col, Colgroup, Data, Datalist, Dd, Del, Desc, Details, Dfn, Dialog, Div, Dl, Dt, Em, Embed, Fieldset, Figcaption, Figure, Font, Footer, Foreignobject, Form, Frameset, H1, H2, H3, H4, H5, H6, Head, Header, Hgroup, Hr, Html, I, Iframe, Img, Input, Ins, Kbd, Keygen, Label, Legend, Li, Link, Listing, Main, Map, Mark, Math, Menu, Meta, Meter, Mi, Mn, Mo, Ms, Mtext, Nav, Nobr, Noembed, Noframes, Noscript, Object, Ol, Optgroup, Option, Output, P, Param, Picture, Plaintext, Pre, Progress, Q, Rb, Rp, Rt, Rtc, Ruby, S, Samp, Script, Search, Section, Select, Small, Source, Span, Strike, Strong, Style, Sub, Summary, Sup, Svg, Table, Tbody, Td, Template, Textarea, Tfoot, Th, Thead, Time, Title, Tr, Track, Tt, U, Ul, Var, Video, Wbr, Xmp, Other(&'a [u8]),
}
Available on crate features html and http only.
Expand description

A classified HTML tag name.

Known elements (the HTML5 set plus the foreign-content and legacy tags the parser tracks) are fieldless variants; anything else is Other, borrowing the original-case name bytes.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

A

The <a> element.

§

Abbr

The <abbr> element.

§

Address

The <address> element.

§

Area

The <area> element.

§

Article

The <article> element.

§

Aside

The <aside> element.

§

Audio

The <audio> element.

§

B

The <b> element.

§

Base

The <base> element.

§

Bdi

The <bdi> element.

§

Bdo

The <bdo> element.

§

Big

The <big> element.

§

Blockquote

The <blockquote> element.

§

Body

The <body> element.

§

Br

The <br> element.

§

Button

The <button> element.

§

Canvas

The <canvas> element.

§

Caption

The <caption> element.

§

Center

The <center> element.

§

Cite

The <cite> element.

§

Code

The <code> element.

§

Col

The <col> element.

§

Colgroup

The <colgroup> element.

§

Data

The <data> element.

§

Datalist

The <datalist> element.

§

Dd

The <dd> element.

§

Del

The <del> element.

§

Desc

The <desc> element.

§

Details

The <details> element.

§

Dfn

The <dfn> element.

§

Dialog

The <dialog> element.

§

Div

The <div> element.

§

Dl

The <dl> element.

§

Dt

The <dt> element.

§

Em

The <em> element.

§

Embed

The <embed> element.

§

Fieldset

The <fieldset> element.

§

Figcaption

The <figcaption> element.

§

Figure

The <figure> element.

§

Font

The <font> element.

§

Footer

The <footer> element.

§

Foreignobject

The <foreignobject> element.

§

Form

The <form> element.

§

Frameset

The <frameset> element.

§

H1

The <h1> element.

§

H2

The <h2> element.

§

H3

The <h3> element.

§

H4

The <h4> element.

§

H5

The <h5> element.

§

H6

The <h6> element.

§

Head

The <head> element.

§

Header

The <header> element.

§

Hgroup

The <hgroup> element.

§

Hr

The <hr> element.

§

Html

The <html> element.

§

I

The <i> element.

§

Iframe

The <iframe> element.

§

Img

The <img> element.

§

Input

The <input> element.

§

Ins

The <ins> element.

§

Kbd

The <kbd> element.

§

Keygen

The <keygen> element.

§

Label

The <label> element.

§

Legend

The <legend> element.

§

Li

The <li> element.

The <link> element.

§

Listing

The <listing> element.

§

Main

The <main> element.

§

Map

The <map> element.

§

Mark

The <mark> element.

§

Math

The <math> element.

§

Menu

The <menu> element.

§

Meta

The <meta> element.

§

Meter

The <meter> element.

§

Mi

The <mi> element.

§

Mn

The <mn> element.

§

Mo

The <mo> element.

§

Ms

The <ms> element.

§

Mtext

The <mtext> element.

§

Nav

The <nav> element.

§

Nobr

The <nobr> element.

§

Noembed

The <noembed> element.

§

Noframes

The <noframes> element.

§

Noscript

The <noscript> element.

§

Object

The <object> element.

§

Ol

The <ol> element.

§

Optgroup

The <optgroup> element.

§

Option

The <option> element.

§

Output

The <output> element.

§

P

The <p> element.

§

Param

The <param> element.

§

Picture

The <picture> element.

§

Plaintext

The <plaintext> element.

§

Pre

The <pre> element.

§

Progress

The <progress> element.

§

Q

The <q> element.

§

Rb

The <rb> element.

§

Rp

The <rp> element.

§

Rt

The <rt> element.

§

Rtc

The <rtc> element.

§

Ruby

The <ruby> element.

§

S

The <s> element.

§

Samp

The <samp> element.

§

Script

The <script> element.

§

Search

The <search> element.

§

Section

The <section> element.

§

Select

The <select> element.

§

Small

The <small> element.

§

Source

The <source> element.

§

Span

The <span> element.

§

Strike

The <strike> element.

§

Strong

The <strong> element.

§

Style

The <style> element.

§

Sub

The <sub> element.

§

Summary

The <summary> element.

§

Sup

The <sup> element.

§

Svg

The <svg> element.

§

Table

The <table> element.

§

Tbody

The <tbody> element.

§

Td

The <td> element.

§

Template

The <template> element.

§

Textarea

The <textarea> element.

§

Tfoot

The <tfoot> element.

§

Th

The <th> element.

§

Thead

The <thead> element.

§

Time

The <time> element.

§

Title

The <title> element.

§

Tr

The <tr> element.

§

Track

The <track> element.

§

Tt

The <tt> element.

§

U

The <u> element.

§

Ul

The <ul> element.

§

Var

The <var> element.

§

Video

The <video> element.

§

Wbr

The <wbr> element.

§

Xmp

The <xmp> element.

§

Other(&'a [u8])

A tag outside the known set (e.g. a custom element). Borrows the original-case name bytes from the source.

Implementations§

§

impl<'a> HtmlTag<'a>

pub fn as_bytes(&self) -> &'a [u8]

The tag name as bytes — lowercase for a known element, the original bytes for Other.

§

impl HtmlTag<'_>

pub fn is_void(&self) -> bool

Returns true if this is an HTML5 void element: one that never has content or an end tag — area, base, br, col, embed, hr, img, input, link, meta, source, track, wbr.

Note param is not void in the current spec (it is obsolete).

pub fn is_raw_text(&self) -> bool

Returns true if this is a raw text elementscript or style. Their content is tokenized verbatim: no markup, no character references, only the matching end tag closes them.

This is the spec category, not rama’s broader tokenizer raw-text set (which also covers legacy xmp / iframe / noembed / noframes / noscript).

pub fn is_escapable_raw_text(&self) -> bool

Returns true if this is an escapable raw text elementtextarea or title. Like a raw text element, but character references are recognized in its content.

pub fn is_phrasing_content(&self) -> bool

Returns true if this is phrasing content — the spec category for the text-level (“inline”) elements: the runs of text in a document and the elements that mark them up (a, span, em, strong, img, br, input, script, …).

Membership is the current WHATWG list of elements that are inherently phrasing content. Elements that qualify only in a specific context (area within a map, link / meta carrying an itemprop) are excluded — this is a name-only predicate. Obsolete presentational tags (big, font, tt, strike, nobr) are excluded too; they are not in the modern content model.

Trait Implementations§

§

impl<'a> Clone for HtmlTag<'a>

§

fn clone(&self) -> HtmlTag<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
§

impl<'a> Copy for HtmlTag<'a>

§

impl<'a> Debug for HtmlTag<'a>

§

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

Formats the value using the given formatter. Read more
§

impl<'a> Eq for HtmlTag<'a>

§

impl<'a> Hash for HtmlTag<'a>

§

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

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
§

impl<'a> PartialEq for HtmlTag<'a>

§

fn eq(&self, other: &HtmlTag<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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.
§

impl<'a> StructuralPartialEq for HtmlTag<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for HtmlTag<'a>

§

impl<'a> RefUnwindSafe for HtmlTag<'a>

§

impl<'a> Send for HtmlTag<'a>

§

impl<'a> Sync for HtmlTag<'a>

§

impl<'a> Unpin for HtmlTag<'a>

§

impl<'a> UnsafeUnpin for HtmlTag<'a>

§

impl<'a> UnwindSafe for HtmlTag<'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
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a rama_grpc::Request
§

impl<L> LayerExt<L> for L

§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
§

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

§

fn rama_from(value: T) -> U

§

impl<T, U, CrateMarker> RamaInto<U, CrateMarker> for T
where U: RamaFrom<T, CrateMarker>,

§

fn rama_into(self) -> U

§

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

§

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

§

fn rama_try_from(value: T) -> Result<U, <U as RamaTryFrom<T>>::Error>

§

impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for T
where U: RamaTryFrom<T, CrateMarker>,

§

type Error = <U as RamaTryFrom<T, CrateMarker>>::Error

§

fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<V, F> ValueFormatter<&V> for F
where F: ValueFormatter<V> + ?Sized, V: ?Sized,

§

fn format_value(writer: impl ValueWriter, value: &&V)

Write value to writer
§

impl<V, F> ValueFormatter<Arc<V>> for F
where F: ValueFormatter<V> + ?Sized, V: ?Sized,

§

fn format_value(writer: impl ValueWriter, value: &Arc<V>)

Write value to writer
§

impl<V, F> ValueFormatter<Box<V>> for F
where F: ValueFormatter<V> + ?Sized, V: ?Sized,

§

fn format_value(writer: impl ValueWriter, value: &Box<V>)

Write value to writer
§

impl<V, F> ValueFormatter<Cow<'_, V>> for F
where V: ToOwned + ?Sized, F: ValueFormatter<V> + ?Sized,

§

fn format_value(writer: impl ValueWriter, value: &Cow<'_, V>)

Write value to writer
§

impl<V, F> ValueFormatter<Option<V>> for F
where F: ValueFormatter<V> + ?Sized,

§

fn format_value(writer: impl ValueWriter, value: &Option<V>)

Write value to writer
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more