File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,43 @@ func CreateOrder(order OrderStruct) {
113113
114114## eface
115115
116+ 从定义来看,eface 其实是 iface 的一个子集:
117+
118+ ```
119+ ┌─────────┐ ┌─────────┐
120+ │ iface │ ┌─────▶│ itab │
121+ ├─────────┴───────────────────┐ │ ├─────────┴───────────────────┐
122+ │ tab *itab │──────┘ │ inter *interfacetype │
123+ ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫ ├─────────────────────────────┤
124+ ┃ data unsafe.Pointer ┃ ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
125+ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ┃ _type *_type ┃
126+ ┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
127+ ├─────────────────────────────┤
128+ │ hash uint32 │
129+ ├─────────────────────────────┤
130+ │ fun [1]uintptr │
131+ └─────────────────────────────┘
132+ ┌─────────┐
133+ │ eface │
134+ ├─────────┴───────────────────┐
135+ │ _type *_type │
136+ ├─────────────────────────────┤
137+ │ data unsafe.Pointer │
138+ └─────────────────────────────┘
139+ ```
140+
116141### eface 适用场景
117142
118143### eface 实现原理
144+
145+ ## 类型转换
146+
147+ ### 普通类型转换为 eface
148+
149+ ### 普通类型转换为 iface
150+
151+ ### eface 转换为普通类型
152+
153+ ### iface 转换为普通类型
154+
155+ ### 类型转换图
You can’t perform that action at this time.
0 commit comments