pub enum Element<'life> {
Show 138 variants
Html(Html<'life>),
Base(Base<'life>),
Head(Head<'life>),
Link(Link<'life>),
Meta(Meta<'life>),
Style(Style<'life>),
Title(Title<'life>),
Body(Body<'life>),
Address(Address<'life>),
Article(Article<'life>),
Aside(Aside<'life>),
Footer(Footer<'life>),
Header(Header<'life>),
Hgroup(Hgroup<'life>),
Main(Main<'life>),
Nav(Nav<'life>),
Section(Section<'life>),
Blockquote(Blockquote<'life>),
Dd(Dd<'life>),
Div(Div<'life>),
Dl(Dl<'life>),
Dt(Dt<'life>),
Figcaption(Figcaption<'life>),
Figure(Figure<'life>),
Hr(Hr<'life>),
Li(Li<'life>),
Menu(Menu<'life>),
Ol(Ol<'life>),
P(P<'life>),
Pre(Pre<'life>),
Ul(Ul<'life>),
A(A<'life>),
Abbr(Abbr<'life>),
B(B<'life>),
Bdi(Bdi<'life>),
Bdo(Bdo<'life>),
Br(Br<'life>),
Cite(Cite<'life>),
Code(Code<'life>),
Data(Data<'life>),
Dfn(Dfn<'life>),
Em(Em<'life>),
I(I<'life>),
Kbd(Kbd<'life>),
Mark(Mark<'life>),
Q(Q<'life>),
Rp(Rp<'life>),
Rt(Rt<'life>),
Ruby(Ruby<'life>),
S(S<'life>),
Samp(Samp<'life>),
Small(Small<'life>),
Span(Span<'life>),
Strong(Strong<'life>),
Sub(Sub<'life>),
Sup(Sup<'life>),
Time(Time<'life>),
U(U<'life>),
Var(Var<'life>),
Wbr(Wbr<'life>),
Area(Area<'life>),
Audio(Audio<'life>),
Img(Img<'life>),
Map(Map<'life>),
Track(Track<'life>),
Video(Video<'life>),
Embed(Embed<'life>),
Iframe(Iframe<'life>),
Object(Object<'life>),
Picture(Picture<'life>),
Portal(Portal<'life>),
Source(Source<'life>),
Canvas(Canvas<'life>),
Noscript(Noscript<'life>),
Script(Script<'life>),
Del(Del<'life>),
Ins(Ins<'life>),
Caption(Caption<'life>),
Col(Col<'life>),
Colgroup(Colgroup<'life>),
Table(Table<'life>),
Tbody(Tbody<'life>),
Td(Td<'life>),
Tfoot(Tfoot<'life>),
Th(Th<'life>),
Thead(Thead<'life>),
Tr(Tr<'life>),
Button(Button<'life>),
Datalist(Datalist<'life>),
Fieldset(Fieldset<'life>),
Form(Form<'life>),
Input(Input<'life>),
Label(Label<'life>),
Legend(Legend<'life>),
Meter(Meter<'life>),
Optgroup(Optgroup<'life>),
Option(Option<'life>),
Output(Output<'life>),
Progress(Progress<'life>),
Select(Select<'life>),
Textarea(Textarea<'life>),
Details(Details<'life>),
Dialog(Dialog<'life>),
Summary(Summary<'life>),
Slot(Slot<'life>),
Template(Template<'life>),
Acronym(Acronym<'life>),
Applet(Applet<'life>),
Bgsound(Bgsound<'life>),
Big(Big<'life>),
Blink(Blink<'life>),
Center(Center<'life>),
Dir(Dir<'life>),
Font(Font<'life>),
Frame(Frame<'life>),
Frameset(Frameset<'life>),
Image(Image<'life>),
Keygen(Keygen<'life>),
Marquee(Marquee<'life>),
Menuitem(Menuitem<'life>),
Nobr(Nobr<'life>),
Noembed(Noembed<'life>),
Noframes(Noframes<'life>),
Param(Param<'life>),
Plaintext(Plaintext<'life>),
Rb(Rb<'life>),
Rtc(Rtc<'life>),
Spacer(Spacer<'life>),
Strike(Strike<'life>),
Tt(Tt<'life>),
Xmp(Xmp<'life>),
H1(H1<'life>),
H2(H2<'life>),
H3(H3<'life>),
H4(H4<'life>),
H5(H5<'life>),
H6(H6<'life>),
Unknown(Unknown<'life>),
}
Variants§
Html(Html<'life>)
Base(Base<'life>)
Head(Head<'life>)
Link(Link<'life>)
Meta(Meta<'life>)
Style(Style<'life>)
Title(Title<'life>)
Body(Body<'life>)
Address(Address<'life>)
Article(Article<'life>)
Aside(Aside<'life>)
Header(Header<'life>)
Hgroup(Hgroup<'life>)
Main(Main<'life>)
Section(Section<'life>)
Blockquote(Blockquote<'life>)
Dd(Dd<'life>)
Div(Div<'life>)
Dl(Dl<'life>)
Dt(Dt<'life>)
Figcaption(Figcaption<'life>)
Figure(Figure<'life>)
Hr(Hr<'life>)
Li(Li<'life>)
Menu(Menu<'life>)
Ol(Ol<'life>)
P(P<'life>)
Pre(Pre<'life>)
Ul(Ul<'life>)
A(A<'life>)
Abbr(Abbr<'life>)
B(B<'life>)
Bdi(Bdi<'life>)
Bdo(Bdo<'life>)
Br(Br<'life>)
Cite(Cite<'life>)
Code(Code<'life>)
Data(Data<'life>)
Dfn(Dfn<'life>)
Em(Em<'life>)
I(I<'life>)
Kbd(Kbd<'life>)
Mark(Mark<'life>)
Q(Q<'life>)
Rp(Rp<'life>)
Rt(Rt<'life>)
Ruby(Ruby<'life>)
S(S<'life>)
Samp(Samp<'life>)
Small(Small<'life>)
Span(Span<'life>)
Strong(Strong<'life>)
Sub(Sub<'life>)
Sup(Sup<'life>)
Time(Time<'life>)
U(U<'life>)
Var(Var<'life>)
Wbr(Wbr<'life>)
Area(Area<'life>)
Audio(Audio<'life>)
Img(Img<'life>)
Map(Map<'life>)
Track(Track<'life>)
Video(Video<'life>)
Embed(Embed<'life>)
Iframe(Iframe<'life>)
Object(Object<'life>)
Picture(Picture<'life>)
Portal(Portal<'life>)
Source(Source<'life>)
Canvas(Canvas<'life>)
Noscript(Noscript<'life>)
Script(Script<'life>)
Del(Del<'life>)
Ins(Ins<'life>)
Caption(Caption<'life>)
Col(Col<'life>)
Colgroup(Colgroup<'life>)
Table(Table<'life>)
Tbody(Tbody<'life>)
Td(Td<'life>)
Tfoot(Tfoot<'life>)
Th(Th<'life>)
Thead(Thead<'life>)
Tr(Tr<'life>)
Button(Button<'life>)
Datalist(Datalist<'life>)
Fieldset(Fieldset<'life>)
Form(Form<'life>)
Input(Input<'life>)
Label(Label<'life>)
Legend(Legend<'life>)
Meter(Meter<'life>)
Optgroup(Optgroup<'life>)
Option(Option<'life>)
Output(Output<'life>)
Progress(Progress<'life>)
Select(Select<'life>)
Textarea(Textarea<'life>)
Details(Details<'life>)
Dialog(Dialog<'life>)
Summary(Summary<'life>)
Slot(Slot<'life>)
Template(Template<'life>)
Acronym(Acronym<'life>)
Applet(Applet<'life>)
Bgsound(Bgsound<'life>)
Big(Big<'life>)
Blink(Blink<'life>)
Center(Center<'life>)
Dir(Dir<'life>)
Font(Font<'life>)
Frame(Frame<'life>)
Frameset(Frameset<'life>)
Image(Image<'life>)
Keygen(Keygen<'life>)
Marquee(Marquee<'life>)
Menuitem(Menuitem<'life>)
Nobr(Nobr<'life>)
Noembed(Noembed<'life>)
Noframes(Noframes<'life>)
Param(Param<'life>)
Plaintext(Plaintext<'life>)
Rb(Rb<'life>)
Rtc(Rtc<'life>)
Spacer(Spacer<'life>)
Strike(Strike<'life>)
Tt(Tt<'life>)
Xmp(Xmp<'life>)
H1(H1<'life>)
H2(H2<'life>)
H3(H3<'life>)
H4(H4<'life>)
H5(H5<'life>)
H6(H6<'life>)
Unknown(Unknown<'life>)
Implementations§
source§impl<'life> Element<'life>
impl<'life> Element<'life>
sourcepub fn set_attr(
&mut self,
name: &'life str,
value: impl Into<AttributeValue<'life>>
)
pub fn set_attr( &mut self, name: &'life str, value: impl Into<AttributeValue<'life>> )
Sets an attribute of the element.
This sets the attribute of the struct. If the attribute is not a known attribute, it is added to the extra
map.
If the alloc
feature is disabled, this function will silently fail.
Note
This only works when the attribute is lowercase.
source§impl<'life> Element<'life>
impl<'life> Element<'life>
sourcepub fn accesskey(&self) -> Option<AttributeValue<'life>>
pub fn accesskey(&self) -> Option<AttributeValue<'life>>
Provides a hint for generating a keyboard shortcut for the current element. This attribute consists of a space-separated list of characters. The browser should use the first one that exists on the computer keyboard layout.
sourcepub fn autocapitalize(&self) -> Option<AttributeValue<'life>>
pub fn autocapitalize(&self) -> Option<AttributeValue<'life>>
Controls whether and how text input is automatically capitalized as it is entered/edited by the user. It can have the following values:
off
ornone
, no autocapitalization is applied (all letters default to lowercase)on
orsentences
, the first letter of each sentence defaults to a capital letter; all other letters default to lowercasewords
, the first letter of each word defaults to a capital letter; all other letters default to lowercasecharacters
, all letters should default to uppercase
sourcepub fn autofocus(&self) -> Option<AttributeValue<'life>>
pub fn autofocus(&self) -> Option<AttributeValue<'life>>
Indicates that an element is to be focused on page load, or as soon as the <dialog>
it is part of is displayed. This attribute is a boolean, initially false.
sourcepub fn class(&self) -> Option<AttributeValue<'life>>
pub fn class(&self) -> Option<AttributeValue<'life>>
A space-separated list of the classes of the element. Classes allow CSS and JavaScript to select and access specific elements via the class selectors or functions like the method Document.getElementsByClassName()
.
sourcepub fn contenteditable(&self) -> Option<AttributeValue<'life>>
pub fn contenteditable(&self) -> Option<AttributeValue<'life>>
An enumerated attribute indicating if the element should be editable by the user. If so, the browser modifies its widget to allow editing. The attribute must take one of the following values:
true
or the empty string, which indicates that the element must be editable;false
, which indicates that the element must not be editable.
sourcepub fn data(&self) -> &BTreeMap<&'life str, AttributeValue<'life>>
pub fn data(&self) -> &BTreeMap<&'life str, AttributeValue<'life>>
Forms a class of attributes, called custom data attributes, that allow proprietary information to be exchanged between the HTML and its DOM representation that may be used by scripts. All such custom data are available via the HTMLElement
interface of the element the attribute is set on. The HTMLElement.dataset
property gives access to them.
sourcepub fn dir(&self) -> Option<AttributeValue<'life>>
pub fn dir(&self) -> Option<AttributeValue<'life>>
An enumerated attribute indicating the directionality of the element's text. It can have the following values:
ltr
, which means left to right and is to be used for languages that are written from the left to the right (like English);rtl
, which means right to left and is to be used for languages that are written from the right to the left (like Arabic);auto
, which lets the user agent decide. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then it applies that directionality to the whole element.
sourcepub fn draggable(&self) -> Option<AttributeValue<'life>>
pub fn draggable(&self) -> Option<AttributeValue<'life>>
An enumerated attribute indicating whether the element can be dragged, using the Drag and Drop API. It can have the following values:
true
, which indicates that the element may be draggedfalse
, which indicates that the element may not be dragged.
sourcepub fn enterkeyhint(&self) -> Option<AttributeValue<'life>>
pub fn enterkeyhint(&self) -> Option<AttributeValue<'life>>
Hints what action label (or icon) to present for the enter key on virtual keyboards.
sourcepub fn exportparts(&self) -> Option<AttributeValue<'life>>
pub fn exportparts(&self) -> Option<AttributeValue<'life>>
Used to transitively export shadow parts from a nested shadow tree into a containing light tree.
sourcepub fn extra(&self) -> &BTreeMap<&'life str, AttributeValue<'life>>
pub fn extra(&self) -> &BTreeMap<&'life str, AttributeValue<'life>>
Extra attributes of the element. This is a map of attribute names to their values, and the attribute names are in lowercase.
An enumerated attribute indicating that the element is not yet, or is no longer, relevant. For example, it can be used to hide elements of the page that can't be used until the login process has been completed. The browser won't render such elements. This attribute must not be used to hide content that could legitimately be shown.
sourcepub fn id(&self) -> Option<AttributeValue<'life>>
pub fn id(&self) -> Option<AttributeValue<'life>>
Defines a unique identifier (ID) which must be unique in the whole document. Its purpose is to identify the element when linking (using a fragment identifier), scripting, or styling (with CSS).
sourcepub fn inert(&self) -> Option<AttributeValue<'life>>
pub fn inert(&self) -> Option<AttributeValue<'life>>
A boolean value that makes the browser disregard user input events for the element. Useful when click events are present.
sourcepub fn inputmode(&self) -> Option<AttributeValue<'life>>
pub fn inputmode(&self) -> Option<AttributeValue<'life>>
Provides a hint to browsers about the type of virtual keyboard configuration to use when editing this element or its contents. Used primarily on <input>
elements, but is usable on any element while in contenteditable
mode.
sourcepub fn is(&self) -> Option<AttributeValue<'life>>
pub fn is(&self) -> Option<AttributeValue<'life>>
Allows you to specify that a standard HTML element should behave like a registered custom built-in element (see Using custom elements for more details).
sourcepub fn set_accesskey(&mut self, val: AttributeValue<'life>)
pub fn set_accesskey(&mut self, val: AttributeValue<'life>)
Provides a hint for generating a keyboard shortcut for the current element. This attribute consists of a space-separated list of characters. The browser should use the first one that exists on the computer keyboard layout.
sourcepub fn set_autocapitalize(&mut self, val: AttributeValue<'life>)
pub fn set_autocapitalize(&mut self, val: AttributeValue<'life>)
Controls whether and how text input is automatically capitalized as it is entered/edited by the user. It can have the following values:
off
ornone
, no autocapitalization is applied (all letters default to lowercase)on
orsentences
, the first letter of each sentence defaults to a capital letter; all other letters default to lowercasewords
, the first letter of each word defaults to a capital letter; all other letters default to lowercasecharacters
, all letters should default to uppercase
sourcepub fn set_autofocus(&mut self, val: AttributeValue<'life>)
pub fn set_autofocus(&mut self, val: AttributeValue<'life>)
Indicates that an element is to be focused on page load, or as soon as the <dialog>
it is part of is displayed. This attribute is a boolean, initially false.
sourcepub fn set_class(&mut self, val: AttributeValue<'life>)
pub fn set_class(&mut self, val: AttributeValue<'life>)
A space-separated list of the classes of the element. Classes allow CSS and JavaScript to select and access specific elements via the class selectors or functions like the method Document.getElementsByClassName()
.
sourcepub fn set_contenteditable(&mut self, val: AttributeValue<'life>)
pub fn set_contenteditable(&mut self, val: AttributeValue<'life>)
An enumerated attribute indicating if the element should be editable by the user. If so, the browser modifies its widget to allow editing. The attribute must take one of the following values:
true
or the empty string, which indicates that the element must be editable;false
, which indicates that the element must not be editable.
sourcepub fn set_dir(&mut self, val: AttributeValue<'life>)
pub fn set_dir(&mut self, val: AttributeValue<'life>)
An enumerated attribute indicating the directionality of the element's text. It can have the following values:
ltr
, which means left to right and is to be used for languages that are written from the left to the right (like English);rtl
, which means right to left and is to be used for languages that are written from the right to the left (like Arabic);auto
, which lets the user agent decide. It uses a basic algorithm as it parses the characters inside the element until it finds a character with a strong directionality, then it applies that directionality to the whole element.
sourcepub fn set_draggable(&mut self, val: AttributeValue<'life>)
pub fn set_draggable(&mut self, val: AttributeValue<'life>)
An enumerated attribute indicating whether the element can be dragged, using the Drag and Drop API. It can have the following values:
true
, which indicates that the element may be draggedfalse
, which indicates that the element may not be dragged.
sourcepub fn set_enterkeyhint(&mut self, val: AttributeValue<'life>)
pub fn set_enterkeyhint(&mut self, val: AttributeValue<'life>)
Hints what action label (or icon) to present for the enter key on virtual keyboards.
sourcepub fn set_exportparts(&mut self, val: AttributeValue<'life>)
pub fn set_exportparts(&mut self, val: AttributeValue<'life>)
Used to transitively export shadow parts from a nested shadow tree into a containing light tree.
An enumerated attribute indicating that the element is not yet, or is no longer, relevant. For example, it can be used to hide elements of the page that can't be used until the login process has been completed. The browser won't render such elements. This attribute must not be used to hide content that could legitimately be shown.
sourcepub fn set_id(&mut self, val: AttributeValue<'life>)
pub fn set_id(&mut self, val: AttributeValue<'life>)
Defines a unique identifier (ID) which must be unique in the whole document. Its purpose is to identify the element when linking (using a fragment identifier), scripting, or styling (with CSS).
sourcepub fn set_inert(&mut self, val: AttributeValue<'life>)
pub fn set_inert(&mut self, val: AttributeValue<'life>)
A boolean value that makes the browser disregard user input events for the element. Useful when click events are present.
sourcepub fn set_inputmode(&mut self, val: AttributeValue<'life>)
pub fn set_inputmode(&mut self, val: AttributeValue<'life>)
Provides a hint to browsers about the type of virtual keyboard configuration to use when editing this element or its contents. Used primarily on <input>
elements, but is usable on any element while in contenteditable
mode.
sourcepub fn set_is(&mut self, val: AttributeValue<'life>)
pub fn set_is(&mut self, val: AttributeValue<'life>)
Allows you to specify that a standard HTML element should behave like a registered custom built-in element (see Using custom elements for more details).
Trait Implementations§
source§impl<'life> Ord for Element<'life>
impl<'life> Ord for Element<'life>
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl<'life> PartialEq<Element<'life>> for Element<'life>
impl<'life> PartialEq<Element<'life>> for Element<'life>
source§impl<'life> PartialOrd<Element<'life>> for Element<'life>
impl<'life> PartialOrd<Element<'life>> for Element<'life>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more