pub trait AsElement: AsEntity + Sized {
Show 49 methods
// Provided methods
fn add_child<T: AsElement>(&self, child: T) { ... }
fn child(self, child: impl AsElement) -> Self { ... }
fn with_child<T: AsElement>(self, f: impl FnOnce(&Self) -> T) -> Self { ... }
fn add_children<Item: AsElement>(
&self,
children: impl IntoIterator<Item = Item>
) { ... }
fn children<Item: AsElement>(
self,
children: impl IntoIterator<Item = Item>
) -> Self { ... }
fn leave_parent(self) { ... }
fn add_child_at<T: AsElement>(&self, at_index: usize, child: T) { ... }
fn add_child_signal<S, E>(&self, signal: S)
where E: AsElement,
S: Signal<Item = E> + 'static { ... }
fn child_signal<S, E>(self, signal: S) -> Self
where E: AsElement,
S: Signal<Item = E> + 'static { ... }
fn set_class_tagged<Tag: Hash + 'static>(
&self,
tag: Tag,
style: impl Into<Style>
) { ... }
fn set_class_typed<Type: 'static>(&self, style: impl Into<Style>) { ... }
fn set_class(&self, style: impl Into<Style>) { ... }
fn add_class(&self, style: impl Into<Style>) { ... }
fn class(self, style: impl Into<Style>) -> Self { ... }
fn class_tagged<Tag: Hash + 'static>(
self,
tag: Tag,
style: impl Into<Style>
) -> Self { ... }
fn class_typed<Type: 'static>(self, style: impl Into<Style>) -> Self { ... }
fn set_class_signal<S, I>(&self, signal: S)
where I: Into<Style>,
S: Signal<Item = I> + 'static { ... }
fn class_signal<S, I>(self, signal: S) -> Self
where I: Into<Style>,
S: Signal<Item = I> + 'static { ... }
fn set_class_typed_signal<Type, S, I>(&self, signal: S)
where Type: 'static,
I: Into<Style>,
S: Signal<Item = I> + 'static { ... }
fn class_typed_signal<Type, S, I>(self, signal: S) -> Self
where Type: 'static,
I: Into<Style>,
S: Signal<Item = I> + 'static { ... }
fn set_class_tagged_signal<Tag, S, I>(&self, tag: Tag, signal: S)
where Tag: Hash + Copy + 'static,
I: Into<Style>,
S: Signal<Item = I> + 'static { ... }
fn class_tagged_signal<Tag, S, I>(self, tag: Tag, signal: S) -> Self
where Tag: Hash + Copy + 'static,
I: Into<Style>,
S: Signal<Item = I> + 'static { ... }
fn get_attr<'k>(&self, key: impl Into<Cow<'k, str>>) -> Option<String> { ... }
fn set_attr<'k, 'v>(
&self,
key: impl Into<Cow<'k, str>>,
value: impl Into<Cow<'v, str>>
) { ... }
fn attr<'k, 'v>(
self,
key: impl Into<Cow<'k, str>>,
value: impl Into<Cow<'v, str>>
) -> Self { ... }
fn set_bool_attr<'k>(&self, key: impl Into<Cow<'k, str>>, value: bool) { ... }
fn bool_attr<'k>(self, key: impl Into<Cow<'k, str>>, value: bool) -> Self { ... }
fn remove_attr<'k>(&self, key: impl Into<Cow<'k, str>>) { ... }
fn set_attr_signal<'k, 'v, S, K, V>(&self, attr: K, signal: S)
where K: Into<Cow<'k, str>>,
V: Into<Cow<'v, str>>,
S: Signal<Item = V> + 'static { ... }
fn attr_signal<'k, 'v, S, K, V>(self, attr: K, signal: S) -> Self
where K: Into<Cow<'k, str>>,
V: Into<Cow<'v, str>>,
S: Signal<Item = V> + 'static { ... }
fn set_bool_attr_signal<'k, S, K>(&self, attr: K, signal: S)
where K: Into<Cow<'k, str>>,
S: Signal<Item = bool> + 'static { ... }
fn bool_attr_signal<'k, S, K>(self, attr: K, signal: S) -> Self
where K: Into<Cow<'k, str>>,
S: Signal<Item = bool> + 'static { ... }
fn set_text<'a>(&self, text: impl Into<Cow<'a, str>>) { ... }
fn text<'a>(self, x: impl Into<Cow<'a, str>>) -> Self { ... }
fn set_text_signal<'a, S, I>(&self, signal: S)
where I: Into<Cow<'a, str>>,
S: Signal<Item = I> + 'static { ... }
fn text_signal<'a, S, I>(self, x: S) -> Self
where I: Into<Cow<'a, str>>,
S: Signal<Item = I> + 'static { ... }
fn set_style(&self, style: impl AppendProperty) { ... }
fn style(self, style: impl AppendProperty) -> Self { ... }
fn remove_style(&self) { ... }
fn set_style_signal<S, I>(&self, signal: S)
where I: AppendProperty,
S: Signal<Item = I> + 'static { ... }
fn style_signal<S, I>(self, signal: S) -> Self
where I: AppendProperty,
S: Signal<Item = I> + 'static { ... }
fn mark<T: 'static>(self) -> Self { ... }
fn unmark<T: 'static>(self) -> Self { ... }
fn mark_signal<T: 'static, S>(self, signal: S) -> Self
where S: Signal<Item = bool> + 'static { ... }
fn with_component<T: 'static>(self, f: impl FnOnce(&Self) -> T) -> Self { ... }
fn replace_with<T: AsElement>(&self, other: T) -> T { ... }
fn parent(&self) -> Element { ... }
fn with(self, f: impl FnOnce(&Self)) -> Self { ... }
fn as_element(&self) -> Element { ... }
}
Expand description
Marker trait for an entity that has web_sys::Node
, web_sys::Element
, web_sys::EventTarget
and one of web_sys::HtmlElement
or web_sys::SvgElement
as attached components
Provided Methods§
fn add_child<T: AsElement>(&self, child: T)
fn child(self, child: impl AsElement) -> Self
fn with_child<T: AsElement>(self, f: impl FnOnce(&Self) -> T) -> Self
fn add_children<Item: AsElement>( &self, children: impl IntoIterator<Item = Item> )
fn children<Item: AsElement>( self, children: impl IntoIterator<Item = Item> ) -> Self
fn leave_parent(self)
sourcefn add_child_at<T: AsElement>(&self, at_index: usize, child: T)
fn add_child_at<T: AsElement>(&self, at_index: usize, child: T)
add a child at an index, useful to update tables without regenerating the whole container element