133d722a9Sopenharmony_ci\documentclass{standalone}
233d722a9Sopenharmony_ci\usepackage{makecell}
333d722a9Sopenharmony_ci\usepackage{pgfplots}
433d722a9Sopenharmony_ci\usepackage{sansmath}
533d722a9Sopenharmony_ci\usetikzlibrary{arrows.meta}
633d722a9Sopenharmony_ci\pgfplotsset{compat=1.16}
733d722a9Sopenharmony_ci\begin{document}
833d722a9Sopenharmony_ci\pagecolor{white}
933d722a9Sopenharmony_ci\begin{tikzpicture}[
1033d722a9Sopenharmony_ci  x=1cm,
1133d722a9Sopenharmony_ci  y=-.6cm,
1233d722a9Sopenharmony_ci  every node/.append style={
1333d722a9Sopenharmony_ci    line width=1.5pt,
1433d722a9Sopenharmony_ci    font=\Large\sansmath\sffamily,
1533d722a9Sopenharmony_ci  },
1633d722a9Sopenharmony_ci  every path/.append style={
1733d722a9Sopenharmony_ci    >={Latex[length=10pt,width=8pt]},
1833d722a9Sopenharmony_ci    line width=1.5pt,
1933d722a9Sopenharmony_ci  },
2033d722a9Sopenharmony_ci  execute at end node={\vphantom{bg}},
2133d722a9Sopenharmony_ci]
2233d722a9Sopenharmony_ci\node[draw, rounded corners=5, inner xsep=30pt, inner ysep=2pt]
2333d722a9Sopenharmony_ci  (bridge) at (0, .25) {\makecell{\texttt{\#\hspace{-1pt}[}cxx::bridge\texttt{]} mod\\[-4pt]description of boundary}};
2433d722a9Sopenharmony_ci\node[draw, rounded corners, inner xsep=10pt, inner ysep=6pt, text depth=1pt]
2533d722a9Sopenharmony_ci  (rust-bindings) at (-3.5, 6.5) {Rust bindings};
2633d722a9Sopenharmony_ci\node[draw, rounded corners, inner xsep=10pt, inner ysep=6pt, text depth=1pt]
2733d722a9Sopenharmony_ci  (cpp-bindings) at (3.5, 6.5) {C\texttt{++} bindings};
2833d722a9Sopenharmony_ci\node[inner xsep=4pt, inner ysep=-0pt]
2933d722a9Sopenharmony_ci  (rust-code) at (-9, 6.5) {\makecell[r]{\\[-8pt]Rust\\[-4pt]code}};
3033d722a9Sopenharmony_ci\node[inner xsep=4pt, inner ysep=-0pt]
3133d722a9Sopenharmony_ci  (cpp-code) at (9, 6.5) {\makecell[l]{\\[-8pt]C\texttt{++}\\[-4pt]code}};
3233d722a9Sopenharmony_ci\draw (bridge) -- (0, 4);
3333d722a9Sopenharmony_ci\draw[<->] (rust-bindings) |- (0, 4) -| (cpp-bindings);
3433d722a9Sopenharmony_ci\draw[<->] (rust-code) -- (rust-bindings);
3533d722a9Sopenharmony_ci\draw[<->, dash pattern=on 8pt off 6pt] (rust-bindings) -- (cpp-bindings);
3633d722a9Sopenharmony_ci\draw[<->] (cpp-bindings) -- (cpp-code);
3733d722a9Sopenharmony_ci\draw (-.75, 4) node[anchor=south east] {Macro expansion};
3833d722a9Sopenharmony_ci\draw (.75, 4) node[anchor=south west] {Code generation};
3933d722a9Sopenharmony_ci\draw (0, 6.5) node[anchor=south, inner ysep=4pt] {Hidden C ABI};
4033d722a9Sopenharmony_ci\draw (-6.75, 6.5) node[anchor=south, inner ysep=1pt] {\makecell{Safe\\[-4pt]straightforward\\[-4pt]Rust APIs}};
4133d722a9Sopenharmony_ci\draw (6.75, 6.5) node[anchor=south, inner ysep=1pt] {\makecell{Straightforward\\[-4pt]C\texttt{++} APIs}};
4233d722a9Sopenharmony_ci\pgfresetboundingbox\path
4333d722a9Sopenharmony_ci  (-9.5, 0) -- (rust-bindings.south)+(0, .3) -- (9.5, 0) -- (bridge.north);
4433d722a9Sopenharmony_ci\end{tikzpicture}
4533d722a9Sopenharmony_ci\end{document}
46