@@ -106,3 +106,58 @@ impl Kind {
106106        panic ! ( "{attrs:?} doesn't contain a proof kind." ) 
107107    } 
108108} 
109+ 
110+ /// Convertion from lib's SerFunction into the counterpart in main.rs 
111+ mod  conversion { 
112+     use  super :: * ; 
113+     use  crate :: functions:: utils:: { MacroBacktrace ,  vec_convertion} ; 
114+     use  distributed_verification as  lib; 
115+ 
116+     impl  From < SerFunction >  for  lib:: SerFunction  { 
117+         fn  from ( value :  SerFunction )  -> Self  { 
118+             let  SerFunction  {  hash,  def_id,  attrs,  kind,  func,  callees_len,  callees }  = value; 
119+             let  func = func. into ( ) ; 
120+             let  kind = kind. into ( ) ; 
121+             let  callees = vec_convertion ( callees) ; 
122+             Self  {  hash,  def_id,  attrs,  kind,  func,  callees_len,  callees } 
123+         } 
124+     } 
125+ 
126+     impl  From < Kind >  for  lib:: Kind  { 
127+         fn  from ( value :  Kind )  -> Self  { 
128+             match  value { 
129+                 Kind :: Standard  => Self :: Standard , 
130+                 Kind :: Contract  => Self :: Contract , 
131+             } 
132+         } 
133+     } 
134+ 
135+     impl  From < Callee >  for  lib:: Callee  { 
136+         fn  from ( Callee  {  def_id,  func } :  Callee )  -> Self  { 
137+             let  func = func. into ( ) ; 
138+             Self  {  def_id,  func } 
139+         } 
140+     } 
141+ 
142+     impl  From < SourceCode >  for  lib:: SourceCode  { 
143+         fn  from ( value :  SourceCode )  -> Self  { 
144+             let  SourceCode  { 
145+                 name, 
146+                 mangled_name, 
147+                 kind, 
148+                 file, 
149+                 src, 
150+                 macro_backtrace_len, 
151+                 macro_backtrace, 
152+             }  = value; 
153+             let  macro_backtrace = vec_convertion ( macro_backtrace) ; 
154+             Self  {  name,  mangled_name,  kind,  file,  src,  macro_backtrace_len,  macro_backtrace } 
155+         } 
156+     } 
157+ 
158+     impl  From < MacroBacktrace >  for  lib:: MacroBacktrace  { 
159+         fn  from ( MacroBacktrace  {  callsite,  defsite } :  MacroBacktrace )  -> Self  { 
160+             Self  {  callsite,  defsite } 
161+         } 
162+     } 
163+ } 
0 commit comments