DomElement

Struct DomElement 

Source
pub struct DomElement { /* private fields */ }
Expand description

A Real DOM representative - element kind

Implementations§

Source§

impl DomElement

Source

pub fn new(name: impl Into<StaticString>) -> Self

Source

pub fn add_attr( &self, name: impl Into<StaticString>, value: impl Into<AttrValue>, )

Source

pub fn add_attr_group( self, values: impl IntoIterator<Item = (impl Into<String>, impl Into<AttrGroupValue>)>, ) -> Self

Source

pub fn add_attr_group_item(self, key: String, value: AttrGroupValue) -> Self

Source

pub fn add_child(&self, child_node: impl Into<DomNode>)

Source

pub fn add_child_text(&self, text: impl Into<String>)

Source

pub fn attr( self, name: impl Into<StaticString>, value: impl Into<AttrValue>, ) -> Self

Source

pub fn attrs<T: Into<AttrValue>>( self, attrs: Vec<(impl Into<StaticString>, T)>, ) -> Self

Source

pub fn child(self, child_node: impl Into<DomNode>) -> Self

Source

pub fn child_text(self, text: impl Into<String>) -> Self

Source

pub fn children<C: Into<DomNode>>(self, children: Vec<C>) -> Self

Source

pub fn css(self, css: impl Into<CssAttrValue>) -> Self

Source

pub fn css_with_class_name( self, css: impl Into<CssAttrValue>, debug_class_name: Option<String>, ) -> Self

Source

pub fn get_ref(&self) -> DomElementRef

Source

pub fn hook_key_down( self, on_hook_key_down: impl Into<Callback1<KeyDownEvent, bool>>, ) -> Self

Source

pub fn hook_key_down_rc( self, on_hook_key_down: Rc<Callback1<KeyDownEvent, bool>>, ) -> Self

Source

pub fn id_dom(&self) -> DomId

Source

pub fn on_blur(self, on_blur: impl Into<Callback<()>>) -> Self

Source

pub fn on_blur_rc(self, on_blur: Rc<Callback<()>>) -> Self

Source

pub fn on_change(self, on_change: impl Into<Callback1<String, ()>>) -> Self

Source

pub fn on_change_rc(self, on_change: Rc<Callback1<String, ()>>) -> Self

Source

pub fn on_click(self, on_click: impl Into<Callback1<ClickEvent, ()>>) -> Self

Source

pub fn on_click_rc(self, on_click: Rc<Callback1<ClickEvent, ()>>) -> Self

Source

pub fn on_dropfile( self, on_dropfile: impl Into<Callback1<DropFileEvent, ()>>, ) -> Self

Source

pub fn on_dropfile_rc( self, on_dropfile: Rc<Callback1<DropFileEvent, ()>>, ) -> Self

Source

pub fn on_input(self, on_input: impl Into<Callback1<String, ()>>) -> Self

Source

pub fn on_input_rc(self, on_input: Rc<Callback1<String, ()>>) -> Self

Source

pub fn on_key_down( self, on_key_down: impl Into<Callback1<KeyDownEvent, bool>>, ) -> Self

Source

pub fn on_key_down_rc( self, on_key_down: Rc<Callback1<KeyDownEvent, bool>>, ) -> Self

Source

pub fn on_load(self, on_load: impl Into<Callback<()>>) -> Self

Source

pub fn on_load_rc(self, on_load: Rc<Callback<()>>) -> Self

Source

pub fn on_mouse_down(self, on_mouse_down: impl Into<Callback<bool>>) -> Self

Source

pub fn on_mouse_down_rc(self, on_mouse_down: Rc<Callback<bool>>) -> Self

Source

pub fn on_mouse_enter(self, on_mouse_enter: impl Into<Callback<()>>) -> Self

Source

pub fn on_mouse_enter_rc(self, on_mouse_enter: Rc<Callback<()>>) -> Self

Source

pub fn on_mouse_leave(self, on_mouse_leave: impl Into<Callback<()>>) -> Self

Source

pub fn on_mouse_leave_rc(self, on_mouse_leave: Rc<Callback<()>>) -> Self

Source

pub fn on_mouse_up(self, on_mouse_up: impl Into<Callback<bool>>) -> Self

Source

pub fn on_mouse_up_rc(self, on_mouse_up: Rc<Callback<bool>>) -> Self

Source

pub fn on_submit(self, on_submit: impl Into<Callback<()>>) -> Self

Source

pub fn on_submit_rc(self, on_submit: Rc<Callback<()>>) -> Self

Trait Implementations§

Source§

impl Drop for DomElement

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl EmbedDom for DomElement

Source§

impl From<DomElement> for DomNode

Source§

fn from(node: DomElement) -> 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.