Enum seed::virtual_dom::node::Node

source ·
pub enum Node<Ms> {
    Element(El<Ms>),
    Text(Text),
    Empty,
    NoChange,
}
Expand description

A component in our virtual DOM. MDN reference web_sys reference

Variants§

§

Element(El<Ms>)

§

Text(Text)

§

Empty

§

NoChange

Implementations§

source§

impl<Ms> Node<Ms>

source

pub fn from_html(namespace: Option<&Namespace>, html: &str) -> Vec<Node<Ms>>

See El::from_html

source

pub fn add_child(&mut self, node: Node<Ms>) -> &mut Self

See El::add_child

source

pub fn add_attr( &mut self, key: impl Into<Cow<'static, str>>, val: impl Into<AtValue> ) -> &mut Self

See El::add_attr

source

pub fn add_class(&mut self, name: impl Into<Cow<'static, str>>) -> &mut Self

See El::add_class

source

pub fn add_style( &mut self, key: impl Into<St>, val: impl Into<CSSValue> ) -> &mut Self

See El::add_style

source

pub fn add_event_handler(&mut self, event_handler: EventHandler<Ms>) -> &mut Self

See El::add_event_handler

source

pub fn add_text(&mut self, text: impl Into<Cow<'static, str>>) -> &mut Self

See El::add_text

source

pub fn replace_text(&mut self, text: impl Into<Cow<'static, str>>) -> &mut Self

See El::replace_text

source

pub fn get_text(&self) -> String

See El::get_text

source

pub fn el_key(&self) -> Option<&ElKey>

Retrive key attached to the El

source§

impl<Ms> Node<Ms>

source

pub fn new_text(text: impl Into<Cow<'static, str>>) -> Self

source

pub const fn is_text(&self) -> bool

source

pub const fn is_el(&self) -> bool

source

pub const fn is_empty(&self) -> bool

source

pub const fn text(&self) -> Option<&Text>

source

pub const fn el(&self) -> Option<&El<Ms>>

source§

impl<Ms> Node<Ms>

Trait Implementations§

source§

impl<Ms> Clone for Node<Ms>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Ms: Debug> Debug for Node<Ms>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Ms> Display for Node<Ms>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Ms> From<&Element> for Node<Ms>

source§

fn from(ws_el: &Element) -> Node<Ms>

Converts to this type from the input type.
source§

impl<Ms> IntoNodes<Ms> for Node<Ms>

source§

fn into_nodes(self) -> Vec<Node<Ms>>

Converts item or items to Vec<Node<Ms>.
source§

impl<Ms: 'static, OtherMs: 'static> MessageMapper<Ms, OtherMs> for Node<Ms>

source§

fn map_msg( self, f: impl FnOnce(Ms) -> OtherMs + 'static + Clone ) -> Node<OtherMs>

See note on impl for El

§

type SelfWithOtherMs = Node<OtherMs>

source§

impl<Ms> UpdateEl<Ms> for Node<Ms>

source§

fn update_el(self, el: &mut El<Ms>)

source§

impl<Ms> View<Ms> for Node<Ms>

source§

fn els(self) -> Vec<Node<Ms>>

👎Deprecated since 0.7.0: Use IntoNodes instead.

Auto Trait Implementations§

§

impl<Ms> !RefUnwindSafe for Node<Ms>

§

impl<Ms> !Send for Node<Ms>

§

impl<Ms> !Sync for Node<Ms>

§

impl<Ms> Unpin for Node<Ms>

§

impl<Ms> !UnwindSafe for Node<Ms>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V