1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
//! This module contains the implementation to get all the VNode structure.
//! it is useful for testing and debuging. For example to know what contain this VNode
//! we use VNodeStruct to get the complete Vnode button and log the result:
//!
//! #Example
//!
//! ```
//! extern crate yew;
//! extern crate yew_vnode_struct;
//!
//! use yew::html;
//! use yew_vnode_struct::VNodeStruct;
//!
//! let example = html! {
//!     <div id="example">{"example"}</div>
//! };
//!
//! let vnode_example = VNodeStruct::new(example.clone());
//!
//! println!("{:#?}", example);
//! ```
//!
//! We will get this structure:
//!
//! ```ignore
//! VNodeStruct {
//!     vtag: Some(
//!         VTagStruct {
//!             reference: None,
//!             attributes: {
//!                 "id": "example",
//!             },
//!             classes: Classes {
//!                 set: {},
//!             },
//!             value: None,
//!             kind: None,
//!             checked: false,
//!             node_ref: NodeRef(
//!                 RefCell {
//!                     value: NodeRefInner {
//!                         node: None,
//!                         link: None,
//!                     },
//!                 },
//!             ),
//!         },
//!     ),
//!     vlist: None,
//!     vtext: None,
//!     vcomp: None,
//!     vref: None,
//!     children: Some(
//!         [
//!             VNodeStruct {
//!                 vtag: None,
//!                 vlist: Some(
//!                     VList {
//!                         children: [
//!                             VText { text: example },
//!                         ],
//!                         elide_placeholder: true,
//!                     },
//!                 ),
//!                 vtext: None,
//!                 vcomp: None,
//!                 vref: None,
//!                 children: Some(
//!                     [
//!                         VNodeStruct {
//!                             vtag: None,
//!                             vlist: None,
//!                             vtext: Some(
//!                                 VText { text: example },
//!                             ),
//!                             vcomp: None,
//!                             vref: None,
//!                             children: None,
//!                         },
//!                     ],
//!                 ),
//!             },
//!         ],
//!     ),
//! }
//! ```

pub mod vnode_struct;

pub use vnode_struct::VNodeStruct;