Skip to main content

Element

Struct Element 

Source
pub struct Element { /* private fields */ }

Implementations§

Source§

impl Element

Source

pub fn new(tag: &'static str) -> Self

Source

pub fn tag(&self) -> &'static str

Source

pub fn attributes(&self) -> &[Attribute]

Source

pub fn get_children(&self) -> &[Node]

Source

pub fn class(self, class: &str) -> Self

Source

pub fn class_reactive(self, class: impl IntoReactiveString) -> Self

Source

pub fn visible_reactive(self, visible: impl IntoReactiveBool) -> Self

Source

pub fn id(self, id: &str) -> Self

Source

pub fn style(self, style: &str) -> Self

Source

pub fn styled(self, style: Style) -> Self

Source

pub fn attr(self, name: &str, value: &str) -> Self

Source

pub fn href(self, href: &str) -> Self

Source

pub fn src(self, src: &str) -> Self

Source

pub fn alt(self, alt: &str) -> Self

Source

pub fn type_(self, type_value: &str) -> Self

Source

pub fn input_type(self, input_type: InputType) -> Self

Source

pub fn target(self, target: LinkTarget) -> Self

Source

pub fn method(self, method: FormMethod) -> Self

Source

pub fn name(self, name: &str) -> Self

Source

pub fn value(self, value: &str) -> Self

Source

pub fn value_reactive(self, value: impl IntoReactiveString) -> Self

Source

pub fn bind_value( self, read: ReadSignal<String>, write: WriteSignal<String>, ) -> Self

Source

pub fn placeholder(self, placeholder: &str) -> Self

Source

pub fn disabled(self, disabled: bool) -> Self

Source

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

Source

pub fn text_reactive(self, text: impl IntoReactiveString) -> Self

Source

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

Source

pub fn children<I, C>(self, children: I) -> Self
where I: IntoIterator<Item = C>, C: IntoNode,

Source

pub fn on_click<F>(self, handler: F) -> Self
where F: Fn(Event) + 'static,

Source

pub fn on_input<F>(self, handler: F) -> Self
where F: Fn(Event) + 'static,

Source

pub fn on_submit<F>(self, handler: F) -> Self
where F: Fn(Event) + 'static,

Source

pub fn on_change<F>(self, handler: F) -> Self
where F: Fn(Event) + 'static,

Source

pub fn show_when(self, condition: impl IntoReactiveBool) -> Node

Source

pub fn show_when_else( self, condition: impl IntoReactiveBool, else_node: impl IntoNode, ) -> Node

Source

pub fn has_class(&self, class_name: &str) -> bool

Source

pub fn event_handlers(&self) -> &[EventHandler]

Trait Implementations§

Auto Trait Implementations§

§

impl Freeze for Element

§

impl !RefUnwindSafe for Element

§

impl !Send for Element

§

impl !Sync for Element

§

impl Unpin for Element

§

impl !UnwindSafe for Element

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> IntoView for T

Source§

type View = T

Source§

fn into_view(self) -> <T as IntoView>::View

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.