[][src]Enum sauron_vdom::Node

pub enum Node<T, CB> {
    Element(Element<T, CB>),
    Text(Text),
}

This is the core data structure of the library. Any tree can be represented by Node. The T is generic instead of just using plain &'static str in order for this library to be used not only in html based widget but can also be used to represent native GUI widgets in various platforms.

Variants

Element(Element<T, CB>)Text(Text)

Methods

impl<T, CB> Node<T, CB> where
    T: Clone,
    CB: Clone
[src]

pub fn as_element(&mut self) -> Option<&mut Element<T, CB>>[src]

pub fn as_element_ref(&mut self) -> Option<&Element<T, CB>>[src]

pub fn children<C>(self, children: C) -> Self where
    C: AsRef<[Node<T, CB>]>,
    CB: Clone
[src]

Append children to this element

pub fn attributes<'a, A>(self, attributes: A) -> Self where
    A: AsRef<[Attribute<'a, CB>]>, 
[src]

add attributes to the node

Trait Implementations

impl<T: PartialEq, CB: PartialEq> PartialEq<Node<T, CB>> for Node<T, CB>[src]

impl<T, CB> From<Element<T, CB>> for Node<T, CB>[src]

impl<T: Clone, CB: Clone> Clone for Node<T, CB>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T, CB> Display for Node<T, CB> where
    T: ToString
[src]

impl<T: Debug, CB: Debug> Debug for Node<T, CB>[src]

Auto Trait Implementations

impl<T, CB> Send for Node<T, CB> where
    CB: Send,
    T: Send

impl<T, CB> Sync for Node<T, CB> where
    CB: Sync,
    T: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.