Trait hobo::element::AsElement

source ·
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§

source

fn add_child<T: AsElement>(&self, child: T)

source

fn child(self, child: impl AsElement) -> Self

source

fn with_child<T: AsElement>(self, f: impl FnOnce(&Self) -> T) -> Self

source

fn add_children<Item: AsElement>( &self, children: impl IntoIterator<Item = Item> )

source

fn children<Item: AsElement>( self, children: impl IntoIterator<Item = Item> ) -> Self

source

fn leave_parent(self)

source

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

source

fn add_child_signal<S, E>(&self, signal: S)where E: AsElement, S: Signal<Item = E> + 'static,

source

fn child_signal<S, E>(self, signal: S) -> Selfwhere E: AsElement, S: Signal<Item = E> + 'static,

source

fn set_class_tagged<Tag: Hash + 'static>( &self, tag: Tag, style: impl Into<Style> )

source

fn set_class_typed<Type: 'static>(&self, style: impl Into<Style>)

source

fn set_class(&self, style: impl Into<Style>)

source

fn add_class(&self, style: impl Into<Style>)

source

fn class(self, style: impl Into<Style>) -> Self

source

fn class_tagged<Tag: Hash + 'static>( self, tag: Tag, style: impl Into<Style> ) -> Self

source

fn class_typed<Type: 'static>(self, style: impl Into<Style>) -> Self

source

fn set_class_signal<S, I>(&self, signal: S)where I: Into<Style>, S: Signal<Item = I> + 'static,

source

fn class_signal<S, I>(self, signal: S) -> Selfwhere I: Into<Style>, S: Signal<Item = I> + 'static,

source

fn set_class_typed_signal<Type, S, I>(&self, signal: S)where Type: 'static, I: Into<Style>, S: Signal<Item = I> + 'static,

source

fn class_typed_signal<Type, S, I>(self, signal: S) -> Selfwhere Type: 'static, I: Into<Style>, S: Signal<Item = I> + 'static,

source

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,

source

fn class_tagged_signal<Tag, S, I>(self, tag: Tag, signal: S) -> Selfwhere Tag: Hash + Copy + 'static, I: Into<Style>, S: Signal<Item = I> + 'static,

source

fn get_attr<'k>(&self, key: impl Into<Cow<'k, str>>) -> Option<String>

source

fn set_attr<'k, 'v>( &self, key: impl Into<Cow<'k, str>>, value: impl Into<Cow<'v, str>> )

source

fn attr<'k, 'v>( self, key: impl Into<Cow<'k, str>>, value: impl Into<Cow<'v, str>> ) -> Self

source

fn set_bool_attr<'k>(&self, key: impl Into<Cow<'k, str>>, value: bool)

source

fn bool_attr<'k>(self, key: impl Into<Cow<'k, str>>, value: bool) -> Self

source

fn remove_attr<'k>(&self, key: impl Into<Cow<'k, str>>)

source

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,

source

fn attr_signal<'k, 'v, S, K, V>(self, attr: K, signal: S) -> Selfwhere K: Into<Cow<'k, str>>, V: Into<Cow<'v, str>>, S: Signal<Item = V> + 'static,

source

fn set_bool_attr_signal<'k, S, K>(&self, attr: K, signal: S)where K: Into<Cow<'k, str>>, S: Signal<Item = bool> + 'static,

source

fn bool_attr_signal<'k, S, K>(self, attr: K, signal: S) -> Selfwhere K: Into<Cow<'k, str>>, S: Signal<Item = bool> + 'static,

source

fn set_text<'a>(&self, text: impl Into<Cow<'a, str>>)

source

fn text<'a>(self, x: impl Into<Cow<'a, str>>) -> Self

source

fn set_text_signal<'a, S, I>(&self, signal: S)where I: Into<Cow<'a, str>>, S: Signal<Item = I> + 'static,

source

fn text_signal<'a, S, I>(self, x: S) -> Selfwhere I: Into<Cow<'a, str>>, S: Signal<Item = I> + 'static,

source

fn set_style(&self, style: impl AppendProperty)

source

fn style(self, style: impl AppendProperty) -> Self

source

fn remove_style(&self)

source

fn set_style_signal<S, I>(&self, signal: S)where I: AppendProperty, S: Signal<Item = I> + 'static,

source

fn style_signal<S, I>(self, signal: S) -> Selfwhere I: AppendProperty, S: Signal<Item = I> + 'static,

source

fn mark<T: 'static>(self) -> Self

source

fn unmark<T: 'static>(self) -> Self

source

fn mark_signal<T: 'static, S>(self, signal: S) -> Selfwhere S: Signal<Item = bool> + 'static,

source

fn with_component<T: 'static>(self, f: impl FnOnce(&Self) -> T) -> Self

source

fn replace_with<T: AsElement>(&self, other: T) -> T

source

fn parent(&self) -> Element

source

fn with(self, f: impl FnOnce(&Self)) -> Self

👎Deprecated: use .tap() instead
source

fn as_element(&self) -> Element

Implementations on Foreign Types§

source§

impl<T: AsElement> AsElement for &mut T

source§

impl<T: AsElement> AsElement for &T

Implementors§

source§

impl AsElement for A

source§

impl AsElement for Abbr

source§

impl AsElement for Address

source§

impl AsElement for Animate

source§

impl AsElement for AnimateMotion

source§

impl AsElement for AnimateTransform

source§

impl AsElement for Area

source§

impl AsElement for Article

source§

impl AsElement for Aside

source§

impl AsElement for Audio

source§

impl AsElement for B

source§

impl AsElement for Base

source§

impl AsElement for Bdi

source§

impl AsElement for Bdo

source§

