Struct LabelBuilder

Source
pub struct LabelBuilder(/* private fields */);

Implementations§

Source§

impl LabelBuilder

Source

pub fn id(self, value: impl AttributeValue<String>) -> Self

Source

pub fn class(self, value: impl AttributeValue<String>) -> Self

Source

pub fn for_(self, value: impl AttributeValue<String>) -> Self

The id of a labelable form-related element in the same document as the <label> element. The first element in the document with an id matching the value of the for attribute is the labeled control for this label element, if it is a labelable element. If it is not labelable then the for attribute has no effect. If there are other elements which also match the id value, later in the document, they are not considered.

Note: A <label> element can have both a for attribute and a contained control element, as long as the for attribute points to the contained control element.

Source

pub fn form(self, value: impl AttributeValue<String>) -> Self

The <form> element with which the label is associated (its form owner). If specified, the value of the attribute is the id of a <form> element in the same document. This lets you place label elements anywhere within a document, not just as descendants of their form elements.

Source§

impl LabelBuilder

Source

pub fn on_blur( self, f: impl 'static + FnMut(FocusEvent, HtmlLabelElement), ) -> Self

Source

pub fn on_click( self, f: impl 'static + FnMut(MouseEvent, HtmlLabelElement), ) -> Self

Source

pub fn on_change(self, f: impl 'static + FnMut(Event, HtmlLabelElement)) -> Self

Source

pub fn on_dblclick( self, f: impl 'static + FnMut(MouseEvent, HtmlLabelElement), ) -> Self

Source

pub fn on_focusout( self, f: impl 'static + FnMut(FocusEvent, HtmlLabelElement), ) -> Self

Source

pub fn on_input( self, f: impl 'static + FnMut(InputEvent, HtmlLabelElement), ) -> Self

Source

pub fn on_keydown( self, f: impl 'static + FnMut(KeyboardEvent, HtmlLabelElement), ) -> Self

Source

pub fn on_keyup( self, f: impl 'static + FnMut(KeyboardEvent, HtmlLabelElement), ) -> Self

Source

pub fn effect(self, f: impl Effect<HtmlLabelElement>) -> Self

Source§

impl LabelBuilder

Source

pub fn text(self, child: impl Text) -> Self

Source

pub fn child<Child>(self, c: Child) -> Self
where Child: Into<Element>,

Trait Implementations§

Source§

impl Builder for LabelBuilder

Source§

impl DomElement for LabelBuilder

Source§

impl From<LabelBuilder> for Element

Source§

fn from(builder: LabelBuilder) -> Self

Converts to this type from the input type.
Source§

impl From<LabelBuilder> for ElementBuilder

Source§

fn from(builder: LabelBuilder) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

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 = 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.