@@ -452,7 +452,7 @@ impl PyContext {
452
452
)
453
453
}
454
454
455
- pub fn new_rustfunc < F : ' static + RustPyFunc > (
455
+ pub fn new_rustfunc < F : ' static + Fn ( & mut VirtualMachine , PyFuncArgs ) -> PyResult > (
456
456
& self ,
457
457
function : F ,
458
458
) -> PyObjectRef {
@@ -466,7 +466,7 @@ impl PyContext {
466
466
467
467
pub fn new_rustfunc_from_box (
468
468
& self ,
469
- function : Box < RustPyFunc > ,
469
+ function : Box < Fn ( & mut VirtualMachine , PyFuncArgs ) -> PyResult > ,
470
470
) -> PyObjectRef {
471
471
PyObject :: new (
472
472
PyObjectKind :: RustFunction { function } ,
@@ -478,7 +478,7 @@ impl PyContext {
478
478
PyObject :: new ( PyObjectKind :: Frame { frame : frame } , self . frame_type ( ) )
479
479
}
480
480
481
- pub fn new_property < F : ' static + RustPyFunc > (
481
+ pub fn new_property < F : ' static + Fn ( & mut VirtualMachine , PyFuncArgs ) -> PyResult > (
482
482
& self ,
483
483
function : F ,
484
484
) -> PyObjectRef {
@@ -523,7 +523,7 @@ impl PyContext {
523
523
)
524
524
}
525
525
526
- pub fn new_member_descriptor < F : ' static + RustPyFunc > (
526
+ pub fn new_member_descriptor < F : ' static + Fn ( & mut VirtualMachine , PyFuncArgs ) -> PyResult > (
527
527
& self ,
528
528
function : F ,
529
529
) -> PyObjectRef {
@@ -783,9 +783,6 @@ impl PyFuncArgs {
783
783
}
784
784
}
785
785
786
- pub trait RustPyFunc : ( Fn ( & mut VirtualMachine , PyFuncArgs ) -> PyResult ) { }
787
- impl < T : Fn ( & mut VirtualMachine , PyFuncArgs ) -> PyResult > RustPyFunc for T { }
788
-
789
786
/// Rather than determining the type of a python object, this enum is more
790
787
/// a holder for the rust payload of a python object. It is more a carrier
791
788
/// of rust data for a particular python object. Determine the python type
@@ -862,7 +859,7 @@ pub enum PyObjectKind {
862
859
dict : PyObjectRef ,
863
860
} ,
864
861
RustFunction {
865
- function : Box < RustPyFunc > ,
862
+ function : Box < Fn ( & mut VirtualMachine , PyFuncArgs ) -> PyResult > ,
866
863
} ,
867
864
}
868
865
0 commit comments