[][src]Struct elvis::Tree

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

Virtual UI Tree

Fields

attrs: HashMap<String, String>children: Vec<Rc<RefCell<Tree>>>tag: Stringpre: Option<Weak<RefCell<Tree>>>

Methods

impl Tree[src]

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

drain tree if not the root

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

pub fn new(
    attrs: HashMap<String, String>,
    children: Vec<Rc<RefCell<Tree>>>,
    pre: Option<Weak<RefCell<Tree>>>,
    tag: String
) -> Rc<RefCell<Tree>>
[src]

generate a Rc<RefCell>

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

add second tree to the first one.

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

delete spefic child using rc

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

replace current tree

pub fn update(&self)[src]

Trait Implementations

impl Clone for Tree[src]

impl Debug for Tree[src]

impl Default for Tree[src]

impl<'t> Into<Tree> for &'t Text[src]

impl<'i> Into<Tree> for &'i Image[src]

impl Into<Tree> for SizedBox[src]

impl<'i> Into<Tree> for &'i Col[src]

impl<'i> Into<Tree> for &'i List[src]

impl<'i> Into<Tree> for &'i Row[src]

impl<'i> Into<Tree> for &'i Grid[src]

impl Into<Tree> for Grid[src]

impl<'i> Into<Tree> for &'i MultiColumn[src]

impl Into<Tree> for MultiColumn[src]

impl Into<Tree> for Center[src]

impl Into<Tree> for Col[src]

impl<'i> Into<Tree> for &'i Center[src]

impl Into<Tree> for Row[src]

impl Into<Tree> for Image[src]

impl Into<Tree> for Text[src]

impl Into<Tree> for List[src]

impl<'s> Into<Tree> for &'s Align[src]

impl Into<Tree> for Align[src]

impl<'s> Into<Tree> for &'s Container[src]

impl Into<Tree> for Container[src]

impl<'s> Into<Tree> for &'s Flex[src]

impl Into<Tree> for Flex[src]

impl<'s> Into<Tree> for &'s SizedBox[src]

impl PartialEq<Tree> for Tree[src]

impl<'t> Serde<Tree, String> for Tree[src]

Auto Trait Implementations

impl !RefUnwindSafe for Tree

impl !Send for Tree

impl !Sync for Tree

impl Unpin for Tree

impl !UnwindSafe for Tree

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.