@@ -13,12 +13,9 @@ pub struct FunctionEnv<T> {
1313 marker : PhantomData < T > ,
1414}
1515
16- impl < T > FunctionEnv < T > {
16+ impl < T : Any > FunctionEnv < T > {
1717 /// Make a new FunctionEnv
18- pub fn new ( store : & mut impl AsStoreMut , value : T ) -> Self
19- where
20- T : Any + Send + ' static + Sized ,
21- {
18+ pub fn new ( store : & mut impl AsStoreMut , value : T ) -> Self {
2219 Self {
2320 handle : StoreHandle :: new (
2421 store. as_store_mut ( ) . objects_mut ( ) ,
@@ -29,10 +26,7 @@ impl<T> FunctionEnv<T> {
2926 }
3027
3128 /// Get the data as reference
32- pub fn as_ref < ' a > ( & self , store : & ' a impl AsStoreRef ) -> & ' a T
33- where
34- T : Any + Send + ' static + Sized ,
35- {
29+ pub fn as_ref < ' a > ( & self , store : & ' a impl AsStoreRef ) -> & ' a T {
3630 self . handle
3731 . get ( store. as_store_ref ( ) . objects ( ) )
3832 . as_ref ( )
@@ -49,10 +43,7 @@ impl<T> FunctionEnv<T> {
4943 }
5044
5145 /// Get the data as mutable
52- pub fn as_mut < ' a > ( & self , store : & ' a mut impl AsStoreMut ) -> & ' a mut T
53- where
54- T : Any + Send + ' static + Sized ,
55- {
46+ pub fn as_mut < ' a > ( & self , store : & ' a mut impl AsStoreMut ) -> & ' a mut T {
5647 self . handle
5748 . get_mut ( store. objects_mut ( ) )
5849 . as_mut ( )
@@ -61,10 +52,7 @@ impl<T> FunctionEnv<T> {
6152 }
6253
6354 /// Convert it into a `FunctionEnvMut`
64- pub fn into_mut ( self , store : & mut impl AsStoreMut ) -> FunctionEnvMut < T >
65- where
66- T : Any + Send + ' static + Sized ,
67- {
55+ pub fn into_mut ( self , store : & mut impl AsStoreMut ) -> FunctionEnvMut < T > {
6856 FunctionEnvMut {
6957 store_mut : store. as_store_mut ( ) ,
7058 func_env : self ,
@@ -102,16 +90,13 @@ pub struct FunctionEnvMut<'a, T: 'a> {
10290 pub ( crate ) func_env : FunctionEnv < T > ,
10391}
10492
105- impl < ' a , T > Debug for FunctionEnvMut < ' a , T >
106- where
107- T : Send + Debug + ' static ,
108- {
93+ impl < ' a , T : Debug + ' static > Debug for FunctionEnvMut < ' a , T > {
10994 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
11095 self . func_env . as_ref ( & self . store_mut ) . fmt ( f)
11196 }
11297}
11398
114- impl < T : Send + ' static > FunctionEnvMut < ' _ , T > {
99+ impl < T : ' static > FunctionEnvMut < ' _ , T > {
115100 /// Returns a reference to the host state in this function environement.
116101 pub fn data ( & self ) -> & T {
117102 self . func_env . as_ref ( & self . store_mut )
0 commit comments