@@ -15,39 +15,15 @@ use crate::py_lib;
1515#[ cfg( target_os = "ios" ) ]
1616tauri:: ios_plugin_binding!( init_plugin_python) ;
1717
18- /// Access to the python plugin APIs.
19- pub struct Python < R : Runtime > ( PluginHandle < R > ) ;
20-
2118// initializes the Kotlin or Swift plugin classes
2219pub fn init < R : Runtime , C : DeserializeOwned > (
2320 _app : & AppHandle < R > ,
2421 api : PluginApi < R , C > ,
25- ) -> crate :: Result < Python < R > > {
22+ ) -> crate :: Result < crate :: Python < R > > {
2623 #[ cfg( target_os = "android" ) ]
2724 let handle = api. register_android_plugin ( "com.plugin.python.application" , "ExamplePlugin" ) ?;
2825 #[ cfg( target_os = "ios" ) ]
2926 let handle = api. register_ios_plugin ( init_plugin_python) ?;
3027 py_lib:: init_python ( ) ?;
31- Ok ( Python ( handle) )
32- }
33-
34- impl < R : Runtime > Python < R > {
35- pub fn run_python ( & self , payload : StringRequest ) -> crate :: Result < StringResponse > {
36- py_lib:: run_python ( payload) ?;
37- Ok ( StringResponse { value : "Ok" . into ( ) } )
38- }
39- pub fn register_function ( & self , payload : RegisterRequest ) -> crate :: Result < StringResponse > {
40- py_lib:: register_function ( payload) ?;
41- Ok ( StringResponse { value : "Ok" . into ( ) } )
42- }
43- pub fn call_function ( & self , payload : RunRequest ) -> crate :: Result < StringResponse > {
44- let py_res = py_lib:: call_function ( payload) ?;
45- Ok ( StringResponse {
46- value : py_res. to_string ( ) ,
47- } )
48- }
49- pub fn read_variable ( & self , payload : StringRequest ) -> crate :: Result < StringResponse > {
50- let py_res = py_lib:: read_variable ( payload) ?;
51- Ok ( StringResponse { value : py_res } )
52- }
28+ Ok ( crate :: Python ( handle) )
5329}
0 commit comments