[][src]Struct elvis_shared::Node

pub struct Node {
    pub attrs: HashMap<String, String>,
    pub children: Vec<Rc<RefCell<Node>>>,
    pub tag: String,
    pub pre: Option<Weak<RefCell<Node>>>,
}

Virtual UI Node

Fields

attrs: HashMap<String, String>

Node attributes

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

Node children

tag: String

Node tag

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

Node parent

Implementations

impl Node[src]

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 new(
    attrs: HashMap<String, String>,
    children: Vec<Rc<RefCell<Node>>>,
    pre: Option<Weak<RefCell<Node>>>,
    tag: String
) -> Rc<RefCell<Node>>
[src]

Generate a Rc<RefCell<Node>>

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 PartialEq<Node> for Node[src]

impl<'t> Serde<Node, String, Error> 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.