impl AsElement for Blockquote

source§

impl AsElement for Body

source§

impl AsElement for Br

source§

impl AsElement for Button

source§

impl AsElement for Canvas

source§

impl AsElement for Caption

source§

impl AsElement for Circle

source§

impl AsElement for Cite

source§

impl AsElement for ClipPath

source§

impl AsElement for Code

source§

impl AsElement for Col

source§

impl AsElement for Colgroup

source§

impl AsElement for Data

source§

impl AsElement for Datalist

source§

impl AsElement for Dd

source§

impl AsElement for Defs

source§

impl AsElement for Del

source§

impl AsElement for Desc

source§

impl AsElement for Details

source§

impl AsElement for Dfn

source§

impl AsElement for Dialog

source§

impl AsElement for Div

source§

impl AsElement for Dl

source§

impl AsElement for Dt

source§

impl AsElement for Ellipse

source§

impl AsElement for Em

source§

impl AsElement for Embed

source§

impl AsElement for FeBlend

source§

impl AsElement for FeColorMatrix

source§

impl AsElement for FeComponentTransfer

source§

impl AsElement for FeComposite

source§

impl AsElement for FeConvolveMatrix

source§

impl AsElement for FeDiffuseLighting

source§

impl AsElement for FeDisplacementMap

source§

impl AsElement for FeDistantLight

source§

impl AsElement for FeDropShadow

source§

impl AsElement for FeFlood

source§

impl AsElement for FeFuncA

source§

impl AsElement for FeFuncB

source§

impl AsElement for FeFuncG

source§

impl AsElement for FeFuncR

source§

impl AsElement for FeGaussianBlur

source§

impl AsElement for FeImage

source§

impl AsElement for FeMerge

source§

impl AsElement for FeMergeNode

source§

impl AsElement for FeMorphology

source§

impl AsElement for FeOffset

source§

impl AsElement for FePointLight

source§

impl AsElement for FeSpecularLighting

source§

impl AsElement for FeSpotLight

source§

impl AsElement for FeTile

source§

impl AsElement for FeTurbulence

source§

impl AsElement for Fieldset

source§

impl AsElement for Figcaption

source§

impl AsElement for Figure

source§

impl AsElement for Filter

source§

impl AsElement for ForeignObject

source§

impl AsElement for Form

source§

impl AsElement for G

source§

impl AsElement for H1

source§

impl AsElement for H2

source§

impl AsElement for H3

source§

impl AsElement for H4

source§

impl AsElement for H5

source§

impl AsElement for H6

source§

impl AsElement for Head

source§

impl AsElement for Header

source§

impl AsElement for Hr

source§

impl AsElement for Html

source§

impl AsElement for I

source§

impl AsElement for Iframe

source§

impl AsElement for Image

source§

impl AsElement for Img

source§

impl AsElement for Input

source§

impl AsElement for Ins

source§

impl AsElement for Kbd

source§

impl AsElement for Label

source§

impl AsElement for Legend

source§

impl AsElement for Li

source§

impl AsElement for Line

source§

impl AsElement for LinearGradient

source§

impl AsElement for Main

source§

impl AsElement for Map

source§

impl AsElement for Mark

source§

impl AsElement for Marker

source§

impl AsElement for Mask

source§

impl AsElement for Menu

source§

impl AsElement for Meta

source§

impl AsElement for Metadata

source§

impl AsElement for Meter

source§

impl AsElement for Mpath

source§

impl AsElement for Nav

source§

impl AsElement for Noscript

source§

impl AsElement for Object

source§

impl AsElement for Ol

source§

impl AsElement for Optgroup

source§

impl AsElement for Option

source§

impl AsElement for Output

source§

impl AsElement for P

source§

impl AsElement for Param

source§

impl AsElement for Path

source§

impl AsElement for Pattern

source§

impl AsElement for Picture

source§

impl AsElement for Polygon

source§

impl AsElement for Polyline

source§

impl AsElement for Pre

source§

impl AsElement for Progress

source§

impl AsElement for Q

source§

impl AsElement for RadialGradient

source§

impl AsElement for Rb

source§

impl AsElement for Rect

source§

impl AsElement for Rp

source§

impl AsElement for Rt

source§

impl AsElement for Rtc

source§

impl AsElement for Ruby

source§

impl AsElement for S

source§

impl AsElement for Samp

source§

impl AsElement for Script

source§

impl AsElement for Section

source§

impl AsElement for Select

source§

impl AsElement for Set

source§

impl AsElement for Slot

source§

impl AsElement for Small

source§

impl AsElement for Source

source§

impl AsElement for Span

source§

impl AsElement for Stop

source§

impl AsElement for Strong

source§

impl AsElement for Style

source§

impl AsElement for Sub

source§

impl AsElement for Summary

source§

impl AsElement for Sup

source§

impl AsElement for Svg

source§

impl AsElement for Switch

source§

impl AsElement for Symbol

source§

impl AsElement for Table

source§

impl AsElement for Tbody

source§

impl AsElement for Td

source§

impl AsElement for Template

source§

impl AsElement for Text

source§

impl AsElement for TextPath

source§

impl AsElement for Textarea

source§

impl AsElement for Tfoot

source§

impl AsElement for Th

source§

impl AsElement for Thead

source§

impl AsElement for Time

source§

impl AsElement for Title

source§

impl AsElement for Tr

source§

impl AsElement for Track

source§

impl AsElement for Tspan

source§

impl AsElement for U

source§

impl AsElement for Ul

source§

impl AsElement for Use

source§

impl AsElement for Var

source§

impl AsElement for Video

source§

impl AsElement for View

source§

impl AsElement for Wbr

source§

impl AsElement for Element