[][src]Struct elvis_core::Node

pub struct Node {
    pub attr: Attribute,
    pub class: Vec<Class>,
    pub style: Vec<Style>,
    pub children: Vec<Rc<RefCell<Node>>>,
    pub pre: Option<Weak<RefCell<Node>>>,
    pub state: Option<StateKV>,
    pub gesture: Option<GestureKV>,
}

Virtual UI Node

Fields

attr: Attribute

Node attribute

class: Vec<Class>

Node Class

style: Vec<Style>

Node Class

children: Vec<Rc<RefCell<Node>>>

Node children

pre: Option<Weak<RefCell<Node>>>

Node parent

state: Option<StateKV>

Node state

gesture: Option<GestureKV>

Node Gestures

Implementations

impl Node[src]

pub fn attr(self, attr: Attribute) -> Node[src]

Set attribute

pub fn children(self, children: Vec<Node>) -> Node[src]

Set Children

pub fn append_child(self, child: Node) -> Node[src]

append child

pub fn append_children(self, children: Vec<Node>) -> Node[src]

append children

pub fn class(self, class: Vec<Class>) -> Node[src]

Set class

pub fn append_class(self, class: &mut Vec<Class>) -> Node[src]

Append class

pub fn style(self, style: impl Into<Vec<Style>>) -> Node[src]

Set style

pub fn append_style(self, styles: impl Into<Vec<Style>>) -> Node[src]

Append style

pub fn drain(t: Rc<RefCell<Node>>)[src]

Drain tree if not the root

pub fn idx(&mut self, path: &mut Vec<u8>)[src]

The path of current node

pub fn locate(&self, path: Vec<usize>) -> Vec<usize>[src]

Locate tree

pub fn push(r: Rc<RefCell<Node>>, c: Rc<RefCell<Node>>)[src]

Add second tree to the first one.

pub fn remove(&mut self, c: Rc<RefCell<Node>>)[src]

Delete spefic child using rc

pub fn replace(&mut self, t: Node)[src]

Replace current tree

pub fn update(&mut self)[src]

Update tree

Trait Implementations

impl Clone for Node[src]

impl Debug for Node[src]

impl Default for Node[src]

impl Eq for Node[src]

impl<W> Into<Node> for GestureDetector<W> where
    W: Into<Node>, 
[src]

impl<W> Into<Node> for State<W> where
    W: Into<Node>, 
[src]

impl PartialEq<Node> for Node[src]

impl StyleWrapper for Node[src]

Auto Trait Implementations

impl !RefUnwindSafe for Node

impl !Send for Node

impl !Sync for Node

impl Unpin for Node

impl !UnwindSafe for Node

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

impl<T, U> Into<U> 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, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.